From 314a1e04504fd12ee3013bafb90531d0a22fc5a9 Mon Sep 17 00:00:00 2001 From: Sophie Date: Sun, 27 Aug 2023 22:12:25 +0800 Subject: [PATCH] refactor: refactor RLS modal --- apps/frontend/src/lib/authz/rls/RLSModal.svelte | 14 +++++++++++--- apps/frontend/src/lib/authz/rls/RLSTab.svelte | 4 ++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/frontend/src/lib/authz/rls/RLSModal.svelte b/apps/frontend/src/lib/authz/rls/RLSModal.svelte index 40ad67008..57f08c574 100644 --- a/apps/frontend/src/lib/authz/rls/RLSModal.svelte +++ b/apps/frontend/src/lib/authz/rls/RLSModal.svelte @@ -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' - - - + + + + + {$t('rls', { ns: 'authz' })} + + + + + diff --git a/apps/frontend/src/lib/authz/rls/RLSTab.svelte b/apps/frontend/src/lib/authz/rls/RLSTab.svelte index 5bd528b62..d6bfbf28f 100644 --- a/apps/frontend/src/lib/authz/rls/RLSTab.svelte +++ b/apps/frontend/src/lib/authz/rls/RLSTab.svelte @@ -8,9 +8,13 @@ export let action: IRLSAction $: rlss = $currentRLSS.filter((rls) => rls.policy.action === action) + $: count = rlss.length
+ {#if !count} +
+ {/if} {#if $hasPermission('rls:create')}