Skip to content

Commit

Permalink
feat(plugin-form): adapt disabled scope for scoped plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
TT1228 committed Dec 5, 2024
1 parent c988d5e commit 1eb40b6
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 55 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
"@kong-ui-public/entities-gateway-services": "^3.8.44",
"@kong-ui-public/entities-key-sets": "^3.5.57",
"@kong-ui-public/entities-keys": "^3.5.58",
"@kong-ui-public/entities-plugins": "9.7.0",
"@kong-ui-public/entities-routes": "3.8.58",
"@kong-ui-public/entities-plugins": "9.7.2-pr.1816.51d0701a1.0",
"@kong-ui-public/entities-routes": "3.8.60-pr.1816.51d0701a1.0",
"@kong-ui-public/entities-shared": "^3.10.16",
"@kong-ui-public/entities-snis": "^3.5.57",
"@kong-ui-public/entities-upstreams-targets": "^3.5.58",
"@kong-ui-public/entities-vaults": "^3.13.51",
"@kong-ui-public/forms": "4.8.2",
"@kong-ui-public/forms": "4.8.3-pr.1816.51d0701a1.0",
"@kong-ui-public/i18n": "^2.2.10",
"@kong-ui-public/misc-widgets": "^2.1.52",
"@kong/icons": "^1.20.0",
Expand Down
106 changes: 74 additions & 32 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/pages/plugins/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
:config="config"
:plugin-type="pluginType"
:plugin-id="pluginId"
:hide-scope-selection="hideScopeSelection"
:disable-scope-selection="disableScopeSelection"
@error:fetch-schema="onFetchSchemaError"
@update="onSave"
/>
Expand Down Expand Up @@ -67,7 +67,7 @@ const entityScope = computed(() => {
return null
})
const hideScopeSelection = computed(() => !!entityScope.value)
const disableScopeSelection = computed(() => !!entityScope.value)
const redirectPath = useURLFromRouteQuery('redirect')
Expand Down
2 changes: 0 additions & 2 deletions tests/playwright/specs/consumers/03-ConsumerPlugins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ test.describe('consumer plugins', () => {
page,
async () => await page.getByTestId('datadog-card').click(),
)
await page.waitForSelector('.vue-form-generator')
await expect(page.locator('.selection-group')).toHaveCount(0)
await withNavigation(
page,
async () => await page.locator('[data-testid="form-actions"] .primary').click(),
Expand Down
8 changes: 0 additions & 8 deletions tests/playwright/specs/plugins/01-Plugins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ test.describe('plugins', () => {
async () => await page.getByTestId('basic-auth-card').click(),
)

await page.waitForSelector('.vue-form-generator')
await expect(page.locator('.selection-group')).toHaveCount(0)

await expandAdvancedFields(page)
await page.locator('#config-anonymous').type('anon')
await page.locator('#config-hide_credentials').check()
Expand Down Expand Up @@ -195,9 +192,6 @@ test.describe('plugins', () => {
async () => await page.getByTestId('basic-auth-card').click(),
)

await page.waitForSelector('.vue-form-generator')
await expect(page.locator('.selection-group')).toHaveCount(0)

await withNavigation(
page,
async () => await page.locator('[data-testid="form-actions"] .primary').click(),
Expand All @@ -224,8 +218,6 @@ test.describe('plugins', () => {
page,
async () => await page.getByTestId('datadog-card').click(),
)
await page.waitForSelector('.vue-form-generator')
await expect(page.locator('.selection-group')).toHaveCount(0)
await withNavigation(
page,
async () => await page.locator('[data-testid="form-actions"] .primary').click(),
Expand Down
3 changes: 0 additions & 3 deletions tests/playwright/specs/routes/02-RoutesPlugins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ test.describe('routes plugins', () => {
async () => await page.getByTestId('basic-auth-card').click(),
)

await page.waitForSelector('.vue-form-generator')
await expect(page.locator('.selection-group')).toHaveCount(0)

await withNavigation(
page,
async () => await page.locator('[data-testid="form-actions"] .primary').click(),
Expand Down
5 changes: 0 additions & 5 deletions tests/playwright/specs/services/03-ServicePlugins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ test.describe('service plugins', () => {
)

await page.waitForSelector('.vue-form-generator')
await expect(page.locator('.selection-group')).toHaveCount(0)
await fillEntityForm({ page })
await withNavigation(page, () => page.getByTestId('form-actions').locator('.k-button.primary').click())
await waitAndDismissToasts(page)
Expand All @@ -76,10 +75,6 @@ test.describe('service plugins', () => {
test("edit action should bring the user to the plugin's edit page", async ({ page }) => {
await withNavigation(page, () => clickEntityListAction(page, 'edit'))
await page.waitForSelector('.kong-ui-entities-plugin-form-container')

// The scope selction should be hidden in UI
await page.waitForSelector('.vue-form-generator')
await expect(page.locator('.selection-group')).toHaveCount(0)
})

test('cancel button on the edit page should bring the user back to the plugin tab', async ({ page }) => {
Expand Down

0 comments on commit 1eb40b6

Please sign in to comment.