From ee0e55ad95926acbb81ec8837d15fd98d8e2a8a0 Mon Sep 17 00:00:00 2001 From: GU Yiling Date: Mon, 4 Nov 2024 20:37:46 +0800 Subject: [PATCH] fix(entities-*): unify table tags and add compat support for filter apis (#1756) * fix(entities-*): unify table tags and add compat support for filter apis * fix(entities-shared): fix tag max width, add test --- cypress.config.ts | 1 - .../sandbox/pages/CACertificateListPage.vue | 1 + .../sandbox/pages/CertificateListPage.vue | 1 + .../src/components/CACertificateList.vue | 12 +-- .../src/components/CertificateList.vue | 12 +-- .../src/components/ConsumerCredentialList.vue | 12 +-- .../src/components/ConsumerGroupList.vue | 12 +-- .../src/components/ConsumerList.vue | 12 +-- .../src/components/GatewayServiceList.vue | 12 +-- .../src/components/KeySetList.vue | 12 +-- .../entities-keys/src/components/KeyList.vue | 12 +-- .../src/components/PluginList.vue | 12 +-- .../src/components/RouteList.vue | 12 +-- .../src/components/common/TableTags.cy.ts | 80 +++++++++++++++++++ .../src/components/common/TableTags.vue | 54 +++++++++++++ .../src/composables/useHelpers.ts | 8 +- .../entities/entities-shared/src/index.ts | 3 +- .../src/components/SniForm.cy.ts | 6 +- .../entities-snis/src/components/SniList.vue | 12 +-- .../src/components/TargetsList.vue | 14 ++-- .../src/components/UpstreamsList.vue | 14 ++-- .../src/components/VaultList.vue | 12 +-- 22 files changed, 181 insertions(+), 145 deletions(-) create mode 100644 packages/entities/entities-shared/src/components/common/TableTags.cy.ts create mode 100644 packages/entities/entities-shared/src/components/common/TableTags.vue diff --git a/cypress.config.ts b/cypress.config.ts index 38f5d5e70e..eb94f2b5cd 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -19,7 +19,6 @@ export default defineConfig({ screenshotsFolder: 'cypress/screenshots', video: true, videosFolder: 'cypress/videos', - videoUploadOnPasses: false, retries: { runMode: 1, }, diff --git a/packages/entities/entities-certificates/sandbox/pages/CACertificateListPage.vue b/packages/entities/entities-certificates/sandbox/pages/CACertificateListPage.vue index daf9ff4fd9..66cbd27ea8 100644 --- a/packages/entities/entities-certificates/sandbox/pages/CACertificateListPage.vue +++ b/packages/entities/entities-certificates/sandbox/pages/CACertificateListPage.vue @@ -50,6 +50,7 @@ const konnectConfig = ref({ // Set the root `.env.development.local` variable to a control plane your PAT can access controlPlaneId, createRoute: { name: 'create-ca-certificate' }, + isExactMatch: true, getViewRoute: (id: string) => ({ name: 'view-ca-certificate', params: { id } }), getEditRoute: (id: string) => ({ name: 'edit-ca-certificate', params: { id } }), }) diff --git a/packages/entities/entities-certificates/sandbox/pages/CertificateListPage.vue b/packages/entities/entities-certificates/sandbox/pages/CertificateListPage.vue index eead13c185..29ea3e315d 100644 --- a/packages/entities/entities-certificates/sandbox/pages/CertificateListPage.vue +++ b/packages/entities/entities-certificates/sandbox/pages/CertificateListPage.vue @@ -50,6 +50,7 @@ const konnectConfig = ref({ // Set the root `.env.development.local` variable to a control plane your PAT can access controlPlaneId, createRoute: { name: 'create-certificate' }, + isExactMatch: true, getViewRoute: (id: string) => ({ name: 'view-certificate', params: { id } }), getEditRoute: (id: string) => ({ name: 'edit-certificate', params: { id } }), getCreateSniRoute: (id: string) => ({ name: 'add-sni', params: { id } }), diff --git a/packages/entities/entities-certificates/src/components/CACertificateList.vue b/packages/entities/entities-certificates/src/components/CACertificateList.vue index a908022c96..d281e7951f 100644 --- a/packages/entities/entities-certificates/src/components/CACertificateList.vue +++ b/packages/entities/entities-certificates/src/components/CACertificateList.vue @@ -59,16 +59,7 @@ @@ -158,6 +149,7 @@ import { useAxios, useFetcher, useDeleteUrlBuilder, + TableTags, } from '@kong-ui-public/entities-shared' import type { KongManagerCertificateListConfig, diff --git a/packages/entities/entities-certificates/src/components/CertificateList.vue b/packages/entities/entities-certificates/src/components/CertificateList.vue index 859ae5ad6c..45e5dd2aa3 100644 --- a/packages/entities/entities-certificates/src/components/CertificateList.vue +++ b/packages/entities/entities-certificates/src/components/CertificateList.vue @@ -75,16 +75,7 @@ - @@ -183,6 +174,7 @@ import { useAxios, useFetcher, useDeleteUrlBuilder, + TableTags, } from '@kong-ui-public/entities-shared' import type { KongManagerCertificateListConfig, diff --git a/packages/entities/entities-consumer-credentials/src/components/ConsumerCredentialList.vue b/packages/entities/entities-consumer-credentials/src/components/ConsumerCredentialList.vue index 659dfad664..cdc7f4bdbc 100644 --- a/packages/entities/entities-consumer-credentials/src/components/ConsumerCredentialList.vue +++ b/packages/entities/entities-consumer-credentials/src/components/ConsumerCredentialList.vue @@ -79,16 +79,7 @@ {{ formatUnixTimeStamp(rowValue) }} @@ -202,6 +193,7 @@ import { useAxios, useFetcher, useDeleteUrlBuilder, + TableTags, } from '@kong-ui-public/entities-shared' import type { CredentialPlugins, diff --git a/packages/entities/entities-consumer-groups/src/components/ConsumerGroupList.vue b/packages/entities/entities-consumer-groups/src/components/ConsumerGroupList.vue index e020869c74..9230e9464f 100644 --- a/packages/entities/entities-consumer-groups/src/components/ConsumerGroupList.vue +++ b/packages/entities/entities-consumer-groups/src/components/ConsumerGroupList.vue @@ -59,16 +59,7 @@ {{ rowValue ?? '-' }} @@ -193,6 +184,7 @@ import { useAxios, useFetcher, useDeleteUrlBuilder, + TableTags, } from '@kong-ui-public/entities-shared' import type { KongManagerConsumerGroupListConfig, diff --git a/packages/entities/entities-consumers/src/components/ConsumerList.vue b/packages/entities/entities-consumers/src/components/ConsumerList.vue index 105651dfaf..446956c9e0 100644 --- a/packages/entities/entities-consumers/src/components/ConsumerList.vue +++ b/packages/entities/entities-consumers/src/components/ConsumerList.vue @@ -59,16 +59,7 @@ {{ getRowValue(rowValue) }} @@ -193,6 +184,7 @@ import { useAxios, useFetcher, useDeleteUrlBuilder, + TableTags, } from '@kong-ui-public/entities-shared' import type { KongManagerConsumerListConfig, diff --git a/packages/entities/entities-gateway-services/src/components/GatewayServiceList.vue b/packages/entities/entities-gateway-services/src/components/GatewayServiceList.vue index e32b6557c7..f6ad40456d 100644 --- a/packages/entities/entities-gateway-services/src/components/GatewayServiceList.vue +++ b/packages/entities/entities-gateway-services/src/components/GatewayServiceList.vue @@ -80,16 +80,7 @@ @@ -142,6 +133,7 @@ import { useAxios, useFetcher, useDeleteUrlBuilder, + TableTags, } from '@kong-ui-public/entities-shared' import type { KongManagerSniListConfig, diff --git a/packages/entities/entities-upstreams-targets/src/components/TargetsList.vue b/packages/entities/entities-upstreams-targets/src/components/TargetsList.vue index 47be247dd2..9305702a53 100644 --- a/packages/entities/entities-upstreams-targets/src/components/TargetsList.vue +++ b/packages/entities/entities-upstreams-targets/src/components/TargetsList.vue @@ -43,15 +43,10 @@ {{ rowValue }} @@ -149,6 +144,7 @@ import { EntityDeleteModal, useAxios, EntityTypes, + TableTags, } from '@kong-ui-public/entities-shared' import type { PropType } from 'vue' import { computed, onBeforeMount, ref, watch } from 'vue' diff --git a/packages/entities/entities-upstreams-targets/src/components/UpstreamsList.vue b/packages/entities/entities-upstreams-targets/src/components/UpstreamsList.vue index 7a9a3d1403..de05e28020 100644 --- a/packages/entities/entities-upstreams-targets/src/components/UpstreamsList.vue +++ b/packages/entities/entities-upstreams-targets/src/components/UpstreamsList.vue @@ -52,15 +52,10 @@ {{ rowValue }} @@ -132,6 +127,7 @@ import { EntityDeleteModal, useAxios, EntityTypes, + TableTags, } from '@kong-ui-public/entities-shared' import type { PropType } from 'vue' import { computed, onBeforeMount, ref, watch } from 'vue' diff --git a/packages/entities/entities-vaults/src/components/VaultList.vue b/packages/entities/entities-vaults/src/components/VaultList.vue index 1583af7275..3dd90cf392 100644 --- a/packages/entities/entities-vaults/src/components/VaultList.vue +++ b/packages/entities/entities-vaults/src/components/VaultList.vue @@ -61,16 +61,7 @@ @@ -148,6 +139,7 @@ import { useAxios, useFetcher, useDeleteUrlBuilder, + TableTags, } from '@kong-ui-public/entities-shared' import type {