Skip to content

Commit c314bf0

Browse files
auto progress bar to settings page (#32)
* auto progress bar to settings page * global listeners * global listeners * UI changes * Label sent as param * test * test * test * test * test * test * test * test * test * test * PR comments * PR comments * PR comments * Submodules merge
1 parent 9ebcb53 commit c314bf0

File tree

8 files changed

+25
-7
lines changed

8 files changed

+25
-7
lines changed

i18n/locales/de/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
"firstName": "Vorname",
1616
"lastName": "Nachname",
1717
"password": "Passwort",
18-
"save": "Speichern"
18+
"save": "Speichern",
19+
"overview": {
20+
"remainingTime": "Verbleibende Zeit vor der automatischen Abmeldung"
21+
}
1922
}

i18n/locales/en/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
"firstName": "First Name",
1616
"lastName": "Last Name",
1717
"password": "Password",
18-
"save": "Save"
18+
"save": "Save",
19+
"overview": {
20+
"remainingTime": "Remaining time before auto logout"
21+
}
1922
}

i18n/locales/nl/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
"firstName": "Voornaam",
1616
"lastName": "Achternaam",
1717
"password": "Wachtwoord",
18-
"save": "Redden"
18+
"save": "Redden",
19+
"overview": {
20+
"remainingTime": "Verbleibende tijd voor automatische afmelding"
21+
}
1922
}

pages/settings.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { AxiosError } from "axios"
33
import type { NextPage } from "next"
44
import Head from "next/head"
55
import { useRouter } from "next/router"
6-
import { useCallback, useEffect, useState } from "react"
6+
import { useCallback, useEffect, useRef, useState } from "react"
77

88
import { Flow, Messages } from "../pkg"
99
import { handleFlowError } from "../pkg/errors"
@@ -18,6 +18,7 @@ import { AdminMessage } from "@/submodules/react-components/types/admin-messages
1818
import { postProcessAdminMessages } from "@/submodules/react-components/helpers/admin-messages-helper"
1919
import AdminMessages from "@/submodules/react-components/components/AdminMessages"
2020
import { useTranslation } from "react-i18next"
21+
import AutoLogoutProgressBar from "@/submodules/react-components/components/AutoLogoutProgressBar"
2122

2223
const Settings: NextPage = () => {
2324
const [initialFlow, setInitialFlow]: any = useState<SettingsFlow>()
@@ -70,6 +71,9 @@ const Settings: NextPage = () => {
7071
WebSocketsService.initWsNotifications();
7172
}
7273
setLanguage(res?.languageDisplay);
74+
if (res?.autoLogoutMinutes) {
75+
localStorage.setItem("comesFromEntry", "true");
76+
}
7377
}
7478
});
7579
}, []);
@@ -333,6 +337,7 @@ const Settings: NextPage = () => {
333337
</div>
334338
<div className="img-container">
335339
</div>
340+
{(language && loadPage) && <AutoLogoutProgressBar className='absolute right-2 top-2' autoLogoutMinutes={user?.autoLogoutMinutes} label={t("overview.remainingTime")} comesFromEntry={true} />}
336341
<AdminMessages
337342
adminMessages={activeAdminMessages}
338343
setActiveAdminMessages={setActiveAdminMessages} />

styles/tailwind.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,8 @@ button.button-sign-in:focus {
258258

259259
.hidden {
260260
display: none !important;
261+
}
262+
263+
.top-2 {
264+
top: 24px !important;
261265
}

submodules/javascript-functions

submodules/tailwind-config

0 commit comments

Comments
 (0)