From c02ed17ebcc9596b5003de5f1df17bd458babf52 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 15 Aug 2025 14:18:59 +0300 Subject: [PATCH] feat(react/settings): port change password --- apps/client/src/widgets/react/Alert.tsx | 2 +- apps/client/src/widgets/react/LinkButton.tsx | 17 +++ .../widgets/type_widgets/content_widget.tsx | 8 +- .../widgets/type_widgets/options/password.tsx | 104 +++++++++++++++ .../type_widgets/options/password/password.ts | 123 ------------------ apps/server/src/routes/api/password.ts | 3 +- .../src/services/encryption/password.ts | 5 +- packages/commons/src/lib/server_api.ts | 4 +- 8 files changed, 132 insertions(+), 134 deletions(-) create mode 100644 apps/client/src/widgets/react/LinkButton.tsx create mode 100644 apps/client/src/widgets/type_widgets/options/password.tsx delete mode 100644 apps/client/src/widgets/type_widgets/options/password/password.ts diff --git a/apps/client/src/widgets/react/Alert.tsx b/apps/client/src/widgets/react/Alert.tsx index 88b6ce81c..8b8afb68b 100644 --- a/apps/client/src/widgets/react/Alert.tsx +++ b/apps/client/src/widgets/react/Alert.tsx @@ -1,7 +1,7 @@ import { ComponentChildren } from "preact"; interface AlertProps { - type: "info" | "danger"; + type: "info" | "danger" | "warning"; title?: string; children: ComponentChildren; } diff --git a/apps/client/src/widgets/react/LinkButton.tsx b/apps/client/src/widgets/react/LinkButton.tsx new file mode 100644 index 000000000..a9596c972 --- /dev/null +++ b/apps/client/src/widgets/react/LinkButton.tsx @@ -0,0 +1,17 @@ +import { ComponentChild } from "preact"; + +interface LinkButtonProps { + onClick: () => void; + text: ComponentChild; +} + +export default function LinkButton({ onClick, text }: LinkButtonProps) { + return ( + { + e.preventDefault(); + onClick(); + }}> + {text} + + ) +} \ No newline at end of file diff --git a/apps/client/src/widgets/type_widgets/content_widget.tsx b/apps/client/src/widgets/type_widgets/content_widget.tsx index 93e0397c3..e34fa2a6b 100644 --- a/apps/client/src/widgets/type_widgets/content_widget.tsx +++ b/apps/client/src/widgets/type_widgets/content_widget.tsx @@ -8,8 +8,6 @@ import DateTimeFormatOptions from "./options/text_notes/date_time_format.js"; import CodeEditorOptions from "./options/code_notes/code_editor.js"; import CodeAutoReadOnlySizeOptions from "./options/code_notes/code_auto_read_only_size.js"; import CodeMimeTypesOptions from "./options/code_notes/code_mime_types.js"; -import PasswordOptions from "./options/password/password.js"; -import ProtectedSessionTimeoutOptions from "./options/password/protected_session_timeout.js"; import SearchEngineOptions from "./options/other/search_engine.js"; import TrayOptions from "./options/other/tray.js"; import NoteErasureTimeoutOptions from "./options/other/note_erasure_timeout.js"; @@ -40,6 +38,7 @@ import SyncOptions from "./options/sync.jsx"; import EtapiSettings from "./options/etapi.js"; import BackupSettings from "./options/backup.js"; import SpellcheckSettings from "./options/spellcheck.js"; +import PasswordSettings from "./options/password.jsx"; const TPL = /*html*/`