Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
responding to code review (thanks pano!)
Matt Wilkie657638ee54f9
diff --git a/src/public/app/widgets/type_widgets/content_widget.ts b/src/public/app/widgets/type_widgets/content_widget.tsindex 5bd577fd23..e4cb81c107 100644--- a/src/public/app/widgets/type_widgets/content_widget.ts+++ b/src/public/app/widgets/type_widgets/content_widget.ts@@ -78,7 +78,7 @@ const CONTENT_WIDGETS: Record<string, (typeof NoteContextAwareWidget)[]> = {RevisionSnapshotsLimitOptions,NetworkConnectionsOptions,HtmlImportTagsOptions,- ShareSettingsOptions // moved to the end of the array+ ShareSettingsOptions],_optionsAdvanced: [DatabaseIntegrityCheckOptions, DatabaseAnonymizationOptions, AdvancedSyncOptions, VacuumDatabaseOptions],_backendLog: [BackendLogWidget]diff --git a/src/public/app/widgets/type_widgets/options/other/share_settings.ts b/src/public/app/widgets/type_widgets/options/other/share_settings.tsindex 9c7cd1b2d1..c4c9d94215 100644--- a/src/public/app/widgets/type_widgets/options/other/share_settings.ts+++ b/src/public/app/widgets/type_widgets/options/other/share_settings.ts@@ -5,22 +5,23 @@ import type { OptionMap, OptionNames } from "../../../../../../services/options_const TPL = `<div class="card-body">- <h4>${t("Share Settings")}</h4>-+ <h4>${t("share.title")}</h4>+<div class="form-check"><label class="form-check-label"><input class="form-check-input" type="checkbox" name="redirectBareDomain" value="true">- ${t("Redirect bare domain to Share page")}+ ${t("share.redirect_bare_domain")}</label>- <p class="form-text">${t("When enabled, accessing the root URL will redirect to the Share page instead of Login")}</p>+ <p class="form-text">${t("share.redirect_bare_domain_description")}</p></div><div class="form-check"><label class="form-check-label"><input class="form-check-input" type="checkbox" name="showLoginInShareTheme" value="true">- ${t("Show Login link in Share theme")}+ ${t("share.show_login_link")}</label>- <p class="form-text">${t("Add a login link to the Share page footer")}</p>+ <p class="form-text">${t("share.show_login_link_description")}</p>+ <p> </p></div></div>`;diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.jsonindex f8fdbc51ac..7fed97206d 100644--- a/src/public/translations/en/translation.json+++ b/src/public/translations/en/translation.json@@ -1656,5 +1656,27 @@"minutes": "Minutes","hours": "Hours","days": "Days"+ },+ "share": {+ "title": "Share Settings",+ "redirect_bare_domain": "Redirect bare domain to Share page",+ "redirect_bare_domain_description": "When enabled, accessing the root URL will redirect to the Share page instead of Login",+ "show_login_link": "Show Login link in Share theme",+ "show_login_link_description": "Add a login link to the Share page footer"+ },+ "sync_2": {+ "config_title": "Sync Configuration",+ "server_address": "Server instance address",+ "timeout": "Sync timeout (milliseconds)",+ "proxy_label": "Sync proxy server (optional)",+ "note": "Note",+ "note_description": "If you leave the proxy setting blank, the system proxy will be used (applies to desktop/electron build only).",+ "special_value_description": "Another special value is <code>noproxy</code> which forces ignoring even the system proxy and respects <code>NODE_TLS_REJECT_UNAUTHORIZED</code>.",+ "save": "Save",+ "help": "Help",+ "test_title": "Sync Test",+ "test_description": "This will test the connection and handshake to the sync server. If the sync server isn't initialized, this will set it up to sync with the local document.",+ "test_button": "Test sync",+ "handshake_failed": "Sync server handshake failed, error: {{message}}"}}diff --git a/src/services/options_interface.ts b/src/services/options_interface.tsindex ef55af6c57..9a89c9ac7d 100644--- a/src/services/options_interface.ts+++ b/src/services/options_interface.ts@@ -29,9 +29,6 @@ export interface OptionDefinitions extends KeyboardShortcutsOptions<KeyboardActidetailFontFamily: FontFamily;monospaceFontFamily: FontFamily;spellCheckLanguageCode: string;- // Share settings- redirectBareDomain: string;- showLoginInShareTheme: string;codeNotesMimeTypes: string;headingStyle: string;highlightsList: string;@@ -97,6 +94,10 @@ export interface OptionDefinitions extends KeyboardShortcutsOptions<KeyboardActicodeBlockWordWrap: boolean;textNoteEditorMultilineToolbar: boolean;backgroundEffects: boolean;+ // Share settings+ redirectBareDomain: boolean;+ showLoginInShareTheme: boolean;+}export type OptionNames = keyof OptionDefinitions;