diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 49258d1be..573970097 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -79,7 +79,7 @@ jobs: if: failure() uses: actions/upload-artifact@v5 with: - name: e2e report + name: e2e report ${{ matrix.arch }} path: apps/server-e2e/test-output - name: Kill the server diff --git a/apps/client/src/services/utils.ts b/apps/client/src/services/utils.ts index b11578bb6..3febb37c2 100644 --- a/apps/client/src/services/utils.ts +++ b/apps/client/src/services/utils.ts @@ -207,7 +207,7 @@ function toObject(array: T[], fn: (arg0: T) => [key: string, value: R]) { return obj; } -function randomString(len: number) { +export function randomString(len: number) { let text = ""; const possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index c1a509944..3a240faf5 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -736,8 +736,8 @@ "zoom_out_title": "Zoom Out" }, "zpetne_odkazy": { - "backlink": "{{count}} Backlink", - "backlinks": "{{count}} Backlinks", + "backlink_one": "{{count}} Backlink", + "backlink_other": "{{count}} Backlinks", "relation": "relation" }, "mobile_detail_menu": { diff --git a/apps/client/src/translations/ro/translation.json b/apps/client/src/translations/ro/translation.json index d0eff357f..a0c866eda 100644 --- a/apps/client/src/translations/ro/translation.json +++ b/apps/client/src/translations/ro/translation.json @@ -1362,8 +1362,9 @@ "title": "Factorul de zoom (doar pentru versiunea desktop)" }, "zpetne_odkazy": { - "backlink": "{{count}} legături de retur", - "backlinks": "{{count}} legături de retur", + "backlink_one": "{{count}} legătură de retur", + "backlink_few": "{{count}} legături de retur", + "backlink_other": "{{count}} de legături de retur", "relation": "relație" }, "svg_export_button": { diff --git a/apps/client/src/widgets/FloatingButtonsDefinitions.tsx b/apps/client/src/widgets/FloatingButtonsDefinitions.tsx index 651f82f05..953e9469d 100644 --- a/apps/client/src/widgets/FloatingButtonsDefinitions.tsx +++ b/apps/client/src/widgets/FloatingButtonsDefinitions.tsx @@ -18,6 +18,7 @@ import froca from "../services/froca"; import NoteLink from "./react/NoteLink"; import RawHtml from "./react/RawHtml"; import { ViewTypeOptions } from "./collections/interface"; +import attributes from "../services/attributes"; export interface FloatingButtonContext { parentComponent: Component; @@ -310,13 +311,24 @@ function Backlinks({ note, isDefaultViewMode }: FloatingButtonContext) { let [ popupOpen, setPopupOpen ] = useState(false); const backlinksContainerRef = useRef(null); - useEffect(() => { + function refresh() { if (!isDefaultViewMode) return; server.get(`note-map/${note.noteId}/backlink-count`).then(resp => { setBacklinkCount(resp.count); }); - }, [ note ]); + } + + useEffect(() => refresh(), [ note ]); + useTriliumEvent("entitiesReloaded", ({ loadResults }) => { + loadResults.getAttributeRows().some(attr => + attr.type === "relation" && + attr.name === "internalLink" && + attributes.isAffecting(attr, note)) + { + refresh(); + } + }); // Determine the max height of the container. const { windowHeight } = useWindowSize(); diff --git a/apps/client/src/widgets/PromotedAttributes.tsx b/apps/client/src/widgets/PromotedAttributes.tsx index 6565c4ed7..776b86fee 100644 --- a/apps/client/src/widgets/PromotedAttributes.tsx +++ b/apps/client/src/widgets/PromotedAttributes.tsx @@ -14,8 +14,10 @@ import ws from "../services/ws"; import { UpdateAttributeResponse } from "@triliumnext/commons"; import attributes from "../services/attributes"; import debounce from "../services/debounce"; +import { randomString } from "../services/utils"; interface Cell { + uniqueId: string; definitionAttr: FAttribute; definition: DefinitionObject; valueAttr: Attribute; @@ -44,6 +46,7 @@ export default function PromotedAttributes() {
{cells && cells.length > 0 &&
{note && cells?.map(cell => { // Check that the default value (English) is set. await expect(app.currentNoteSplit).toContainText("First day of the week"); const languageCombobox = app.dropdown(app.currentNoteSplit.locator(".options-section .dropdown").first()); - await expect(languageCombobox).toContainText("English"); + await expect(languageCombobox).toContainText("English (United States)"); // Select Chinese and ensure the translation is set. await languageCombobox.selectOptionByText("简体中文"); @@ -53,8 +53,8 @@ test("User can change language from settings", async ({ page, context }) => { await expect(languageCombobox).toContainText("简体中文"); // Select English again. - await languageCombobox.selectOptionByText("English"); + await languageCombobox.selectOptionByText("English (United States)"); await app.currentNoteSplit.locator("button[name=restart-app-button]").click(); await expect(app.currentNoteSplit).toContainText("Language", { timeout: 15000 }); - await expect(languageCombobox).toContainText("English"); + await expect(languageCombobox).toContainText("English (United States)"); }); diff --git a/packages/commons/src/lib/i18n.ts b/packages/commons/src/lib/i18n.ts index 8d2bc0232..eed5aec1b 100644 --- a/packages/commons/src/lib/i18n.ts +++ b/packages/commons/src/lib/i18n.ts @@ -14,7 +14,7 @@ export interface Locale { const UNSORTED_LOCALES = [ { id: "cn", name: "简体中文", electronLocale: "zh_CN" }, { id: "de", name: "Deutsch", electronLocale: "de" }, - { id: "en", name: "English", electronLocale: "en" }, + { id: "en", name: "English (United States)", electronLocale: "en" }, { id: "en-GB", name: "English (United Kingdom)", electronLocale: "en_GB" }, { id: "es", name: "Español", electronLocale: "es" }, { id: "fr", name: "Français", electronLocale: "fr" },