Skip to content

Commit

Permalink
fix(entities): conditionally render Teleport for Konnect and div for …
Browse files Browse the repository at this point in the history
…Kong Manager per pr feedback
  • Loading branch information
mptap committed May 2, 2024
1 parent c3ba6a6 commit 1aa1fc1
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<Teleport :to="useActionOutside ? '#kong-ui-app-page-header-action-button' : '#kong-ui-app-page-header-action-button-default'">
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
<KButton
Expand All @@ -45,6 +42,8 @@
</KButton>
</PermissionsWrapper>
</Teleport>
<!-- render this fallback div for Kong Manager instead, as there is no kong-ui-app-page-header-action-button target to go to in KM -->
<div id="kong-ui-app-page-header-action-button-default" />
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<Teleport :to="useActionOutside ? '#kong-ui-app-page-header-action-button' : '#kong-ui-app-page-header-action-button-default'">
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
<KButton
Expand All @@ -45,6 +42,8 @@
</KButton>
</PermissionsWrapper>
</Teleport>
<!-- render this fallback div for Kong Manager instead, as there is no kong-ui-app-page-header-action-button target to go to in KM -->
<div id="kong-ui-app-page-header-action-button-default" />
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
>
<!-- Create action -->
<template #toolbar-button>
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<Teleport :to="useActionOutside ? '#kong-ui-app-page-header-action-button' : '#kong-ui-app-page-header-action-button-default'">
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
<KButton
Expand All @@ -36,6 +33,8 @@
</KButton>
</PermissionsWrapper>
</Teleport>
<!-- render this fallback div for Kong Manager instead, as there is no kong-ui-app-page-header-action-button target to go to in KM -->
<div id="kong-ui-app-page-header-action-button-default" />
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<Teleport :to="useActionOutside ? '#kong-ui-app-page-header-action-button' : '#kong-ui-app-page-header-action-button-default'">
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
<KButton
Expand All @@ -50,6 +47,8 @@
</KButton>
</PermissionsWrapper>
</Teleport>
<!-- render this fallback div for Kong Manager instead, as there is no kong-ui-app-page-header-action-button target to go to in KM -->
<div id="kong-ui-app-page-header-action-button-default" />
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<Teleport :to="useActionOutside ? '#kong-ui-app-page-header-action-button' : '#kong-ui-app-page-header-action-button-default'">
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
<KButton
Expand All @@ -50,6 +47,8 @@
</KButton>
</PermissionsWrapper>
</Teleport>
<!-- render this fallback div for Kong Manager instead, as there is no kong-ui-app-page-header-action-button target to go to in KM -->
<div id="kong-ui-app-page-header-action-button-default" />
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<Teleport :to="useActionOutside ? '#kong-ui-app-page-header-action-button' : '#kong-ui-app-page-header-action-button-default'">
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
<KButton
Expand All @@ -45,6 +42,8 @@
</KButton>
</PermissionsWrapper>
</Teleport>
<!-- render this fallback div for Kong Manager instead, as there is no kong-ui-app-page-header-action-button target to go to in KM -->
<div id="kong-ui-app-page-header-action-button-default" />
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<Teleport :to="useActionOutside ? '#kong-ui-app-page-header-action-button' : '#kong-ui-app-page-header-action-button-default'">
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
<KButton
Expand All @@ -45,6 +42,8 @@
</KButton>
</PermissionsWrapper>
</Teleport>
<!-- render this fallback div for Kong Manager instead, as there is no kong-ui-app-page-header-action-button target to go to in KM -->
<div id="kong-ui-app-page-header-action-button-default" />
</template>

<!-- Column Formatting -->
Expand Down
7 changes: 3 additions & 4 deletions packages/entities/entities-keys/src/components/KeyList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<Teleport :to="useActionOutside ? '#kong-ui-app-page-header-action-button' : '#kong-ui-app-page-header-action-button-default'">
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
<KButton
Expand All @@ -45,6 +42,8 @@
</KButton>
</PermissionsWrapper>
</Teleport>
<!-- render this fallback div for Kong Manager instead, as there is no kong-ui-app-page-header-action-button target to go to in KM -->
<div id="kong-ui-app-page-header-action-button-default" />
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<Teleport :to="useActionOutside ? '#kong-ui-app-page-header-action-button' : '#kong-ui-app-page-header-action-button-default'">
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
<KButton
Expand All @@ -48,6 +45,8 @@
</KButton>
</PermissionsWrapper>
</Teleport>
<!-- render this fallback div for Kong Manager instead, as there is no kong-ui-app-page-header-action-button target to go to in KM -->
<div id="kong-ui-app-page-header-action-button-default" />
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<Teleport :to="useActionOutside ? '#kong-ui-app-page-header-action-button' : '#kong-ui-app-page-header-action-button-default'">
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
<KButton
Expand All @@ -48,6 +45,8 @@
</KButton>
</PermissionsWrapper>
</Teleport>
<!-- render this fallback div for Kong Manager instead, as there is no kong-ui-app-page-header-action-button target to go to in KM -->
<div id="kong-ui-app-page-header-action-button-default" />
</template>

<!-- Column Formatting -->
Expand Down
7 changes: 3 additions & 4 deletions packages/entities/entities-snis/src/components/SniList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<Teleport :to="useActionOutside ? '#kong-ui-app-page-header-action-button' : '#kong-ui-app-page-header-action-button-default'">
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
<KButton
Expand All @@ -46,6 +43,8 @@
</KButton>
</PermissionsWrapper>
</Teleport>
<!-- render this fallback div for Kong Manager instead, as there is no kong-ui-app-page-header-action-button target to go to in KM -->
<div id="kong-ui-app-page-header-action-button-default" />
</template>

<!-- Column Formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
>
<!-- Create action -->
<template #toolbar-button>
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<Teleport :to="useActionOutside ? '#kong-ui-app-page-header-action-button' : '#kong-ui-app-page-header-action-button-default'">
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
<KButton
Expand All @@ -36,6 +33,8 @@
</KButton>
</PermissionsWrapper>
</Teleport>
<!-- render this fallback div for Kong Manager instead, as there is no kong-ui-app-page-header-action-button target to go to in KM -->
<div id="kong-ui-app-page-header-action-button-default" />
</template>

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

<!-- Create action -->
<template #toolbar-button>
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<Teleport :to="useActionOutside ? '#kong-ui-app-page-header-action-button' : '#kong-ui-app-page-header-action-button-default'">
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
<KButton
Expand All @@ -46,6 +43,8 @@
</KButton>
</PermissionsWrapper>
</Teleport>
<!-- render this fallback div for Kong Manager instead, as there is no kong-ui-app-page-header-action-button target to go to in KM -->
<div id="kong-ui-app-page-header-action-button-default" />
</template>

<!-- Column formatting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
</template>
<!-- Create action -->
<template #toolbar-button>
<Teleport
:disabled="!useActionOutside || config.app !== 'konnect'"
to="#kong-ui-app-page-header-action-button"
>
<Teleport :to="useActionOutside ? '#kong-ui-app-page-header-action-button' : '#kong-ui-app-page-header-action-button-default'">
<PermissionsWrapper :auth-function="() => canCreate()">
<!-- Hide Create button if table is empty -->
<KButton
Expand All @@ -45,6 +42,8 @@
</KButton>
</PermissionsWrapper>
</Teleport>
<!-- render this fallback div for Kong Manager instead, as there is no kong-ui-app-page-header-action-button target to go to in KM -->
<div id="kong-ui-app-page-header-action-button-default" />
</template>

<!-- Column Formatting -->
Expand Down

0 comments on commit 1aa1fc1

Please sign in to comment.