From be66557985ad49f12ce30792d9e0dae4e1d0d6f9 Mon Sep 17 00:00:00 2001 From: "Gross, Lukas" Date: Tue, 4 Feb 2025 15:15:44 +0100 Subject: [PATCH 1/5] Improved usage of VDataVirtual - Pass ref to ensure correct row height measurement - Introduced GScrollContainer Component to indicate more content is available - Optimized worker, ticket labels and access restrictions layout on cluster list - Use VDataVirtual for Secret & Member Page - Introduced useTwoTableLayout composable for optimized two table page layouting --- frontend/__tests__/components/Vuetify.spec.js | 61 +++++- frontend/src/components/GDataTableFooter.vue | 107 +-------- frontend/src/components/GScrollContainer.vue | 66 ++++++ frontend/src/components/GShootListRow.vue | 55 ++--- .../components/Members/GServiceAccountRow.vue | 5 +- frontend/src/components/Members/GUserRow.vue | 5 +- .../src/components/Secrets/GSecretDialog.vue | 18 +- .../GAccessRestrictionChip.vue | 6 +- .../components/icons/GCertifiedKubernetes.vue | 204 ------------------ frontend/src/composables/useTwoTableLayout.js | 74 +++++++ frontend/src/store/localStorage.js | 24 --- frontend/src/views/GMembers.vue | 88 ++++---- frontend/src/views/GSecrets.vue | 124 +++++++---- frontend/src/views/GShootList.vue | 29 +-- 14 files changed, 380 insertions(+), 486 deletions(-) create mode 100644 frontend/src/components/GScrollContainer.vue delete mode 100644 frontend/src/components/icons/GCertifiedKubernetes.vue create mode 100644 frontend/src/composables/useTwoTableLayout.js diff --git a/frontend/__tests__/components/Vuetify.spec.js b/frontend/__tests__/components/Vuetify.spec.js index bef2015749..b724eb41e0 100644 --- a/frontend/__tests__/components/Vuetify.spec.js +++ b/frontend/__tests__/components/Vuetify.spec.js @@ -127,8 +127,6 @@ describe('components', () => { }) describe('v-data-table-virtual', () => { - // These tests basically test that nothing changes in the way vuetify renders the virtual table - // as the way it behaves in case no item-height is defined is kind of undeterministic const TestTableRow = { name: 'TestTableRow', props: { @@ -137,10 +135,10 @@ describe('components', () => { required: true, }, }, - template: '{{ item.name }}', + template: '
{{ item.name }}
', } - function mountDataTableVirtual ({ itemHeight, itemsCount = 50 } = {}) { + function mountDataTableVirtual ({ itemHeight, itemsCount = 50, useItemRef = false } = {}) { const items = Array.from({ length: itemsCount }).map((_, i) => ({ id: i, name: `Item ${i}`, @@ -163,8 +161,9 @@ describe('components', () => { :item-height="itemHeight" :height="400" > - - + -
-
+