@umbraco-cms/backoffice 14.0.0--preview004-b8e22352 → 14.0.0--preview004-9e9461f6
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/apps/app/app.element.js +1 -1
- package/dist-cms/custom-elements.json +0 -14
- package/dist-cms/packages/core/data-type/tree/folder/data-type-folder.repository.js +1 -2
- package/dist-cms/packages/documents/document-types/entity-actions/create/create.action.js +1 -1
- package/dist-cms/packages/documents/document-types/entity-actions/create/modal/document-type-create-options-modal.element.d.ts +3 -6
- package/dist-cms/packages/documents/document-types/entity-actions/create/modal/document-type-create-options-modal.element.js +31 -36
- package/dist-cms/packages/documents/document-types/entity-actions/create/modal/index.d.ts +1 -1
- package/dist-cms/packages/documents/document-types/tree/folder/document-type-folder.repository.d.ts +6 -0
- package/dist-cms/packages/documents/document-types/tree/folder/document-type-folder.repository.js +21 -0
- package/dist-cms/packages/documents/document-types/tree/folder/document-type-folder.server.data-source.d.ts +75 -0
- package/dist-cms/packages/documents/document-types/tree/folder/document-type-folder.server.data-source.js +111 -0
- package/dist-cms/packages/documents/document-types/tree/folder/index.d.ts +2 -0
- package/dist-cms/packages/documents/document-types/tree/folder/index.js +2 -0
- package/dist-cms/packages/documents/document-types/tree/folder/manifests.d.ts +3 -0
- package/dist-cms/packages/documents/document-types/tree/folder/manifests.js +39 -0
- package/dist-cms/packages/documents/document-types/tree/folder/types.d.ts +5 -0
- package/dist-cms/packages/documents/document-types/tree/folder/types.js +1 -0
- package/dist-cms/packages/documents/document-types/tree/index.d.ts +2 -0
- package/dist-cms/packages/documents/document-types/tree/index.js +2 -0
- package/dist-cms/packages/documents/document-types/tree/manifests.d.ts +1 -1
- package/dist-cms/packages/documents/document-types/tree/manifests.js +8 -3
- package/dist-cms/packages/user/current-user/modals/current-user/current-user-modal.element.js +1 -4
- package/dist-cms/shared/auth/auth-flow.d.ts +4 -0
- package/dist-cms/shared/auth/auth-flow.js +35 -19
- package/dist-cms/shared/auth/auth.context.d.ts +5 -0
- package/dist-cms/shared/auth/auth.context.interface.d.ts +4 -0
- package/dist-cms/shared/auth/auth.context.js +7 -0
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +2 -8
- package/package.json +1 -1
|
@@ -101,7 +101,7 @@ _UmbAppElement_setup = async function _UmbAppElement_setup() {
|
|
|
101
101
|
// If the runtime level is "install" we should clear any cached tokens
|
|
102
102
|
// else we should try and set the auth status
|
|
103
103
|
if (__classPrivateFieldGet(this, _UmbAppElement_serverConnection, "f").getStatus() === RuntimeLevelModel.INSTALL) {
|
|
104
|
-
await __classPrivateFieldGet(this, _UmbAppElement_authContext, "f").
|
|
104
|
+
await __classPrivateFieldGet(this, _UmbAppElement_authContext, "f").clearTokenStorage();
|
|
105
105
|
}
|
|
106
106
|
else {
|
|
107
107
|
await __classPrivateFieldGet(this, _UmbAppElement_instances, "m", _UmbAppElement_setAuthStatus).call(this);
|
|
@@ -6194,21 +6194,7 @@
|
|
|
6194
6194
|
{
|
|
6195
6195
|
"name": "umb-document-type-create-options-modal",
|
|
6196
6196
|
"path": "./../src/packages/documents/document-types/entity-actions/create/modal/document-type-create-options-modal.element.ts",
|
|
6197
|
-
"attributes": [
|
|
6198
|
-
{
|
|
6199
|
-
"name": "data",
|
|
6200
|
-
"type": "UmbDocumentTypeCreateOptionsModalData | undefined"
|
|
6201
|
-
}
|
|
6202
|
-
],
|
|
6203
6197
|
"properties": [
|
|
6204
|
-
{
|
|
6205
|
-
"name": "modalContext"
|
|
6206
|
-
},
|
|
6207
|
-
{
|
|
6208
|
-
"name": "data",
|
|
6209
|
-
"attribute": "data",
|
|
6210
|
-
"type": "UmbDocumentTypeCreateOptionsModalData | undefined"
|
|
6211
|
-
},
|
|
6212
6198
|
{
|
|
6213
6199
|
"name": "styles",
|
|
6214
6200
|
"type": "array",
|
|
@@ -8,7 +8,7 @@ export class UmbDataTypeFolderRepository extends UmbFolderRepositoryBase {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
const folderToDataTypeTreeItemMapper = (folder) => {
|
|
11
|
-
|
|
11
|
+
return {
|
|
12
12
|
unique: folder.unique,
|
|
13
13
|
parentUnique: folder.parentUnique,
|
|
14
14
|
name: folder.name,
|
|
@@ -17,5 +17,4 @@ const folderToDataTypeTreeItemMapper = (folder) => {
|
|
|
17
17
|
hasChildren: false,
|
|
18
18
|
isFolder: true,
|
|
19
19
|
};
|
|
20
|
-
return folderTreeItem;
|
|
21
20
|
};
|
|
@@ -28,7 +28,7 @@ export class UmbCreateDataTypeEntityAction extends UmbEntityActionBase {
|
|
|
28
28
|
throw new Error('Repository is not available');
|
|
29
29
|
__classPrivateFieldGet(this, _UmbCreateDataTypeEntityAction_modalManagerContext, "f")?.open(UMB_DOCUMENT_TYPE_CREATE_OPTIONS_MODAL, {
|
|
30
30
|
data: {
|
|
31
|
-
|
|
31
|
+
parentUnique: this.unique,
|
|
32
32
|
},
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { UmbDocumentTypeCreateOptionsModalData } from './index.js';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare class UmbDataTypeCreateOptionsModalElement extends UmbLitElement {
|
|
2
|
+
import { UmbModalBaseElement } from '../../../../../core/modal/index.js';
|
|
3
|
+
export declare class UmbDataTypeCreateOptionsModalElement extends UmbModalBaseElement<UmbDocumentTypeCreateOptionsModalData> {
|
|
5
4
|
#private;
|
|
6
|
-
|
|
7
|
-
data?: UmbDocumentTypeCreateOptionsModalData;
|
|
8
|
-
constructor();
|
|
5
|
+
connectedCallback(): void;
|
|
9
6
|
render(): import("lit-html").TemplateResult<1>;
|
|
10
7
|
static styles: import("../../../../../../external/lit/index.js").CSSResult[];
|
|
11
8
|
}
|
|
@@ -15,21 +15,27 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
16
16
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
17
17
|
};
|
|
18
|
-
var _UmbDataTypeCreateOptionsModalElement_instances,
|
|
19
|
-
import {
|
|
20
|
-
import { html, customElement
|
|
18
|
+
var _UmbDataTypeCreateOptionsModalElement_instances, _UmbDataTypeCreateOptionsModalElement_createFolderAction, _UmbDataTypeCreateOptionsModalElement_onCreateFolderClick, _UmbDataTypeCreateOptionsModalElement_onNavigate;
|
|
19
|
+
import { UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS } from '../../../tree/index.js';
|
|
20
|
+
import { html, customElement } from '../../../../../../external/lit/index.js';
|
|
21
21
|
import { UmbTextStyles } from '../../../../../../shared/style/index.js';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
let UmbDataTypeCreateOptionsModalElement = class UmbDataTypeCreateOptionsModalElement extends UmbLitElement {
|
|
22
|
+
import { UmbModalBaseElement } from '../../../../../core/modal/index.js';
|
|
23
|
+
import { UmbCreateFolderEntityAction } from '../../../../../core/tree/index.js';
|
|
24
|
+
let UmbDataTypeCreateOptionsModalElement = class UmbDataTypeCreateOptionsModalElement extends UmbModalBaseElement {
|
|
26
25
|
constructor() {
|
|
27
|
-
super();
|
|
26
|
+
super(...arguments);
|
|
28
27
|
_UmbDataTypeCreateOptionsModalElement_instances.add(this);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
_UmbDataTypeCreateOptionsModalElement_createFolderAction.set(this, void 0);
|
|
29
|
+
}
|
|
30
|
+
connectedCallback() {
|
|
31
|
+
super.connectedCallback();
|
|
32
|
+
if (this.data?.parentUnique === undefined)
|
|
33
|
+
throw new Error('A parent unique is required to create a folder');
|
|
34
|
+
__classPrivateFieldSet(this, _UmbDataTypeCreateOptionsModalElement_createFolderAction, new UmbCreateFolderEntityAction(this, UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS,
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
// TODO: allow null for entity actions. Some actions can be executed on the root item
|
|
38
|
+
this.data.parentUnique), "f");
|
|
33
39
|
}
|
|
34
40
|
render() {
|
|
35
41
|
return html `
|
|
@@ -37,47 +43,36 @@ let UmbDataTypeCreateOptionsModalElement = class UmbDataTypeCreateOptionsModalEl
|
|
|
37
43
|
<uui-box>
|
|
38
44
|
<!-- TODO: construct url -->
|
|
39
45
|
<uui-menu-item
|
|
40
|
-
href=${`section/settings/workspace/document-type/create/${this.data?.
|
|
46
|
+
href=${`section/settings/workspace/document-type/create/${this.data?.parentUnique || 'null'}`}
|
|
41
47
|
label="New Document Type..."
|
|
42
48
|
@click=${__classPrivateFieldGet(this, _UmbDataTypeCreateOptionsModalElement_instances, "m", _UmbDataTypeCreateOptionsModalElement_onNavigate)}>
|
|
43
49
|
<uui-icon slot="icon" name="icon-autofill"></uui-icon>}
|
|
44
50
|
</uui-menu-item>
|
|
45
|
-
<uui-menu-item @click=${__classPrivateFieldGet(this, _UmbDataTypeCreateOptionsModalElement_instances, "m",
|
|
51
|
+
<uui-menu-item @click=${__classPrivateFieldGet(this, _UmbDataTypeCreateOptionsModalElement_instances, "m", _UmbDataTypeCreateOptionsModalElement_onCreateFolderClick)} label="New Folder...">
|
|
46
52
|
<uui-icon slot="icon" name="icon-folder"></uui-icon>}
|
|
47
53
|
</uui-menu-item>
|
|
48
54
|
</uui-box>
|
|
49
|
-
<uui-button slot="actions" id="cancel" label="Cancel" @click="${
|
|
55
|
+
<uui-button slot="actions" id="cancel" label="Cancel" @click="${this._rejectModal}">Cancel</uui-button>
|
|
50
56
|
</umb-body-layout>
|
|
51
57
|
`;
|
|
52
58
|
}
|
|
53
59
|
};
|
|
54
|
-
|
|
60
|
+
_UmbDataTypeCreateOptionsModalElement_createFolderAction = new WeakMap();
|
|
55
61
|
_UmbDataTypeCreateOptionsModalElement_instances = new WeakSet();
|
|
56
|
-
|
|
62
|
+
_UmbDataTypeCreateOptionsModalElement_onCreateFolderClick = async function _UmbDataTypeCreateOptionsModalElement_onCreateFolderClick(event) {
|
|
57
63
|
event.stopPropagation();
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
});
|
|
66
|
-
folderModalHandler?.onSubmit().then(() => this.modalContext?.submit());
|
|
64
|
+
try {
|
|
65
|
+
await __classPrivateFieldGet(this, _UmbDataTypeCreateOptionsModalElement_createFolderAction, "f")?.execute();
|
|
66
|
+
this._submitModal();
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
console.error(error);
|
|
70
|
+
}
|
|
67
71
|
};
|
|
68
72
|
_UmbDataTypeCreateOptionsModalElement_onNavigate = function _UmbDataTypeCreateOptionsModalElement_onNavigate() {
|
|
69
|
-
this.
|
|
70
|
-
};
|
|
71
|
-
_UmbDataTypeCreateOptionsModalElement_onCancel = function _UmbDataTypeCreateOptionsModalElement_onCancel() {
|
|
72
|
-
this.modalContext?.reject();
|
|
73
|
+
this._rejectModal();
|
|
73
74
|
};
|
|
74
75
|
UmbDataTypeCreateOptionsModalElement.styles = [UmbTextStyles];
|
|
75
|
-
__decorate([
|
|
76
|
-
property({ attribute: false })
|
|
77
|
-
], UmbDataTypeCreateOptionsModalElement.prototype, "modalContext", void 0);
|
|
78
|
-
__decorate([
|
|
79
|
-
property({ type: Object })
|
|
80
|
-
], UmbDataTypeCreateOptionsModalElement.prototype, "data", void 0);
|
|
81
76
|
UmbDataTypeCreateOptionsModalElement = __decorate([
|
|
82
77
|
customElement('umb-document-type-create-options-modal')
|
|
83
78
|
], UmbDataTypeCreateOptionsModalElement);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UmbModalToken } from '../../../../../core/modal/index.js';
|
|
2
2
|
export interface UmbDocumentTypeCreateOptionsModalData {
|
|
3
|
-
|
|
3
|
+
parentUnique: string | null;
|
|
4
4
|
}
|
|
5
5
|
export declare const UMB_DOCUMENT_TYPE_CREATE_OPTIONS_MODAL: UmbModalToken<UmbDocumentTypeCreateOptionsModalData, unknown>;
|
package/dist-cms/packages/documents/document-types/tree/folder/document-type-folder.repository.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UmbDocumentTypeFolderTreeItemModel } from './types.js';
|
|
2
|
+
import { type UmbControllerHost } from '../../../../../libs/controller-api/index.js';
|
|
3
|
+
import { UmbFolderRepositoryBase } from '../../../../core/tree/index.js';
|
|
4
|
+
export declare class UmbDocumentTypeFolderRepository extends UmbFolderRepositoryBase<UmbDocumentTypeFolderTreeItemModel> {
|
|
5
|
+
constructor(host: UmbControllerHost);
|
|
6
|
+
}
|
package/dist-cms/packages/documents/document-types/tree/folder/document-type-folder.repository.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../../entity.js';
|
|
2
|
+
import { UMB_DOCUMENT_TYPE_TREE_STORE_CONTEXT } from '../../tree/index.js';
|
|
3
|
+
import { UmbDocumentTypeFolderServerDataSource } from './document-type-folder.server.data-source.js';
|
|
4
|
+
import { UmbFolderRepositoryBase } from '../../../../core/tree/index.js';
|
|
5
|
+
export class UmbDocumentTypeFolderRepository extends UmbFolderRepositoryBase {
|
|
6
|
+
constructor(host) {
|
|
7
|
+
super(host, UmbDocumentTypeFolderServerDataSource, UMB_DOCUMENT_TYPE_TREE_STORE_CONTEXT, folderToDocumentTypeTreeItemMapper);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const folderToDocumentTypeTreeItemMapper = (folder) => {
|
|
11
|
+
return {
|
|
12
|
+
unique: folder.unique,
|
|
13
|
+
parentUnique: folder.parentUnique,
|
|
14
|
+
name: folder.name,
|
|
15
|
+
entityType: UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE,
|
|
16
|
+
isContainer: false,
|
|
17
|
+
hasChildren: false,
|
|
18
|
+
isFolder: true,
|
|
19
|
+
isElement: false,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { UmbCreateFolderModel, UmbFolderDataSource, UmbUpdateFolderModel } from '../../../../core/tree/index.js';
|
|
2
|
+
import type { UmbControllerHost } from '../../../../../libs/controller-api/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* A data source for a Document Type folder that fetches data from the server
|
|
5
|
+
* @export
|
|
6
|
+
* @class UmbDocumentTypeFolderServerDataSource
|
|
7
|
+
* @implements {RepositoryDetailDataSource}
|
|
8
|
+
*/
|
|
9
|
+
export declare class UmbDocumentTypeFolderServerDataSource implements UmbFolderDataSource {
|
|
10
|
+
#private;
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of UmbDocumentTypeFolderServerDataSource.
|
|
13
|
+
* @param {UmbControllerHost} host
|
|
14
|
+
* @memberof UmbDocumentTypeFolderServerDataSource
|
|
15
|
+
*/
|
|
16
|
+
constructor(host: UmbControllerHost);
|
|
17
|
+
/**
|
|
18
|
+
* Fetches a Document Type folder from the server
|
|
19
|
+
* @param {string} unique
|
|
20
|
+
* @return {*}
|
|
21
|
+
* @memberof UmbDocumentTypeFolderServerDataSource
|
|
22
|
+
*/
|
|
23
|
+
read(unique: string): Promise<{
|
|
24
|
+
data: {
|
|
25
|
+
unique: string;
|
|
26
|
+
name: string;
|
|
27
|
+
parentUnique: string | null;
|
|
28
|
+
};
|
|
29
|
+
error?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
error: import("../../../../../external/backend-api/index.js").ApiError | import("../../../../../external/backend-api/index.js").CancelError | undefined;
|
|
32
|
+
data?: undefined;
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a Document Type folder on the server
|
|
36
|
+
* @param {UmbCreateFolderModel} args
|
|
37
|
+
* @return {*}
|
|
38
|
+
* @memberof UmbDocumentTypeFolderServerDataSource
|
|
39
|
+
*/
|
|
40
|
+
create(args: UmbCreateFolderModel): Promise<{
|
|
41
|
+
data: {
|
|
42
|
+
unique: string;
|
|
43
|
+
name: string;
|
|
44
|
+
parentUnique: string | null;
|
|
45
|
+
};
|
|
46
|
+
error?: undefined;
|
|
47
|
+
} | {
|
|
48
|
+
error: import("../../../../../external/backend-api/index.js").ApiError | import("../../../../../external/backend-api/index.js").CancelError | undefined;
|
|
49
|
+
data?: undefined;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Updates a Document Type folder on the server
|
|
53
|
+
* @param {UmbUpdateFolderModel} args
|
|
54
|
+
* @return {*}
|
|
55
|
+
* @memberof UmbDocumentTypeFolderServerDataSource
|
|
56
|
+
*/
|
|
57
|
+
update(args: UmbUpdateFolderModel): Promise<{
|
|
58
|
+
data: {
|
|
59
|
+
unique: string;
|
|
60
|
+
name: string;
|
|
61
|
+
parentUnique: string | null;
|
|
62
|
+
};
|
|
63
|
+
error?: undefined;
|
|
64
|
+
} | {
|
|
65
|
+
error: import("../../../../../external/backend-api/index.js").ApiError | import("../../../../../external/backend-api/index.js").CancelError | undefined;
|
|
66
|
+
data?: undefined;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Deletes a Document Type folder on the server
|
|
70
|
+
* @param {string} unique
|
|
71
|
+
* @return {*}
|
|
72
|
+
* @memberof UmbDocumentTypeServerDataSource
|
|
73
|
+
*/
|
|
74
|
+
delete(unique: string): Promise<import("../../../../core/repository/index.js").DataSourceResponse<any>>;
|
|
75
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _UmbDocumentTypeFolderServerDataSource_host;
|
|
13
|
+
import { DocumentTypeResource } from '../../../../../external/backend-api/index.js';
|
|
14
|
+
import { tryExecuteAndNotify } from '../../../../../shared/resources/index.js';
|
|
15
|
+
/**
|
|
16
|
+
* A data source for a Document Type folder that fetches data from the server
|
|
17
|
+
* @export
|
|
18
|
+
* @class UmbDocumentTypeFolderServerDataSource
|
|
19
|
+
* @implements {RepositoryDetailDataSource}
|
|
20
|
+
*/
|
|
21
|
+
export class UmbDocumentTypeFolderServerDataSource {
|
|
22
|
+
/**
|
|
23
|
+
* Creates an instance of UmbDocumentTypeFolderServerDataSource.
|
|
24
|
+
* @param {UmbControllerHost} host
|
|
25
|
+
* @memberof UmbDocumentTypeFolderServerDataSource
|
|
26
|
+
*/
|
|
27
|
+
constructor(host) {
|
|
28
|
+
_UmbDocumentTypeFolderServerDataSource_host.set(this, void 0);
|
|
29
|
+
__classPrivateFieldSet(this, _UmbDocumentTypeFolderServerDataSource_host, host, "f");
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Fetches a Document Type folder from the server
|
|
33
|
+
* @param {string} unique
|
|
34
|
+
* @return {*}
|
|
35
|
+
* @memberof UmbDocumentTypeFolderServerDataSource
|
|
36
|
+
*/
|
|
37
|
+
async read(unique) {
|
|
38
|
+
if (!unique)
|
|
39
|
+
throw new Error('Unique is missing');
|
|
40
|
+
const { data, error } = await tryExecuteAndNotify(__classPrivateFieldGet(this, _UmbDocumentTypeFolderServerDataSource_host, "f"), DocumentTypeResource.getDocumentTypeFolderById({
|
|
41
|
+
id: unique,
|
|
42
|
+
}));
|
|
43
|
+
if (data) {
|
|
44
|
+
const mappedData = {
|
|
45
|
+
unique: data.id,
|
|
46
|
+
name: data.name,
|
|
47
|
+
parentUnique: data.parentId || null,
|
|
48
|
+
};
|
|
49
|
+
return { data: mappedData };
|
|
50
|
+
}
|
|
51
|
+
return { error };
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Creates a Document Type folder on the server
|
|
55
|
+
* @param {UmbCreateFolderModel} args
|
|
56
|
+
* @return {*}
|
|
57
|
+
* @memberof UmbDocumentTypeFolderServerDataSource
|
|
58
|
+
*/
|
|
59
|
+
async create(args) {
|
|
60
|
+
if (args.parentUnique === undefined)
|
|
61
|
+
throw new Error('Parent unique is missing');
|
|
62
|
+
if (!args.name)
|
|
63
|
+
throw new Error('Name is missing');
|
|
64
|
+
const requestBody = {
|
|
65
|
+
id: args.unique,
|
|
66
|
+
parentId: args.parentUnique,
|
|
67
|
+
name: args.name,
|
|
68
|
+
};
|
|
69
|
+
const { error } = await tryExecuteAndNotify(__classPrivateFieldGet(this, _UmbDocumentTypeFolderServerDataSource_host, "f"), DocumentTypeResource.postDocumentTypeFolder({
|
|
70
|
+
requestBody,
|
|
71
|
+
}));
|
|
72
|
+
if (!error) {
|
|
73
|
+
return this.read(args.unique);
|
|
74
|
+
}
|
|
75
|
+
return { error };
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Updates a Document Type folder on the server
|
|
79
|
+
* @param {UmbUpdateFolderModel} args
|
|
80
|
+
* @return {*}
|
|
81
|
+
* @memberof UmbDocumentTypeFolderServerDataSource
|
|
82
|
+
*/
|
|
83
|
+
async update(args) {
|
|
84
|
+
if (!args.unique)
|
|
85
|
+
throw new Error('Unique is missing');
|
|
86
|
+
if (!args.name)
|
|
87
|
+
throw new Error('Folder name is missing');
|
|
88
|
+
const { error } = await tryExecuteAndNotify(__classPrivateFieldGet(this, _UmbDocumentTypeFolderServerDataSource_host, "f"), DocumentTypeResource.putDocumentTypeFolderById({
|
|
89
|
+
id: args.unique,
|
|
90
|
+
requestBody: { name: args.name },
|
|
91
|
+
}));
|
|
92
|
+
if (!error) {
|
|
93
|
+
return this.read(args.unique);
|
|
94
|
+
}
|
|
95
|
+
return { error };
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Deletes a Document Type folder on the server
|
|
99
|
+
* @param {string} unique
|
|
100
|
+
* @return {*}
|
|
101
|
+
* @memberof UmbDocumentTypeServerDataSource
|
|
102
|
+
*/
|
|
103
|
+
async delete(unique) {
|
|
104
|
+
if (!unique)
|
|
105
|
+
throw new Error('Unique is missing');
|
|
106
|
+
return tryExecuteAndNotify(__classPrivateFieldGet(this, _UmbDocumentTypeFolderServerDataSource_host, "f"), DocumentTypeResource.deleteDocumentTypeFolderById({
|
|
107
|
+
id: unique,
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
_UmbDocumentTypeFolderServerDataSource_host = new WeakMap();
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ManifestEntityAction, ManifestRepository } from '../../../../core/extension-registry/index.js';
|
|
2
|
+
export declare const UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS = "Umb.Repository.DocumentType.Folder";
|
|
3
|
+
export declare const manifests: (ManifestEntityAction | ManifestRepository<import("../../../../../libs/extension-api/index.js").UmbApi>)[];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../../entity.js';
|
|
2
|
+
import { UmbDocumentTypeFolderRepository } from './document-type-folder.repository.js';
|
|
3
|
+
import { UmbDeleteFolderEntityAction, UmbFolderUpdateEntityAction } from '../../../../core/tree/index.js';
|
|
4
|
+
export const UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS = 'Umb.Repository.DocumentType.Folder';
|
|
5
|
+
const folderRepository = {
|
|
6
|
+
type: 'repository',
|
|
7
|
+
alias: UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS,
|
|
8
|
+
name: 'Document Type Folder Repository',
|
|
9
|
+
api: UmbDocumentTypeFolderRepository,
|
|
10
|
+
};
|
|
11
|
+
const entityActions = [
|
|
12
|
+
{
|
|
13
|
+
type: 'entityAction',
|
|
14
|
+
alias: 'Umb.EntityAction.DocumentType.DeleteFolder',
|
|
15
|
+
name: 'Delete Document Type Folder Entity Action',
|
|
16
|
+
weight: 800,
|
|
17
|
+
api: UmbDeleteFolderEntityAction,
|
|
18
|
+
meta: {
|
|
19
|
+
icon: 'icon-trash',
|
|
20
|
+
label: 'Delete Folder...',
|
|
21
|
+
repositoryAlias: UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS,
|
|
22
|
+
entityTypes: [UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'entityAction',
|
|
27
|
+
alias: 'Umb.EntityAction.DocumentType.RenameFolder',
|
|
28
|
+
name: 'Rename Document Type Folder Entity Action',
|
|
29
|
+
weight: 700,
|
|
30
|
+
api: UmbFolderUpdateEntityAction,
|
|
31
|
+
meta: {
|
|
32
|
+
icon: 'icon-edit',
|
|
33
|
+
label: 'Rename Folder...',
|
|
34
|
+
repositoryAlias: UMB_DOCUMENT_TYPE_FOLDER_REPOSITORY_ALIAS,
|
|
35
|
+
entityTypes: [UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
export const manifests = [folderRepository, ...entityActions];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE } from '../../entity.js';
|
|
2
|
+
import { UmbDocumentTypeTreeItemModel } from '../types.js';
|
|
3
|
+
export interface UmbDocumentTypeFolderTreeItemModel extends UmbDocumentTypeTreeItemModel {
|
|
4
|
+
entityType: typeof UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE;
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,4 +2,4 @@ import type { ManifestRepository, ManifestTree, ManifestTreeItem, ManifestTreeSt
|
|
|
2
2
|
export declare const UMB_DOCUMENT_TYPE_TREE_REPOSITORY_ALIAS = "Umb.Repository.DocumentType.Tree";
|
|
3
3
|
export declare const UMB_DOCUMENT_TYPE_TREE_STORE_ALIAS = "Umb.Store.DocumentType.Tree";
|
|
4
4
|
export declare const UMB_DOCUMENT_TYPE_TREE_ALIAS = "Umb.Tree.DocumentType";
|
|
5
|
-
export declare const manifests: (ManifestTree | ManifestTreeItem | ManifestTreeStore | ManifestRepository<import("../../../../libs/extension-api/index.js").UmbApi>)[];
|
|
5
|
+
export declare const manifests: (import("../../../core/extension-registry/index.js").ManifestEntityAction | ManifestTree | ManifestTreeItem | ManifestTreeStore | ManifestRepository<import("../../../../libs/extension-api/index.js").UmbApi>)[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { UMB_DOCUMENT_TYPE_ENTITY_TYPE, UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE } from '../entity.js';
|
|
1
|
+
import { UMB_DOCUMENT_TYPE_ENTITY_TYPE, UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE, UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE, } from '../entity.js';
|
|
2
2
|
import { UmbDocumentTypeTreeRepository } from './document-type-tree.repository.js';
|
|
3
3
|
import { UmbDocumentTypeTreeStore } from './document-type.tree.store.js';
|
|
4
|
+
import { manifests as folderManifests } from './folder/manifests.js';
|
|
4
5
|
export const UMB_DOCUMENT_TYPE_TREE_REPOSITORY_ALIAS = 'Umb.Repository.DocumentType.Tree';
|
|
5
6
|
export const UMB_DOCUMENT_TYPE_TREE_STORE_ALIAS = 'Umb.Store.DocumentType.Tree';
|
|
6
7
|
export const UMB_DOCUMENT_TYPE_TREE_ALIAS = 'Umb.Tree.DocumentType';
|
|
@@ -30,7 +31,11 @@ const treeItem = {
|
|
|
30
31
|
alias: 'Umb.TreeItem.DocumentType',
|
|
31
32
|
name: 'Document Type Tree Item',
|
|
32
33
|
meta: {
|
|
33
|
-
entityTypes: [
|
|
34
|
+
entityTypes: [
|
|
35
|
+
UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE,
|
|
36
|
+
UMB_DOCUMENT_TYPE_ENTITY_TYPE,
|
|
37
|
+
UMB_DOCUMENT_TYPE_FOLDER_ENTITY_TYPE,
|
|
38
|
+
],
|
|
34
39
|
},
|
|
35
40
|
};
|
|
36
|
-
export const manifests = [treeRepository, treeStore, tree, treeItem];
|
|
41
|
+
export const manifests = [treeRepository, treeStore, tree, treeItem, ...folderManifests];
|
package/dist-cms/packages/user/current-user/modals/current-user/current-user-modal.element.js
CHANGED
|
@@ -52,10 +52,7 @@ let UmbCurrentUserModalElement = class UmbCurrentUserModalElement extends UmbLit
|
|
|
52
52
|
async _logout() {
|
|
53
53
|
if (!__classPrivateFieldGet(this, _UmbCurrentUserModalElement_authContext, "f"))
|
|
54
54
|
return;
|
|
55
|
-
|
|
56
|
-
let newUrl = __classPrivateFieldGet(this, _UmbCurrentUserModalElement_appContext, "f") ? `${__classPrivateFieldGet(this, _UmbCurrentUserModalElement_appContext, "f").getBackofficePath()}/login` : '/';
|
|
57
|
-
newUrl = newUrl.replace(/\/\//g, '/');
|
|
58
|
-
location.href = newUrl;
|
|
55
|
+
__classPrivateFieldGet(this, _UmbCurrentUserModalElement_authContext, "f").signOut();
|
|
59
56
|
}
|
|
60
57
|
render() {
|
|
61
58
|
return html `
|
|
@@ -72,6 +72,10 @@ export declare class UmbAuthFlow {
|
|
|
72
72
|
* @returns true if the user is logged in, false otherwise.
|
|
73
73
|
*/
|
|
74
74
|
isAuthorized(): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Forget all cached token state
|
|
77
|
+
*/
|
|
78
|
+
clearTokenStorage(): Promise<void>;
|
|
75
79
|
/**
|
|
76
80
|
* This method will sign the user out of the application.
|
|
77
81
|
*/
|
|
@@ -25,7 +25,7 @@ var _UmbAuthFlow_instances, _UmbAuthFlow_notifier, _UmbAuthFlow_authorizationHan
|
|
|
25
25
|
* License for the specific language governing permissions and limitations under
|
|
26
26
|
* the License.
|
|
27
27
|
*/
|
|
28
|
-
import { BaseTokenRequestHandler, BasicQueryStringUtils, FetchRequestor, LocalStorageBackend, RedirectRequestHandler, AuthorizationRequest, AuthorizationNotifier, AuthorizationServiceConfiguration, GRANT_TYPE_AUTHORIZATION_CODE, GRANT_TYPE_REFRESH_TOKEN, TokenRequest, TokenResponse, } from '../../external/openid/index.js';
|
|
28
|
+
import { BaseTokenRequestHandler, BasicQueryStringUtils, FetchRequestor, LocalStorageBackend, RedirectRequestHandler, AuthorizationRequest, AuthorizationNotifier, AuthorizationServiceConfiguration, GRANT_TYPE_AUTHORIZATION_CODE, GRANT_TYPE_REFRESH_TOKEN, RevokeTokenRequest, TokenRequest, TokenResponse, } from '../../external/openid/index.js';
|
|
29
29
|
const requestor = new FetchRequestor();
|
|
30
30
|
const TOKEN_RESPONSE_NAME = 'umb:userAuthTokenResponse';
|
|
31
31
|
/**
|
|
@@ -185,32 +185,48 @@ export class UmbAuthFlow {
|
|
|
185
185
|
isAuthorized() {
|
|
186
186
|
return !!__classPrivateFieldGet(this, _UmbAuthFlow_accessTokenResponse, "f") && __classPrivateFieldGet(this, _UmbAuthFlow_accessTokenResponse, "f").isValid();
|
|
187
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Forget all cached token state
|
|
190
|
+
*/
|
|
191
|
+
async clearTokenStorage() {
|
|
192
|
+
await __classPrivateFieldGet(this, _UmbAuthFlow_storageBackend, "f").removeItem(TOKEN_RESPONSE_NAME);
|
|
193
|
+
// clear the internal state
|
|
194
|
+
__classPrivateFieldSet(this, _UmbAuthFlow_accessTokenResponse, undefined, "f");
|
|
195
|
+
__classPrivateFieldSet(this, _UmbAuthFlow_refreshToken, undefined, "f");
|
|
196
|
+
}
|
|
188
197
|
/**
|
|
189
198
|
* This method will sign the user out of the application.
|
|
190
199
|
*/
|
|
191
200
|
async signOut() {
|
|
192
|
-
|
|
193
|
-
|
|
201
|
+
const signOutPromises = [];
|
|
202
|
+
// revoke the access token if it exists
|
|
194
203
|
if (__classPrivateFieldGet(this, _UmbAuthFlow_accessTokenResponse, "f")) {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
// await this.#tokenHandler.performRevokeTokenRequest(this.#configuration, tokenRevokeRequest);
|
|
202
|
-
__classPrivateFieldSet(this, _UmbAuthFlow_accessTokenResponse, undefined, "f");
|
|
204
|
+
const tokenRevokeRequest = new RevokeTokenRequest({
|
|
205
|
+
token: __classPrivateFieldGet(this, _UmbAuthFlow_accessTokenResponse, "f").accessToken,
|
|
206
|
+
client_id: __classPrivateFieldGet(this, _UmbAuthFlow_clientId, "f"),
|
|
207
|
+
token_type_hint: 'access_token',
|
|
208
|
+
});
|
|
209
|
+
signOutPromises.push(__classPrivateFieldGet(this, _UmbAuthFlow_tokenHandler, "f").performRevokeTokenRequest(__classPrivateFieldGet(this, _UmbAuthFlow_configuration, "f"), tokenRevokeRequest));
|
|
203
210
|
}
|
|
211
|
+
// revoke the refresh token if it exists
|
|
204
212
|
if (__classPrivateFieldGet(this, _UmbAuthFlow_refreshToken, "f")) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
// await this.#tokenHandler.performRevokeTokenRequest(this.#configuration, tokenRevokeRequest);
|
|
212
|
-
__classPrivateFieldSet(this, _UmbAuthFlow_refreshToken, undefined, "f");
|
|
213
|
+
const tokenRevokeRequest = new RevokeTokenRequest({
|
|
214
|
+
token: __classPrivateFieldGet(this, _UmbAuthFlow_refreshToken, "f"),
|
|
215
|
+
client_id: __classPrivateFieldGet(this, _UmbAuthFlow_clientId, "f"),
|
|
216
|
+
token_type_hint: 'refresh_token',
|
|
217
|
+
});
|
|
218
|
+
signOutPromises.push(__classPrivateFieldGet(this, _UmbAuthFlow_tokenHandler, "f").performRevokeTokenRequest(__classPrivateFieldGet(this, _UmbAuthFlow_configuration, "f"), tokenRevokeRequest));
|
|
213
219
|
}
|
|
220
|
+
// clear the internal token state
|
|
221
|
+
signOutPromises.push(this.clearTokenStorage());
|
|
222
|
+
// wait for all promises to settle before continuing
|
|
223
|
+
await Promise.allSettled(signOutPromises);
|
|
224
|
+
// clear the session on the server as well
|
|
225
|
+
// this will redirect the user to the end session endpoint of the server
|
|
226
|
+
// which will redirect the user back to the client
|
|
227
|
+
// and the client will then try and log in again (if the user is not logged in)
|
|
228
|
+
// which will redirect the user to the login page
|
|
229
|
+
location.href = `${__classPrivateFieldGet(this, _UmbAuthFlow_configuration, "f").endSessionEndpoint}?post_logout_redirect_uri=${__classPrivateFieldGet(this, _UmbAuthFlow_redirectUri, "f")}`;
|
|
214
230
|
}
|
|
215
231
|
/**
|
|
216
232
|
* This method will check if the token needs to be refreshed and if so, it will refresh it and return the new access token.
|
|
@@ -28,6 +28,11 @@ export declare class UmbAuthContext extends UmbBaseController implements IUmbAut
|
|
|
28
28
|
* @returns The latest token from the Management API
|
|
29
29
|
*/
|
|
30
30
|
getLatestToken(): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Clears the token storage.
|
|
33
|
+
* @memberof UmbAuthContext
|
|
34
|
+
*/
|
|
35
|
+
clearTokenStorage(): Promise<void>;
|
|
31
36
|
/**
|
|
32
37
|
* Signs the user out by removing any tokens from the browser.
|
|
33
38
|
* @return {*} {Promise<void>}
|
|
@@ -28,6 +28,10 @@ export interface IUmbAuthContext {
|
|
|
28
28
|
* @returns The latest token from the Management API
|
|
29
29
|
*/
|
|
30
30
|
getLatestToken(): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Clears the token storage.
|
|
33
|
+
*/
|
|
34
|
+
clearTokenStorage(): Promise<void>;
|
|
31
35
|
/**
|
|
32
36
|
* Signs the user out by removing any tokens from the browser.
|
|
33
37
|
*/
|