@isoftdata/svelte-user-configuration 1.0.15 → 1.0.17

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.
@@ -10,7 +10,6 @@ export let deactivateUser = void 0;
10
10
  export async function open(userAccountCtx) {
11
11
  userAccount = klona(userAccountCtx);
12
12
  lockNotes = userAccount.lockNotes;
13
- await tick();
14
13
  show = true;
15
14
  await tick();
16
15
  textarea?.select();
@@ -19,7 +18,7 @@ const { t: translate } = getContext("i18next") || { t: (_key, fallback) => fallb
19
18
  </script>
20
19
 
21
20
  <Modal
22
- title={translate('common:deactivate', 'Deactivate {{userName}}', { userName: userAccount?.name })}
21
+ title={translate('common:deactivate', 'Deactivate {{- userName}}', { userName: userAccount?.name ?? '' })}
23
22
  confirmButtonText={translate('common:deactivate', 'Deactivate')}
24
23
  confirmButtonColor="danger"
25
24
  cancelButtonText={translate('common:close', 'Close')}
@@ -138,19 +138,13 @@ $: computedPermissions = getComputedPermissions(permissions, permissionValueMap,
138
138
  property="groupValue"
139
139
  class="px-4"
140
140
  >
141
- <span
142
- style="width: 5em;"
143
- class="badge badge-pill badge-{permissionValueList[permission.groupValue ?? 'NONE'].color}">{permissionValueList[permission.groupValue ?? 'NONE'].label}</span
144
- >
141
+ <span class="badge badge-pill badge-{permissionValueList[permission.groupValue ?? 'NONE'].color}">{permissionValueList[permission.groupValue ?? 'NONE'].label}</span>
145
142
  </Td>
146
143
  <Td
147
144
  property="computedValue"
148
145
  class="px-4"
149
146
  >
150
- <span
151
- style="width: 5em;"
152
- class="badge badge-pill badge-{permissionValueList[permission.computedValue ?? 'NONE'].color}">{permissionValueList[permission.computedValue ?? 'NONE'].label}</span
153
- >
147
+ <span class="badge badge-pill badge-{permissionValueList[permission.computedValue ?? 'NONE'].color}">{permissionValueList[permission.computedValue ?? 'NONE'].label}</span>
154
148
  </Td>
155
149
  {/if}
156
150
  <Td property="category">{permission.category}</Td>
@@ -81,7 +81,7 @@ $: activationPIN = userAccount.userActivationData?.activationPIN;
81
81
  />
82
82
  {isCreatingNewUser ? translate('configuration.user.creatingNewAccountInfoHeader', 'New Account') : translate('configuration.user.accountInfoHeader', 'Account')}
83
83
  </h5>
84
- {#if status === 'ACTIVE'}
84
+ {#if !isCreatingNewUser && status === 'ACTIVE'}
85
85
  <Button
86
86
  size="xs"
87
87
  outline
@@ -92,7 +92,7 @@ $: activationPIN = userAccount.userActivationData?.activationPIN;
92
92
  >
93
93
  <span>{translate('common:deactivate', 'Deactivate')}</span>
94
94
  </Button>
95
- {:else if status === 'DEACTIVATED' || status === 'LOCKED'}
95
+ {:else if (!isCreatingNewUser && status === 'DEACTIVATED') || status === 'LOCKED'}
96
96
  <Button
97
97
  size="xs"
98
98
  outline
@@ -279,5 +279,10 @@ $: activationPIN = userAccount.userActivationData?.activationPIN;
279
279
 
280
280
  <PasswordSetModal
281
281
  bind:this={passwordSetModal}
282
- {confirmPasswordSet}
282
+ confirmPasswordSet={async ({ password }) => {
283
+ if (hasPermissionToChangePassword) {
284
+ userAccount.newPassword = password
285
+ confirmPasswordSet?.({ password })
286
+ }
287
+ }}
283
288
  />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isoftdata/svelte-user-configuration",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",
@@ -70,4 +70,4 @@
70
70
  "just-camel-case": "^6.2.0",
71
71
  "klona": "^2.0.6"
72
72
  }
73
- }
73
+ }