@umbraco-cms/backoffice 14.0.0--preview004-e91a3686 → 14.0.0--preview004-bf106bcf
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/backoffice/backoffice.element.js +1 -0
- package/dist-cms/assets/lang/da-dk.js +2 -0
- package/dist-cms/assets/lang/da-dk.ts +2 -0
- package/dist-cms/assets/lang/en-us.js +2 -0
- package/dist-cms/assets/lang/en-us.ts +2 -0
- package/dist-cms/custom-elements.json +96 -62
- package/dist-cms/mocks/browser-handlers.js +4 -1
- package/dist-cms/mocks/data/object-type/object-type.data.d.ts +8 -0
- package/dist-cms/mocks/data/object-type/object-type.data.js +28 -0
- package/dist-cms/mocks/data/{relation-type.data.d.ts → relations/relation-type.data.d.ts} +2 -2
- package/dist-cms/mocks/data/{relation-type.data.js → relations/relation-type.data.js} +2 -2
- package/dist-cms/mocks/data/relations/relation.data.d.ts +12 -0
- package/dist-cms/mocks/data/relations/relation.data.js +104 -0
- package/dist-cms/mocks/handlers/object-type/index.js +2 -0
- package/dist-cms/mocks/handlers/object-type/item.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/object-type/item.handlers.js +10 -0
- package/dist-cms/mocks/handlers/object-type/slug.d.ts +1 -0
- package/dist-cms/mocks/handlers/object-type/slug.js +1 -0
- package/dist-cms/mocks/handlers/relations/index.d.ts +2 -0
- package/dist-cms/mocks/handlers/relations/index.js +2 -0
- package/dist-cms/mocks/handlers/relations/relation/index.d.ts +1 -0
- package/dist-cms/mocks/handlers/relations/relation/index.js +2 -0
- package/dist-cms/mocks/handlers/relations/relation/item.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/relations/relation/item.handlers.js +13 -0
- package/dist-cms/mocks/handlers/relations/relation/slug.d.ts +1 -0
- package/dist-cms/mocks/handlers/relations/relation/slug.js +1 -0
- package/dist-cms/mocks/handlers/relations/relation-type/detail.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/relations/relation-type/detail.handlers.js +41 -0
- package/dist-cms/mocks/handlers/relations/relation-type/index.d.ts +1 -0
- package/dist-cms/mocks/handlers/relations/relation-type/index.js +3 -0
- package/dist-cms/mocks/handlers/relations/relation-type/slug.d.ts +1 -0
- package/dist-cms/mocks/handlers/relations/relation-type/slug.js +1 -0
- package/dist-cms/mocks/handlers/relations/relation-type/tree.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/relations/relation-type/tree.handlers.js +32 -0
- package/dist-cms/packages/core/components/input-start-node/input-start-node.element.d.ts +11 -3
- package/dist-cms/packages/core/components/input-start-node/input-start-node.element.js +26 -16
- package/dist-cms/packages/core/index.d.ts +1 -0
- package/dist-cms/packages/core/index.js +1 -0
- package/dist-cms/packages/core/object-type/index.d.ts +2 -0
- package/dist-cms/packages/core/object-type/index.js +2 -0
- package/dist-cms/packages/core/object-type/input-object-type.element.d.ts +20 -0
- package/dist-cms/packages/core/object-type/input-object-type.element.js +53 -0
- package/dist-cms/packages/core/object-type/object-type.repository.d.ts +11 -0
- package/dist-cms/packages/core/object-type/object-type.repository.js +17 -0
- package/dist-cms/packages/core/property-editor/uis/tree-picker/config/start-node/property-editor-ui-tree-picker-start-node.element.js +5 -3
- package/dist-cms/packages/documents/documents/components/index.d.ts +1 -0
- package/dist-cms/packages/documents/documents/components/index.js +1 -0
- package/dist-cms/packages/documents/documents/components/input-document-picker-root/input-document-picker-root.element.d.ts +19 -0
- package/dist-cms/packages/documents/documents/components/input-document-picker-root/input-document-picker-root.element.js +93 -0
- package/dist-cms/packages/members/member-types/workspace/member-type-workspace.context.js +1 -1
- package/dist-cms/packages/relations/index.d.ts +3 -0
- package/dist-cms/packages/relations/index.js +3 -0
- package/dist-cms/packages/relations/manifests.d.ts +1 -0
- package/dist-cms/packages/relations/manifests.js +3 -0
- package/dist-cms/packages/relations/relation-types/entity-actions/create.action.d.ts +7 -0
- package/dist-cms/packages/relations/relation-types/entity-actions/create.action.js +11 -0
- package/dist-cms/packages/relations/relation-types/entity-actions/manifests.d.ts +2 -0
- package/dist-cms/packages/relations/relation-types/entity-actions/manifests.js +32 -0
- package/dist-cms/packages/{settings → relations}/relation-types/index.d.ts +1 -0
- package/dist-cms/packages/{settings → relations}/relation-types/index.js +1 -0
- package/dist-cms/packages/relations/relation-types/manifests.d.ts +1 -0
- package/dist-cms/packages/{settings → relations}/relation-types/manifests.js +8 -1
- package/dist-cms/packages/{settings → relations}/relation-types/repository/manifests.js +1 -1
- package/dist-cms/packages/{settings → relations}/relation-types/repository/relation-type.repository.d.ts +4 -0
- package/dist-cms/packages/{settings → relations}/relation-types/repository/relation-type.repository.js +10 -0
- package/dist-cms/packages/{settings → relations}/relation-types/repository/sources/relation-type.server.data.d.ts +7 -0
- package/dist-cms/packages/{settings → relations}/relation-types/repository/sources/relation-type.server.data.js +25 -4
- package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace.context.d.ts +4 -0
- package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace.context.js +10 -3
- package/dist-cms/packages/{settings → relations}/relation-types/workspace/views/relation/workspace-view-relation-type-relation.element.d.ts +3 -1
- package/dist-cms/packages/{settings → relations}/relation-types/workspace/views/relation/workspace-view-relation-type-relation.element.js +16 -69
- package/dist-cms/packages/{settings → relations}/relation-types/workspace/views/relation-type/relation-type-workspace-view-relation-type.element.js +17 -5
- package/dist-cms/packages/relations/relations/entities.d.ts +1 -0
- package/dist-cms/packages/relations/relations/entities.js +1 -0
- package/dist-cms/packages/relations/relations/index.d.ts +2 -0
- package/dist-cms/packages/relations/relations/index.js +2 -0
- package/dist-cms/packages/relations/relations/manifests.d.ts +1 -0
- package/dist-cms/packages/relations/relations/manifests.js +2 -0
- package/dist-cms/packages/relations/relations/repository/index.d.ts +1 -0
- package/dist-cms/packages/relations/relations/repository/index.js +1 -0
- package/dist-cms/packages/relations/relations/repository/manifests.d.ts +3 -0
- package/dist-cms/packages/relations/relations/repository/manifests.js +9 -0
- package/dist-cms/packages/relations/relations/repository/relation.repository.d.ts +15 -0
- package/dist-cms/packages/relations/relations/repository/relation.repository.js +38 -0
- package/dist-cms/packages/relations/relations/repository/sources/relation.server.data.d.ts +30 -0
- package/dist-cms/packages/relations/relations/repository/sources/relation.server.data.js +48 -0
- package/dist-cms/packages/relations/umbraco-package.d.ts +7 -0
- package/dist-cms/packages/relations/umbraco-package.js +9 -0
- package/dist-cms/packages/settings/manifests.js +0 -2
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +47 -30
- package/package.json +3 -2
- package/dist-cms/mocks/handlers/relation-type.handlers.js +0 -66
- package/dist-cms/packages/settings/relation-types/manifests.d.ts +0 -1
- /package/dist-cms/mocks/handlers/{relation-type.handlers.d.ts → object-type/index.d.ts} +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/entities.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/entities.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/menu-item/manifests.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/menu-item/manifests.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/repository/index.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/repository/index.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/repository/manifests.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/repository/relation-type.store.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/repository/relation-type.store.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/index.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/index.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/manifests.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/manifests.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.repository.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.repository.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.server.data-source.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.server.data-source.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.store.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/relation-type-tree.store.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/types.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/tree/types.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/workspace/manifests.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/workspace/manifests.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace-editor.element.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace-editor.element.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace.element.d.ts +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/workspace/relation-type-workspace.element.js +0 -0
- /package/dist-cms/packages/{settings → relations}/relation-types/workspace/views/relation-type/relation-type-workspace-view-relation-type.element.d.ts +0 -0
|
@@ -7,23 +7,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { html, customElement, property, css, state } from '../../../../external/lit/index.js';
|
|
8
8
|
import { FormControlMixin } from '../../../../external/uui/index.js';
|
|
9
9
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
10
|
-
import { UmbChangeEvent } from '../../event/index.js';
|
|
11
10
|
let UmbInputStartNodeElement = class UmbInputStartNodeElement extends FormControlMixin(UmbLitElement) {
|
|
12
11
|
constructor() {
|
|
13
12
|
super(...arguments);
|
|
14
13
|
this._type = 'content';
|
|
15
|
-
this.nodeId = '';
|
|
16
|
-
this.dynamicPath = '';
|
|
17
14
|
this._options = [
|
|
18
15
|
{ value: 'content', name: 'Content' },
|
|
19
|
-
{ value: 'member', name: 'Members' },
|
|
20
16
|
{ value: 'media', name: 'Media' },
|
|
17
|
+
{ value: 'member', name: 'Members' },
|
|
21
18
|
];
|
|
22
19
|
}
|
|
23
20
|
getFormElement() {
|
|
24
21
|
return undefined;
|
|
25
22
|
}
|
|
26
23
|
set type(value) {
|
|
24
|
+
if (value === undefined) {
|
|
25
|
+
value = this._type;
|
|
26
|
+
}
|
|
27
27
|
const oldValue = this._type;
|
|
28
28
|
this._options = this._options.map((option) => option.value === value ? { ...option, selected: true } : { ...option, selected: false });
|
|
29
29
|
this._type = value;
|
|
@@ -33,15 +33,25 @@ let UmbInputStartNodeElement = class UmbInputStartNodeElement extends FormContro
|
|
|
33
33
|
return this._type;
|
|
34
34
|
}
|
|
35
35
|
#onTypeChange(event) {
|
|
36
|
+
//console.log('onTypeChange');
|
|
36
37
|
this.type = event.target.value;
|
|
37
|
-
// Clear others
|
|
38
38
|
this.nodeId = '';
|
|
39
|
-
|
|
40
|
-
this.dispatchEvent(new UmbChangeEvent());
|
|
39
|
+
// TODO: Appears that the event gets bubbled up. Will need to review. [LK]
|
|
40
|
+
//this.dispatchEvent(new UmbChangeEvent());
|
|
41
41
|
}
|
|
42
42
|
#onIdChange(event) {
|
|
43
|
-
|
|
44
|
-
this.
|
|
43
|
+
//console.log('onIdChange', event.target);
|
|
44
|
+
switch (this.type) {
|
|
45
|
+
case 'content':
|
|
46
|
+
this.nodeId = event.target.nodeId;
|
|
47
|
+
break;
|
|
48
|
+
case 'media':
|
|
49
|
+
this.nodeId = event.target.selectedIds.join('');
|
|
50
|
+
break;
|
|
51
|
+
default:
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
this.dispatchEvent(new CustomEvent(event.type));
|
|
45
55
|
}
|
|
46
56
|
render() {
|
|
47
57
|
return html `<umb-input-dropdown-list
|
|
@@ -62,19 +72,19 @@ let UmbInputStartNodeElement = class UmbInputStartNodeElement extends FormContro
|
|
|
62
72
|
}
|
|
63
73
|
}
|
|
64
74
|
#renderTypeContent() {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
return html `<umb-input-document-picker-root
|
|
76
|
+
@change=${this.#onIdChange}
|
|
77
|
+
.nodeId=${this.nodeId}></umb-input-document-picker-root>`;
|
|
68
78
|
}
|
|
69
79
|
#renderTypeMedia() {
|
|
70
80
|
const nodeId = this.nodeId ? [this.nodeId] : [];
|
|
71
81
|
//TODO => MediaTypes
|
|
72
|
-
return html
|
|
82
|
+
return html `<umb-input-media @change=${this.#onIdChange} .selectedIds=${nodeId} max="1"></umb-input-media>`;
|
|
73
83
|
}
|
|
74
84
|
#renderTypeMember() {
|
|
75
85
|
const nodeId = this.nodeId ? [this.nodeId] : [];
|
|
76
86
|
//TODO => Members
|
|
77
|
-
return html
|
|
87
|
+
return html `<umb-input-member @change=${this.#onIdChange} .selectedIds=${nodeId} max="1"></umb-input-member>`;
|
|
78
88
|
}
|
|
79
89
|
static { this.styles = [
|
|
80
90
|
css `
|
|
@@ -93,8 +103,8 @@ __decorate([
|
|
|
93
103
|
property({ attribute: 'node-id' })
|
|
94
104
|
], UmbInputStartNodeElement.prototype, "nodeId", void 0);
|
|
95
105
|
__decorate([
|
|
96
|
-
property({ attribute:
|
|
97
|
-
], UmbInputStartNodeElement.prototype, "
|
|
106
|
+
property({ attribute: false })
|
|
107
|
+
], UmbInputStartNodeElement.prototype, "dynamicRoot", void 0);
|
|
98
108
|
__decorate([
|
|
99
109
|
state()
|
|
100
110
|
], UmbInputStartNodeElement.prototype, "_options", void 0);
|
|
@@ -39,6 +39,7 @@ export * from './variant/index.js';
|
|
|
39
39
|
export * from './workspace/index.js';
|
|
40
40
|
export * from './culture/index.js';
|
|
41
41
|
export * from './temporary-file/index.js';
|
|
42
|
+
export * from './object-type/index.js';
|
|
42
43
|
const manifests = [
|
|
43
44
|
...conditionManifests,
|
|
44
45
|
...debugManifests,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UUISelectElement } from '../../../external/uui/index.js';
|
|
2
|
+
import { UmbLitElement } from '../../../shared/lit-element/index.js';
|
|
3
|
+
declare const UmbInputObjectTypeElement_base: (new (...args: any[]) => import("../../../external/uui/index.js").FormControlMixinInterface) & typeof UmbLitElement;
|
|
4
|
+
export declare class UmbInputObjectTypeElement extends UmbInputObjectTypeElement_base {
|
|
5
|
+
#private;
|
|
6
|
+
private select;
|
|
7
|
+
set value(value: UUISelectElement['value']);
|
|
8
|
+
get value(): UUISelectElement['value'];
|
|
9
|
+
private _options;
|
|
10
|
+
constructor();
|
|
11
|
+
protected getFormElement(): undefined;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
static styles: never[];
|
|
14
|
+
}
|
|
15
|
+
export default UmbInputObjectTypeElement;
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
'umb-input-object-type': UmbInputObjectTypeElement;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { UmbObjectTypeRepository } from './object-type.repository.js';
|
|
8
|
+
import { html, customElement, property, query, state } from '../../../external/lit/index.js';
|
|
9
|
+
import { FormControlMixin } from '../../../external/uui/index.js';
|
|
10
|
+
import { UmbLitElement } from '../../../shared/lit-element/index.js';
|
|
11
|
+
let UmbInputObjectTypeElement = class UmbInputObjectTypeElement extends FormControlMixin(UmbLitElement) {
|
|
12
|
+
set value(value) {
|
|
13
|
+
this.select.value = value;
|
|
14
|
+
}
|
|
15
|
+
get value() {
|
|
16
|
+
return this.select.value;
|
|
17
|
+
}
|
|
18
|
+
#repository;
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
this._options = [];
|
|
22
|
+
this.#repository = new UmbObjectTypeRepository(this);
|
|
23
|
+
this.#repository.read().then(({ data, error }) => {
|
|
24
|
+
if (!data)
|
|
25
|
+
return;
|
|
26
|
+
this._options = data.items.map((item) => ({ value: item.id, name: item.name ?? '' }));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
getFormElement() {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
#onChange() {
|
|
33
|
+
this.dispatchEvent(new CustomEvent('change'));
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return html `<uui-select .options=${this._options} @change=${this.#onChange}></uui-select> `;
|
|
37
|
+
}
|
|
38
|
+
static { this.styles = []; }
|
|
39
|
+
};
|
|
40
|
+
__decorate([
|
|
41
|
+
query('uui-select')
|
|
42
|
+
], UmbInputObjectTypeElement.prototype, "select", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
property()
|
|
45
|
+
], UmbInputObjectTypeElement.prototype, "value", null);
|
|
46
|
+
__decorate([
|
|
47
|
+
state()
|
|
48
|
+
], UmbInputObjectTypeElement.prototype, "_options", void 0);
|
|
49
|
+
UmbInputObjectTypeElement = __decorate([
|
|
50
|
+
customElement('umb-input-object-type')
|
|
51
|
+
], UmbInputObjectTypeElement);
|
|
52
|
+
export { UmbInputObjectTypeElement };
|
|
53
|
+
export default UmbInputObjectTypeElement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UmbBaseController } from '../../../libs/class-api/index.js';
|
|
2
|
+
import { UmbControllerHost } from '../../../libs/controller-api/index.js';
|
|
3
|
+
import { UmbApi } from '../../../libs/extension-api/index.js';
|
|
4
|
+
export declare class UmbObjectTypeRepository extends UmbBaseController implements UmbApi {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(host: UmbControllerHost);
|
|
7
|
+
read(): Promise<{
|
|
8
|
+
data: import("../../../external/backend-api/index.js").PagedObjectTypeResponseModel | undefined;
|
|
9
|
+
error: import("../../../external/backend-api/index.js").ApiError | import("../../../external/backend-api/index.js").CancelError | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ObjectTypesResource } from '../../../external/backend-api/index.js';
|
|
2
|
+
import { UmbBaseController } from '../../../libs/class-api/index.js';
|
|
3
|
+
import { tryExecuteAndNotify } from '../../../shared/resources/index.js';
|
|
4
|
+
export class UmbObjectTypeRepository extends UmbBaseController {
|
|
5
|
+
#host;
|
|
6
|
+
constructor(host) {
|
|
7
|
+
super(host);
|
|
8
|
+
this.#host = host;
|
|
9
|
+
}
|
|
10
|
+
async #read() {
|
|
11
|
+
return tryExecuteAndNotify(this.#host, ObjectTypesResource.getObjectTypes({}));
|
|
12
|
+
}
|
|
13
|
+
async read() {
|
|
14
|
+
const { data, error } = await this.#read();
|
|
15
|
+
return { data, error };
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -16,13 +16,15 @@ let UmbPropertyEditorUITreePickerStartNodeElement = class UmbPropertyEditorUITre
|
|
|
16
16
|
this.value = {
|
|
17
17
|
type: target.type,
|
|
18
18
|
id: target.nodeId,
|
|
19
|
-
|
|
20
|
-
query: target.dynamicPath,
|
|
19
|
+
dynamicRoot: target.dynamicRoot,
|
|
21
20
|
};
|
|
22
21
|
this.dispatchEvent(new CustomEvent('property-value-change'));
|
|
23
22
|
}
|
|
24
23
|
render() {
|
|
25
|
-
return html `<umb-input-start-node
|
|
24
|
+
return html `<umb-input-start-node
|
|
25
|
+
@change=${this.#onChange}
|
|
26
|
+
.type=${this.value?.type}
|
|
27
|
+
.nodeId=${this.value?.id}></umb-input-start-node>`;
|
|
26
28
|
}
|
|
27
29
|
static { this.styles = [UmbTextStyles]; }
|
|
28
30
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
|
|
2
|
+
declare const UmbInputDocumentPickerRootElement_base: (new (...args: any[]) => import("../../../../../external/uui/index.js").FormControlMixinInterface) & typeof UmbLitElement;
|
|
3
|
+
export declare class UmbInputDocumentPickerRootElement extends UmbInputDocumentPickerRootElement_base {
|
|
4
|
+
#private;
|
|
5
|
+
get nodeId(): string | null | undefined;
|
|
6
|
+
set nodeId(id: string | null | undefined);
|
|
7
|
+
set value(id: string);
|
|
8
|
+
private _items?;
|
|
9
|
+
constructor();
|
|
10
|
+
protected getFormElement(): undefined;
|
|
11
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
12
|
+
private _renderItem;
|
|
13
|
+
}
|
|
14
|
+
export default UmbInputDocumentPickerRootElement;
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'umb-input-document-picker-root': UmbInputDocumentPickerRootElement;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { UmbDocumentPickerContext } from '../input-document/input-document.context.js';
|
|
8
|
+
import { html, customElement, property, state, ifDefined, repeat } from '../../../../../external/lit/index.js';
|
|
9
|
+
import { FormControlMixin } from '../../../../../external/uui/index.js';
|
|
10
|
+
import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
|
|
11
|
+
let UmbInputDocumentPickerRootElement = class UmbInputDocumentPickerRootElement extends FormControlMixin(UmbLitElement) {
|
|
12
|
+
get nodeId() {
|
|
13
|
+
return this.#documentPickerContext.getSelection()[0];
|
|
14
|
+
}
|
|
15
|
+
set nodeId(id) {
|
|
16
|
+
const selection = id ? [id] : [];
|
|
17
|
+
this.#documentPickerContext.setSelection(selection);
|
|
18
|
+
}
|
|
19
|
+
set value(id) {
|
|
20
|
+
this.nodeId = id;
|
|
21
|
+
}
|
|
22
|
+
#documentPickerContext = new UmbDocumentPickerContext(this);
|
|
23
|
+
// TODO: DynamicRoot - once feature implemented, wire up context and picker UI. [LK]
|
|
24
|
+
#dynamicRootPickerContext = {
|
|
25
|
+
openPicker: () => {
|
|
26
|
+
throw new Error('DynamicRoot picker has not been implemented yet.');
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
this.#documentPickerContext.max = 1;
|
|
32
|
+
this.observe(this.#documentPickerContext.selection, (selection) => (super.value = selection.join(',')));
|
|
33
|
+
this.observe(this.#documentPickerContext.selectedItems, (selectedItems) => (this._items = selectedItems));
|
|
34
|
+
}
|
|
35
|
+
getFormElement() {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return html `
|
|
40
|
+
${this._items
|
|
41
|
+
? html ` <uui-ref-list
|
|
42
|
+
>${repeat(this._items, (item) => item.id, (item) => this._renderItem(item))}
|
|
43
|
+
</uui-ref-list>`
|
|
44
|
+
: ''}
|
|
45
|
+
${this.#renderButtons()}
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
#renderButtons() {
|
|
49
|
+
if (this.nodeId)
|
|
50
|
+
return;
|
|
51
|
+
//TODO: Dynamic paths
|
|
52
|
+
return html ` <uui-button-group>
|
|
53
|
+
<uui-button
|
|
54
|
+
look="placeholder"
|
|
55
|
+
@click=${() => this.#documentPickerContext.openPicker()}
|
|
56
|
+
label=${this.localize.term('contentPicker_defineRootNode')}></uui-button>
|
|
57
|
+
<uui-button
|
|
58
|
+
look="placeholder"
|
|
59
|
+
@click=${() => this.#dynamicRootPickerContext.openPicker()}
|
|
60
|
+
label=${this.localize.term('contentPicker_defineDynamicRoot')}></uui-button>
|
|
61
|
+
</uui-button-group>`;
|
|
62
|
+
}
|
|
63
|
+
_renderItem(item) {
|
|
64
|
+
if (!item.id)
|
|
65
|
+
return;
|
|
66
|
+
return html `
|
|
67
|
+
<uui-ref-node name=${ifDefined(item.name)} detail=${ifDefined(item.id)}>
|
|
68
|
+
<!-- TODO: implement is trashed <uui-tag size="s" slot="tag" color="danger">Trashed</uui-tag> -->
|
|
69
|
+
<uui-action-bar slot="actions">
|
|
70
|
+
<uui-button @click=${() => this.#documentPickerContext.openPicker()} label="Edit document ${item.name}"
|
|
71
|
+
>Edit</uui-button
|
|
72
|
+
>
|
|
73
|
+
<uui-button
|
|
74
|
+
@click=${() => this.#documentPickerContext.requestRemoveItem(item.id)}
|
|
75
|
+
label="Remove document ${item.name}"
|
|
76
|
+
>Remove</uui-button
|
|
77
|
+
>
|
|
78
|
+
</uui-action-bar>
|
|
79
|
+
</uui-ref-node>
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
__decorate([
|
|
84
|
+
property()
|
|
85
|
+
], UmbInputDocumentPickerRootElement.prototype, "value", null);
|
|
86
|
+
__decorate([
|
|
87
|
+
state()
|
|
88
|
+
], UmbInputDocumentPickerRootElement.prototype, "_items", void 0);
|
|
89
|
+
UmbInputDocumentPickerRootElement = __decorate([
|
|
90
|
+
customElement('umb-input-document-picker-root')
|
|
91
|
+
], UmbInputDocumentPickerRootElement);
|
|
92
|
+
export { UmbInputDocumentPickerRootElement };
|
|
93
|
+
export default UmbInputDocumentPickerRootElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const manifests: (import("../core/index.js").ManifestEntityAction | import("../core/index.js").ManifestMenuItemTreeKind | import("../core/index.js").ManifestStore | import("../core/index.js").ManifestTree | import("../core/index.js").ManifestTreeItem | import("../core/index.js").ManifestTreeStore | import("../core/index.js").ManifestWorkspace | import("../core/index.js").ManifestWorkspaceAction | import("../core/index.js").ManifestWorkspaceView | import("../core/index.js").ManifestRepository<import("../../libs/extension-api/index.js").UmbApi>)[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UmbRelationTypeRepository } from '../repository/relation-type.repository.js';
|
|
2
|
+
import { UmbEntityActionBase } from '../../../core/entity-action/index.js';
|
|
3
|
+
import { UmbControllerHostElement } from '../../../../libs/controller-api/index.js';
|
|
4
|
+
export declare class UmbCreateRelationTypeEntityAction extends UmbEntityActionBase<UmbRelationTypeRepository> {
|
|
5
|
+
constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
|
|
6
|
+
execute(): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UmbEntityActionBase } from '../../../core/entity-action/index.js';
|
|
2
|
+
export class UmbCreateRelationTypeEntityAction extends UmbEntityActionBase {
|
|
3
|
+
// TODO: Could EntityActions take the manifest instead, for more flexibility?
|
|
4
|
+
constructor(host, repositoryAlias, unique) {
|
|
5
|
+
super(host, repositoryAlias, unique);
|
|
6
|
+
}
|
|
7
|
+
async execute() {
|
|
8
|
+
// TODO: Generate the href or retrieve it from something?
|
|
9
|
+
history.pushState(null, '', `section/settings/workspace/relation-type/create/${this.unique ?? null}`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { UMB_RELATION_TYPE_REPOSITORY_ALIAS } from '../repository/manifests.js';
|
|
2
|
+
import { UMB_RELATION_TYPE_ENTITY_TYPE, UMB_RELATION_TYPE_ROOT_ENTITY_TYPE } from '../index.js';
|
|
3
|
+
import { UmbCreateRelationTypeEntityAction } from './create.action.js';
|
|
4
|
+
import { UmbDeleteEntityAction } from '../../../core/entity-action/index.js';
|
|
5
|
+
const entityActions = [
|
|
6
|
+
{
|
|
7
|
+
type: 'entityAction',
|
|
8
|
+
alias: 'Umb.EntityAction.RelationType.Delete',
|
|
9
|
+
name: 'Delete RelationType Entity Action',
|
|
10
|
+
api: UmbDeleteEntityAction,
|
|
11
|
+
meta: {
|
|
12
|
+
repositoryAlias: UMB_RELATION_TYPE_REPOSITORY_ALIAS,
|
|
13
|
+
icon: 'icon-trash',
|
|
14
|
+
label: 'Delete',
|
|
15
|
+
entityTypes: [UMB_RELATION_TYPE_ENTITY_TYPE],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
type: 'entityAction',
|
|
20
|
+
alias: 'Umb.EntityAction.RelationType.Create',
|
|
21
|
+
name: 'Create RelationType Entity Action',
|
|
22
|
+
weight: 900,
|
|
23
|
+
api: UmbCreateRelationTypeEntityAction,
|
|
24
|
+
meta: {
|
|
25
|
+
icon: 'icon-add',
|
|
26
|
+
label: 'Create',
|
|
27
|
+
repositoryAlias: UMB_RELATION_TYPE_REPOSITORY_ALIAS,
|
|
28
|
+
entityTypes: [UMB_RELATION_TYPE_ROOT_ENTITY_TYPE],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
export const manifests = [...entityActions];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const manifests: (import("../../core/index.js").ManifestEntityAction | import("../../core/index.js").ManifestMenuItemTreeKind | import("../../core/index.js").ManifestStore | import("../../core/index.js").ManifestTree | import("../../core/index.js").ManifestTreeItem | import("../../core/index.js").ManifestTreeStore | import("../../core/index.js").ManifestWorkspace | import("../../core/index.js").ManifestWorkspaceAction | import("../../core/index.js").ManifestWorkspaceView | import("../../core/index.js").ManifestRepository<import("../../../libs/extension-api/index.js").UmbApi>)[];
|
|
@@ -2,4 +2,11 @@ import { manifests as repositoryManifests } from './repository/manifests.js';
|
|
|
2
2
|
import { manifests as menuItemManifests } from './menu-item/manifests.js';
|
|
3
3
|
import { manifests as treeManifests } from './tree/manifests.js';
|
|
4
4
|
import { manifests as workspaceManifests } from './workspace/manifests.js';
|
|
5
|
-
|
|
5
|
+
import { manifests as entityActionManifests } from './entity-actions/manifests.js';
|
|
6
|
+
export const manifests = [
|
|
7
|
+
...repositoryManifests,
|
|
8
|
+
...menuItemManifests,
|
|
9
|
+
...treeManifests,
|
|
10
|
+
...workspaceManifests,
|
|
11
|
+
...entityActionManifests,
|
|
12
|
+
];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UmbRelationTypeRepository } from '
|
|
1
|
+
import { UmbRelationTypeRepository } from './relation-type.repository.js';
|
|
2
2
|
import { UmbRelationTypeStore } from './relation-type.store.js';
|
|
3
3
|
export const UMB_RELATION_TYPE_REPOSITORY_ALIAS = 'Umb.Repository.RelationType';
|
|
4
4
|
const repository = {
|
|
@@ -9,6 +9,10 @@ export declare class UmbRelationTypeRepository extends UmbBaseController impleme
|
|
|
9
9
|
createScaffold(parentId: string | null): Promise<{
|
|
10
10
|
data: RelationTypeResponseModel;
|
|
11
11
|
}>;
|
|
12
|
+
requestRelationsById(id: string): Promise<{
|
|
13
|
+
data: import("../../../../external/backend-api/index.js").PagedRelationResponseModel | undefined;
|
|
14
|
+
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
15
|
+
}>;
|
|
12
16
|
requestById(id: string): Promise<{
|
|
13
17
|
data: RelationTypeResponseModel | undefined;
|
|
14
18
|
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
@@ -34,6 +34,16 @@ export class UmbRelationTypeRepository extends UmbBaseController {
|
|
|
34
34
|
await this.#init;
|
|
35
35
|
return this.#detailDataSource.createScaffold(parentId);
|
|
36
36
|
}
|
|
37
|
+
async requestRelationsById(id) {
|
|
38
|
+
await this.#init;
|
|
39
|
+
// TODO: should we show a notification if the id is missing?
|
|
40
|
+
// Investigate what is best for Acceptance testing, cause in that perspective a thrown error might be the best choice?
|
|
41
|
+
if (!id) {
|
|
42
|
+
throw new Error('Id is missing');
|
|
43
|
+
}
|
|
44
|
+
const { data, error } = await this.#detailDataSource.readRelations(id);
|
|
45
|
+
return { data, error };
|
|
46
|
+
}
|
|
37
47
|
async requestById(id) {
|
|
38
48
|
await this.#init;
|
|
39
49
|
// TODO: should we show a notification if the id is missing?
|
|
@@ -22,6 +22,13 @@ export declare class UmbRelationTypeServerDataSource implements UmbDataSource<Cr
|
|
|
22
22
|
* @memberof UmbRelationTypeServerDataSource
|
|
23
23
|
*/
|
|
24
24
|
read(id: string): Promise<import("../../../../core/repository/index.js").DataSourceResponse<RelationTypeResponseModel>>;
|
|
25
|
+
/**
|
|
26
|
+
* Fetches a Relation Type with the given id from the server
|
|
27
|
+
* @param {string} id
|
|
28
|
+
* @return {*}
|
|
29
|
+
* @memberof UmbRelationTypeServerDataSource
|
|
30
|
+
*/
|
|
31
|
+
readRelations(id: string): Promise<import("../../../../core/repository/index.js").DataSourceResponse<import("../../../../../external/backend-api/index.js").PagedRelationResponseModel>>;
|
|
25
32
|
/**
|
|
26
33
|
* Creates a new Relation Type scaffold
|
|
27
34
|
* @param {(string | null)} parentId
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { RelationTypeResource, } from '../../../../../external/backend-api/index.js';
|
|
1
|
+
import { RelationTypeResource, RelationResource, } from '../../../../../external/backend-api/index.js';
|
|
2
2
|
import { tryExecuteAndNotify } from '../../../../../shared/resources/index.js';
|
|
3
|
+
import { UmbId } from '../../../../core/id/index.js';
|
|
3
4
|
/**
|
|
4
5
|
* A data source for the Relation Type that fetches data from the server
|
|
5
6
|
* @export
|
|
@@ -30,6 +31,20 @@ export class UmbRelationTypeServerDataSource {
|
|
|
30
31
|
id,
|
|
31
32
|
}));
|
|
32
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Fetches a Relation Type with the given id from the server
|
|
36
|
+
* @param {string} id
|
|
37
|
+
* @return {*}
|
|
38
|
+
* @memberof UmbRelationTypeServerDataSource
|
|
39
|
+
*/
|
|
40
|
+
async readRelations(id) {
|
|
41
|
+
if (!id) {
|
|
42
|
+
throw new Error('Id is missing');
|
|
43
|
+
}
|
|
44
|
+
return tryExecuteAndNotify(this.#host, RelationResource.getRelationTypeById({
|
|
45
|
+
id,
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
33
48
|
/**
|
|
34
49
|
* Creates a new Relation Type scaffold
|
|
35
50
|
* @param {(string | null)} parentId
|
|
@@ -37,9 +52,15 @@ export class UmbRelationTypeServerDataSource {
|
|
|
37
52
|
* @memberof UmbRelationTypeServerDataSource
|
|
38
53
|
*/
|
|
39
54
|
async createScaffold(parentId) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
55
|
+
const data = {
|
|
56
|
+
id: UmbId.new(),
|
|
57
|
+
name: '',
|
|
58
|
+
alias: '',
|
|
59
|
+
isBidirectional: false,
|
|
60
|
+
isDependency: false,
|
|
61
|
+
path: '',
|
|
62
|
+
isSystemRelationType: false,
|
|
63
|
+
};
|
|
43
64
|
return { data };
|
|
44
65
|
}
|
|
45
66
|
/**
|
|
@@ -11,6 +11,10 @@ export declare class UmbRelationTypeWorkspaceContext extends UmbEditableWorkspac
|
|
|
11
11
|
constructor(host: UmbControllerHostElement);
|
|
12
12
|
load(id: string): Promise<void>;
|
|
13
13
|
createScaffold(parentId: string | null): Promise<void>;
|
|
14
|
+
getRelations(): Promise<{
|
|
15
|
+
data: import("../../../../external/backend-api/index.js").PagedRelationResponseModel | undefined;
|
|
16
|
+
error: import("../../../../external/backend-api/index.js").ApiError | import("../../../../external/backend-api/index.js").CancelError | undefined;
|
|
17
|
+
}>;
|
|
14
18
|
getData(): RelationTypeResponseModel | undefined;
|
|
15
19
|
getEntityId(): string;
|
|
16
20
|
getEntityType(): string;
|
|
@@ -25,6 +25,10 @@ export class UmbRelationTypeWorkspaceContext extends UmbEditableWorkspaceContext
|
|
|
25
25
|
this.setIsNew(true);
|
|
26
26
|
this.#data.next(data);
|
|
27
27
|
}
|
|
28
|
+
async getRelations() {
|
|
29
|
+
//TODO: How do we test this?
|
|
30
|
+
return await this.repository.requestRelationsById(this.getEntityId());
|
|
31
|
+
}
|
|
28
32
|
getData() {
|
|
29
33
|
return this.#data.getValue();
|
|
30
34
|
}
|
|
@@ -42,12 +46,15 @@ export class UmbRelationTypeWorkspaceContext extends UmbEditableWorkspaceContext
|
|
|
42
46
|
return;
|
|
43
47
|
if (!this.#data.value.id)
|
|
44
48
|
return;
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
let response = undefined;
|
|
50
|
+
if (this.getIsNew()) {
|
|
51
|
+
response = await this.repository.create(this.#data.value);
|
|
47
52
|
}
|
|
48
53
|
else {
|
|
49
|
-
await this.repository.save(this.#data.value.id, this.#data.value);
|
|
54
|
+
response = await this.repository.save(this.#data.value.id, this.#data.value);
|
|
50
55
|
}
|
|
56
|
+
if (response.error)
|
|
57
|
+
return;
|
|
51
58
|
// If it went well, then its not new anymore?.
|
|
52
59
|
this.setIsNew(false);
|
|
53
60
|
}
|