From f7e97d443a34d784d620c858ef7c37bb62b0f245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nig?= Date: Thu, 21 Nov 2024 16:07:51 +0100 Subject: [PATCH 01/14] eslint --- eslint.config.mjs | 2 +- tests/e2e/tests/Routing.spec.ts | 2 +- tests/e2e/tests/pages/Base.spec.ts | 2 +- tests/e2e/tests/pages/ClusterManagement.spec.ts | 2 +- tests/e2e/tests/pages/HomeStatus.spec.ts | 2 +- tests/e2e/tests/pages/Indices.spec.ts | 2 +- tests/e2e/tests/pages/Nodes.spec.ts | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 41cf23d5..e3d21bff 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -38,7 +38,7 @@ export default [ }], quotes: ['error', 'single'], }, - files: ['src/**/*.{js,vue,ts,json}'], + files: ['src/**/*.{js,vue,ts,json}', 'tests/**/*.ts}'], settings: { 'vue-i18n': { localeDir: { diff --git a/tests/e2e/tests/Routing.spec.ts b/tests/e2e/tests/Routing.spec.ts index 67378778..79946195 100644 --- a/tests/e2e/tests/Routing.spec.ts +++ b/tests/e2e/tests/Routing.spec.ts @@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test' import { setupClusterConnection } from '../helpers' import { withElastic } from '../mocks' -test.describe.configure({ mode: 'parallel' }); +test.describe.configure({ mode: 'parallel' }) withElastic(({ mockElastic, elastic }) => { test.describe(`elasticsearch ${elastic.version}`, () => { diff --git a/tests/e2e/tests/pages/Base.spec.ts b/tests/e2e/tests/pages/Base.spec.ts index ac2f69af..75c1e1c4 100644 --- a/tests/e2e/tests/pages/Base.spec.ts +++ b/tests/e2e/tests/pages/Base.spec.ts @@ -1,7 +1,7 @@ import { test, expect } from '@playwright/test' import { openElasticvue } from '../../helpers' -test.describe.configure({ mode: 'parallel' }); +test.describe.configure({ mode: 'parallel' }) test.describe('base', () => { test('has a title', async ({ page }) => { diff --git a/tests/e2e/tests/pages/ClusterManagement.spec.ts b/tests/e2e/tests/pages/ClusterManagement.spec.ts index cf292d05..8cabd67f 100644 --- a/tests/e2e/tests/pages/ClusterManagement.spec.ts +++ b/tests/e2e/tests/pages/ClusterManagement.spec.ts @@ -2,7 +2,7 @@ import { test, expect, Page } from '@playwright/test' import { setupClusterConnection } from '../../helpers' import { withElastic } from '../../mocks' -test.describe.configure({ mode: 'parallel' }); +test.describe.configure({ mode: 'parallel' }) const setupClusterSelectionTest = async (page: Page) => { await setupClusterConnection(page) diff --git a/tests/e2e/tests/pages/HomeStatus.spec.ts b/tests/e2e/tests/pages/HomeStatus.spec.ts index 74695f0a..339fcaf7 100644 --- a/tests/e2e/tests/pages/HomeStatus.spec.ts +++ b/tests/e2e/tests/pages/HomeStatus.spec.ts @@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test' import { setupClusterConnection } from '../../helpers' import { withElastic } from '../../mocks' -test.describe.configure({ mode: 'parallel' }); +test.describe.configure({ mode: 'parallel' }) withElastic(({ mockElastic, elastic }) => { test.describe(`elasticsearch ${elastic.version}`, () => { diff --git a/tests/e2e/tests/pages/Indices.spec.ts b/tests/e2e/tests/pages/Indices.spec.ts index 31b36a88..68cf168c 100644 --- a/tests/e2e/tests/pages/Indices.spec.ts +++ b/tests/e2e/tests/pages/Indices.spec.ts @@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test' import { setupClusterConnection } from '../../helpers' import { withElastic } from '../../mocks' -test.describe.configure({ mode: 'parallel' }); +test.describe.configure({ mode: 'parallel' }) const setup = async (page: any, mockElastic: any) => { await mockElastic(page) diff --git a/tests/e2e/tests/pages/Nodes.spec.ts b/tests/e2e/tests/pages/Nodes.spec.ts index dbd24551..fdcc9bbc 100644 --- a/tests/e2e/tests/pages/Nodes.spec.ts +++ b/tests/e2e/tests/pages/Nodes.spec.ts @@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test' import { setupClusterConnection } from '../../helpers' import { withElastic } from '../../mocks' -test.describe.configure({ mode: 'parallel' }); +test.describe.configure({ mode: 'parallel' }) withElastic(({ mockElastic, elastic }) => { test.describe(`elasticsearch ${elastic.version}`, () => { 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 02/14] 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 @@