Sync shared snapshot from 51eef30

This commit is contained in:
Gabriel20xx committed 2026-09-17 00:15:32 +02:00
1 parent b3d27ff37e
commit ec82a8a8b9
4 files changed
+93 -1

No files matched your search

@@ -123,6 +123,11 @@
editUser.projects = checked ? [...current, key] : current.filter((project) => project !== key);
}
function toggleNewProject(key: string, checked: boolean): void {
const current = newUser.projects ?? [];
newUser.projects = checked ? [...current, key] : current.filter((project) => project !== key);
}
function projectLabel(key: string): string {
return projects?.find((project) => project.key === key)?.label ?? key;
}
@@ -198,6 +203,21 @@
{#if canAssignAdmin}<option value="admin">Admin</option>{/if}
</select>
</div>
{#if projects && projects.length > 0}
<fieldset class="sc-user-projects">
<legend>Projects (none checked = all projects)</legend>
{#each projects as project (project.key)}
<label class="sc-user-project-option">
<input
type="checkbox"
checked={(newUser.projects ?? []).includes(project.key)}
onchange={(event) => toggleNewProject(project.key, event.currentTarget.checked)}
/>
{project.label}
</label>
{/each}
</fieldset>
{/if}
<div class="sc-form-actions"><Button disabled={saving} type="submit">Add user</Button></div>
</form>