@umbraco-cms/backoffice 14.0.0-631d8769 → 14.0.0-709b3cbf
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/assets/lang/en-us.js +18 -18
- package/dist-cms/assets/lang/en-us.ts +18 -18
- package/dist-cms/custom-elements.json +11 -11
- package/dist-cms/external/backend-api/index.js +1 -1
- package/dist-cms/external/backend-api/src/index.d.ts +17 -1
- package/dist-cms/external/backend-api/src/models/CreateContentRequestModelBaseDocumentValueModelDocumentVariantRequestModel.d.ts +1 -0
- package/dist-cms/external/backend-api/src/models/CreateContentRequestModelBaseMediaValueModelMediaVariantRequestModel.d.ts +1 -0
- package/dist-cms/external/backend-api/src/models/CreateContentTypeRequestModelBaseCreateDocumentTypePropertyTypeRequestModelCreateDocumentTypePropertyTypeContainerRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/CreateContentTypeRequestModelBaseCreateMediaTypePropertyTypeRequestModelCreateMediaTypePropertyTypeContainerRequestModel.d.ts +20 -0
- package/dist-cms/external/backend-api/src/models/CreateMediaTypePropertyTypeContainerRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/CreateMediaTypePropertyTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/CreateMediaTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/DeleteUserGroupsRequestModel.d.ts +3 -0
- package/dist-cms/external/backend-api/src/models/DeleteUsersRequestModel.d.ts +3 -0
- package/dist-cms/external/backend-api/src/models/ItemSortingRequestModel.d.ts +4 -0
- package/dist-cms/external/backend-api/src/models/ProblemDetailsBuilderModel.d.ts +1 -0
- package/dist-cms/external/backend-api/src/models/RelationResponseModel.d.ts +2 -2
- package/dist-cms/external/backend-api/src/models/ResetPasswordRequestModel.d.ts +3 -0
- package/dist-cms/external/backend-api/src/models/ResetPasswordTokenRequestModel.d.ts +4 -0
- package/dist-cms/external/backend-api/src/models/SortingRequestModel.d.ts +5 -0
- package/dist-cms/external/backend-api/src/models/UpdateContentTypeRequestModelBaseUpdateMediaTypePropertyTypeRequestModelUpdateMediaTypePropertyTypeContainerRequestModel.d.ts +18 -0
- package/dist-cms/external/backend-api/src/models/{UpdateFolderReponseModel.d.ts → UpdateFolderResponseModel.d.ts} +1 -1
- package/dist-cms/external/backend-api/src/models/UpdateMediaTypePropertyTypeContainerRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/UpdateMediaTypePropertyTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/UpdateMediaTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/VerifyResetPasswordTokenRequestModel.d.ts +4 -0
- package/dist-cms/external/backend-api/src/services/DataTypeResource.d.ts +2 -2
- package/dist-cms/external/backend-api/src/services/DocumentResource.d.ts +21 -21
- package/dist-cms/external/backend-api/src/services/DocumentTypeResource.d.ts +35 -3
- package/dist-cms/external/backend-api/src/services/MediaResource.d.ts +13 -5
- package/dist-cms/external/backend-api/src/services/MediaTypeResource.d.ts +56 -0
- package/dist-cms/external/backend-api/src/services/RelationResource.d.ts +1 -9
- package/dist-cms/external/backend-api/src/services/SecurityResource.d.ts +24 -0
- package/dist-cms/external/backend-api/src/services/UserGroupResource.d.ts +8 -0
- package/dist-cms/external/backend-api/src/services/UserResource.d.ts +8 -0
- package/dist-cms/external/router-slot/config.d.ts +8 -0
- package/dist-cms/external/router-slot/index.d.ts +4 -3
- package/dist-cms/external/router-slot/index.js +1 -1
- package/dist-cms/external/router-slot/model.d.ts +123 -0
- package/dist-cms/external/router-slot/router-slot.d.ts +111 -0
- package/dist-cms/external/router-slot/util/anchor.d.ts +5 -0
- package/dist-cms/external/router-slot/util/events.d.ts +26 -0
- package/dist-cms/external/router-slot/util/history.d.ts +32 -0
- package/dist-cms/external/router-slot/util/index.d.ts +6 -0
- package/dist-cms/external/router-slot/util/router.d.ts +72 -0
- package/dist-cms/external/router-slot/util/shadow.d.ts +15 -0
- package/dist-cms/external/router-slot/util/url.d.ts +78 -0
- package/dist-cms/external/router-slot/util.d.ts +1 -0
- package/dist-cms/libs/observable-api/observer.js +2 -1
- package/dist-cms/mocks/browser-handlers.js +1 -1
- package/dist-cms/mocks/data/document.data.d.ts +6 -2
- package/dist-cms/mocks/data/document.data.js +54 -4
- package/dist-cms/mocks/data/entity.data.js +0 -2
- package/dist-cms/mocks/handlers/{document.handlers.js → document/document.handlers.js} +28 -40
- package/dist-cms/mocks/handlers/document/index.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/index.js +5 -0
- package/dist-cms/mocks/handlers/document/item.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/item.handlers.js +13 -0
- package/dist-cms/mocks/handlers/document/recycle-bin.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/recycle-bin.handlers.js +16 -0
- package/dist-cms/mocks/handlers/document/slug.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/slug.js +1 -0
- package/dist-cms/mocks/handlers/document/tree.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/tree.handlers.js +16 -0
- package/dist-cms/packages/core/components/input-list-base/input-list-base.js +1 -1
- package/dist-cms/packages/core/content-type/content-type-container-structure-helper.class.js +2 -2
- package/dist-cms/packages/core/content-type/content-type-property-structure-helper.class.js +1 -1
- package/dist-cms/packages/core/content-type/content-type-structure-manager.class.d.ts +15 -15
- package/dist-cms/packages/core/content-type/content-type-structure-manager.class.js +79 -103
- package/dist-cms/packages/core/entity-action/common/trash/trash.action.d.ts +1 -1
- package/dist-cms/packages/core/entity-action/common/trash/trash.action.js +1 -1
- package/dist-cms/packages/core/modal/token/create-document-modal.token.d.ts +8 -0
- package/dist-cms/packages/core/modal/token/create-document-modal.token.js +5 -0
- package/dist-cms/packages/core/modal/token/index.d.ts +1 -1
- package/dist-cms/packages/core/modal/token/index.js +1 -1
- package/dist-cms/packages/core/store/store-base.d.ts +18 -6
- package/dist-cms/packages/core/store/store-base.js +22 -6
- package/dist-cms/packages/documents/document-types/manifests.js +0 -2
- package/dist-cms/packages/documents/document-types/repository/document-type.repository.d.ts +0 -21
- package/dist-cms/packages/documents/document-types/repository/document-type.repository.js +6 -18
- package/dist-cms/packages/documents/document-types/repository/sources/document-type.server.data.d.ts +1 -1
- package/dist-cms/packages/documents/document-types/repository/sources/document-type.server.data.js +1 -12
- package/dist-cms/packages/documents/document-types/workspace/document-type-workspace.context.js +27 -27
- package/dist-cms/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit.element.js +8 -4
- package/dist-cms/packages/documents/documents/entity-actions/create/create-document-modal.element.d.ts +17 -0
- package/dist-cms/packages/documents/{document-types/modals/allowed-document-types/allowed-document-types-modal.element.js → documents/entity-actions/create/create-document-modal.element.js} +29 -38
- package/dist-cms/packages/documents/documents/entity-actions/create/create.action.d.ts +0 -2
- package/dist-cms/packages/documents/documents/entity-actions/create/create.action.js +7 -23
- package/dist-cms/packages/documents/documents/entity-actions/create/manifests.d.ts +2 -0
- package/dist-cms/packages/documents/documents/entity-actions/create/manifests.js +27 -0
- package/dist-cms/packages/documents/documents/entity-actions/manifests.d.ts +2 -2
- package/dist-cms/packages/documents/documents/entity-actions/manifests.js +15 -48
- package/dist-cms/packages/documents/documents/index.d.ts +1 -0
- package/dist-cms/packages/documents/documents/index.js +1 -0
- package/dist-cms/packages/documents/documents/manifests.d.ts +13 -1
- package/dist-cms/packages/documents/documents/manifests.js +2 -0
- package/dist-cms/packages/documents/documents/menu-item/manifests.js +1 -1
- package/dist-cms/packages/documents/documents/recycle-bin/entity-action/manifests.d.ts +14 -0
- package/dist-cms/packages/documents/documents/recycle-bin/entity-action/manifests.js +18 -0
- package/dist-cms/packages/documents/documents/recycle-bin/index.d.ts +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/index.js +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/manifests.d.ts +13 -0
- package/dist-cms/packages/documents/documents/recycle-bin/manifests.js +5 -0
- package/dist-cms/packages/documents/documents/recycle-bin/menu-item/manifests.d.ts +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/menu-item/manifests.js +14 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle-bin.repository.d.ts +28 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle-bin.repository.js +56 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle.bin.tree.store.d.ts +18 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle.bin.tree.store.js +19 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/index.d.ts +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/index.js +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/manifests.d.ts +4 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/manifests.js +17 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/sources/document-recycle-bin.tree.server.data.d.ts +29 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/sources/document-recycle-bin.tree.server.data.js +49 -0
- package/dist-cms/packages/documents/documents/recycle-bin/tree/manifests.d.ts +2 -0
- package/dist-cms/packages/documents/documents/recycle-bin/tree/manifests.js +19 -0
- package/dist-cms/packages/documents/documents/repository/document-item.store.d.ts +20 -0
- package/dist-cms/packages/documents/documents/repository/document-item.store.js +23 -0
- package/dist-cms/packages/documents/documents/repository/document.repository.d.ts +10 -9
- package/dist-cms/packages/documents/documents/repository/document.repository.js +47 -25
- package/dist-cms/packages/documents/documents/repository/document.store.d.ts +0 -12
- package/dist-cms/packages/documents/documents/repository/document.store.js +0 -16
- package/dist-cms/packages/documents/documents/repository/sources/document-item.server.data.d.ts +24 -0
- package/dist-cms/packages/documents/documents/repository/sources/document-item.server.data.js +31 -0
- package/dist-cms/packages/documents/documents/repository/sources/document.server.data.d.ts +9 -21
- package/dist-cms/packages/documents/documents/repository/sources/document.server.data.js +33 -62
- package/dist-cms/packages/documents/documents/workspace/manifests.js +6 -4
- package/dist-cms/packages/documents/manifests.d.ts +13 -1
- package/dist-cms/packages/settings/dashboards/performance-profiling/dashboard-performance-profiling.element.d.ts +3 -1
- package/dist-cms/packages/settings/dashboards/performance-profiling/dashboard-performance-profiling.element.js +26 -40
- package/dist-cms/packages/settings/relation-types/workspace/views/relation/workspace-view-relation-type-relation.element.js +17 -17
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.d.ts +1 -1
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.js +1 -1
- package/dist-cms/packages/users/user-groups/collection/user-group-collection-header.element.js +2 -2
- package/dist-cms/packages/users/user-groups/collection/user-group-collection-view.element.js +6 -6
- package/dist-cms/packages/users/user-groups/workspace/user-group-workspace-editor.element.js +15 -12
- package/dist-cms/packages/users/users/collection/user-collection-header.element.js +18 -11
- package/dist-cms/packages/users/users/collection/views/grid/user-collection-grid-view.element.js +6 -6
- package/dist-cms/packages/users/users/collection/views/table/column-layouts/status/user-table-status-column-layout.element.js +3 -3
- package/dist-cms/packages/users/users/index.d.ts +1 -0
- package/dist-cms/packages/users/users/index.js +1 -0
- package/dist-cms/packages/users/users/repository/index.d.ts +1 -0
- package/dist-cms/packages/users/users/repository/index.js +1 -0
- package/dist-cms/packages/users/users/workspace/user-workspace-editor.element.js +36 -35
- package/dist-cms/packages/users/utils.d.ts +5 -2
- package/dist-cms/packages/users/utils.js +14 -14
- package/dist-cms/shared/repository/data-source/folder-data-source.interface.d.ts +2 -2
- package/dist-cms/shared/repository/folder-repository.interface.d.ts +2 -2
- package/dist-cms/shared/router/index.d.ts +1 -1
- package/dist-cms/shared/router/index.js +1 -1
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +7 -7
- package/package.json +2 -3
- package/dist-cms/packages/core/modal/token/allowed-document-types-modal.token.d.ts +0 -9
- package/dist-cms/packages/core/modal/token/allowed-document-types-modal.token.js +0 -5
- package/dist-cms/packages/documents/document-types/modals/allowed-document-types/allowed-document-types-modal.element.d.ts +0 -19
- package/dist-cms/packages/documents/document-types/modals/manifests.d.ts +0 -2
- package/dist-cms/packages/documents/document-types/modals/manifests.js +0 -9
- package/router-slot-2.3.0.tgz +0 -0
- /package/dist-cms/mocks/handlers/{document.handlers.d.ts → document/document.handlers.d.ts} +0 -0
|
@@ -460,7 +460,7 @@ export const data = [
|
|
|
460
460
|
publishDate: '2023-02-06T15:32:24.957009',
|
|
461
461
|
culture: 'en-us',
|
|
462
462
|
segment: null,
|
|
463
|
-
name: '
|
|
463
|
+
name: 'Simple Document',
|
|
464
464
|
createDate: '2023-02-06T15:32:05.350038',
|
|
465
465
|
updateDate: '2023-02-06T15:32:24.957009',
|
|
466
466
|
},
|
|
@@ -538,7 +538,29 @@ export const treeData = [
|
|
|
538
538
|
isEdited: false,
|
|
539
539
|
isTrashed: false,
|
|
540
540
|
},
|
|
541
|
+
{
|
|
542
|
+
name: 'Trashed',
|
|
543
|
+
type: 'document',
|
|
544
|
+
icon: 'document',
|
|
545
|
+
hasChildren: false,
|
|
546
|
+
id: 'trashed-document-id',
|
|
547
|
+
isContainer: false,
|
|
548
|
+
parentId: null,
|
|
549
|
+
noAccess: false,
|
|
550
|
+
isProtected: false,
|
|
551
|
+
isPublished: false,
|
|
552
|
+
isEdited: false,
|
|
553
|
+
isTrashed: true,
|
|
554
|
+
},
|
|
541
555
|
];
|
|
556
|
+
const createDocumentItem = (item) => {
|
|
557
|
+
return {
|
|
558
|
+
id: item.id,
|
|
559
|
+
name: item.variants?.[0].name,
|
|
560
|
+
contentTypeId: item.contentTypeId,
|
|
561
|
+
};
|
|
562
|
+
};
|
|
563
|
+
// TODO: look into making a combined document model so we don't need to maintain two+ data sets.
|
|
542
564
|
// Temp mocked database
|
|
543
565
|
// TODO: all properties are optional in the server schema. I don't think this is correct.
|
|
544
566
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -566,14 +588,26 @@ class UmbDocumentData extends UmbEntityData {
|
|
|
566
588
|
});
|
|
567
589
|
return result;
|
|
568
590
|
}
|
|
591
|
+
trash(ids) {
|
|
592
|
+
const result = super.trash(ids);
|
|
593
|
+
this.treeData = this.treeData.map((x) => {
|
|
594
|
+
if (x.id && ids.includes(x.id)) {
|
|
595
|
+
return { ...x, isTrashed: true };
|
|
596
|
+
}
|
|
597
|
+
else {
|
|
598
|
+
return x;
|
|
599
|
+
}
|
|
600
|
+
});
|
|
601
|
+
return result;
|
|
602
|
+
}
|
|
569
603
|
getTreeRoot() {
|
|
570
|
-
const items = this.treeData.filter((item) => item.parentId === null);
|
|
604
|
+
const items = this.treeData.filter((item) => item.parentId === null && item.isTrashed === false);
|
|
571
605
|
const treeItems = items.map((item) => item);
|
|
572
606
|
const total = items.length;
|
|
573
607
|
return { items: treeItems, total };
|
|
574
608
|
}
|
|
575
|
-
|
|
576
|
-
const items = this.treeData.filter((item) => item.parentId === id);
|
|
609
|
+
getTreeItemChildrenOf(id) {
|
|
610
|
+
const items = this.treeData.filter((item) => item.parentId === id && item.isTrashed === false);
|
|
577
611
|
const treeItems = items.map((item) => item);
|
|
578
612
|
const total = items.length;
|
|
579
613
|
return { items: treeItems, total };
|
|
@@ -582,6 +616,10 @@ class UmbDocumentData extends UmbEntityData {
|
|
|
582
616
|
const items = this.treeData.filter((item) => ids.includes(item.id ?? ''));
|
|
583
617
|
return items.map((item) => item);
|
|
584
618
|
}
|
|
619
|
+
getItems(ids) {
|
|
620
|
+
const items = this.data.filter((item) => ids.includes(item.id ?? ''));
|
|
621
|
+
return items.map((item) => createDocumentItem(item));
|
|
622
|
+
}
|
|
585
623
|
getDocumentByIdAllowedDocumentTypes(id) {
|
|
586
624
|
const item = this.getById(id);
|
|
587
625
|
if (item?.contentTypeId) {
|
|
@@ -599,5 +637,17 @@ class UmbDocumentData extends UmbEntityData {
|
|
|
599
637
|
const total = items?.length;
|
|
600
638
|
return { items, total };
|
|
601
639
|
}
|
|
640
|
+
getRecycleBinRoot() {
|
|
641
|
+
const items = this.treeData.filter((item) => item.parentId === null && item.isTrashed === true);
|
|
642
|
+
const treeItems = items.map((item) => item);
|
|
643
|
+
const total = items.length;
|
|
644
|
+
return { items: treeItems, total };
|
|
645
|
+
}
|
|
646
|
+
getRecycleBinChildrenOf(parentId) {
|
|
647
|
+
const items = this.treeData.filter((item) => item.parentId === parentId && item.isTrashed === true);
|
|
648
|
+
const treeItems = items.map((item) => item);
|
|
649
|
+
const total = items.length;
|
|
650
|
+
return { items: treeItems, total };
|
|
651
|
+
}
|
|
602
652
|
}
|
|
603
653
|
export const umbDocumentData = new UmbDocumentData();
|
|
@@ -51,8 +51,6 @@ export class UmbEntityData extends UmbData {
|
|
|
51
51
|
const item = this.getById(id);
|
|
52
52
|
if (!item)
|
|
53
53
|
return;
|
|
54
|
-
// TODO: how do we handle trashed items?
|
|
55
|
-
// TODO: remove ignore when we know how to handle trashed items.
|
|
56
54
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
57
55
|
// @ts-ignore
|
|
58
56
|
item.isTrashed = true;
|
|
@@ -1,38 +1,37 @@
|
|
|
1
1
|
const { rest } = window.MockServiceWorker;
|
|
2
|
-
import { umbDocumentData } from '
|
|
3
|
-
import { umbracoPath } from '
|
|
2
|
+
import { umbDocumentData } from '../../data/document.data.js';
|
|
3
|
+
import { umbracoPath } from '../../../shared/utils/index.js';
|
|
4
4
|
// TODO: add schema
|
|
5
5
|
export const handlers = [
|
|
6
|
-
rest.
|
|
7
|
-
|
|
8
|
-
const ids = await req.json();
|
|
9
|
-
const trashed = umbDocumentData.trash(ids);
|
|
10
|
-
return res(ctx.status(200), ctx.json(trashed));
|
|
11
|
-
}),
|
|
12
|
-
rest.get(umbracoPath('/tree/document/root'), (req, res, ctx) => {
|
|
13
|
-
const response = umbDocumentData.getTreeRoot();
|
|
6
|
+
rest.get(umbracoPath('/document/root/allowed-document-types'), (req, res, ctx) => {
|
|
7
|
+
const response = umbDocumentData.getAllowedDocumentTypesAtRoot();
|
|
14
8
|
return res(ctx.status(200), ctx.json(response));
|
|
15
9
|
}),
|
|
16
|
-
rest.
|
|
17
|
-
const
|
|
18
|
-
|
|
10
|
+
rest.put(umbracoPath('/document/:id/move-to-recycle-bin'), async (req, res, ctx) => {
|
|
11
|
+
const id = req.params.id;
|
|
12
|
+
umbDocumentData.trash([id]);
|
|
13
|
+
return res(ctx.status(200));
|
|
14
|
+
}),
|
|
15
|
+
rest.get(umbracoPath('/document/:id/allowed-document-types'), (req, res, ctx) => {
|
|
16
|
+
const id = req.params.id;
|
|
17
|
+
if (!id)
|
|
19
18
|
return;
|
|
20
|
-
const response = umbDocumentData.
|
|
19
|
+
const response = umbDocumentData.getDocumentByIdAllowedDocumentTypes(id);
|
|
21
20
|
return res(ctx.status(200), ctx.json(response));
|
|
22
21
|
}),
|
|
23
|
-
rest.get(umbracoPath('/
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
22
|
+
rest.get(umbracoPath('/document/:id'), (req, res, ctx) => {
|
|
23
|
+
const id = req.params.id;
|
|
24
|
+
if (!id)
|
|
26
25
|
return;
|
|
27
|
-
const
|
|
28
|
-
return res(ctx.status(200), ctx.json(
|
|
26
|
+
const document = umbDocumentData.getById(id);
|
|
27
|
+
return res(ctx.status(200), ctx.json(document));
|
|
29
28
|
}),
|
|
30
|
-
rest.
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
29
|
+
rest.delete(umbracoPath('/document/:id'), (req, res, ctx) => {
|
|
30
|
+
const id = req.params.id;
|
|
31
|
+
if (!id)
|
|
33
32
|
return;
|
|
34
|
-
umbDocumentData.
|
|
35
|
-
return res(ctx.status(200));
|
|
33
|
+
const document = umbDocumentData.getById(id);
|
|
34
|
+
return res(ctx.status(200), ctx.json(document));
|
|
36
35
|
}),
|
|
37
36
|
rest.put(umbracoPath(`/document/:id`), async (req, res, ctx) => {
|
|
38
37
|
const id = req.params.id;
|
|
@@ -44,22 +43,11 @@ export const handlers = [
|
|
|
44
43
|
const saved = umbDocumentData.save(id, data);
|
|
45
44
|
return res(ctx.status(200), ctx.json(saved));
|
|
46
45
|
}),
|
|
47
|
-
rest.
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
}),
|
|
51
|
-
rest.get(umbracoPath('/document/:id/allowed-document-types'), (req, res, ctx) => {
|
|
52
|
-
const id = req.params.id;
|
|
53
|
-
if (!id)
|
|
54
|
-
return;
|
|
55
|
-
const response = umbDocumentData.getDocumentByIdAllowedDocumentTypes(id);
|
|
56
|
-
return res(ctx.status(200), ctx.json(response));
|
|
57
|
-
}),
|
|
58
|
-
rest.get(umbracoPath('/document/:id'), (req, res, ctx) => {
|
|
59
|
-
const id = req.params.id;
|
|
60
|
-
if (!id)
|
|
46
|
+
rest.post(umbracoPath(`/document`), async (req, res, ctx) => {
|
|
47
|
+
const data = await req.json();
|
|
48
|
+
if (!data)
|
|
61
49
|
return;
|
|
62
|
-
|
|
63
|
-
return res(ctx.status(200)
|
|
50
|
+
umbDocumentData.insert(data);
|
|
51
|
+
return res(ctx.status(200));
|
|
64
52
|
}),
|
|
65
53
|
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const handlers: import("msw").RestHandler<import("msw/lib/glossary-de6278a9.js").M<import("msw/lib/glossary-de6278a9.js").h>>[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { handlers as recycleBinHandlers } from './recycle-bin.handlers.js';
|
|
2
|
+
import { handlers as treeHandlers } from './tree.handlers.js';
|
|
3
|
+
import { handlers as documentHandlers } from './document.handlers.js';
|
|
4
|
+
import { handlers as itemHandlers } from './item.handlers.js';
|
|
5
|
+
export const handlers = [...recycleBinHandlers, ...treeHandlers, ...itemHandlers, ...documentHandlers];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const handlers: import("msw").RestHandler<import("msw/lib/glossary-de6278a9.js").M<import("msw/lib/glossary-de6278a9.js").h>>[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { rest } = window.MockServiceWorker;
|
|
2
|
+
import { umbDocumentData } from '../../data/document.data.js';
|
|
3
|
+
import { slug } from './slug.js';
|
|
4
|
+
import { umbracoPath } from '../../../shared/utils/index.js';
|
|
5
|
+
export const handlers = [
|
|
6
|
+
rest.get(umbracoPath(`${slug}/item`), (req, res, ctx) => {
|
|
7
|
+
const ids = req.url.searchParams.getAll('id');
|
|
8
|
+
if (!ids)
|
|
9
|
+
return;
|
|
10
|
+
const items = umbDocumentData.getItems(ids);
|
|
11
|
+
return res(ctx.status(200), ctx.json(items));
|
|
12
|
+
}),
|
|
13
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const handlers: import("msw").RestHandler<import("msw/lib/glossary-de6278a9.js").M<import("msw/lib/glossary-de6278a9.js").h>>[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const { rest } = window.MockServiceWorker;
|
|
2
|
+
import { umbDocumentData } from '../../data/document.data.js';
|
|
3
|
+
import { umbracoPath } from '../../../shared/utils/index.js';
|
|
4
|
+
export const handlers = [
|
|
5
|
+
rest.get(umbracoPath(`/recycle-bin/document/root`), (req, res, ctx) => {
|
|
6
|
+
const response = umbDocumentData.getRecycleBinRoot();
|
|
7
|
+
return res(ctx.status(200), ctx.json(response));
|
|
8
|
+
}),
|
|
9
|
+
rest.get(umbracoPath(`/recycle-bin/document/children`), (req, res, ctx) => {
|
|
10
|
+
const parentId = req.url.searchParams.get('parentId');
|
|
11
|
+
if (!parentId)
|
|
12
|
+
return;
|
|
13
|
+
const response = umbDocumentData.getRecycleBinChildrenOf(parentId);
|
|
14
|
+
return res(ctx.status(200), ctx.json(response));
|
|
15
|
+
}),
|
|
16
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const slug = "/document";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const slug = '/document';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const handlers: import("msw").RestHandler<import("msw/lib/glossary-de6278a9.js").M<import("msw/lib/glossary-de6278a9.js").h>>[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const { rest } = window.MockServiceWorker;
|
|
2
|
+
import { umbDocumentData } from '../../data/document.data.js';
|
|
3
|
+
import { umbracoPath } from '../../../shared/utils/index.js';
|
|
4
|
+
export const handlers = [
|
|
5
|
+
rest.get(umbracoPath('/tree/document/root'), (req, res, ctx) => {
|
|
6
|
+
const response = umbDocumentData.getTreeRoot();
|
|
7
|
+
return res(ctx.status(200), ctx.json(response));
|
|
8
|
+
}),
|
|
9
|
+
rest.get(umbracoPath('/tree/document/children'), (req, res, ctx) => {
|
|
10
|
+
const parentId = req.url.searchParams.get('parentId');
|
|
11
|
+
if (!parentId)
|
|
12
|
+
return;
|
|
13
|
+
const response = umbDocumentData.getTreeItemChildrenOf(parentId);
|
|
14
|
+
return res(ctx.status(200), ctx.json(response));
|
|
15
|
+
}),
|
|
16
|
+
];
|
|
@@ -42,7 +42,7 @@ export class UmbInputListBaseElement extends UmbLitElement {
|
|
|
42
42
|
}
|
|
43
43
|
renderButton() {
|
|
44
44
|
return html `<uui-button id="add-button" look="placeholder" @click=${this._openPicker} label="open">
|
|
45
|
-
|
|
45
|
+
${this.localize.term('general_add')}
|
|
46
46
|
</uui-button>`;
|
|
47
47
|
}
|
|
48
48
|
renderContent() {
|
package/dist-cms/packages/core/content-type/content-type-container-structure-helper.class.js
CHANGED
|
@@ -14,7 +14,7 @@ export class UmbContentTypeContainerStructureHelper {
|
|
|
14
14
|
// Containers defined in data might be more than actual containers to display as we merge them by name.
|
|
15
15
|
// Direct containers are the containers defining the total of this container(Multiple containers with the same name and type)
|
|
16
16
|
this._ownerAlikeContainers = [];
|
|
17
|
-
// Owner containers are containers owned by the owner
|
|
17
|
+
// Owner containers are containers owned by the owner Content Type (The specific one up for editing)
|
|
18
18
|
this._ownerContainers = [];
|
|
19
19
|
// State containing the merged containers (only one pr. name):
|
|
20
20
|
this.#containers = new UmbArrayState([], (x) => x.id);
|
|
@@ -172,7 +172,7 @@ export class UmbContentTypeContainerStructureHelper {
|
|
|
172
172
|
await this.#init;
|
|
173
173
|
if (!this.#structure)
|
|
174
174
|
return;
|
|
175
|
-
const newName = this.#structure.
|
|
175
|
+
const newName = this.#structure.makeContainerNameUniqueForOwnerContentType(name, this._childType, containerParentId) ?? name;
|
|
176
176
|
return await this.partialUpdateContainer(containerId, { name: newName });
|
|
177
177
|
}
|
|
178
178
|
}
|
|
@@ -16,7 +16,7 @@ export class UmbContentTypePropertyStructureHelper {
|
|
|
16
16
|
this.#propertyStructure.sortBy((a, b) => (a.sortOrder ?? 0) - (b.sortOrder ?? 0));
|
|
17
17
|
}
|
|
18
18
|
get ownerDocumentTypes() {
|
|
19
|
-
return this.#structure?.
|
|
19
|
+
return this.#structure?.contentTypes;
|
|
20
20
|
}
|
|
21
21
|
setStructureManager(structure) {
|
|
22
22
|
this.#structure = structure;
|
|
@@ -6,8 +6,8 @@ export type PropertyContainerTypes = 'Group' | 'Tab';
|
|
|
6
6
|
type T = DocumentTypeResponseModel;
|
|
7
7
|
export declare class UmbContentTypePropertyStructureManager<R extends UmbDetailRepository<T> = UmbDetailRepository<T>> {
|
|
8
8
|
#private;
|
|
9
|
-
readonly
|
|
10
|
-
private readonly
|
|
9
|
+
readonly contentTypes: import("rxjs").Observable<DocumentTypeResponseModel[]>;
|
|
10
|
+
private readonly _contentTypeContainers;
|
|
11
11
|
constructor(host: UmbControllerHostElement, typeRepository: R);
|
|
12
12
|
/**
|
|
13
13
|
* loadType will load the node type and all inherited and composed types.
|
|
@@ -27,26 +27,26 @@ export declare class UmbContentTypePropertyStructureManager<R extends UmbDetailR
|
|
|
27
27
|
create(): Promise<boolean>;
|
|
28
28
|
private _ensureType;
|
|
29
29
|
private _loadType;
|
|
30
|
-
|
|
31
|
-
private
|
|
30
|
+
_observeContentType(data: T): Promise<void>;
|
|
31
|
+
private _loadContentTypeCompositions;
|
|
32
32
|
/** Public methods for consuming structure: */
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
ownerContentType(): import("rxjs").Observable<DocumentTypeResponseModel | undefined>;
|
|
34
|
+
getOwnerContentType(): DocumentTypeResponseModel | undefined;
|
|
35
|
+
updateOwnerContentType(entry: T): void;
|
|
36
36
|
createContainer(contentTypeId: string | null, parentId?: string | null, type?: PropertyContainerTypes, sortOrder?: number): Promise<PropertyTypeContainerModelBaseModel>;
|
|
37
|
-
|
|
38
|
-
updateContainer(
|
|
39
|
-
removeContainer(
|
|
37
|
+
makeContainerNameUniqueForOwnerContentType(newName: string, containerType?: PropertyContainerTypes, parentId?: string | null): string | null;
|
|
38
|
+
updateContainer(contentTypeId: string | null, containerId: string, partialUpdate: Partial<PropertyTypeContainerModelBaseModel>): Promise<void>;
|
|
39
|
+
removeContainer(contentTypeId: string | null, containerId?: string | null): Promise<void>;
|
|
40
40
|
createPropertyScaffold(containerId?: string | null, sortOrder?: number): PropertyTypeModelBaseModel;
|
|
41
|
-
createProperty(
|
|
42
|
-
insertProperty(
|
|
43
|
-
removeProperty(
|
|
44
|
-
updateProperty(
|
|
41
|
+
createProperty(contentTypeId: string | null, containerId?: string | null, sortOrder?: number): Promise<PropertyTypeModelBaseModel>;
|
|
42
|
+
insertProperty(contentTypeId: string | null, property: PropertyTypeModelBaseModel): Promise<void>;
|
|
43
|
+
removeProperty(contentTypeId: string | null, propertyId: string): Promise<void>;
|
|
44
|
+
updateProperty(contentTypeId: string | null, propertyId: string, partialUpdate: Partial<PropertyTypeModelBaseModel>): Promise<void>;
|
|
45
45
|
propertyStructureById(propertyId: string): Promise<import("rxjs").Observable<PropertyTypeModelBaseModel | undefined>>;
|
|
46
46
|
propertyStructureByAlias(propertyAlias: string): Promise<import("rxjs").Observable<PropertyTypeModelBaseModel | undefined>>;
|
|
47
47
|
getPropertyStructureById(propertyId: string): Promise<PropertyTypeModelBaseModel | undefined>;
|
|
48
48
|
getPropertyStructureByAlias(propertyAlias: string): Promise<PropertyTypeModelBaseModel | undefined>;
|
|
49
|
-
|
|
49
|
+
ownerContentTypeObservablePart<PartResult>(mappingFunction: MappingFunction<T, PartResult>): import("rxjs").Observable<PartResult | undefined>;
|
|
50
50
|
hasPropertyStructuresOf(containerId: string | null): import("rxjs").Observable<boolean>;
|
|
51
51
|
rootPropertyStructures(): import("rxjs").Observable<PropertyTypeModelBaseModel[]>;
|
|
52
52
|
propertyStructuresOf(containerId: string | null): import("rxjs").Observable<PropertyTypeModelBaseModel[]>;
|