Readonly name only

This commit is contained in:
Adria Navarro 2024-02-27 14:59:58 +01:00
parent f55dd8badb
commit ce998c456e
2 changed files with 24 additions and 13 deletions

View File

@ -48,7 +48,7 @@
let editModal, deleteModal
$: group = $groups.find(x => x._id === groupId)
$: readonly = !sdk.users.isAdmin($auth.user) || group?.scimInfo?.isSync
$: readonly = !sdk.users.isAdmin($auth.user)
$: groupApps = $apps
.filter(app =>
groups.actions
@ -118,19 +118,23 @@
<div class="header">
<GroupIcon {group} size="L" />
<Heading>{group?.name}</Heading>
{#if !readonly}
<ActionMenu align="right">
<span slot="control">
<Icon hoverable name="More" />
</span>
<MenuItem icon="Refresh" on:click={() => editModal.show()}>
Edit
</MenuItem>
<MenuItem icon="Delete" on:click={() => deleteModal.show()}>
<ActionMenu align="right">
<span slot="control">
<Icon hoverable name="More" />
</span>
<MenuItem icon="Refresh" on:click={() => editModal.show()}>
Edit
</MenuItem>
<div title={group?.scimInfo?.isSync && "Group synced from your AD"}>
<MenuItem
icon="Delete"
on:click={() => deleteModal.show()}
disabled={group?.scimInfo?.isSync}
>
Delete
</MenuItem>
</ActionMenu>
{/if}
</div>
</ActionMenu>
</div>
<Layout noPadding gap="S">

View File

@ -11,6 +11,8 @@
export let group
export let saveGroup
let readonlyTitle = group?.scimInfo?.isSync
let nameError
</script>
@ -26,7 +28,12 @@
title={group?._rev ? "Edit group" : "Create group"}
confirmText="Save"
>
<Input bind:value={group.name} label="Name" error={nameError} />
<Input
bind:value={group.name}
label="Name"
error={nameError}
disabled={readonlyTitle}
/>
<div class="modal-format">
<div class="modal-inner">
<Body size="XS">Icon</Body>