@isoftdata/svelte-user-configuration 1.0.16 → 1.0.18
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.
|
@@ -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>
|
|
@@ -11,7 +11,6 @@ export let userAccount;
|
|
|
11
11
|
export let icon = "user";
|
|
12
12
|
export let canToggleActive = true;
|
|
13
13
|
export let canEditAccountInfo = true;
|
|
14
|
-
export let isCreatingNewUser = false;
|
|
15
14
|
export let deactivateUser = void 0;
|
|
16
15
|
export let hasPermissionToChangePassword = false;
|
|
17
16
|
export let confirmPasswordSet = void 0;
|
|
@@ -65,6 +64,7 @@ async function reactivateUserAccount() {
|
|
|
65
64
|
$: workEmail = userAccount.workEmail;
|
|
66
65
|
$: status = userAccount.status;
|
|
67
66
|
$: activationPIN = userAccount.userActivationData?.activationPIN;
|
|
67
|
+
$: isCreatingNewUser = userAccount.id === null;
|
|
68
68
|
</script>
|
|
69
69
|
|
|
70
70
|
<div
|
|
@@ -191,7 +191,8 @@ $: activationPIN = userAccount.userActivationData?.activationPIN;
|
|
|
191
191
|
required={isCreatingNewUser}
|
|
192
192
|
validation={{
|
|
193
193
|
validator: value => {
|
|
194
|
-
|
|
194
|
+
if (!value) return 'Username is required.'
|
|
195
|
+
else return value.length > 320 ? 'Username must be less than 320 characters.' : true
|
|
195
196
|
},
|
|
196
197
|
}}
|
|
197
198
|
bind:input={usernameInput}
|
|
@@ -279,5 +280,10 @@ $: activationPIN = userAccount.userActivationData?.activationPIN;
|
|
|
279
280
|
|
|
280
281
|
<PasswordSetModal
|
|
281
282
|
bind:this={passwordSetModal}
|
|
282
|
-
{
|
|
283
|
+
confirmPasswordSet={async ({ password }) => {
|
|
284
|
+
if (hasPermissionToChangePassword) {
|
|
285
|
+
userAccount.newPassword = password
|
|
286
|
+
confirmPasswordSet?.({ password })
|
|
287
|
+
}
|
|
288
|
+
}}
|
|
283
289
|
/>
|
|
@@ -5,7 +5,6 @@ declare const __propDef: {
|
|
|
5
5
|
userAccount: UserAccount;
|
|
6
6
|
canEditAccountInfo?: boolean;
|
|
7
7
|
canToggleActive?: boolean;
|
|
8
|
-
isCreatingNewUser?: boolean;
|
|
9
8
|
hasPermissionToChangePassword?: boolean;
|
|
10
9
|
generateNewActivationPIN?: (userName: string, hasWorkEmail: boolean) => Promise<void>;
|
|
11
10
|
confirmPasswordSet?: ConfirmPasswordSetFn;
|
|
@@ -12,7 +12,6 @@ export let cardDeckHeight = "500px";
|
|
|
12
12
|
export let usernameInput = void 0;
|
|
13
13
|
export let userAccount;
|
|
14
14
|
export let canToggleActive = true;
|
|
15
|
-
export let isCreatingNewUser = false;
|
|
16
15
|
export let canEditAccountInfo = true;
|
|
17
16
|
export let hasPermissionToChangePassword = false;
|
|
18
17
|
export let error = void 0;
|
|
@@ -41,7 +40,6 @@ export let permissionValueChange = void 0;
|
|
|
41
40
|
bind:usernameInput
|
|
42
41
|
{canToggleActive}
|
|
43
42
|
{canEditAccountInfo}
|
|
44
|
-
{isCreatingNewUser}
|
|
45
43
|
{hasPermissionToChangePassword}
|
|
46
44
|
{error}
|
|
47
45
|
{success}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { ErrorFn, IconName, UserSites, SuccessFn, SiteLabel, UserAccount, Permissions, GroupMembership, CanToggleActive, DeactivateUserFn, CanEditSiteAccess,
|
|
2
|
+
import type { ErrorFn, IconName, UserSites, SuccessFn, SiteLabel, UserAccount, Permissions, GroupMembership, CanToggleActive, DeactivateUserFn, CanEditSiteAccess, SiteAccessChangeFn, PermissionValueMap, CanEditAccountInfo, ConfirmPasswordSetFn, AccountInfoChangedFn, CanEditGroupMembership, GroupMembershipChangeFn, PermissionValueChangeFn, GroupPermissionValueMap, GenerateNewActivationPINFn, SendPasswordRecoveryTokenFn, HasPermissionToChangePassword, PermissionListCardHeaderTitle } from './util';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
siteLabel?: SiteLabel;
|
|
@@ -12,7 +12,6 @@ declare const __propDef: {
|
|
|
12
12
|
usernameInput?: HTMLInputElement | undefined;
|
|
13
13
|
userAccount: UserAccount;
|
|
14
14
|
canToggleActive?: CanToggleActive;
|
|
15
|
-
isCreatingNewUser?: IsCreatingNewUser;
|
|
16
15
|
canEditAccountInfo?: CanEditAccountInfo;
|
|
17
16
|
hasPermissionToChangePassword?: HasPermissionToChangePassword;
|
|
18
17
|
error?: ErrorFn;
|
package/dist/util.d.ts
CHANGED
|
@@ -35,7 +35,6 @@ export type AccountInfoChangedFn = ComponentProps<UserAccountInfo>['accountInfoC
|
|
|
35
35
|
export type SendPasswordRecoveryTokenFn = ComponentProps<UserAccountInfo>['sendPasswordRecoveryToken'];
|
|
36
36
|
export type CanEditAccountInfo = ComponentProps<UserAccountInfo>['canEditAccountInfo'];
|
|
37
37
|
export type CanToggleActive = ComponentProps<UserAccountInfo>['canToggleActive'];
|
|
38
|
-
export type IsCreatingNewUser = ComponentProps<UserAccountInfo>['isCreatingNewUser'];
|
|
39
38
|
export type HasPermissionToChangePassword = ComponentProps<UserAccountInfo>['hasPermissionToChangePassword'];
|
|
40
39
|
export type ConfirmPasswordSetFn = ComponentProps<PasswordSetModal>['confirmPasswordSet'];
|
|
41
40
|
export type DeactivateUserFn = ComponentProps<DeactivateUserModal>['deactivateUser'];
|