From 2beb415feb7cc6d394a5f56a572da6598d80b392 Mon Sep 17 00:00:00 2001 From: TheMeinerLP Date: Mon, 23 Nov 2026 14:41:16 +0100 Subject: [PATCH 1/2] fix(ui): draw the remaining plain alert and loading notices of the access area through shared components The permission node template menu, the permission node card and the repository access card still drew their own error line, missing line and "Loading..." text. They now use MdAlert and MdStatePanel, as the rest of the dashboard does since the previous change. Signed-off-by: TheMeinerLP --- .../references/plugins/dashboard-anchors.md | 2 +- reposilite-frontend/src/anchors/registry.json | 4 +- .../access/PermissionNodesCard.test.ts | 2 + .../components/access/PermissionNodesCard.vue | 8 ++-- .../access/nodes/NodeTemplateMenu.test.ts | 16 +++++++- .../access/nodes/NodeTemplateMenu.vue | 8 ++-- .../settings/RepositoryAccessCard.test.ts | 4 +- .../settings/RepositoryAccessCard.vue | 40 +++++++++---------- 8 files changed, 50 insertions(+), 34 deletions(-) diff --git a/docs/gitbook/references/plugins/dashboard-anchors.md b/docs/gitbook/references/plugins/dashboard-anchors.md index b5cdb934d6..57bebbd069 100644 --- a/docs/gitbook/references/plugins/dashboard-anchors.md +++ b/docs/gitbook/references/plugins/dashboard-anchors.md @@ -194,7 +194,7 @@ The dashboard animates a change of page, a menu, a dialog and a few other surfac | `rebuild-index-dialog` | experimental | `src/components/maintenance/RebuildIndexDialog.vue` | none | none | none | | `repositories-table` | experimental | `src/components/repositories/RepositoriesTable.vue` | `cell-name`, `empty` | `empty` | none | | `repositories-view` | experimental | `src/components/repositories/RepositoriesView.vue` | none | none | none | -| `repository-access-card` | stable | `src/components/settings/RepositoryAccessCard.vue` | none | `loading` | none | +| `repository-access-card` | stable | `src/components/settings/RepositoryAccessCard.vue` | none | none | none | | `repository-detail` | experimental | `src/components/repositories/RepositoryDetail.vue` | `header`, `tabs` | `empty`, `loading` | none | | `repository-members-picker` | stable | `src/components/settings/RepositoryMembersPicker.vue` | none | none | none | | `repository-overview` | experimental | `src/components/overview/RepositoryOverview.vue` | none | `loading` | none | diff --git a/reposilite-frontend/src/anchors/registry.json b/reposilite-frontend/src/anchors/registry.json index 0423b98326..8e48e7d08e 100644 --- a/reposilite-frontend/src/anchors/registry.json +++ b/reposilite-frontend/src/anchors/registry.json @@ -1509,9 +1509,7 @@ "file": "src/components/settings/RepositoryAccessCard.vue", "stability": "stable", "parts": [], - "states": [ - "loading" - ] + "states": [] }, { "name": "repository-members-picker", diff --git a/reposilite-frontend/src/components/access/PermissionNodesCard.test.ts b/reposilite-frontend/src/components/access/PermissionNodesCard.test.ts index b47f471ee3..0b72375a42 100644 --- a/reposilite-frontend/src/components/access/PermissionNodesCard.test.ts +++ b/reposilite-frontend/src/components/access/PermissionNodesCard.test.ts @@ -158,6 +158,8 @@ describe('PermissionNodesCard', () => { await mountCard({ subjectKind: 'principal', name: 'ghost' }) expect(wrapper.find('[data-test="nodes-missing"]').text()).toContain('ghost') + expect(wrapper.find('[data-test="nodes-missing"]').attributes('role'), 'the missing notice is an alert').toBe('alert') + expect(wrapper.find('[data-test="nodes-missing"]').classes(), 'the notice is drawn on the error container').toContain('bg-error-container') }) it('reads the nodes of the new subject when the name changes', async () => { diff --git a/reposilite-frontend/src/components/access/PermissionNodesCard.vue b/reposilite-frontend/src/components/access/PermissionNodesCard.vue index 33c846b5f4..8901982ee0 100644 --- a/reposilite-frontend/src/components/access/PermissionNodesCard.vue +++ b/reposilite-frontend/src/components/access/PermissionNodesCard.vue @@ -18,6 +18,7 @@ import { computed, onMounted, useId, watch, type PropType } from 'vue' import { createErrorToast, createSuccessToast } from '../../helpers/toast' import { useSession } from '../../store/session' +import MdAlert from '../md/MdAlert.vue' import MdButton from '../md/MdButton.vue' import MdCard from '../md/MdCard.vue' import MdSection from '../md/MdSection.vue' @@ -147,14 +148,13 @@ const overwrite = async () => settle(await nodes.overwriteConflict()) - + { const repository = () => wrapper!.find('input[role="combobox"]') const listbox = () => wrapper!.find('[role="listbox"]') + it('draws the problem of a filled node through the shared error alert', async () => { + mountMenu() + await toggle().trigger('click') + await wrapper!.findAll('[data-test="template-option"]')[2].trigger('click') + await repository().setValue('releases') + + const problem = wrapper!.find('[data-test="template-problem"]') + + expect(problem.exists(), 'the refused node is reported').toBe(true) + expect(problem.classes(), 'the problem is drawn on the error container').toContain('bg-error-container') + expect(problem.attributes('role'), 'the problem is announced at once').toBe('alert') + }) + it('announces the open panel on the toggle button', async () => { mountMenu() diff --git a/reposilite-frontend/src/components/access/nodes/NodeTemplateMenu.vue b/reposilite-frontend/src/components/access/nodes/NodeTemplateMenu.vue index 659ade100a..81a6e08dbe 100644 --- a/reposilite-frontend/src/components/access/nodes/NodeTemplateMenu.vue +++ b/reposilite-frontend/src/components/access/nodes/NodeTemplateMenu.vue @@ -16,6 +16,7 @@