Skip to content

Build your personal knowledge base with Trilium Notes

feat(options/password): use options row for protected session timeout

Elian Doran9ba1eeaf209a
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 5e419f282f..935ea05090 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -1492,10 +1492,10 @@
"new_password_confirmation": "New password confirmation",
"change_password": "Change password",
"protected_session_timeout": "Protected Session Timeout",
- "protected_session_timeout_description": "Protected session timeout is a time period after which the protected session is wiped from the browser's memory. This is measured from the last interaction with protected notes. See",
+ "protected_session_timeout_description": "Time of inactivity before the session is cleared from browser memory. See",
"wiki": "wiki",
"for_more_info": "for more info.",
- "protected_session_timeout_label": "Protected session timeout:",
+ "protected_session_timeout_label": "Auto-close session after",
"reset_confirmation": "By resetting the password you will forever lose access to all your existing protected notes. Do you really want to reset the password?",
"reset_success_message": "Password has been reset. Please set new password",
"change_password_heading": "Change Password",
diff --git a/apps/client/src/widgets/type_widgets/options/password.tsx b/apps/client/src/widgets/type_widgets/options/password.tsx
index 6e2eec9581..ce12f52c8e 100644
--- a/apps/client/src/widgets/type_widgets/options/password.tsx
+++ b/apps/client/src/widgets/type_widgets/options/password.tsx
@@ -8,11 +8,11 @@ import FormGroup from "../../react/FormGroup"
import FormTextBox from "../../react/FormTextBox"
import LinkButton from "../../react/LinkButton"
import OptionsSection from "./components/OptionsSection"
+import OptionsRow from "./components/OptionsRow"
import protected_session_holder from "../../../services/protected_session_holder"
import { ChangePasswordResponse } from "@triliumnext/commons"
import dialog from "../../../services/dialog"
import TimeSelector from "./components/TimeSelector"
-import FormText from "../../react/FormText"
export default function PasswordSettings() {
return (
@@ -105,19 +105,17 @@ function ChangePassword() {
function ProtectedSessionTimeout() {
return (
<OptionsSection title={t("password.protected_session_timeout")}>
- <FormText>
- {t("password.protected_session_timeout_description")}
- &nbsp;
- <a class="tn-link" href="https://triliumnext.github.io/Docs/Wiki/protected-notes.html" className="external">{t("password.wiki")}</a> {t("password.for_more_info")}
- </FormText>
-
- <FormGroup name="protected-session-timeout" label={t("password.protected_session_timeout_label")}>
- <TimeSelector
+ <OptionsRow
+ name="protected-session-timeout"
+ label={t("password.protected_session_timeout_label")}
+ description={<>{t("password.protected_session_timeout_description")} <a class="tn-link" href="https://triliumnext.github.io/Docs/Wiki/protected-notes.html">{t("password.wiki")}</a> {t("password.for_more_info")}</>}
+ >
+ <TimeSelector
name="protected-session-timeout"
optionValueId="protectedSessionTimeout" optionTimeScaleId="protectedSessionTimeoutTimeScale"
minimumSeconds={60}
/>
- </FormGroup>
+ </OptionsRow>
</OptionsSection>
)
}
\ No newline at end of file