From 3080d0a8c4165b0d8ba0ea2faac0a9b06f73dba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Wed, 19 May 2021 11:23:14 +0200 Subject: [PATCH] adds UI elements for toggling builder access --- .../portal/manage/users/[userId].svelte | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte index b8c55d6aca..8968384c91 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte @@ -9,6 +9,8 @@ Divider, Label, Input, + Select, + Toggle, Modal, Table, ModalContent, @@ -33,23 +35,25 @@ $: appList = Object.keys($apps?.data).map(id => ({ ...$apps?.data?.[id], _id: id, - role: [$roleFetch?.data?.roles?.[id]], + role: [$userFetch?.data?.roles?.[id]], })) let selectedApp - const roleFetch = fetchData(`/api/admin/users/${userId}`) + const userFetch = fetchData(`/api/admin/users/${userId}`) const apps = fetchData(`/api/admin/roles`) async function deleteUser() { const res = await users.del(userId) if (res.message) { - notifications.success(`User ${$roleFetch?.data?.email} deleted.`) + notifications.success(`User ${$userFetch?.data?.email} deleted.`) $goto("./") } else { notifications.error("Failed to delete user.") } } + async function toggleBuilderAccess() {} + async function openUpdateRolesModal({ detail }) { console.log(detail) selectedApp = detail @@ -65,11 +69,10 @@
- User: {$roleFetch?.data?.email} + User: {$userFetch?.data?.email} Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis porro - ut nesciunt ipsam perspiciatis aliquam et hic minus alias beatae. Odit - veritatis quos quas laborum magnam tenetur perspiciatis ex hic. + >Change user settings and update their app roles. Also contains the + ability to delete the user as well as force reset their password.
@@ -79,7 +82,15 @@
- + +
+
+ +