Skip to content

Commit

Permalink
refactor: refactor RLS modal
Browse files Browse the repository at this point in the history
  • Loading branch information
WanShufen authored and nichenqin committed Aug 28, 2023
1 parent 1b72276 commit 314a1e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 11 additions & 3 deletions apps/frontend/src/lib/authz/rls/RLSModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
import { Modal } from 'flowbite-svelte'
import RLS from './RLS.svelte'
import { t } from '$lib/i18n'
import * as Dialog from '$components/ui/dialog'
</script>

<Modal bind:open={$rlsModal.open} class="w-full" title={$t('rls', { ns: 'authz' })} placement="top-center" size="xl">
<RLS />
</Modal>
<Dialog.Root bind:open={$rlsModal.open}>
<Dialog.Content class="!w-4/5 max-w-none max-h-[98%] overflow-y-auto">
<Dialog.Header>
<Dialog.Title>
{$t('rls', { ns: 'authz' })}
</Dialog.Title>
</Dialog.Header>
<RLS />
</Dialog.Content>
</Dialog.Root>
4 changes: 4 additions & 0 deletions apps/frontend/src/lib/authz/rls/RLSTab.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
export let action: IRLSAction
$: rlss = $currentRLSS.filter((rls) => rls.policy.action === action)
$: count = rlss.length
</script>

<div class="space-y-2">
{#if !count}
<div class="h-6"></div>
{/if}
<RlsList {rlss} />
{#if $hasPermission('rls:create')}
<RlsCreate {action} {rlss} />
Expand Down

0 comments on commit 314a1e0

Please sign in to comment.