@isoftdata/svelte-user-configuration 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -30,9 +30,10 @@ const { t: translate } = getContext("i18next") || { t: (_key, fallback) => fallb
|
|
|
30
30
|
>
|
|
31
31
|
<form
|
|
32
32
|
id="deactivateUserModalForm"
|
|
33
|
-
on:submit={e => {
|
|
33
|
+
on:submit={async e => {
|
|
34
34
|
e.preventDefault()
|
|
35
|
-
userAccount
|
|
35
|
+
userAccount ? await deactivateUser?.({ id: userAccount.id, lockNotes }) : undefined
|
|
36
|
+
show = false
|
|
36
37
|
}}
|
|
37
38
|
>
|
|
38
39
|
<TextArea
|
|
@@ -138,13 +138,19 @@ $: computedPermissions = getComputedPermissions(permissions, permissionValueMap,
|
|
|
138
138
|
property="groupValue"
|
|
139
139
|
class="px-4"
|
|
140
140
|
>
|
|
141
|
-
<span
|
|
141
|
+
<span
|
|
142
|
+
style="width: 5em;"
|
|
143
|
+
class="badge badge-pill badge-{permissionValueList[permission.groupValue ?? 'NONE'].color}">{permissionValueList[permission.groupValue ?? 'NONE'].label}</span
|
|
144
|
+
>
|
|
142
145
|
</Td>
|
|
143
146
|
<Td
|
|
144
147
|
property="computedValue"
|
|
145
148
|
class="px-4"
|
|
146
149
|
>
|
|
147
|
-
<span
|
|
150
|
+
<span
|
|
151
|
+
style="width: 5em;"
|
|
152
|
+
class="badge badge-pill badge-{permissionValueList[permission.computedValue ?? 'NONE'].color}">{permissionValueList[permission.computedValue ?? 'NONE'].label}</span
|
|
153
|
+
>
|
|
148
154
|
</Td>
|
|
149
155
|
{/if}
|
|
150
156
|
<Td property="category">{permission.category}</Td>
|
|
@@ -61,11 +61,6 @@ async function reactivateUserAccount() {
|
|
|
61
61
|
await accountInfoChanged?.();
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
async function deactivateUserAccount(lockNotes) {
|
|
65
|
-
userAccount.status = "DEACTIVATED";
|
|
66
|
-
userAccount.lockNotes = lockNotes;
|
|
67
|
-
await accountInfoChanged?.();
|
|
68
|
-
}
|
|
69
64
|
$: workEmail = userAccount.workEmail;
|
|
70
65
|
$: status = userAccount.status;
|
|
71
66
|
$: activationPIN = userAccount.userActivationData?.activationPIN;
|
|
@@ -98,7 +93,7 @@ $: activationPIN = userAccount.userActivationData?.activationPIN;
|
|
|
98
93
|
</Button>
|
|
99
94
|
{:else if status === 'DEACTIVATED' || status === 'LOCKED'}
|
|
100
95
|
<Button
|
|
101
|
-
size="
|
|
96
|
+
size="xs"
|
|
102
97
|
outline
|
|
103
98
|
color="success"
|
|
104
99
|
iconClass="check"
|
|
@@ -266,7 +261,19 @@ $: activationPIN = userAccount.userActivationData?.activationPIN;
|
|
|
266
261
|
|
|
267
262
|
<DeactivateUserModal
|
|
268
263
|
bind:this={deactivateUserModal}
|
|
269
|
-
{
|
|
264
|
+
deactivateUser={async ({ lockNotes }) => {
|
|
265
|
+
userAccount.status = 'DEACTIVATED'
|
|
266
|
+
userAccount.lockNotes = lockNotes
|
|
267
|
+
try {
|
|
268
|
+
await deactivateUser?.({ id: userAccount.id, lockNotes })
|
|
269
|
+
await accountInfoChanged?.()
|
|
270
|
+
} catch (err) {
|
|
271
|
+
console.error(err)
|
|
272
|
+
if (err instanceof Error) {
|
|
273
|
+
await error?.({ heading: translate('configuration.user.messageHeading.failedToDeactivateUser', 'Failed To Deactivate User'), message: err.message })
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}}
|
|
270
277
|
/>
|
|
271
278
|
|
|
272
279
|
<PasswordSetModal
|