@umbraco-cms/backoffice 14.0.0--preview004-13d6f91d → 14.0.0--preview004-11efe831
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.
- package/dist-cms/custom-elements.json +8 -8
- package/dist-cms/mocks/data/user/user.db.d.ts +3 -1
- package/dist-cms/mocks/data/user/user.db.js +3 -2
- package/dist-cms/mocks/handlers/user/invite.handlers.js +7 -4
- package/dist-cms/packages/core/modal/modal-element.element.d.ts +12 -0
- package/dist-cms/packages/core/modal/modal-element.element.js +16 -0
- package/dist-cms/packages/core/modal/token/index.d.ts +0 -2
- package/dist-cms/packages/core/modal/token/index.js +0 -2
- package/dist-cms/packages/core/modal/token/user-picker-modal.token.d.ts +2 -2
- package/dist-cms/packages/user/user/collection/action/manifests.d.ts +0 -1
- package/dist-cms/packages/user/user/collection/action/manifests.js +1 -19
- package/dist-cms/packages/user/user/collection/repository/user-collection.server.data-source.d.ts +2 -2
- package/dist-cms/packages/user/user/collection/repository/user-collection.server.data-source.js +1 -1
- package/dist-cms/packages/user/user/collection/user-collection-header.element.js +0 -4
- package/dist-cms/packages/user/user/collection/user-collection.context.d.ts +2 -2
- package/dist-cms/packages/user/user/conditions/manifests.js +0 -2
- package/dist-cms/packages/user/user/conditions/user-allow-action-base.condition.d.ts +2 -2
- package/dist-cms/packages/user/user/entity-actions/manifests.js +2 -21
- package/dist-cms/packages/user/user/entity.d.ts +1 -0
- package/dist-cms/packages/user/user/entity.js +1 -0
- package/dist-cms/packages/user/user/index.d.ts +1 -0
- package/dist-cms/packages/user/user/index.js +1 -0
- package/dist-cms/packages/user/user/{collection/action → invite/collection-action}/invite-user.collection-action.js +2 -1
- package/dist-cms/packages/user/user/invite/collection-action/manifests.d.ts +3 -0
- package/dist-cms/packages/user/user/invite/collection-action/manifests.js +20 -0
- package/dist-cms/packages/user/user/invite/entity-action/manifests.d.ts +2 -0
- package/dist-cms/packages/user/user/invite/entity-action/manifests.js +26 -0
- package/dist-cms/packages/user/user/{conditions/user-allow-resend-invite-action.condition.d.ts → invite/entity-action/resend-invite/resend-invite.action.condition.d.ts} +2 -2
- package/dist-cms/packages/user/user/{conditions/user-allow-resend-invite-action.condition.js → invite/entity-action/resend-invite/resend-invite.action.condition.js} +2 -2
- package/dist-cms/packages/user/user/invite/entity-action/resend-invite/resend-invite.action.d.ts +8 -0
- package/dist-cms/packages/user/user/{entity-actions/resend-invite/resend-invite-to-user.action.js → invite/entity-action/resend-invite/resend-invite.action.js} +3 -2
- package/dist-cms/packages/user/user/invite/index.d.ts +2 -0
- package/dist-cms/packages/user/user/invite/index.js +2 -0
- package/dist-cms/packages/user/user/invite/manifests.d.ts +1 -0
- package/dist-cms/packages/user/user/invite/manifests.js +10 -0
- package/dist-cms/packages/user/user/invite/modal/index.d.ts +2 -0
- package/dist-cms/packages/user/user/invite/modal/index.js +2 -0
- package/dist-cms/packages/user/user/invite/modal/invite/index.d.ts +1 -0
- package/dist-cms/packages/user/user/invite/modal/invite/index.js +1 -0
- package/dist-cms/packages/user/user/invite/modal/invite/user-invite-modal.element.d.ts +12 -0
- package/dist-cms/packages/user/user/invite/modal/invite/user-invite-modal.element.js +105 -0
- package/dist-cms/packages/{core/modal/token/invite-user-modal.token.d.ts → user/user/invite/modal/invite/user-invite-modal.token.d.ts} +1 -1
- package/dist-cms/packages/{core/modal/token/invite-user-modal.token.js → user/user/invite/modal/invite/user-invite-modal.token.js} +1 -1
- package/dist-cms/packages/user/user/invite/modal/manifests.d.ts +2 -0
- package/dist-cms/packages/user/user/invite/modal/manifests.js +15 -0
- package/dist-cms/packages/user/user/invite/modal/resend-invite/index.d.ts +1 -0
- package/dist-cms/packages/user/user/invite/modal/resend-invite/index.js +1 -0
- package/dist-cms/packages/user/user/{modals → invite/modal}/resend-invite/resend-invite-to-user-modal.element.d.ts +3 -4
- package/dist-cms/packages/user/user/{modals → invite/modal}/resend-invite/resend-invite-to-user-modal.element.js +12 -16
- package/dist-cms/packages/{core/modal/token → user/user/invite/modal/resend-invite}/resend-invite-to-user-modal.token.d.ts +1 -1
- package/dist-cms/packages/{core/modal/token → user/user/invite/modal/resend-invite}/resend-invite-to-user-modal.token.js +2 -2
- package/dist-cms/packages/user/user/invite/repository/index.d.ts +2 -0
- package/dist-cms/packages/user/user/invite/repository/index.js +2 -0
- package/dist-cms/packages/user/user/invite/repository/invite-user-server.data-source.d.ts +46 -0
- package/dist-cms/packages/user/user/{repository/invite/invite-user.server.data-source.js → invite/repository/invite-user-server.data-source.js} +15 -18
- package/dist-cms/packages/user/user/{repository/invite → invite/repository}/invite-user.repository.d.ts +4 -4
- package/dist-cms/packages/user/user/{repository/invite → invite/repository}/invite-user.repository.js +10 -9
- package/dist-cms/packages/user/user/invite/repository/manifests.d.ts +3 -0
- package/dist-cms/packages/user/user/invite/repository/manifests.js +9 -0
- package/dist-cms/packages/user/user/invite/repository/types.d.ts +7 -0
- package/dist-cms/packages/user/user/manifests.js +2 -0
- package/dist-cms/packages/user/user/modals/manifests.js +0 -12
- package/dist-cms/packages/user/user/repository/detail/user-detail.repository.d.ts +2 -2
- package/dist-cms/packages/user/user/repository/detail/user-detail.server.data-source.js +1 -1
- package/dist-cms/packages/user/user/repository/index.d.ts +0 -1
- package/dist-cms/packages/user/user/repository/index.js +0 -1
- package/dist-cms/packages/user/user/repository/manifests.d.ts +0 -1
- package/dist-cms/packages/user/user/repository/manifests.js +0 -9
- package/dist-cms/packages/user/user/repository/user.store.d.ts +2 -2
- package/dist-cms/packages/user/user/types.d.ts +2 -3
- package/dist-cms/packages/user/user/types.js +1 -1
- package/dist-cms/packages/user/user/workspace/manifests.js +1 -1
- package/dist-cms/packages/user/user/workspace/user-workspace-editor.element.js +1 -1
- package/dist-cms/packages/user/user/workspace/user-workspace.context.d.ts +6 -6
- package/dist-cms/packages/user/user/workspace/user-workspace.context.js +1 -1
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +8 -8
- package/package.json +1 -1
- package/dist-cms/packages/user/user/entity-actions/resend-invite/resend-invite-to-user.action.d.ts +0 -8
- package/dist-cms/packages/user/user/modals/invite/user-invite-modal.element.d.ts +0 -21
- package/dist-cms/packages/user/user/modals/invite/user-invite-modal.element.js +0 -175
- package/dist-cms/packages/user/user/repository/invite/invite-user.server.data-source.d.ts +0 -32
- package/dist-cms/packages/user/user/repository/invite/types.d.ts +0 -6
- /package/dist-cms/packages/user/user/{collection/action → invite/collection-action}/invite-user.collection-action.d.ts +0 -0
- /package/dist-cms/packages/user/user/{repository/invite → invite/repository}/types.js +0 -0
|
@@ -9282,8 +9282,8 @@
|
|
|
9282
9282
|
]
|
|
9283
9283
|
},
|
|
9284
9284
|
{
|
|
9285
|
-
"name": "umb-user-
|
|
9286
|
-
"path": "./../src/packages/user/user/
|
|
9285
|
+
"name": "umb-invite-user-modal",
|
|
9286
|
+
"path": "./../src/packages/user/user/invite/modal/invite/user-invite-modal.element.ts",
|
|
9287
9287
|
"properties": [
|
|
9288
9288
|
{
|
|
9289
9289
|
"name": "styles",
|
|
@@ -9293,8 +9293,8 @@
|
|
|
9293
9293
|
]
|
|
9294
9294
|
},
|
|
9295
9295
|
{
|
|
9296
|
-
"name": "umb-
|
|
9297
|
-
"path": "./../src/packages/user/user/
|
|
9296
|
+
"name": "umb-resend-invite-to-user-modal",
|
|
9297
|
+
"path": "./../src/packages/user/user/invite/modal/resend-invite/resend-invite-to-user-modal.element.ts",
|
|
9298
9298
|
"properties": [
|
|
9299
9299
|
{
|
|
9300
9300
|
"name": "styles",
|
|
@@ -9304,8 +9304,8 @@
|
|
|
9304
9304
|
]
|
|
9305
9305
|
},
|
|
9306
9306
|
{
|
|
9307
|
-
"name": "umb-user-
|
|
9308
|
-
"path": "./../src/packages/user/user/modals/
|
|
9307
|
+
"name": "umb-user-create-modal",
|
|
9308
|
+
"path": "./../src/packages/user/user/modals/create/user-create-modal.element.ts",
|
|
9309
9309
|
"properties": [
|
|
9310
9310
|
{
|
|
9311
9311
|
"name": "styles",
|
|
@@ -9315,8 +9315,8 @@
|
|
|
9315
9315
|
]
|
|
9316
9316
|
},
|
|
9317
9317
|
{
|
|
9318
|
-
"name": "umb-
|
|
9319
|
-
"path": "./../src/packages/user/user/modals/
|
|
9318
|
+
"name": "umb-user-create-success-modal",
|
|
9319
|
+
"path": "./../src/packages/user/user/modals/create/user-create-success-modal.element.ts",
|
|
9320
9320
|
"properties": [
|
|
9321
9321
|
{
|
|
9322
9322
|
"name": "styles",
|
|
@@ -51,7 +51,9 @@ declare class UmbUserData extends UmbEntityData<UserResponseModel> {
|
|
|
51
51
|
* @param {InviteUserRequestModel} data
|
|
52
52
|
* @memberof UmbUserData
|
|
53
53
|
*/
|
|
54
|
-
invite(data: InviteUserRequestModel):
|
|
54
|
+
invite(data: InviteUserRequestModel): {
|
|
55
|
+
userId: string | undefined;
|
|
56
|
+
};
|
|
55
57
|
filter(options: any): PagedUserResponseModel;
|
|
56
58
|
}
|
|
57
59
|
export declare const umbUsersData: UmbUserData;
|
|
@@ -128,10 +128,11 @@ class UmbUserData extends UmbEntityData {
|
|
|
128
128
|
*/
|
|
129
129
|
invite(data) {
|
|
130
130
|
const invitedUser = {
|
|
131
|
-
status: UserStateModel.INVITED,
|
|
132
131
|
...data,
|
|
132
|
+
state: UserStateModel.INVITED,
|
|
133
133
|
};
|
|
134
|
-
this.createUser(invitedUser);
|
|
134
|
+
const response = this.createUser(invitedUser);
|
|
135
|
+
return { userId: response.userId };
|
|
135
136
|
}
|
|
136
137
|
filter(options) {
|
|
137
138
|
const { items: allItems } = this.getAll();
|
|
@@ -2,15 +2,18 @@ const { rest } = window.MockServiceWorker;
|
|
|
2
2
|
import { umbUsersData } from '../../data/user/user.db.js';
|
|
3
3
|
import { UMB_SLUG } from './slug.js';
|
|
4
4
|
import { umbracoPath } from '../../../shared/utils/index.js';
|
|
5
|
+
const inviteSlug = `${UMB_SLUG}/invite`;
|
|
5
6
|
export const handlers = [
|
|
6
|
-
rest.post(umbracoPath(`${
|
|
7
|
+
rest.post(umbracoPath(`${inviteSlug}`), async (req, res, ctx) => {
|
|
7
8
|
const data = await req.json();
|
|
8
9
|
if (!data)
|
|
9
10
|
return;
|
|
10
|
-
umbUsersData.invite(data);
|
|
11
|
-
|
|
11
|
+
const { userId } = umbUsersData.invite(data);
|
|
12
|
+
if (!userId)
|
|
13
|
+
return res(ctx.status(400));
|
|
14
|
+
return res(ctx.status(201), ctx.set('Location', userId));
|
|
12
15
|
}),
|
|
13
|
-
rest.post(umbracoPath(`${
|
|
16
|
+
rest.post(umbracoPath(`${inviteSlug}/resend`), async (req, res, ctx) => {
|
|
14
17
|
const data = await req.json();
|
|
15
18
|
if (!data)
|
|
16
19
|
return;
|
|
@@ -7,4 +7,16 @@ export declare abstract class UmbModalBaseElement<ModalDataType extends object =
|
|
|
7
7
|
data?: ModalDataType;
|
|
8
8
|
get _value(): ModalValueType;
|
|
9
9
|
set _value(value: ModalValueType);
|
|
10
|
+
/**
|
|
11
|
+
* Submits the modal
|
|
12
|
+
* @protected
|
|
13
|
+
* @memberof UmbModalBaseElement
|
|
14
|
+
*/
|
|
15
|
+
protected _submitModal(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Rejects the modal
|
|
18
|
+
* @protected
|
|
19
|
+
* @memberof UmbModalBaseElement
|
|
20
|
+
*/
|
|
21
|
+
protected _rejectModal(): void;
|
|
10
22
|
}
|
|
@@ -13,6 +13,22 @@ export class UmbModalBaseElement extends UmbLitElement {
|
|
|
13
13
|
set _value(value) {
|
|
14
14
|
this.modalContext?.setValue(value);
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Submits the modal
|
|
18
|
+
* @protected
|
|
19
|
+
* @memberof UmbModalBaseElement
|
|
20
|
+
*/
|
|
21
|
+
_submitModal() {
|
|
22
|
+
this.modalContext?.submit(this._value);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Rejects the modal
|
|
26
|
+
* @protected
|
|
27
|
+
* @memberof UmbModalBaseElement
|
|
28
|
+
*/
|
|
29
|
+
_rejectModal() {
|
|
30
|
+
this.modalContext?.reject();
|
|
31
|
+
}
|
|
16
32
|
}
|
|
17
33
|
__decorate([
|
|
18
34
|
property({ type: Object, attribute: false })
|
|
@@ -15,7 +15,6 @@ export * from './examine-fields-settings-modal.token.js';
|
|
|
15
15
|
export * from './export-dictionary-modal.token.js';
|
|
16
16
|
export * from './icon-picker-modal.token.js';
|
|
17
17
|
export * from './import-dictionary-modal.token.js';
|
|
18
|
-
export * from './invite-user-modal.token.js';
|
|
19
18
|
export * from './language-picker-modal.token.js';
|
|
20
19
|
export * from './link-picker-modal.token.js';
|
|
21
20
|
export * from './media-tree-picker-modal.token.js';
|
|
@@ -37,4 +36,3 @@ export * from './data-type-picker-flow-modal.token.js';
|
|
|
37
36
|
export * from './data-type-picker-flow-data-type-picker-modal.token.js';
|
|
38
37
|
export * from './entity-user-permission-settings-modal.token.js';
|
|
39
38
|
export * from './permissions-modal.token.js';
|
|
40
|
-
export * from './resend-invite-to-user-modal.token.js';
|
|
@@ -15,7 +15,6 @@ export * from './examine-fields-settings-modal.token.js';
|
|
|
15
15
|
export * from './export-dictionary-modal.token.js';
|
|
16
16
|
export * from './icon-picker-modal.token.js';
|
|
17
17
|
export * from './import-dictionary-modal.token.js';
|
|
18
|
-
export * from './invite-user-modal.token.js';
|
|
19
18
|
export * from './language-picker-modal.token.js';
|
|
20
19
|
export * from './link-picker-modal.token.js';
|
|
21
20
|
export * from './media-tree-picker-modal.token.js';
|
|
@@ -37,4 +36,3 @@ export * from './data-type-picker-flow-modal.token.js';
|
|
|
37
36
|
export * from './data-type-picker-flow-data-type-picker-modal.token.js';
|
|
38
37
|
export * from './entity-user-permission-settings-modal.token.js';
|
|
39
38
|
export * from './permissions-modal.token.js';
|
|
40
|
-
export * from './resend-invite-to-user-modal.token.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UmbUserDetailModel } from '../../../user/user/index.js';
|
|
2
2
|
import { UmbModalToken, UmbPickerModalData } from '../index.js';
|
|
3
|
-
export type UmbUserPickerModalData = UmbPickerModalData<
|
|
3
|
+
export type UmbUserPickerModalData = UmbPickerModalData<UmbUserDetailModel>;
|
|
4
4
|
export interface UmbUserPickerModalValue {
|
|
5
5
|
selection: Array<string | null>;
|
|
6
6
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { ManifestTypes } from '../../../../core/extension-registry/index.js';
|
|
2
2
|
export declare const createManifest: ManifestTypes;
|
|
3
|
-
export declare const inviteManifest: ManifestTypes;
|
|
4
3
|
export declare const manifests: import("../../../../core/extension-registry/index.js").ManifestCollectionAction[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UmbCreateUserCollectionAction } from './create-user.collection-action.js';
|
|
2
|
-
import { UmbInviteUserCollectionAction } from './invite-user.collection-action.js';
|
|
3
2
|
import { UMB_COLLECTION_ALIAS_CONDITION } from '../../../../core/collection/index.js';
|
|
4
3
|
export const createManifest = {
|
|
5
4
|
type: 'collectionAction',
|
|
@@ -18,21 +17,4 @@ export const createManifest = {
|
|
|
18
17
|
},
|
|
19
18
|
],
|
|
20
19
|
};
|
|
21
|
-
export const
|
|
22
|
-
type: 'collectionAction',
|
|
23
|
-
kind: 'button',
|
|
24
|
-
name: 'Invite User Collection Action',
|
|
25
|
-
alias: 'Umb.CollectionAction.User.Invite',
|
|
26
|
-
api: UmbInviteUserCollectionAction,
|
|
27
|
-
weight: 100,
|
|
28
|
-
meta: {
|
|
29
|
-
label: 'Invite',
|
|
30
|
-
},
|
|
31
|
-
conditions: [
|
|
32
|
-
{
|
|
33
|
-
alias: UMB_COLLECTION_ALIAS_CONDITION,
|
|
34
|
-
match: 'Umb.Collection.User',
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
};
|
|
38
|
-
export const manifests = [createManifest, inviteManifest];
|
|
20
|
+
export const manifests = [createManifest];
|
package/dist-cms/packages/user/user/collection/repository/user-collection.server.data-source.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type UmbUserCollectionFilterModel, type
|
|
1
|
+
import { type UmbUserCollectionFilterModel, type UmbUserDetailModel } from '../../types.js';
|
|
2
2
|
import { UmbCollectionDataSource } from '../../../../core/repository/index.js';
|
|
3
3
|
import type { UmbControllerHost } from '../../../../../libs/controller-api/index.js';
|
|
4
4
|
/**
|
|
@@ -7,7 +7,7 @@ import type { UmbControllerHost } from '../../../../../libs/controller-api/index
|
|
|
7
7
|
* @class UmbUserCollectionServerDataSource
|
|
8
8
|
* @implements {UmbCollectionDataSource}
|
|
9
9
|
*/
|
|
10
|
-
export declare class UmbUserCollectionServerDataSource implements UmbCollectionDataSource<
|
|
10
|
+
export declare class UmbUserCollectionServerDataSource implements UmbCollectionDataSource<UmbUserDetailModel> {
|
|
11
11
|
#private;
|
|
12
12
|
/**
|
|
13
13
|
* Creates an instance of UmbUserCollectionServerDataSource.
|
package/dist-cms/packages/user/user/collection/repository/user-collection.server.data-source.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UMB_USER_ENTITY_TYPE } from '../../
|
|
1
|
+
import { UMB_USER_ENTITY_TYPE } from '../../entity.js';
|
|
2
2
|
import { extendDataSourcePagedResponseData } from '../../../../core/repository/index.js';
|
|
3
3
|
import { UserResource } from '../../../../../external/backend-api/index.js';
|
|
4
4
|
import { tryExecuteAndNotify } from '../../../../../shared/resources/index.js';
|
|
@@ -7,7 +7,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { css, html, customElement, state, repeat, ifDefined } from '../../../../external/lit/index.js';
|
|
8
8
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
9
9
|
import { UMB_COLLECTION_CONTEXT } from '../../../core/collection/index.js';
|
|
10
|
-
import { UMB_INVITE_USER_MODAL, } from '../../../core/modal/index.js';
|
|
11
10
|
import { UserOrderModel, UserStateModel } from '../../../../external/backend-api/index.js';
|
|
12
11
|
import { UmbUserGroupCollectionRepository } from '../../user-group/index.js';
|
|
13
12
|
export let UmbUserCollectionHeaderElement = class UmbUserCollectionHeaderElement extends UmbLitElement {
|
|
@@ -44,9 +43,6 @@ export let UmbUserCollectionHeaderElement = class UmbUserCollectionHeaderElement
|
|
|
44
43
|
clearTimeout(this.#inputTimer);
|
|
45
44
|
this.#inputTimer = setTimeout(() => this.#collectionContext?.setFilter({ filter }), this.#inputTimerAmount);
|
|
46
45
|
}
|
|
47
|
-
#onInviteUserClick() {
|
|
48
|
-
this.#modalContext?.open(UMB_INVITE_USER_MODAL);
|
|
49
|
-
}
|
|
50
46
|
#onStateFilterChange(event) {
|
|
51
47
|
event.stopPropagation();
|
|
52
48
|
const target = event.currentTarget;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { UmbUserCollectionFilterModel,
|
|
1
|
+
import { UmbUserCollectionFilterModel, UmbUserDetailModel } from '../types.js';
|
|
2
2
|
import { UmbDefaultCollectionContext } from '../../../core/collection/index.js';
|
|
3
3
|
import { UserOrderModel, UserStateModel } from '../../../../external/backend-api/index.js';
|
|
4
4
|
import { UmbControllerHostElement } from '../../../../libs/controller-api/index.js';
|
|
5
|
-
export declare class UmbUserCollectionContext extends UmbDefaultCollectionContext<
|
|
5
|
+
export declare class UmbUserCollectionContext extends UmbDefaultCollectionContext<UmbUserDetailModel, UmbUserCollectionFilterModel> {
|
|
6
6
|
constructor(host: UmbControllerHostElement);
|
|
7
7
|
/**
|
|
8
8
|
* Sets the state filter for the collection and refreshes the collection.
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { manifest as userAllowDisableActionManifest } from './user-allow-disable-action.condition.js';
|
|
2
2
|
import { manifest as userAllowEnableActionManifest } from './user-allow-enable-action.condition.js';
|
|
3
3
|
import { manifest as userAllowUnlockActionManifest } from './user-allow-unlock-action.condition.js';
|
|
4
|
-
import { manifest as userAllowResendInviteActionManifest } from './user-allow-resend-invite-action.condition.js';
|
|
5
4
|
import { manifest as userAllowDeleteActionManifest } from './user-allow-delete-action.condition.js';
|
|
6
5
|
export const manifests = [
|
|
7
6
|
userAllowDisableActionManifest,
|
|
8
7
|
userAllowEnableActionManifest,
|
|
9
8
|
userAllowUnlockActionManifest,
|
|
10
|
-
userAllowResendInviteActionManifest,
|
|
11
9
|
userAllowDeleteActionManifest,
|
|
12
10
|
];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UmbUserDetailModel } from '../types.js';
|
|
2
2
|
import { UmbBaseController } from '../../../../libs/class-api/index.js';
|
|
3
3
|
import { UmbConditionConfigBase, UmbConditionControllerArguments, UmbExtensionCondition } from '../../../../libs/extension-api/index.js';
|
|
4
4
|
export declare class UmbUserActionConditionBase extends UmbBaseController implements UmbExtensionCondition {
|
|
5
5
|
#private;
|
|
6
6
|
config: UmbConditionConfigBase;
|
|
7
7
|
permitted: boolean;
|
|
8
|
-
protected userData?:
|
|
8
|
+
protected userData?: UmbUserDetailModel;
|
|
9
9
|
constructor(args: UmbConditionControllerArguments<UmbConditionConfigBase>);
|
|
10
10
|
/**
|
|
11
11
|
* Check if the current user is the same as the user being edited
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { UMB_CHANGE_USER_PASSWORD_REPOSITORY_ALIAS, UMB_DISABLE_USER_REPOSITORY_ALIAS, UMB_ENABLE_USER_REPOSITORY_ALIAS,
|
|
2
|
-
import { UMB_USER_ENTITY_TYPE } from '../
|
|
1
|
+
import { UMB_CHANGE_USER_PASSWORD_REPOSITORY_ALIAS, UMB_DISABLE_USER_REPOSITORY_ALIAS, UMB_ENABLE_USER_REPOSITORY_ALIAS, UMB_UNLOCK_USER_REPOSITORY_ALIAS, UMB_USER_REPOSITORY_ALIAS, } from '../repository/manifests.js';
|
|
2
|
+
import { UMB_USER_ENTITY_TYPE } from '../entity.js';
|
|
3
3
|
import { UmbDisableUserEntityAction } from './disable/disable-user.action.js';
|
|
4
4
|
import { UmbEnableUserEntityAction } from './enable/enable-user.action.js';
|
|
5
5
|
import { UmbChangeUserPasswordEntityAction } from './change-password/change-user-password.action.js';
|
|
6
6
|
import { UmbUnlockUserEntityAction } from './unlock/unlock-user.action.js';
|
|
7
|
-
import { UmbResendInviteToUserEntityAction } from './resend-invite/resend-invite-to-user.action.js';
|
|
8
7
|
import { UmbDeleteEntityAction } from '../../../core/entity-action/index.js';
|
|
9
8
|
const entityActions = [
|
|
10
9
|
{
|
|
@@ -92,23 +91,5 @@ const entityActions = [
|
|
|
92
91
|
},
|
|
93
92
|
],
|
|
94
93
|
},
|
|
95
|
-
{
|
|
96
|
-
type: 'entityAction',
|
|
97
|
-
alias: 'Umb.EntityAction.User.ResendInvite',
|
|
98
|
-
name: 'Resend Invite User Entity Action',
|
|
99
|
-
weight: 500,
|
|
100
|
-
api: UmbResendInviteToUserEntityAction,
|
|
101
|
-
meta: {
|
|
102
|
-
icon: 'icon-message',
|
|
103
|
-
label: 'Resend Invite',
|
|
104
|
-
repositoryAlias: UMB_INVITE_USER_REPOSITORY_ALIAS,
|
|
105
|
-
entityTypes: [UMB_USER_ENTITY_TYPE],
|
|
106
|
-
},
|
|
107
|
-
conditions: [
|
|
108
|
-
{
|
|
109
|
-
alias: 'Umb.Condition.User.AllowResendInviteAction',
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
94
|
];
|
|
114
95
|
export const manifests = [...entityActions];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const UMB_USER_ENTITY_TYPE = "user";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const UMB_USER_ENTITY_TYPE = 'user';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { UMB_INVITE_USER_MODAL } from '../modal/index.js';
|
|
1
2
|
import { UmbCollectionActionBase } from '../../../../core/collection/index.js';
|
|
2
|
-
import {
|
|
3
|
+
import { UMB_MODAL_MANAGER_CONTEXT_TOKEN } from '../../../../core/modal/index.js';
|
|
3
4
|
export class UmbInviteUserCollectionAction extends UmbCollectionActionBase {
|
|
4
5
|
#modalManagerContext;
|
|
5
6
|
constructor(host) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UmbInviteUserCollectionAction } from './invite-user.collection-action.js';
|
|
2
|
+
import { UMB_COLLECTION_ALIAS_CONDITION } from '../../../../core/collection/index.js';
|
|
3
|
+
export const inviteManifest = {
|
|
4
|
+
type: 'collectionAction',
|
|
5
|
+
kind: 'button',
|
|
6
|
+
name: 'Invite User Collection Action',
|
|
7
|
+
alias: 'Umb.CollectionAction.User.Invite',
|
|
8
|
+
api: UmbInviteUserCollectionAction,
|
|
9
|
+
weight: 100,
|
|
10
|
+
meta: {
|
|
11
|
+
label: 'Invite',
|
|
12
|
+
},
|
|
13
|
+
conditions: [
|
|
14
|
+
{
|
|
15
|
+
alias: UMB_COLLECTION_ALIAS_CONDITION,
|
|
16
|
+
match: 'Umb.Collection.User',
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
export const manifests = [inviteManifest];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UMB_INVITE_USER_REPOSITORY_ALIAS } from '../repository/manifests.js';
|
|
2
|
+
import { UMB_USER_ENTITY_TYPE } from '../../entity.js';
|
|
3
|
+
import { UmbResendInviteToUserEntityAction } from './resend-invite/resend-invite.action.js';
|
|
4
|
+
import { manifest as conditionManifest } from './resend-invite/resend-invite.action.condition.js';
|
|
5
|
+
const entityActions = [
|
|
6
|
+
{
|
|
7
|
+
type: 'entityAction',
|
|
8
|
+
alias: 'Umb.EntityAction.User.ResendInvite',
|
|
9
|
+
name: 'Resend Invite User Entity Action',
|
|
10
|
+
weight: 500,
|
|
11
|
+
api: UmbResendInviteToUserEntityAction,
|
|
12
|
+
meta: {
|
|
13
|
+
icon: 'icon-message',
|
|
14
|
+
label: 'Resend Invite',
|
|
15
|
+
repositoryAlias: UMB_INVITE_USER_REPOSITORY_ALIAS,
|
|
16
|
+
entityTypes: [UMB_USER_ENTITY_TYPE],
|
|
17
|
+
},
|
|
18
|
+
conditions: [
|
|
19
|
+
{
|
|
20
|
+
alias: 'Umb.Condition.User.AllowResendInviteAction',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
conditionManifest,
|
|
25
|
+
];
|
|
26
|
+
export const manifests = [...entityActions];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UmbUserActionConditionBase } from '
|
|
2
|
-
import { ManifestCondition, UmbConditionConfigBase, UmbConditionControllerArguments } from '
|
|
1
|
+
import { UmbUserActionConditionBase } from '../../../conditions/user-allow-action-base.condition.js';
|
|
2
|
+
import { ManifestCondition, UmbConditionConfigBase, UmbConditionControllerArguments } from '../../../../../../libs/extension-api/index.js';
|
|
3
3
|
export declare class UmbUserAllowResendInviteActionCondition extends UmbUserActionConditionBase {
|
|
4
4
|
constructor(args: UmbConditionControllerArguments<UmbConditionConfigBase>);
|
|
5
5
|
onUserDataChange(): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UmbUserActionConditionBase } from '
|
|
2
|
-
import { UserStateModel } from '
|
|
1
|
+
import { UmbUserActionConditionBase } from '../../../conditions/user-allow-action-base.condition.js';
|
|
2
|
+
import { UserStateModel } from '../../../../../../external/backend-api/index.js';
|
|
3
3
|
export class UmbUserAllowResendInviteActionCondition extends UmbUserActionConditionBase {
|
|
4
4
|
constructor(args) {
|
|
5
5
|
super(args);
|
package/dist-cms/packages/user/user/invite/entity-action/resend-invite/resend-invite.action.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type UmbEnableUserRepository } from '../../../repository/enable/enable-user.repository.js';
|
|
2
|
+
import { UmbEntityActionBase } from '../../../../../core/entity-action/index.js';
|
|
3
|
+
import { UmbControllerHostElement } from '../../../../../../libs/controller-api/index.js';
|
|
4
|
+
export declare class UmbResendInviteToUserEntityAction extends UmbEntityActionBase<UmbEnableUserRepository> {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
|
|
7
|
+
execute(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { UMB_RESEND_INVITE_TO_USER_MODAL } from '../../index.js';
|
|
2
|
+
import { UmbEntityActionBase } from '../../../../../core/entity-action/index.js';
|
|
3
|
+
import { UMB_MODAL_MANAGER_CONTEXT_TOKEN } from '../../../../../core/modal/index.js';
|
|
3
4
|
export class UmbResendInviteToUserEntityAction extends UmbEntityActionBase {
|
|
4
5
|
#modalManager;
|
|
5
6
|
constructor(host, repositoryAlias, unique) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const manifests: import("../../../core/index.js").ManifestTypes[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { manifests as collectionActionManifests } from './collection-action/manifests.js';
|
|
2
|
+
import { manifests as modalManifests } from './modal/manifests.js';
|
|
3
|
+
import { manifests as repositoryManifests } from './repository/manifests.js';
|
|
4
|
+
import { manifests as entityActionManifests } from './entity-action/manifests.js';
|
|
5
|
+
export const manifests = [
|
|
6
|
+
...collectionActionManifests,
|
|
7
|
+
...modalManifests,
|
|
8
|
+
...repositoryManifests,
|
|
9
|
+
...entityActionManifests,
|
|
10
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UMB_INVITE_USER_MODAL } from './user-invite-modal.token.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UMB_INVITE_USER_MODAL } from './user-invite-modal.token.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UmbModalBaseElement } from '../../../../../core/modal/index.js';
|
|
2
|
+
export declare class UmbInviteUserModalElement extends UmbModalBaseElement {
|
|
3
|
+
#private;
|
|
4
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
5
|
+
static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
|
|
6
|
+
}
|
|
7
|
+
export default UmbInviteUserModalElement;
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
'umb-invite-user-modal': UmbInviteUserModalElement;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { UmbInviteUserRepository } from '../../repository/invite-user.repository.js';
|
|
8
|
+
import { css, html, customElement } from '../../../../../../external/lit/index.js';
|
|
9
|
+
import { UmbTextStyles } from '../../../../../../shared/style/index.js';
|
|
10
|
+
import { UmbModalBaseElement } from '../../../../../core/modal/index.js';
|
|
11
|
+
export let UmbInviteUserModalElement = class UmbInviteUserModalElement extends UmbModalBaseElement {
|
|
12
|
+
#inviteUserRepository = new UmbInviteUserRepository(this);
|
|
13
|
+
async #onSubmit(e) {
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
const form = e.target;
|
|
16
|
+
if (!form)
|
|
17
|
+
return;
|
|
18
|
+
const isValid = form.checkValidity();
|
|
19
|
+
if (!isValid)
|
|
20
|
+
return;
|
|
21
|
+
const formData = new FormData(form);
|
|
22
|
+
const name = formData.get('name');
|
|
23
|
+
const email = formData.get('email');
|
|
24
|
+
//TODO: How should we handle pickers forms?
|
|
25
|
+
const userGroupPicker = form.querySelector('#userGroups');
|
|
26
|
+
const userGroupIds = userGroupPicker?.selectedIds;
|
|
27
|
+
const message = formData.get('message');
|
|
28
|
+
// TODO: figure out when to use email or username
|
|
29
|
+
// TODO: invite request gives 500 error.
|
|
30
|
+
const { error } = await this.#inviteUserRepository.invite({
|
|
31
|
+
name,
|
|
32
|
+
email,
|
|
33
|
+
userName: email,
|
|
34
|
+
message,
|
|
35
|
+
userGroupIds,
|
|
36
|
+
});
|
|
37
|
+
if (!error) {
|
|
38
|
+
this._submitModal();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
return html `<uui-dialog-layout headline="Invite User">
|
|
43
|
+
${this.#renderForm()}
|
|
44
|
+
<uui-button @click=${this._rejectModal} slot="actions" label="Cancel" look="secondary"></uui-button>
|
|
45
|
+
<uui-button
|
|
46
|
+
form="InviteUserForm"
|
|
47
|
+
slot="actions"
|
|
48
|
+
type="submit"
|
|
49
|
+
label="Send invite"
|
|
50
|
+
look="primary"
|
|
51
|
+
color="positive"></uui-button
|
|
52
|
+
></uui-dialog-layout>`;
|
|
53
|
+
}
|
|
54
|
+
#renderForm() {
|
|
55
|
+
return html ` <p style="margin-top: 0">
|
|
56
|
+
Invite new users to give them access to Umbraco. An invite email will be sent to the user with information on
|
|
57
|
+
how to log in to Umbraco. Invites last for 72 hours.
|
|
58
|
+
</p>
|
|
59
|
+
<uui-form>
|
|
60
|
+
<form id="InviteUserForm" name="form" @submit="${this.#onSubmit}">
|
|
61
|
+
<uui-form-layout-item>
|
|
62
|
+
<uui-label id="nameLabel" slot="label" for="name" required>Name</uui-label>
|
|
63
|
+
<uui-input id="name" label="name" type="text" name="name" required></uui-input>
|
|
64
|
+
</uui-form-layout-item>
|
|
65
|
+
<uui-form-layout-item>
|
|
66
|
+
<uui-label id="emailLabel" slot="label" for="email" required>Email</uui-label>
|
|
67
|
+
<uui-input id="email" label="email" type="email" name="email" required></uui-input>
|
|
68
|
+
</uui-form-layout-item>
|
|
69
|
+
<uui-form-layout-item>
|
|
70
|
+
<uui-label id="userGroupsLabel" slot="label" for="userGroups" required>User group</uui-label>
|
|
71
|
+
<span slot="description">Add groups to assign access and permissions</span>
|
|
72
|
+
<umb-user-group-input id="userGroups" name="userGroups"></umb-user-group-input>
|
|
73
|
+
</uui-form-layout-item>
|
|
74
|
+
<uui-form-layout-item>
|
|
75
|
+
<uui-label id="messageLabel" slot="label" for="message" required>Message</uui-label>
|
|
76
|
+
<uui-textarea id="message" label="message" name="message" required></uui-textarea>
|
|
77
|
+
</uui-form-layout-item>
|
|
78
|
+
</form>
|
|
79
|
+
</uui-form>`;
|
|
80
|
+
}
|
|
81
|
+
static { this.styles = [
|
|
82
|
+
UmbTextStyles,
|
|
83
|
+
css `
|
|
84
|
+
:host {
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
height: 100%;
|
|
89
|
+
width: 100%;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
uui-input {
|
|
93
|
+
width: 100%;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
uui-textarea {
|
|
97
|
+
--uui-textarea-min-height: 100px;
|
|
98
|
+
}
|
|
99
|
+
`,
|
|
100
|
+
]; }
|
|
101
|
+
};
|
|
102
|
+
UmbInviteUserModalElement = __decorate([
|
|
103
|
+
customElement('umb-invite-user-modal')
|
|
104
|
+
], UmbInviteUserModalElement);
|
|
105
|
+
export default UmbInviteUserModalElement;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UmbModalToken } from '
|
|
1
|
+
import { UmbModalToken } from '../../../../../core/modal/index.js';
|
|
2
2
|
export declare const UMB_INVITE_USER_MODAL: UmbModalToken<object, unknown>;
|