Skip to content

Commit 947330e

Browse files
committed
chore(options/etapi): update help
1 parent 4526455 commit 947330e

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

apps/client/src/translations/en/translation.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,10 +1453,6 @@
14531453
"etapi": {
14541454
"title": "ETAPI",
14551455
"description": "ETAPI is a REST API used to access Trilium instance programmatically, without UI.",
1456-
"see_more": "See more details in the {{- link_to_wiki}} and the {{- link_to_openapi_spec}} or the {{- link_to_swagger_ui }}.",
1457-
"wiki": "wiki",
1458-
"openapi_spec": "ETAPI OpenAPI spec",
1459-
"swagger_ui": "ETAPI Swagger UI",
14601456
"create_token": "Create new ETAPI token",
14611457
"existing_tokens": "Existing tokens",
14621458
"no_tokens_yet": "There are no tokens yet. Click on the button above to create one.",

apps/client/src/widgets/type_widgets/options/components/OptionsSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { ComponentChildren } from "preact";
22
import { CSSProperties } from "preact/compat";
33

44
interface OptionsSectionProps {
5-
title?: string;
5+
title?: ComponentChildren;
66
children: ComponentChildren;
77
noCard?: boolean;
88
style?: CSSProperties;

apps/client/src/widgets/type_widgets/options/etapi.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import dialog from "../../../services/dialog";
1111
import { formatDateTime } from "../../../utils/formatters";
1212
import ActionButton from "../../react/ActionButton";
1313
import { useTriliumEvent } from "../../react/hooks";
14+
import HelpButton from "../../react/HelpButton";
1415

1516
type RenameTokenCallback = (tokenId: string, oldName: string) => Promise<void>;
1617
type DeleteTokenCallback = (tokenId: string, name: string ) => Promise<void>;
@@ -48,26 +49,21 @@ export default function EtapiSettings() {
4849
message: t("etapi.token_created_message"),
4950
defaultValue: authToken
5051
});
51-
}, []);
52+
}, []);
5253

5354
return (
5455
<OptionsSection title={t("etapi.title")}>
5556
<FormText>
56-
{t("etapi.description")}<br />
57-
<RawHtml
58-
html={t("etapi.see_more", {
59-
link_to_wiki: `<a class="tn-link" href="https://triliumnext.github.io/Docs/Wiki/etapi.html">${t("etapi.wiki")}</a>`,
60-
// TODO: We use window.open src/public/app/services/link.ts -> prevents regular click behavior on "a" element here because it's a relative path
61-
link_to_openapi_spec: `<a class="tn-link" onclick="window.open('etapi/etapi.openapi.yaml')" href="etapi/etapi.openapi.yaml">${t("etapi.openapi_spec")}</a>`,
62-
link_to_swagger_ui: `<a class="tn-link" href="#_help_f3xpgx6H01PW">${t("etapi.swagger_ui")}</a>`
63-
})} />
57+
{t("etapi.description")}
58+
<HelpButton helpPage="pgxEVkzLl1OP" />
6459
</FormText>
6560

6661
<Button
6762
size="small" icon="bx bx-plus"
6863
text={t("etapi.create_token")}
6964
onClick={createTokenCallback}
7065
/>
66+
7167
<hr />
7268

7369
<h5>{t("etapi.existing_tokens")}</h5>
@@ -123,7 +119,7 @@ function TokenList({ tokens }: { tokens: EtapiToken[] }) {
123119
text={t("etapi.rename_token")}
124120
onClick={() => renameCallback(etapiTokenId, name)}
125121
/>
126-
122+
127123
<ActionButton
128124
icon="bx bx-trash"
129125
text={t("etapi.delete_token")}

0 commit comments

Comments
 (0)