diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index 84c178cc46..0fd6ea1fa9 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -118,6 +118,7 @@ export enum Submit { UserCreate = 'submit_user_create', UserDelete = 'submit_user_delete', UserUpdateEmail = 'submit_user_update_email', + UserUpdateLabels = 'submit_user_update_labels', UserUpdateName = 'submit_user_update_name', UserUpdatePassword = 'submit_user_update_password', UserUpdatePhone = 'submit_user_update_phone', diff --git a/src/routes/console/project-[project]/auth/+page.svelte b/src/routes/console/project-[project]/auth/+page.svelte index 0063f7ea1f..39252ec876 100644 --- a/src/routes/console/project-[project]/auth/+page.svelte +++ b/src/routes/console/project-[project]/auth/+page.svelte @@ -29,6 +29,12 @@ export let data: PageData; + // TODO: Remove this when the console SDK is updated + const users = data.users.users.map((user) => { + const labels: string[] = []; + return { labels, ...user }; + }); + let showCreate = false; const projectId = $page.params.project; async function userCreated(event: CustomEvent>>) { @@ -49,10 +55,11 @@ Identifiers Status ID + Labels Joined - {#each data.users.users as user} + {#each users as user} @@ -102,6 +109,9 @@ + + {user.labels.join(', ')} + {toLocaleDateTime(user.registration)} diff --git a/src/routes/console/project-[project]/auth/user-[user]/+page.svelte b/src/routes/console/project-[project]/auth/user-[user]/+page.svelte index b48becb71b..04ef2f14a2 100644 --- a/src/routes/console/project-[project]/auth/user-[user]/+page.svelte +++ b/src/routes/console/project-[project]/auth/user-[user]/+page.svelte @@ -2,6 +2,7 @@ import { Container } from '$lib/layout'; import DangerZone from './dangerZone.svelte'; import UpdateEmail from './updateEmail.svelte'; + import UpdateLabels from './updateLabels.svelte'; import UpdateName from './updateName.svelte'; import UpdatePassword from './updatePassword.svelte'; import UpdatePhone from './updatePhone.svelte'; @@ -15,6 +16,7 @@ + diff --git a/src/routes/console/project-[project]/auth/user-[user]/updateLabels.svelte b/src/routes/console/project-[project]/auth/user-[user]/updateLabels.svelte new file mode 100644 index 0000000000..b8fe681503 --- /dev/null +++ b/src/routes/console/project-[project]/auth/user-[user]/updateLabels.svelte @@ -0,0 +1,119 @@ + + +
+ + Labels +

+ Categorize and manage your users based on specific criteria by assigning them + customizable labels. New label-based roles will be assigned. +

+ +
    + +
  • + {error ? error : 'Only alphanumeric characters are allowed'} +
  • +
  • + {#each suggestedLabels as suggestedLabel} + { + if (!labels.includes(suggestedLabel)) { + labels = [...labels, suggestedLabel]; + } else { + labels = labels.filter((e) => e !== suggestedLabel); + } + }}> + + {/each} +
  • +
+
+ + + + +
+