@umbraco-cms/backoffice 14.0.0--preview004-903b0a6a → 14.0.0--preview004-e1502383
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 +26 -11
- package/dist-cms/libs/observable-api/array-state.d.ts +2 -1
- package/dist-cms/libs/observable-api/array-state.js +11 -12
- package/dist-cms/mocks/data/data-type.data.js +17 -0
- package/dist-cms/packages/core/collection/collection-default.context.js +2 -2
- package/dist-cms/packages/core/components/index.d.ts +0 -1
- package/dist-cms/packages/core/components/index.js +0 -1
- package/dist-cms/packages/core/components/property-type-based-property/property-type-based-property.element.js +4 -4
- package/dist-cms/packages/core/data-type/components/index.d.ts +1 -0
- package/dist-cms/packages/core/data-type/components/index.js +1 -0
- package/dist-cms/packages/core/{components → data-type/components}/property-editor-config/property-editor-config.element.d.ts +1 -1
- package/dist-cms/packages/core/{components → data-type/components}/property-editor-config/property-editor-config.element.js +5 -5
- package/dist-cms/packages/core/data-type/components/ref-data-type/ref-data-type.element.js +1 -1
- package/dist-cms/packages/core/data-type/entity-actions/create/manifests.js +2 -2
- package/dist-cms/packages/core/data-type/entity-actions/manifests.js +3 -3
- package/dist-cms/packages/core/data-type/index.d.ts +1 -1
- package/dist-cms/packages/core/data-type/modals/data-type-picker-flow/data-type-picker-flow-data-type-picker-modal.element.js +1 -1
- package/dist-cms/packages/core/data-type/repository/copy/data-type-copy.repository.d.ts +3 -4
- package/dist-cms/packages/core/data-type/repository/copy/data-type-copy.repository.js +23 -14
- package/dist-cms/packages/core/data-type/repository/copy/data-type-copy.server.data-source.d.ts +3 -3
- package/dist-cms/packages/core/data-type/repository/copy/data-type-copy.server.data-source.js +9 -9
- package/dist-cms/packages/core/data-type/repository/detail/data-type-detail.repository.d.ts +4 -21
- package/dist-cms/packages/core/data-type/repository/detail/data-type-detail.repository.js +13 -84
- package/dist-cms/packages/core/data-type/repository/detail/data-type-detail.server.data-source.d.ts +60 -18
- package/dist-cms/packages/core/data-type/repository/detail/data-type-detail.server.data-source.js +76 -34
- package/dist-cms/packages/core/data-type/repository/detail/data-type-detail.store.d.ts +9 -15
- package/dist-cms/packages/core/data-type/repository/detail/data-type-detail.store.js +8 -17
- package/dist-cms/packages/core/data-type/repository/folder/data-type-folder.repository.d.ts +3 -6
- package/dist-cms/packages/core/data-type/repository/folder/data-type-folder.repository.js +25 -10
- package/dist-cms/packages/core/data-type/repository/move/data-type-move.repository.d.ts +3 -4
- package/dist-cms/packages/core/data-type/repository/move/data-type-move.repository.js +20 -11
- package/dist-cms/packages/core/data-type/repository/move/data-type-move.server.data-source.d.ts +4 -4
- package/dist-cms/packages/core/data-type/repository/move/data-type-move.server.data-source.js +10 -10
- package/dist-cms/packages/core/data-type/repository/utils.d.ts +10 -3
- package/dist-cms/packages/core/data-type/repository/utils.js +5 -15
- package/dist-cms/packages/core/data-type/tree/data-type-tree.repository.d.ts +1 -1
- package/dist-cms/packages/core/data-type/tree/data-type-tree.repository.js +1 -1
- package/dist-cms/packages/core/data-type/tree/data-type.tree.server.data.d.ts +26 -8
- package/dist-cms/packages/core/data-type/tree/data-type.tree.server.data.js +35 -16
- package/dist-cms/packages/core/data-type/tree/data-type.tree.store.d.ts +3 -2
- package/dist-cms/packages/core/data-type/tree/data-type.tree.store.js +23 -2
- package/dist-cms/packages/core/data-type/tree/manifests.js +2 -2
- package/dist-cms/packages/core/data-type/tree/types.d.ts +10 -2
- package/dist-cms/packages/core/data-type/types.d.ts +13 -0
- package/dist-cms/packages/core/data-type/variant-context/data-type-variant-context.d.ts +3 -3
- package/dist-cms/packages/core/data-type/variant-context/data-type-variant-context.js +1 -2
- package/dist-cms/packages/core/data-type/workspace/data-type-workspace.context.d.ts +8 -8
- package/dist-cms/packages/core/data-type/workspace/data-type-workspace.context.js +10 -10
- package/dist-cms/packages/core/data-type/workspace/data-type-workspace.element.js +6 -6
- package/dist-cms/packages/core/data-type/workspace/views/details/data-type-details-workspace-view.element.d.ts +2 -2
- package/dist-cms/packages/core/data-type/workspace/views/details/data-type-details-workspace-view.element.js +0 -1
- package/dist-cms/packages/core/data-type/workspace/views/info/workspace-view-data-type-info.element.d.ts +2 -2
- package/dist-cms/packages/core/data-type/workspace/views/info/workspace-view-data-type-info.element.js +2 -2
- package/dist-cms/packages/core/repository/detail/detail-data-source.interface.d.ts +12 -0
- package/dist-cms/packages/core/repository/detail/detail-data-source.interface.js +1 -0
- package/dist-cms/packages/core/repository/detail/detail-repository-base.d.ts +63 -0
- package/dist-cms/packages/core/repository/detail/detail-repository-base.js +120 -0
- package/dist-cms/packages/core/repository/detail/index.d.ts +2 -0
- package/dist-cms/packages/core/repository/detail/index.js +1 -0
- package/dist-cms/packages/core/repository/index.d.ts +1 -0
- package/dist-cms/packages/core/repository/index.js +1 -0
- package/dist-cms/packages/core/repository/repository-base.d.ts +1 -1
- package/dist-cms/packages/core/repository/repository-base.js +1 -0
- package/dist-cms/packages/core/repository/repository-items.manager.js +2 -2
- package/dist-cms/packages/core/store/detail-store-base.d.ts +25 -0
- package/dist-cms/packages/core/store/detail-store-base.js +26 -0
- package/dist-cms/packages/core/store/detail-store.interface.d.ts +8 -0
- package/dist-cms/packages/core/store/detail-store.interface.js +1 -0
- package/dist-cms/packages/core/store/events/index.d.ts +4 -0
- package/dist-cms/packages/core/store/events/index.js +4 -0
- package/dist-cms/packages/core/store/events/store-append.event.d.ts +5 -0
- package/dist-cms/packages/core/store/events/store-append.event.js +7 -0
- package/dist-cms/packages/core/store/events/store-remove.event.d.ts +5 -0
- package/dist-cms/packages/core/store/events/store-remove.event.js +7 -0
- package/dist-cms/packages/core/store/events/store-update.event.d.ts +5 -0
- package/dist-cms/packages/core/store/events/store-update.event.js +7 -0
- package/dist-cms/packages/core/store/events/store.event.d.ts +4 -0
- package/dist-cms/packages/core/store/events/store.event.js +7 -0
- package/dist-cms/packages/core/store/index.d.ts +3 -0
- package/dist-cms/packages/core/store/index.js +2 -0
- package/dist-cms/packages/core/store/store-base.d.ts +8 -1
- package/dist-cms/packages/core/store/store-base.js +21 -2
- package/dist-cms/packages/core/store/store-connector.d.ts +7 -0
- package/dist-cms/packages/core/store/store-connector.js +44 -0
- package/dist-cms/packages/core/store/store.interface.d.ts +6 -1
- package/dist-cms/packages/core/tree/index.d.ts +2 -0
- package/dist-cms/packages/core/tree/index.js +3 -0
- package/dist-cms/packages/core/tree/tree-item-base/tree-item-base.context.d.ts +3 -3
- package/dist-cms/packages/core/tree/tree-item-base/tree-item-base.context.js +19 -2
- package/dist-cms/packages/core/tree/tree-store.interface.d.ts +1 -2
- package/dist-cms/packages/core/tree/types.d.ts +3 -0
- package/dist-cms/packages/core/tree/unique-tree-item/index.d.ts +2 -0
- package/dist-cms/packages/core/tree/unique-tree-item/index.js +2 -0
- package/dist-cms/packages/core/tree/unique-tree-item/unique-tree-item.context.d.ts +6 -0
- package/dist-cms/packages/core/tree/unique-tree-item/unique-tree-item.context.js +6 -0
- package/dist-cms/packages/core/tree/unique-tree-item/unique-tree-item.element.d.ts +17 -0
- package/dist-cms/packages/core/tree/unique-tree-item/unique-tree-item.element.js +45 -0
- package/dist-cms/packages/core/tree/unique-tree-store.d.ts +36 -0
- package/dist-cms/packages/core/tree/unique-tree-store.js +37 -0
- package/dist-cms/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit-property.element.js +1 -1
- package/dist-cms/packages/log-viewer/workspace/logviewer.context.js +2 -2
- package/dist-cms/packages/media/media-types/workspace/views/design/media-type-workspace-view-edit-property.element.js +1 -1
- package/dist-cms/packages/user/current-user/current-user-history.store.d.ts +1 -0
- package/dist-cms/packages/user/current-user/current-user-history.store.js +7 -2
- package/dist-cms/packages/user/user-group/workspace/user-group-workspace.context.js +1 -1
- package/dist-cms/shared/utils/selection-manager.js +1 -1
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +12 -7
- package/examples/workspace-context-counter/counter-workspace-view.ts +3 -7
- package/package.json +1 -1
- package/dist-cms/packages/core/data-type/models.d.ts +0 -4
- package/dist-cms/packages/core/data-type/repository/data-type-repository-base.d.ts +0 -14
- package/dist-cms/packages/core/data-type/repository/data-type-repository-base.js +0 -24
- /package/dist-cms/packages/core/{components → data-type/components}/property-editor-config/index.d.ts +0 -0
- /package/dist-cms/packages/core/{components → data-type/components}/property-editor-config/index.js +0 -0
- /package/dist-cms/packages/core/data-type/{models.js → types.js} +0 -0
|
@@ -1956,17 +1956,6 @@
|
|
|
1956
1956
|
}
|
|
1957
1957
|
]
|
|
1958
1958
|
},
|
|
1959
|
-
{
|
|
1960
|
-
"name": "umb-property-editor-config",
|
|
1961
|
-
"path": "./../src/packages/core/components/property-editor-config/property-editor-config.element.ts",
|
|
1962
|
-
"properties": [
|
|
1963
|
-
{
|
|
1964
|
-
"name": "styles",
|
|
1965
|
-
"type": "array",
|
|
1966
|
-
"default": "[\"UmbTextStyles\"]"
|
|
1967
|
-
}
|
|
1968
|
-
]
|
|
1969
|
-
},
|
|
1970
1959
|
{
|
|
1971
1960
|
"name": "umb-property-type-based-property",
|
|
1972
1961
|
"path": "./../src/packages/core/components/property-type-based-property/property-type-based-property.element.ts",
|
|
@@ -2325,6 +2314,17 @@
|
|
|
2325
2314
|
}
|
|
2326
2315
|
]
|
|
2327
2316
|
},
|
|
2317
|
+
{
|
|
2318
|
+
"name": "umb-property-editor-config",
|
|
2319
|
+
"path": "./../src/packages/core/data-type/components/property-editor-config/property-editor-config.element.ts",
|
|
2320
|
+
"properties": [
|
|
2321
|
+
{
|
|
2322
|
+
"name": "styles",
|
|
2323
|
+
"type": "array",
|
|
2324
|
+
"default": "[\"UmbTextStyles\"]"
|
|
2325
|
+
}
|
|
2326
|
+
]
|
|
2327
|
+
},
|
|
2328
2328
|
{
|
|
2329
2329
|
"name": "umb-ref-data-type",
|
|
2330
2330
|
"path": "./../src/packages/core/data-type/components/ref-data-type/ref-data-type.element.ts",
|
|
@@ -4994,6 +4994,21 @@
|
|
|
4994
4994
|
}
|
|
4995
4995
|
]
|
|
4996
4996
|
},
|
|
4997
|
+
{
|
|
4998
|
+
"name": "umb-unique-tree-item",
|
|
4999
|
+
"path": "./../src/packages/core/tree/unique-tree-item/unique-tree-item.element.ts",
|
|
5000
|
+
"properties": [
|
|
5001
|
+
{
|
|
5002
|
+
"name": "item",
|
|
5003
|
+
"type": "UmbUniqueTreeItemModel | undefined"
|
|
5004
|
+
},
|
|
5005
|
+
{
|
|
5006
|
+
"name": "styles",
|
|
5007
|
+
"type": "array",
|
|
5008
|
+
"default": "[\"UmbTextStyles\",null]"
|
|
5009
|
+
}
|
|
5010
|
+
]
|
|
5011
|
+
},
|
|
4997
5012
|
{
|
|
4998
5013
|
"name": "umb-workspace-action-menu",
|
|
4999
5014
|
"path": "./../src/packages/core/workspace/workspace-action-menu/workspace-action-menu.element.ts",
|
|
@@ -10,7 +10,8 @@ import { UmbDeepState } from './deep-state.js';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare class UmbArrayState<T> extends UmbDeepState<T[]> {
|
|
12
12
|
#private;
|
|
13
|
-
|
|
13
|
+
readonly getUnique: (entry: T) => unknown;
|
|
14
|
+
constructor(initialData: T[], getUniqueMethod: (entry: T) => unknown);
|
|
14
15
|
/**
|
|
15
16
|
* @method sortBy
|
|
16
17
|
* @param {(a: T, b: T) => number} sortMethod - A method to be used for sorting everytime data is set.
|
|
@@ -11,11 +11,10 @@ import { pushToUniqueArray } from './push-to-unique-array.function.js';
|
|
|
11
11
|
* The ArrayState provides methods to append data when the data is an Object.
|
|
12
12
|
*/
|
|
13
13
|
export class UmbArrayState extends UmbDeepState {
|
|
14
|
-
#getUnique;
|
|
15
14
|
#sortMethod;
|
|
16
15
|
constructor(initialData, getUniqueMethod) {
|
|
17
16
|
super(initialData);
|
|
18
|
-
this
|
|
17
|
+
this.getUnique = getUniqueMethod;
|
|
19
18
|
}
|
|
20
19
|
/**
|
|
21
20
|
* @method sortBy
|
|
@@ -56,12 +55,12 @@ export class UmbArrayState extends UmbDeepState {
|
|
|
56
55
|
*/
|
|
57
56
|
remove(uniques) {
|
|
58
57
|
let next = this.getValue();
|
|
59
|
-
if (this
|
|
58
|
+
if (this.getUnique) {
|
|
60
59
|
uniques.forEach((unique) => {
|
|
61
60
|
next = next.filter((x) => {
|
|
62
61
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
63
62
|
// @ts-ignore
|
|
64
|
-
return this
|
|
63
|
+
return this.getUnique(x) !== unique;
|
|
65
64
|
});
|
|
66
65
|
});
|
|
67
66
|
this.next(next);
|
|
@@ -83,11 +82,11 @@ export class UmbArrayState extends UmbDeepState {
|
|
|
83
82
|
*/
|
|
84
83
|
removeOne(unique) {
|
|
85
84
|
let next = this.getValue();
|
|
86
|
-
if (this
|
|
85
|
+
if (this.getUnique) {
|
|
87
86
|
next = next.filter((x) => {
|
|
88
87
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
89
88
|
// @ts-ignore
|
|
90
|
-
return this
|
|
89
|
+
return this.getUnique(x) !== unique;
|
|
91
90
|
});
|
|
92
91
|
this.next(next);
|
|
93
92
|
}
|
|
@@ -133,8 +132,8 @@ export class UmbArrayState extends UmbDeepState {
|
|
|
133
132
|
*/
|
|
134
133
|
appendOne(entry) {
|
|
135
134
|
const next = [...this.getValue()];
|
|
136
|
-
if (this
|
|
137
|
-
pushToUniqueArray(next, entry, this
|
|
135
|
+
if (this.getUnique) {
|
|
136
|
+
pushToUniqueArray(next, entry, this.getUnique);
|
|
138
137
|
}
|
|
139
138
|
else {
|
|
140
139
|
next.push(entry);
|
|
@@ -159,10 +158,10 @@ export class UmbArrayState extends UmbDeepState {
|
|
|
159
158
|
* ]);
|
|
160
159
|
*/
|
|
161
160
|
append(entries) {
|
|
162
|
-
if (this
|
|
161
|
+
if (this.getUnique) {
|
|
163
162
|
const next = [...this.getValue()];
|
|
164
163
|
entries.forEach((entry) => {
|
|
165
|
-
pushToUniqueArray(next, entry, this
|
|
164
|
+
pushToUniqueArray(next, entry, this.getUnique);
|
|
166
165
|
});
|
|
167
166
|
this.next(next);
|
|
168
167
|
}
|
|
@@ -186,10 +185,10 @@ export class UmbArrayState extends UmbDeepState {
|
|
|
186
185
|
* myState.updateOne(2, {value: 'updated-bar'});
|
|
187
186
|
*/
|
|
188
187
|
updateOne(unique, entry) {
|
|
189
|
-
if (!this
|
|
188
|
+
if (!this.getUnique) {
|
|
190
189
|
throw new Error("Can't partial update an ArrayState without a getUnique method provided when constructed.");
|
|
191
190
|
}
|
|
192
|
-
this.next(partialUpdateFrozenArray(this.getValue(), entry, (x) => unique === this
|
|
191
|
+
this.next(partialUpdateFrozenArray(this.getValue(), entry, (x) => unique === this.getUnique(x)));
|
|
193
192
|
return this;
|
|
194
193
|
}
|
|
195
194
|
}
|
|
@@ -10,6 +10,14 @@ export const data = [
|
|
|
10
10
|
parentId: null,
|
|
11
11
|
isFolder: true,
|
|
12
12
|
},
|
|
13
|
+
{
|
|
14
|
+
type: 'data-type',
|
|
15
|
+
name: 'Folder 2',
|
|
16
|
+
id: 'dt-folder2',
|
|
17
|
+
parentId: null,
|
|
18
|
+
isFolder: true,
|
|
19
|
+
hasChildren: true,
|
|
20
|
+
},
|
|
13
21
|
{
|
|
14
22
|
type: 'data-type',
|
|
15
23
|
id: '0cc0eba1-9960-42c9-bf9b-60e150b429ae',
|
|
@@ -687,6 +695,15 @@ export const data = [
|
|
|
687
695
|
propertyEditorUiAlias: 'Umb.PropertyEditorUi.MemberGroupPicker',
|
|
688
696
|
values: [],
|
|
689
697
|
},
|
|
698
|
+
{
|
|
699
|
+
type: 'data-type',
|
|
700
|
+
name: 'Data Type in folder',
|
|
701
|
+
id: 'dt-data-type-in-folder',
|
|
702
|
+
parentId: 'dt-folder2',
|
|
703
|
+
propertyEditorAlias: 'Umbraco.MemberGroupPicker',
|
|
704
|
+
propertyEditorUiAlias: 'Umb.PropertyEditorUi.MemberGroupPicker',
|
|
705
|
+
values: [],
|
|
706
|
+
},
|
|
690
707
|
];
|
|
691
708
|
const createDataTypeItem = (item) => {
|
|
692
709
|
return {
|
|
@@ -18,13 +18,13 @@ export class UmbDefaultCollectionContext extends UmbBaseController {
|
|
|
18
18
|
#init;
|
|
19
19
|
constructor(host, config = { pageSize: 50 }) {
|
|
20
20
|
super(host);
|
|
21
|
-
this.#items = new UmbArrayState([]);
|
|
21
|
+
this.#items = new UmbArrayState([], (x) => x);
|
|
22
22
|
this.items = this.#items.asObservable();
|
|
23
23
|
this.#totalItems = new UmbNumberState(0);
|
|
24
24
|
this.totalItems = this.#totalItems.asObservable();
|
|
25
25
|
this.#filter = new UmbObjectState({});
|
|
26
26
|
this.filter = this.#filter.asObservable();
|
|
27
|
-
this.#views = new UmbArrayState([]);
|
|
27
|
+
this.#views = new UmbArrayState([], (x) => x.alias);
|
|
28
28
|
this.views = this.#views.asObservable();
|
|
29
29
|
this.#currentView = new UmbObjectState(undefined);
|
|
30
30
|
this.currentView = this.#currentView.asObservable();
|
|
@@ -25,7 +25,6 @@ export * from './input-section/index.js';
|
|
|
25
25
|
export * from './input-slider/index.js';
|
|
26
26
|
export * from './input-toggle/index.js';
|
|
27
27
|
export * from './input-upload-field/index.js';
|
|
28
|
-
export * from './property-editor-config/index.js';
|
|
29
28
|
export * from './property-type-based-property/index.js';
|
|
30
29
|
export * from './ref-property-editor-ui/index.js';
|
|
31
30
|
export * from './table/index.js';
|
|
@@ -27,7 +27,6 @@ export * from './input-section/index.js';
|
|
|
27
27
|
export * from './input-slider/index.js';
|
|
28
28
|
export * from './input-toggle/index.js';
|
|
29
29
|
export * from './input-upload-field/index.js';
|
|
30
|
-
export * from './property-editor-config/index.js';
|
|
31
30
|
export * from './property-type-based-property/index.js';
|
|
32
31
|
export * from './ref-property-editor-ui/index.js';
|
|
33
32
|
export * from './table/index.js';
|
|
@@ -24,12 +24,12 @@ export let UmbPropertyTypeBasedPropertyElement = class UmbPropertyTypeBasedPrope
|
|
|
24
24
|
this._observeDataType(this._property?.dataTypeId);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
async _observeDataType(
|
|
27
|
+
async _observeDataType(dataTypeUnique) {
|
|
28
28
|
this._dataTypeObserver?.destroy();
|
|
29
|
-
if (
|
|
29
|
+
if (dataTypeUnique) {
|
|
30
30
|
// Its not technically needed to have await here, this is only to ensure that the data is loaded before we observe it, and thereby only updating the DOM with the latest data.
|
|
31
|
-
await this._dataTypeDetailRepository.
|
|
32
|
-
this._dataTypeObserver = this.observe(await this._dataTypeDetailRepository.
|
|
31
|
+
await this._dataTypeDetailRepository.requestByUnique(dataTypeUnique);
|
|
32
|
+
this._dataTypeObserver = this.observe(await this._dataTypeDetailRepository.byUnique(dataTypeUnique), (dataType) => {
|
|
33
33
|
this._dataTypeData = dataType?.values;
|
|
34
34
|
this._propertyEditorUiAlias = dataType?.propertyEditorUiAlias || undefined;
|
|
35
35
|
// If there is no UI, we will look up the Property editor model to find the default UI alias:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UmbLitElement } from '
|
|
1
|
+
import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* @element umb-property-editor-config
|
|
4
4
|
* @description - Element for displaying the configuration for a Property Editor based on a Property Editor UI Alias and a Property Editor Model alias.
|
|
@@ -4,10 +4,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { html, customElement, state, ifDefined, repeat } from '
|
|
8
|
-
import { UmbTextStyles } from '
|
|
9
|
-
import { UmbLitElement } from '
|
|
10
|
-
import { UMB_DATA_TYPE_VARIANT_CONTEXT } from '../../
|
|
7
|
+
import { html, customElement, state, ifDefined, repeat } from '../../../../../external/lit/index.js';
|
|
8
|
+
import { UmbTextStyles } from '../../../../../shared/style/index.js';
|
|
9
|
+
import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
|
|
10
|
+
import { UMB_DATA_TYPE_VARIANT_CONTEXT } from '../../index.js';
|
|
11
11
|
/**
|
|
12
12
|
* @element umb-property-editor-config
|
|
13
13
|
* @description - Element for displaying the configuration for a Property Editor based on a Property Editor UI Alias and a Property Editor Model alias.
|
|
@@ -32,7 +32,7 @@ export let UmbPropertyEditorConfigElement = class UmbPropertyEditorConfigElement
|
|
|
32
32
|
}, 'observeProperties');
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
|
-
return this._properties
|
|
35
|
+
return this._properties?.length > 0
|
|
36
36
|
? repeat(this._properties, (property) => property.alias, (property) => html `<umb-workspace-property
|
|
37
37
|
label="${property.label}"
|
|
38
38
|
description="${ifDefined(property.description)}"
|
|
@@ -35,7 +35,7 @@ export let UmbRefDataTypeElement = class UmbRefDataTypeElement extends UmbElemen
|
|
|
35
35
|
}
|
|
36
36
|
async setDataTypeId(value) {
|
|
37
37
|
if (value) {
|
|
38
|
-
this.observe((await this.repository.
|
|
38
|
+
this.observe((await this.repository.requestByUnique(value)).asObservable(), (dataType) => {
|
|
39
39
|
if (dataType) {
|
|
40
40
|
this.name = dataType.name ?? '';
|
|
41
41
|
this.propertyEditorUiAlias = dataType.propertyEditorUiAlias ?? '';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UMB_DATA_TYPE_FOLDER_ENTITY_TYPE, UMB_DATA_TYPE_ROOT_ENTITY_TYPE, } from '../../entity.js';
|
|
2
2
|
import { UMB_DATA_TYPE_DETAIL_REPOSITORY_ALIAS } from '../../repository/detail/manifests.js';
|
|
3
3
|
import { UmbCreateDataTypeEntityAction } from './create.action.js';
|
|
4
4
|
const entityActions = [
|
|
@@ -12,7 +12,7 @@ const entityActions = [
|
|
|
12
12
|
icon: 'icon-add',
|
|
13
13
|
label: 'Create...',
|
|
14
14
|
repositoryAlias: UMB_DATA_TYPE_DETAIL_REPOSITORY_ALIAS,
|
|
15
|
-
entityTypes: [
|
|
15
|
+
entityTypes: [UMB_DATA_TYPE_ROOT_ENTITY_TYPE, UMB_DATA_TYPE_FOLDER_ENTITY_TYPE],
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
{
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { UMB_DATA_TYPE_FOLDER_ENTITY_TYPE, UMB_DATA_TYPE_ENTITY_TYPE } from '../entity.js';
|
|
2
2
|
import { UMB_DATA_TYPE_DETAIL_REPOSITORY_ALIAS } from '../repository/detail/manifests.js';
|
|
3
|
+
import { UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS } from '../repository/folder/manifests.js';
|
|
3
4
|
import { manifests as createManifests } from './create/manifests.js';
|
|
4
5
|
import { manifests as moveManifests } from './move/manifests.js';
|
|
5
6
|
import { manifests as copyManifests } from './copy/manifests.js';
|
|
6
7
|
import { UmbDeleteEntityAction, UmbDeleteFolderEntityAction, UmbFolderUpdateEntityAction, } from '../../entity-action/index.js';
|
|
7
|
-
import { UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS } from '../repository/folder/manifests.js';
|
|
8
8
|
const entityActions = [
|
|
9
9
|
{
|
|
10
10
|
type: 'entityAction',
|
|
@@ -29,7 +29,7 @@ const entityActions = [
|
|
|
29
29
|
icon: 'icon-trash',
|
|
30
30
|
label: 'Delete Folder...',
|
|
31
31
|
repositoryAlias: UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS,
|
|
32
|
-
entityTypes: [
|
|
32
|
+
entityTypes: [UMB_DATA_TYPE_FOLDER_ENTITY_TYPE],
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
{
|
|
@@ -42,7 +42,7 @@ const entityActions = [
|
|
|
42
42
|
icon: 'icon-edit',
|
|
43
43
|
label: 'Rename Folder...',
|
|
44
44
|
repositoryAlias: UMB_DATA_TYPE_FOLDER_REPOSITORY_ALIAS,
|
|
45
|
-
entityTypes: [
|
|
45
|
+
entityTypes: [UMB_DATA_TYPE_FOLDER_ENTITY_TYPE],
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
48
|
];
|
|
@@ -30,7 +30,7 @@ export let UmbDataTypePickerFlowDataTypePickerModalElement = class UmbDataTypePi
|
|
|
30
30
|
return;
|
|
31
31
|
await Promise.all(data.items.map((item) => {
|
|
32
32
|
if (item.id) {
|
|
33
|
-
return dataTypeDetailRepository.
|
|
33
|
+
return dataTypeDetailRepository.requestByUnique(item.id);
|
|
34
34
|
}
|
|
35
35
|
return Promise.resolve();
|
|
36
36
|
}));
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { UmbDataTypeRepositoryBase } from '../data-type-repository-base.js';
|
|
2
1
|
import type { UmbControllerHost } from '../../../../../libs/controller-api/index.js';
|
|
3
|
-
import { UmbCopyRepository } from '../../../repository/index.js';
|
|
4
|
-
export declare class UmbCopyDataTypeRepository extends
|
|
2
|
+
import { UmbCopyRepository, UmbRepositoryBase } from '../../../repository/index.js';
|
|
3
|
+
export declare class UmbCopyDataTypeRepository extends UmbRepositoryBase implements UmbCopyRepository {
|
|
5
4
|
#private;
|
|
6
5
|
constructor(host: UmbControllerHost);
|
|
7
|
-
copy(
|
|
6
|
+
copy(unique: string, targetUnique: string | null): Promise<{
|
|
8
7
|
error: import("../../../../../external/backend-api/index.js").ApiError | import("../../../../../external/backend-api/index.js").CancelError;
|
|
9
8
|
data?: undefined;
|
|
10
9
|
} | {
|
|
@@ -1,32 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UMB_DATA_TYPE_TREE_STORE_CONTEXT } from '../../tree/data-type.tree.store.js';
|
|
2
2
|
import { UmbDataTypeDetailRepository } from '../detail/data-type-detail.repository.js';
|
|
3
3
|
import { UmbDataTypeCopyServerDataSource } from './data-type-copy.server.data-source.js';
|
|
4
|
-
|
|
4
|
+
import { UMB_NOTIFICATION_CONTEXT_TOKEN } from '../../../notification/index.js';
|
|
5
|
+
import { UmbRepositoryBase } from '../../../repository/index.js';
|
|
6
|
+
export class UmbCopyDataTypeRepository extends UmbRepositoryBase {
|
|
7
|
+
#init;
|
|
5
8
|
#copySource;
|
|
6
9
|
#detailRepository;
|
|
10
|
+
#treeStore;
|
|
11
|
+
#notificationContext;
|
|
7
12
|
constructor(host) {
|
|
8
13
|
super(host);
|
|
9
14
|
this.#copySource = new UmbDataTypeCopyServerDataSource(this);
|
|
10
15
|
this.#detailRepository = new UmbDataTypeDetailRepository(this);
|
|
16
|
+
this.#init = Promise.all([
|
|
17
|
+
this.consumeContext(UMB_DATA_TYPE_TREE_STORE_CONTEXT, (instance) => {
|
|
18
|
+
this.#treeStore = instance;
|
|
19
|
+
}).asPromise(),
|
|
20
|
+
this.consumeContext(UMB_NOTIFICATION_CONTEXT_TOKEN, (instance) => {
|
|
21
|
+
this.#notificationContext = instance;
|
|
22
|
+
}).asPromise(),
|
|
23
|
+
]);
|
|
11
24
|
}
|
|
12
|
-
async copy(
|
|
13
|
-
await this
|
|
14
|
-
const { data:
|
|
25
|
+
async copy(unique, targetUnique) {
|
|
26
|
+
await this.#init;
|
|
27
|
+
const { data: dataTypeCopyUnique, error } = await this.#copySource.copy(unique, targetUnique);
|
|
15
28
|
if (error)
|
|
16
29
|
return { error };
|
|
17
|
-
if (
|
|
18
|
-
const { data: dataTypeCopy } = await this.#detailRepository.
|
|
30
|
+
if (dataTypeCopyUnique) {
|
|
31
|
+
const { data: dataTypeCopy } = await this.#detailRepository.requestByUnique(dataTypeCopyUnique);
|
|
19
32
|
if (!dataTypeCopy)
|
|
20
33
|
throw new Error('Could not find copied data type');
|
|
21
34
|
// TODO: Be aware about this responsibility.
|
|
22
|
-
this.
|
|
23
|
-
// only update the target if its not the root
|
|
24
|
-
if (targetId) {
|
|
25
|
-
this._treeStore.updateItem(targetId, { hasChildren: true });
|
|
26
|
-
}
|
|
35
|
+
this.#treeStore.append(dataTypeCopy);
|
|
27
36
|
const notification = { data: { message: `Data type copied` } };
|
|
28
|
-
this.
|
|
37
|
+
this.#notificationContext.peek('positive', notification);
|
|
29
38
|
}
|
|
30
|
-
return { data:
|
|
39
|
+
return { data: dataTypeCopyUnique };
|
|
31
40
|
}
|
|
32
41
|
}
|
package/dist-cms/packages/core/data-type/repository/copy/data-type-copy.server.data-source.d.ts
CHANGED
|
@@ -14,10 +14,10 @@ export declare class UmbDataTypeCopyServerDataSource implements UmbCopyDataSourc
|
|
|
14
14
|
*/
|
|
15
15
|
constructor(host: UmbControllerHost);
|
|
16
16
|
/**
|
|
17
|
-
* Copy an item for the given
|
|
18
|
-
* @param {Array<string>}
|
|
17
|
+
* Copy an item for the given unique to the target unique
|
|
18
|
+
* @param {Array<string>} unique
|
|
19
19
|
* @return {*}
|
|
20
20
|
* @memberof UmbDataTypeCopyServerDataSource
|
|
21
21
|
*/
|
|
22
|
-
copy(
|
|
22
|
+
copy(unique: string, targetUnique: string | null): Promise<import("../../../repository/index.js").DataSourceResponse<string>>;
|
|
23
23
|
}
|
package/dist-cms/packages/core/data-type/repository/copy/data-type-copy.server.data-source.js
CHANGED
|
@@ -16,20 +16,20 @@ export class UmbDataTypeCopyServerDataSource {
|
|
|
16
16
|
this.#host = host;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* Copy an item for the given
|
|
20
|
-
* @param {Array<string>}
|
|
19
|
+
* Copy an item for the given unique to the target unique
|
|
20
|
+
* @param {Array<string>} unique
|
|
21
21
|
* @return {*}
|
|
22
22
|
* @memberof UmbDataTypeCopyServerDataSource
|
|
23
23
|
*/
|
|
24
|
-
async copy(
|
|
25
|
-
if (!
|
|
26
|
-
throw new Error('
|
|
27
|
-
if (
|
|
28
|
-
throw new Error('Target
|
|
24
|
+
async copy(unique, targetUnique) {
|
|
25
|
+
if (!unique)
|
|
26
|
+
throw new Error('Unique is missing');
|
|
27
|
+
if (targetUnique === undefined)
|
|
28
|
+
throw new Error('Target unique is missing');
|
|
29
29
|
return tryExecuteAndNotify(this.#host, DataTypeResource.postDataTypeByIdCopy({
|
|
30
|
-
id,
|
|
30
|
+
id: unique,
|
|
31
31
|
requestBody: {
|
|
32
|
-
targetId,
|
|
32
|
+
targetId: targetUnique,
|
|
33
33
|
},
|
|
34
34
|
}));
|
|
35
35
|
}
|
|
@@ -1,25 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { UmbDetailRepository } from '../../../repository/index.js';
|
|
1
|
+
import { UmbDataTypeDetailModel } from '../../types.js';
|
|
3
2
|
import { type UmbControllerHost } from '../../../../../libs/controller-api/index.js';
|
|
4
|
-
import {
|
|
5
|
-
export declare class UmbDataTypeDetailRepository extends
|
|
3
|
+
import { UmbDetailRepositoryBase } from '../../../repository/index.js';
|
|
4
|
+
export declare class UmbDataTypeDetailRepository extends UmbDetailRepositoryBase<UmbDataTypeDetailModel> {
|
|
6
5
|
#private;
|
|
7
6
|
constructor(host: UmbControllerHost);
|
|
8
|
-
|
|
9
|
-
requestById(id: string): Promise<{
|
|
10
|
-
data: DataTypeResponseModel | undefined;
|
|
11
|
-
error: import("../../../../../external/backend-api/index.js").ApiError | import("../../../../../external/backend-api/index.js").CancelError | undefined;
|
|
12
|
-
asObservable: () => import("rxjs").Observable<DataTypeResponseModel | undefined>;
|
|
13
|
-
}>;
|
|
14
|
-
byId(id: string): Promise<import("rxjs").Observable<DataTypeResponseModel | undefined>>;
|
|
15
|
-
byPropertyEditorUiAlias(propertyEditorUiAlias: string): Promise<import("rxjs").Observable<DataTypeResponseModel[]>>;
|
|
16
|
-
create(dataType: CreateDataTypeRequestModel): Promise<{
|
|
17
|
-
error: import("../../../../../external/backend-api/index.js").ApiError | import("../../../../../external/backend-api/index.js").CancelError | undefined;
|
|
18
|
-
}>;
|
|
19
|
-
save(id: string, updatedDataType: UpdateDataTypeRequestModel): Promise<{
|
|
20
|
-
error: import("../../../../../external/backend-api/index.js").ApiError | import("../../../../../external/backend-api/index.js").CancelError | undefined;
|
|
21
|
-
}>;
|
|
22
|
-
delete(id: string): Promise<{
|
|
23
|
-
error: import("../../../../../external/backend-api/index.js").ApiError | import("../../../../../external/backend-api/index.js").CancelError | undefined;
|
|
24
|
-
}>;
|
|
7
|
+
byPropertyEditorUiAlias(propertyEditorUiAlias: string): Promise<import("rxjs").Observable<any[]>>;
|
|
25
8
|
}
|
|
@@ -1,92 +1,21 @@
|
|
|
1
|
-
import { UmbDataTypeRepositoryBase } from '../data-type-repository-base.js';
|
|
2
|
-
import { createTreeItem } from '../utils.js';
|
|
3
1
|
import { UmbDataTypeServerDataSource } from './data-type-detail.server.data-source.js';
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { UMB_DATA_TYPE_DETAIL_STORE_CONTEXT } from './data-type-detail.store.js';
|
|
3
|
+
import { UmbDetailRepositoryBase } from '../../../repository/index.js';
|
|
4
|
+
export class UmbDataTypeDetailRepository extends UmbDetailRepositoryBase {
|
|
5
|
+
#init;
|
|
6
|
+
#detailStore;
|
|
6
7
|
constructor(host) {
|
|
7
|
-
super(host);
|
|
8
|
-
this.#
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
await this._init;
|
|
14
|
-
return this.#detailSource.createScaffold(parentId);
|
|
15
|
-
}
|
|
16
|
-
async requestById(id) {
|
|
17
|
-
if (!id)
|
|
18
|
-
throw new Error('Key is missing');
|
|
19
|
-
await this._init;
|
|
20
|
-
const { data, error } = await this.#detailSource.read(id);
|
|
21
|
-
if (data) {
|
|
22
|
-
this._detailStore.append(data);
|
|
23
|
-
}
|
|
24
|
-
return { data, error, asObservable: () => this._detailStore.byId(id) };
|
|
25
|
-
}
|
|
26
|
-
async byId(id) {
|
|
27
|
-
if (!id)
|
|
28
|
-
throw new Error('Key is missing');
|
|
29
|
-
await this._init;
|
|
30
|
-
return this._detailStore.byId(id);
|
|
8
|
+
super(host, UmbDataTypeServerDataSource, UMB_DATA_TYPE_DETAIL_STORE_CONTEXT);
|
|
9
|
+
this.#init = Promise.all([
|
|
10
|
+
this.consumeContext(UMB_DATA_TYPE_DETAIL_STORE_CONTEXT, (instance) => {
|
|
11
|
+
this.#detailStore = instance;
|
|
12
|
+
}).asPromise(),
|
|
13
|
+
]);
|
|
31
14
|
}
|
|
32
15
|
async byPropertyEditorUiAlias(propertyEditorUiAlias) {
|
|
33
16
|
if (!propertyEditorUiAlias)
|
|
34
17
|
throw new Error('propertyEditorUiAlias is missing');
|
|
35
|
-
await this
|
|
36
|
-
return this.
|
|
37
|
-
}
|
|
38
|
-
async create(dataType) {
|
|
39
|
-
if (!dataType)
|
|
40
|
-
throw new Error('Data Type is missing');
|
|
41
|
-
if (!dataType.id)
|
|
42
|
-
throw new Error('Data Type id is missing');
|
|
43
|
-
await this._init;
|
|
44
|
-
const { error } = await this.#detailSource.create(dataType);
|
|
45
|
-
if (!error) {
|
|
46
|
-
// TODO: We need to push a new item to the tree store to update the tree. How do we want to create the tree items?
|
|
47
|
-
const treeItem = createTreeItem(dataType);
|
|
48
|
-
this._treeStore.appendItems([treeItem]);
|
|
49
|
-
//this.#detailStore?.append(dataType);
|
|
50
|
-
const notification = { data: { message: `Data Type created` } };
|
|
51
|
-
this._notificationContext.peek('positive', notification);
|
|
52
|
-
}
|
|
53
|
-
return { error };
|
|
54
|
-
}
|
|
55
|
-
async save(id, updatedDataType) {
|
|
56
|
-
if (!id)
|
|
57
|
-
throw new Error('Data Type id is missing');
|
|
58
|
-
if (!updatedDataType)
|
|
59
|
-
throw new Error('Data Type is missing');
|
|
60
|
-
await this._init;
|
|
61
|
-
const { error } = await this.#detailSource.update(id, updatedDataType);
|
|
62
|
-
if (!error) {
|
|
63
|
-
// TODO: we currently don't use the detail store for anything.
|
|
64
|
-
// Consider to look up the data before fetching from the server
|
|
65
|
-
// Consider notify a workspace if a template is updated in the store while someone is editing it.
|
|
66
|
-
this._detailStore.updateItem(id, updatedDataType);
|
|
67
|
-
// TODO: This is parsing on the full models to the tree and item store. Those should only contain the data they need. I don't know, at this point, if thats a repository or store responsibility.
|
|
68
|
-
this._treeStore.updateItem(id, updatedDataType);
|
|
69
|
-
this._itemStore.updateItem(id, updatedDataType);
|
|
70
|
-
const notification = { data: { message: `Data Type saved` } };
|
|
71
|
-
this._notificationContext.peek('positive', notification);
|
|
72
|
-
}
|
|
73
|
-
return { error };
|
|
74
|
-
}
|
|
75
|
-
async delete(id) {
|
|
76
|
-
if (!id)
|
|
77
|
-
throw new Error('Data Type id is missing');
|
|
78
|
-
await this._init;
|
|
79
|
-
const { error } = await this.#detailSource.delete(id);
|
|
80
|
-
if (!error) {
|
|
81
|
-
// TODO: we currently don't use the detail store for anything.
|
|
82
|
-
// Consider to look up the data before fetching from the server.
|
|
83
|
-
// Consider notify a workspace if a template is deleted from the store while someone is editing it.
|
|
84
|
-
this._detailStore.removeItem(id);
|
|
85
|
-
this._treeStore.removeItem(id);
|
|
86
|
-
this._itemStore.removeItem(id);
|
|
87
|
-
const notification = { data: { message: `Data Type deleted` } };
|
|
88
|
-
this._notificationContext.peek('positive', notification);
|
|
89
|
-
}
|
|
90
|
-
return { error };
|
|
18
|
+
await this.#init;
|
|
19
|
+
return this.#detailStore.withPropertyEditorUiAlias(propertyEditorUiAlias);
|
|
91
20
|
}
|
|
92
21
|
}
|