diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index 39de45b8a3..b422af9f97 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -1129,11 +1129,12 @@ }, "database_anonymization": { "title": "Database Anonymization", - "full_anonymization": "Full Anonymization", - "full_anonymization_description": "This action will create a new copy of the database and anonymize it (remove all note content and leave only structure and some non-sensitive metadata) for sharing online for debugging purposes without fear of leaking your personal data.", + "description": "Create an anonymized copy of your database for sharing with developers when debugging issues, without exposing personal data.", + "full_anonymization": "Full anonymization", + "full_anonymization_description": "Creates a copy of the database with all note content removed, leaving only structure and non-sensitive metadata. Safe for sharing online when debugging issues.", "save_fully_anonymized_database": "Save fully anonymized database", - "light_anonymization": "Light Anonymization", - "light_anonymization_description": "This action will create a new copy of the database and do a light anonymization on it — specifically only content of all notes will be removed, but titles and attributes will remain. Additionally, custom JS frontend/backend script notes and custom widgets will remain. This provides more context to debug the issues.", + "light_anonymization": "Light anonymization", + "light_anonymization_description": "Creates a copy with note content removed, but titles, attributes, and custom scripts/widgets remain. Provides more context for debugging.", "choose_anonymization": "You can decide yourself if you want to provide a fully or lightly anonymized database. Even fully anonymized DB is very useful, however in some cases lightly anonymized database can speed up the process of bug identification and fixing.", "save_lightly_anonymized_database": "Save lightly anonymized database", "existing_anonymized_databases": "Existing anonymized databases", diff --git a/apps/client/src/widgets/type_widgets/options/advanced.tsx b/apps/client/src/widgets/type_widgets/options/advanced.tsx index 53203a5903..ec924bfa1c 100644 --- a/apps/client/src/widgets/type_widgets/options/advanced.tsx +++ b/apps/client/src/widgets/type_widgets/options/advanced.tsx @@ -1,12 +1,10 @@ import { AnonymizedDbResponse, DatabaseAnonymizeResponse, DatabaseCheckIntegrityResponse } from "@triliumnext/commons"; import { useCallback, useEffect, useMemo, useState } from "preact/hooks"; -import { experimentalFeatures, type ExperimentalFeatureId } from "../../../services/experimental_features"; +import { type ExperimentalFeatureId,experimentalFeatures } from "../../../services/experimental_features"; import { t } from "../../../services/i18n"; import server from "../../../services/server"; import toast from "../../../services/toast"; -import Button from "../../react/Button"; -import Column from "../../react/Column"; import FormText from "../../react/FormText"; import { useTriliumOptionJson } from "../../react/hooks"; import { OptionsRowWithButton, OptionsRowWithToggle } from "./components/OptionsRow"; @@ -89,7 +87,7 @@ function DatabaseOptions() { } function DatabaseAnonymizationOptions() { - const [ existingAnonymizedDatabases, setExistingAnonymizedDatabases ] = useState([]); + const [existingAnonymizedDatabases, setExistingAnonymizedDatabases] = useState([]); function refreshAnonymizedDatabase() { server.get("database/anonymized-databases").then(setExistingAnonymizedDatabases); @@ -99,59 +97,47 @@ function DatabaseAnonymizationOptions() { return ( - {t("database_anonymization.choose_anonymization")} + {t("database_anonymization.description")} -
- { - toast.showMessage(t("database_anonymization.creating_fully_anonymized_database")); - const resp = await server.post("database/anonymize/full"); + { + toast.showMessage(t("database_anonymization.creating_fully_anonymized_database")); + const resp = await server.post("database/anonymize/full"); - if (!resp.success) { - toast.showError(t("database_anonymization.error_creating_anonymized_database")); - } else { - toast.showMessage(t("database_anonymization.successfully_created_fully_anonymized_database", { anonymizedFilePath: resp.anonymizedFilePath }), 10000); - refreshAnonymizedDatabase(); - } - }} - /> - { - toast.showMessage(t("database_anonymization.creating_lightly_anonymized_database")); - const resp = await server.post("database/anonymize/light"); + if (!resp.success) { + toast.showError(t("database_anonymization.error_creating_anonymized_database")); + } else { + toast.showMessage(t("database_anonymization.successfully_created_fully_anonymized_database", { anonymizedFilePath: resp.anonymizedFilePath }), 10000); + refreshAnonymizedDatabase(); + } + }} + /> - if (!resp.success) { - toast.showError(t("database_anonymization.error_creating_anonymized_database")); - } else { - toast.showMessage(t("database_anonymization.successfully_created_lightly_anonymized_database", { anonymizedFilePath: resp.anonymizedFilePath }), 10000); - refreshAnonymizedDatabase(); - } - }} - /> -
+ { + toast.showMessage(t("database_anonymization.creating_lightly_anonymized_database")); + const resp = await server.post("database/anonymize/light"); + + if (!resp.success) { + toast.showError(t("database_anonymization.error_creating_anonymized_database")); + } else { + toast.showMessage(t("database_anonymization.successfully_created_lightly_anonymized_database", { anonymizedFilePath: resp.anonymizedFilePath }), 10000); + refreshAnonymizedDatabase(); + } + }} + />
+
); } -function DatabaseAnonymizationOption({ title, description, buttonText, buttonClick }: { title: string, description: string, buttonText: string, buttonClick: () => void }) { - return ( - -
{title}
- {description} -