diff --git a/package.json b/package.json index 8440702..b2533ef 100644 --- a/package.json +++ b/package.json @@ -31,13 +31,13 @@ "@kong-ui-public/entities-gateway-services": "^3.3.0", "@kong-ui-public/entities-key-sets": "^3.2.0", "@kong-ui-public/entities-keys": "^3.2.0", - "@kong-ui-public/entities-plugins": "^5.1.0", + "@kong-ui-public/entities-plugins": "^8.7.1", "@kong-ui-public/entities-routes": "^3.2.0", - "@kong-ui-public/entities-shared": "^3.2.0", + "@kong-ui-public/entities-shared": "^3.6.2", "@kong-ui-public/entities-snis": "^3.2.0", "@kong-ui-public/entities-upstreams-targets": "^3.2.0", - "@kong-ui-public/entities-vaults": "^3.3.0", - "@kong-ui-public/forms": "^3.1.5", + "@kong-ui-public/entities-vaults": "^3.9.2", + "@kong-ui-public/forms": "^4.3.1", "@kong-ui-public/i18n": "^2.2.0", "@kong-ui-public/misc-widgets": "^2.1.0", "@kong/icons": "^1.12.0", diff --git a/src/pages/plugins/Form.vue b/src/pages/plugins/Form.vue index a8f715a..a378c7e 100644 --- a/src/pages/plugins/Form.vue +++ b/src/pages/plugins/Form.vue @@ -11,6 +11,7 @@ :config="config" :plugin-type="pluginType" :plugin-id="pluginId" + enable-vault-secret-picker @error:fetch-schema="onFetchSchemaError" @update="onSave" /> diff --git a/tests/playwright/fixtures/vaults.ts b/tests/playwright/fixtures/vaults.ts new file mode 100644 index 0000000..2cb9fc0 --- /dev/null +++ b/tests/playwright/fixtures/vaults.ts @@ -0,0 +1,15 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +export interface Vault extends Record { + id?: string + name: string + prefix: string + config?: Record +} + +export const VAULTS: Vault[] = [ + { name: 'env', prefix: 'my-env-1', config: { prefix: 'super_secret_1_' } }, + { name: 'env', prefix: 'my-env-2', config: { prefix: 'super_secret_2_' } }, + { name: 'env', prefix: 'my-env-3', config: { prefix: 'super_secret_3_' } }, + { name: 'env', prefix: 'my-env-4', config: { prefix: 'super_secret_4_' } }, +] diff --git a/tests/playwright/helpers/vaults.ts b/tests/playwright/helpers/vaults.ts new file mode 100644 index 0000000..5edc6ba --- /dev/null +++ b/tests/playwright/helpers/vaults.ts @@ -0,0 +1,9 @@ +import { createKongResource } from '@pw/commands/createKongResource' +import { VAULTS } from '@pw/fixtures/vaults' + +export const createVaults = async () => { + // Create vaults to test the vault secret picker + for (const vault of VAULTS) { + await createKongResource('/vaults', vault) + } +} diff --git a/tests/playwright/pages/plugins.ts b/tests/playwright/pages/plugins.ts index 813efc8..7e5c7e9 100644 --- a/tests/playwright/pages/plugins.ts +++ b/tests/playwright/pages/plugins.ts @@ -1,4 +1,5 @@ -import type { Page } from '@playwright/test' +import { expect, type Locator, type Page } from '@playwright/test' +import { VAULTS } from '@pw/fixtures/vaults' import { POM } from '.' export class PluginListPage extends POM { @@ -10,3 +11,155 @@ export class PluginListPage extends POM { super(page, '/plugins') } } + +export class PluginFormPage extends POM { + public $ = { + ...POM.$, + } + + constructor (page: Page, plugin: string) { + super(page, `/plugins/${plugin}/create`) + } + + /** + * Get the field's form group with a given label + * + * @param labelFor the `for` attribute of the