Skip to content

Commit

Permalink
fix(entities): restore Teleport for new entity button only in Konnect…
Browse files Browse the repository at this point in the history
… app [KHCP-11277]
  • Loading branch information
mptap committed May 1, 2024
1 parent 46b157a commit c3ba6a6
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<component
:is="useActionOutside ? 'Teleport' : 'div'"
:to="useActionOutside ? '#kong-ui-app-page-header-action-button' : undefined"
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
Expand All @@ -44,7 +44,7 @@
{{ t('ca-certificates.list.toolbar_actions.new_ca_certificate') }}
</KButton>
</PermissionsWrapper>
</component>
</Teleport>
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<component
:is="useActionOutside ? 'Teleport' : 'div'"
:to="useActionOutside ? '#kong-ui-app-page-header-action-button' : undefined"
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
Expand All @@ -44,7 +44,7 @@
{{ t('certificates.list.toolbar_actions.new_certificate') }}
</KButton>
</PermissionsWrapper>
</component>
</Teleport>
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
>
<!-- Create action -->
<template #toolbar-button>
<component
:is="useActionOutside ? 'Teleport' : 'div'"
:to="useActionOutside ? '#kong-ui-app-page-header-action-button' : undefined"
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
Expand All @@ -35,7 +35,7 @@
{{ t(`credentials.list.toolbar_actions.${config.plugin}.new`) }}
</KButton>
</PermissionsWrapper>
</component>
</Teleport>
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<component
:is="useActionOutside ? 'Teleport' : 'div'"
:to="useActionOutside ? '#kong-ui-app-page-header-action-button' : undefined"
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
Expand All @@ -49,7 +49,7 @@
{{ config.consumerId ? t('consumer_groups.actions.add_to_group') : t('consumer_groups.list.toolbar_actions.new_consumer_group') }}
</KButton>
</PermissionsWrapper>
</component>
</Teleport>
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<component
:is="useActionOutside ? 'Teleport' : 'div'"
:to="useActionOutside ? '#kong-ui-app-page-header-action-button' : undefined"
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
Expand All @@ -49,7 +49,7 @@
{{ config.consumerGroupId ? t('consumers.actions.add_consumer') : t('consumers.list.toolbar_actions.new_consumer') }}
</KButton>
</PermissionsWrapper>
</component>
</Teleport>
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<component
:is="useActionOutside ? 'Teleport' : 'div'"
:to="useActionOutside ? '#kong-ui-app-page-header-action-button' : undefined"
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
Expand All @@ -44,7 +44,7 @@
{{ t('gateway_services.list.toolbar_actions.new_gateway_service') }}
</KButton>
</PermissionsWrapper>
</component>
</Teleport>
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<component
:is="useActionOutside ? 'Teleport' : 'div'"
:to="useActionOutside ? '#kong-ui-app-page-header-action-button' : undefined"
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
Expand All @@ -44,7 +44,7 @@
{{ t('keySets.list.toolbar_actions.new_key_set') }}
</KButton>
</PermissionsWrapper>
</component>
</Teleport>
</template>

<!-- Column Formatting -->
Expand Down
8 changes: 4 additions & 4 deletions packages/entities/entities-keys/src/components/KeyList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<component
:is="useActionOutside ? 'Teleport' : 'div'"
:to="useActionOutside ? '#kong-ui-app-page-header-action-button' : undefined"
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
Expand All @@ -44,7 +44,7 @@
{{ t('keys.list.toolbar_actions.new_key') }}
</KButton>
</PermissionsWrapper>
</component>
</Teleport>
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<component
:is="useActionOutside ? 'Teleport' : 'div'"
:to="useActionOutside ? '#kong-ui-app-page-header-action-button' : undefined"
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
Expand All @@ -47,7 +47,7 @@
{{ t('plugins.list.toolbar_actions.new_plugin') }}
</KButton>
</PermissionsWrapper>
</component>
</Teleport>
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<component
:is="useActionOutside ? 'Teleport' : 'div'"
:to="useActionOutside ? '#kong-ui-app-page-header-action-button' : undefined"
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
Expand All @@ -47,7 +47,7 @@
{{ t('routes.list.toolbar_actions.new_route') }}
</KButton>
</PermissionsWrapper>
</component>
</Teleport>
</template>

<!-- Column Formatting -->
Expand Down
8 changes: 4 additions & 4 deletions packages/entities/entities-snis/src/components/SniList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<component
:is="useActionOutside ? 'Teleport' : 'div'"
:to="useActionOutside ? '#kong-ui-app-page-header-action-button' : undefined"
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
Expand All @@ -45,7 +45,7 @@
{{ t('snis.list.toolbar_actions.new') }}
</KButton>
</PermissionsWrapper>
</component>
</Teleport>
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
>
<!-- Create action -->
<template #toolbar-button>
<component
:is="useActionOutside ? 'Teleport' : 'div'"
:to="useActionOutside ? '#kong-ui-app-page-header-action-button' : undefined"
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
Expand All @@ -35,7 +35,7 @@
{{ t('targets.list.toolbar_actions.new_target') }}
</KButton>
</PermissionsWrapper>
</component>
</Teleport>
</template>

<!-- Column formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

<!-- Create action -->
<template #toolbar-button>
<component
:is="useActionOutside ? 'Teleport' : 'div'"
:to="useActionOutside ? '#kong-ui-app-page-header-action-button' : undefined"
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
Expand All @@ -45,7 +45,7 @@
{{ t('upstreams.list.toolbar_actions.new_upstream') }}
</KButton>
</PermissionsWrapper>
</component>
</Teleport>
</template>

<!-- Column formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<component
:is="useActionOutside ? 'Teleport' : 'div'"
:to="useActionOutside ? '#kong-ui-app-page-header-action-button' : undefined"
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
Expand All @@ -44,7 +44,7 @@
{{ t('vaults.list.toolbar_actions.new_vault') }}
</KButton>
</PermissionsWrapper>
</component>
</Teleport>
</template>

<!-- Column Formatting -->
Expand Down

0 comments on commit c3ba6a6

Please sign in to comment.