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

View File

@ -11,6 +11,8 @@
export let group export let group
export let saveGroup export let saveGroup
let readonlyTitle = group?.scimInfo?.isSync
let nameError let nameError
</script> </script>
@ -26,7 +28,12 @@
title={group?._rev ? "Edit group" : "Create group"} title={group?._rev ? "Edit group" : "Create group"}
confirmText="Save" 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-format">
<div class="modal-inner"> <div class="modal-inner">
<Body size="XS">Icon</Body> <Body size="XS">Icon</Body>