Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plugin-form): adapt disabled scope for scoped plugin #348

Merged
merged 3 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 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-shared": "^3.10.16",
"@kong-ui-public/entities-plugins": "9.8.0",
"@kong-ui-public/entities-routes": "3.8.60",
"@kong-ui-public/entities-shared": "^3.10.17",
"@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.9.0",
"@kong-ui-public/i18n": "^2.2.10",
"@kong-ui-public/misc-widgets": "^2.1.52",
"@kong/icons": "^1.20.0",
Expand Down
182 changes: 112 additions & 70 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
Loading