From 43470d458a75e93c5ef5a1bf4bec1e518634cefb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Thu, 21 Nov 2024 16:09:09 +0100 Subject: [PATCH] truncate long fields in search results table, fixes #211 --- CHANGELOG.md | 4 ++ package.json | 2 +- src-tauri/gen/schemas/macOS-schema.json | 4 +- src/components/settings/GlobalSettings.vue | 21 +++++- .../components/search/SearchResult.ts | 6 +- src/consts.ts | 1 + src/helpers/truncate.ts | 5 ++ src/locales/cn.json | 51 +++---------- src/locales/en.json | 51 +++---------- src/locales/fr.json | 51 +++---------- src/store/search.ts | 9 ++- tests/unit/helpers/truncate.spec.ts | 72 +++++++++++++++++++ 12 files changed, 140 insertions(+), 137 deletions(-) create mode 100644 src/helpers/truncate.ts create mode 100644 tests/unit/helpers/truncate.spec.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index e042f104..783127c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.1.1 + +* truncate long fields in search results table, fixes [#211](https://github.com/cars10/elasticvue/issues/211) + ## 1.1.0 * update to tauri `2.0`, fixes [#228](https://github.com/cars10/elasticvue/issues/228) diff --git a/package.json b/package.json index 4e27b16b..c32f10a9 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dev": "vite", "build": "vite build", "tsc": "tsc --noEmit && vue-tsc", - "lint": "eslint src", + "lint": "eslint src tests", "test:unit": "vitest run tests/unit", "test:unit:watch": "vitest watch tests/unit", "test:e2e": "playwright test --project=chromium", diff --git a/src-tauri/gen/schemas/macOS-schema.json b/src-tauri/gen/schemas/macOS-schema.json index 116c9c60..ab0bfa8d 100644 --- a/src-tauri/gen/schemas/macOS-schema.json +++ b/src-tauri/gen/schemas/macOS-schema.json @@ -37,7 +37,7 @@ ], "definitions": { "Capability": { - "description": "A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\n\nIt controls application windows fine grained access to the Tauri core, application, or plugin commands. If a window is not matching any capability then it has no access to the IPC layer at all.\n\nThis can be done to create groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\n\n## Example\n\n```json { \"identifier\": \"main-user-files-write\", \"description\": \"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.\", \"windows\": [ \"main\" ], \"permissions\": [ \"core:default\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] }, \"platforms\": [\"macOS\",\"windows\"] } ```", + "description": "A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\n\nIt controls application windows fine grained access to the Tauri core, application, or plugin commands. If a window is not matching any capability then it has no access to the IPC layer at all.\n\nThis can be done to create groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\n\n## Example\n\n```json { \"identifier\": \"main-user-files-write\", \"description\": \"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.\", \"windows\": [ \"main\" ], \"permissions\": [ \"core:default\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] }, ], \"platforms\": [\"macOS\",\"windows\"] } ```", "type": "object", "required": [ "identifier", @@ -84,7 +84,7 @@ } }, "permissions": { - "description": "List of permissions attached to this capability.\n\nMust include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. For commands directly implemented in the application itself only `${permission-name}` is required.\n\n## Example\n\n```json [ \"core:default\", \"shell:allow-open\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] } ```", + "description": "List of permissions attached to this capability.\n\nMust include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. For commands directly implemented in the application itself only `${permission-name}` is required.\n\n## Example\n\n```json [ \"core:default\", \"shell:allow-open\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] } ] ```", "type": "array", "items": { "$ref": "#/definitions/PermissionEntry" diff --git a/src/components/settings/GlobalSettings.vue b/src/components/settings/GlobalSettings.vue index c23fcb98..c42e61d6 100644 --- a/src/components/settings/GlobalSettings.vue +++ b/src/components/settings/GlobalSettings.vue @@ -44,6 +44,24 @@ +
+
+ + + +
+
+
@@ -82,7 +100,7 @@