@umbraco-cms/backoffice 14.0.0--preview005-88d5dedc → 14.0.0--preview005-afb72093
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 +2 -2
- package/dist-cms/packages/core/content-type/content-type-property-structure-helper.class.d.ts +3 -3
- package/dist-cms/packages/core/content-type/content-type-property-structure-helper.class.js +5 -2
- package/dist-cms/packages/core/content-type/content-type-structure-manager.class.d.ts +3 -3
- package/dist-cms/packages/core/content-type/content-type-structure-manager.class.js +2 -3
- package/dist-cms/packages/core/content-type/types.d.ts +3 -0
- 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/modal/common/property-settings/property-settings-modal.element.js +1 -1
- package/dist-cms/packages/core/modal/token/property-settings-modal.token.d.ts +3 -3
- package/dist-cms/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit-properties.element.d.ts +0 -1
- package/dist-cms/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit-properties.element.js +11 -11
- package/dist-cms/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit-property.element.d.ts +4 -4
- package/dist-cms/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit-property.element.js +6 -3
- package/dist-cms/packages/media/media-types/workspace/views/design/media-type-workspace-view-edit-properties.element.d.ts +0 -1
- package/dist-cms/packages/media/media-types/workspace/views/design/media-type-workspace-view-edit-properties.element.js +10 -10
- package/dist-cms/packages/media/media-types/workspace/views/design/media-type-workspace-view-edit-property.element.js +4 -1
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.js +12 -1
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +2 -2
- package/package.json +1 -1
|
@@ -6134,7 +6134,7 @@
|
|
|
6134
6134
|
{
|
|
6135
6135
|
"name": "property",
|
|
6136
6136
|
"description": "Property, the data object for the property.",
|
|
6137
|
-
"type": "UmbPropertyTypeModel",
|
|
6137
|
+
"type": "UmbPropertyTypeModel | UmbPropertyTypeScaffoldModel | undefined",
|
|
6138
6138
|
"default": "\"undefined\""
|
|
6139
6139
|
},
|
|
6140
6140
|
{
|
|
@@ -6166,7 +6166,7 @@
|
|
|
6166
6166
|
"name": "property",
|
|
6167
6167
|
"attribute": "property",
|
|
6168
6168
|
"description": "Property, the data object for the property.",
|
|
6169
|
-
"type": "UmbPropertyTypeModel",
|
|
6169
|
+
"type": "UmbPropertyTypeModel | UmbPropertyTypeScaffoldModel | undefined",
|
|
6170
6170
|
"default": "\"undefined\""
|
|
6171
6171
|
},
|
|
6172
6172
|
{
|
package/dist-cms/packages/core/content-type/content-type-property-structure-helper.class.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare class UmbContentTypePropertyStructureHelper<T extends UmbContentT
|
|
|
8
8
|
private _containerName?;
|
|
9
9
|
readonly propertyStructure: import("rxjs").Observable<UmbPropertyTypeModel[]>;
|
|
10
10
|
constructor(host: UmbControllerHostElement);
|
|
11
|
-
|
|
11
|
+
ownerDocumentTypes(): Promise<import("rxjs").Observable<T[]> | undefined>;
|
|
12
12
|
setStructureManager(structure: UmbContentTypePropertyStructureManager<T>): void;
|
|
13
13
|
setContainerType(value?: UmbPropertyContainerTypes): void;
|
|
14
14
|
getContainerType(): UmbPropertyContainerTypes | undefined;
|
|
@@ -19,8 +19,8 @@ export declare class UmbContentTypePropertyStructureHelper<T extends UmbContentT
|
|
|
19
19
|
private _observeGroupContainers;
|
|
20
20
|
private _observePropertyStructureOf;
|
|
21
21
|
/** Manipulate methods: */
|
|
22
|
-
createPropertyScaffold(ownerId?: string, sortOrder?: number): Promise<
|
|
23
|
-
addProperty(ownerId?: string, sortOrder?: number): Promise<
|
|
22
|
+
createPropertyScaffold(ownerId?: string, sortOrder?: number): Promise<import("./types.js").UmbPropertyTypeScaffoldModel | undefined>;
|
|
23
|
+
addProperty(ownerId?: string, sortOrder?: number): Promise<import("./types.js").UmbPropertyTypeScaffoldModel | undefined>;
|
|
24
24
|
insertProperty(property: UmbPropertyTypeModel, sortOrder?: number): Promise<boolean>;
|
|
25
25
|
removeProperty(propertyId: string): Promise<boolean>;
|
|
26
26
|
partialUpdateProperty(propertyKey?: string, partialUpdate?: Partial<UmbPropertyTypeModel>): Promise<void>;
|
|
@@ -26,8 +26,11 @@ export class UmbContentTypePropertyStructureHelper {
|
|
|
26
26
|
// TODO: Remove as any when sortOrder is implemented:
|
|
27
27
|
__classPrivateFieldGet(this, _UmbContentTypePropertyStructureHelper_propertyStructure, "f").sortBy((a, b) => (a.sortOrder ?? 0) - (b.sortOrder ?? 0));
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
async ownerDocumentTypes() {
|
|
30
|
+
await __classPrivateFieldGet(this, _UmbContentTypePropertyStructureHelper_init, "f");
|
|
31
|
+
if (!__classPrivateFieldGet(this, _UmbContentTypePropertyStructureHelper_structure, "f"))
|
|
32
|
+
return;
|
|
33
|
+
return __classPrivateFieldGet(this, _UmbContentTypePropertyStructureHelper_structure, "f").contentTypes;
|
|
31
34
|
}
|
|
32
35
|
setStructureManager(structure) {
|
|
33
36
|
__classPrivateFieldSet(this, _UmbContentTypePropertyStructureHelper_structure, structure, "f");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UmbContentTypeModel, UmbPropertyContainerTypes, UmbPropertyTypeContainerModel, UmbPropertyTypeModel } from './types.js';
|
|
1
|
+
import type { UmbContentTypeModel, UmbPropertyContainerTypes, UmbPropertyTypeContainerModel, UmbPropertyTypeModel, UmbPropertyTypeScaffoldModel } from './types.js';
|
|
2
2
|
import type { UmbDetailRepository } from '../repository/index.js';
|
|
3
3
|
import type { UmbControllerHost } from '../../../libs/controller-api/index.js';
|
|
4
4
|
import type { MappingFunction } from '../../../libs/observable-api/index.js';
|
|
@@ -45,8 +45,8 @@ export declare class UmbContentTypePropertyStructureManager<T extends UmbContent
|
|
|
45
45
|
makeContainerNameUniqueForOwnerContentType(newName: string, containerType?: UmbPropertyContainerTypes, parentId?: string | null): string | null;
|
|
46
46
|
updateContainer(contentTypeUnique: string | null, containerId: string, partialUpdate: Partial<UmbPropertyTypeContainerModel>): Promise<void>;
|
|
47
47
|
removeContainer(contentTypeUnique: string | null, containerId?: string | null): Promise<void>;
|
|
48
|
-
createPropertyScaffold(containerId?: string | null, sortOrder?: number):
|
|
49
|
-
createProperty(contentTypeUnique: string | null, containerId?: string | null, sortOrder?: number): Promise<
|
|
48
|
+
createPropertyScaffold(containerId?: string | null, sortOrder?: number): UmbPropertyTypeScaffoldModel;
|
|
49
|
+
createProperty(contentTypeUnique: string | null, containerId?: string | null, sortOrder?: number): Promise<UmbPropertyTypeScaffoldModel>;
|
|
50
50
|
insertProperty(contentTypeUnique: string | null, property: UmbPropertyTypeModel): Promise<void>;
|
|
51
51
|
removeProperty(contentTypeUnique: string | null, propertyId: string): Promise<void>;
|
|
52
52
|
updateProperty(contentTypeUnique: string | null, propertyId: string, partialUpdate: Partial<UmbPropertyTypeModel>): Promise<void>;
|
|
@@ -203,11 +203,10 @@ export class UmbContentTypePropertyStructureManager extends UmbBaseController {
|
|
|
203
203
|
createPropertyScaffold(containerId = null, sortOrder) {
|
|
204
204
|
const property = {
|
|
205
205
|
id: UmbId.new(),
|
|
206
|
-
containerId: containerId,
|
|
206
|
+
container: containerId ? { id: containerId } : null,
|
|
207
207
|
alias: '',
|
|
208
208
|
name: '',
|
|
209
209
|
description: '',
|
|
210
|
-
dataTypeId: '',
|
|
211
210
|
variesByCulture: false,
|
|
212
211
|
variesBySegment: false,
|
|
213
212
|
validation: {
|
|
@@ -220,7 +219,7 @@ export class UmbContentTypePropertyStructureManager extends UmbBaseController {
|
|
|
220
219
|
labelOnTop: false,
|
|
221
220
|
},
|
|
222
221
|
sortOrder: sortOrder ?? 0,
|
|
223
|
-
};
|
|
222
|
+
};
|
|
224
223
|
return property;
|
|
225
224
|
}
|
|
226
225
|
async createProperty(contentTypeUnique, containerId = null, sortOrder) {
|
|
@@ -23,6 +23,9 @@ export interface UmbContentTypeModel {
|
|
|
23
23
|
allowedContentTypes: Array<UmbContentTypeSortModel>;
|
|
24
24
|
compositions: Array<UmbContentTypeCompositionModel>;
|
|
25
25
|
}
|
|
26
|
+
export interface UmbPropertyTypeScaffoldModel extends Omit<UmbPropertyTypeModel, 'dataType'> {
|
|
27
|
+
dataType?: UmbPropertyTypeModel['dataType'];
|
|
28
|
+
}
|
|
26
29
|
export interface UmbPropertyTypeModel extends Omit<PropertyTypeModelBaseModel, 'dataType'> {
|
|
27
30
|
dataType: {
|
|
28
31
|
unique: string;
|
|
@@ -8,7 +8,7 @@ import { UmbDataTypeDetailRepository } from '../../repository/detail/data-type-d
|
|
|
8
8
|
import { UmbDataTypeTreeRepository } from '../../tree/data-type-tree.repository.js';
|
|
9
9
|
import { css, html, customElement, state, repeat, when } from '../../../../../external/lit/index.js';
|
|
10
10
|
import { UmbTextStyles } from '../../../../../shared/style/index.js';
|
|
11
|
-
import { UmbModalBaseElement
|
|
11
|
+
import { UmbModalBaseElement } from '../../../modal/index.js';
|
|
12
12
|
let UmbDataTypePickerFlowDataTypePickerModalElement = class UmbDataTypePickerFlowDataTypePickerModalElement extends UmbModalBaseElement {
|
|
13
13
|
connectedCallback() {
|
|
14
14
|
super.connectedCallback();
|
package/dist-cms/packages/core/modal/common/property-settings/property-settings-modal.element.js
CHANGED
|
@@ -135,7 +135,7 @@ let UmbPropertySettingsModalElement = class UmbPropertySettingsModalElement exte
|
|
|
135
135
|
.value=${this.value.description}></uui-textarea>
|
|
136
136
|
</div>
|
|
137
137
|
<umb-data-type-flow-input
|
|
138
|
-
.value=${this.value.dataType
|
|
138
|
+
.value=${this.value.dataType?.unique}
|
|
139
139
|
@change=${__classPrivateFieldGet(this, _UmbPropertySettingsModalElement_instances, "m", _UmbPropertySettingsModalElement_onDataTypeIdChange)}></umb-data-type-flow-input>
|
|
140
140
|
<hr />
|
|
141
141
|
<div class="container">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { UmbPropertyTypeModel } from '../../content-type/index.js';
|
|
1
|
+
import type { UmbPropertyTypeModel, UmbPropertyTypeScaffoldModel } from '../../content-type/index.js';
|
|
2
2
|
import { UmbModalToken } from '../index.js';
|
|
3
3
|
export type UmbPropertySettingsModalData = {
|
|
4
4
|
documentTypeId: string;
|
|
5
5
|
};
|
|
6
|
-
export type UmbPropertySettingsModalValue = UmbPropertyTypeModel;
|
|
7
|
-
export declare const UMB_PROPERTY_SETTINGS_MODAL: UmbModalToken<UmbPropertySettingsModalData,
|
|
6
|
+
export type UmbPropertySettingsModalValue = UmbPropertyTypeModel | UmbPropertyTypeScaffoldModel;
|
|
7
|
+
export declare const UMB_PROPERTY_SETTINGS_MODAL: UmbModalToken<UmbPropertySettingsModalData, UmbPropertySettingsModalValue>;
|
|
@@ -18,7 +18,6 @@ export declare class UmbDocumentTypeWorkspaceViewEditPropertiesElement extends U
|
|
|
18
18
|
protected _modalRouteNewProperty?: string;
|
|
19
19
|
_sortModeActive?: boolean;
|
|
20
20
|
constructor();
|
|
21
|
-
connectedCallback(): void;
|
|
22
21
|
render(): import("lit-html").TemplateResult<1>;
|
|
23
22
|
static styles: import("../../../../../../external/lit/index.js").CSSResult[];
|
|
24
23
|
}
|
|
@@ -91,12 +91,18 @@ let UmbDocumentTypeWorkspaceViewEditPropertiesElement = class UmbDocumentTypeWor
|
|
|
91
91
|
}));
|
|
92
92
|
this._propertyStructureHelper = new UmbContentTypePropertyStructureHelper(this);
|
|
93
93
|
this._propertyStructure = [];
|
|
94
|
-
this.consumeContext(UMB_WORKSPACE_CONTEXT, (workspaceContext) => {
|
|
94
|
+
this.consumeContext(UMB_WORKSPACE_CONTEXT, async (workspaceContext) => {
|
|
95
95
|
this._propertyStructureHelper.setStructureManager(workspaceContext.structure);
|
|
96
96
|
this.observe(workspaceContext.isSorting, (isSorting) => {
|
|
97
97
|
this._sortModeActive = isSorting;
|
|
98
98
|
__classPrivateFieldGet(this, _UmbDocumentTypeWorkspaceViewEditPropertiesElement_instances, "m", _UmbDocumentTypeWorkspaceViewEditPropertiesElement_setModel).call(this, isSorting);
|
|
99
99
|
}, '_observeIsSorting');
|
|
100
|
+
const docTypesObservable = await this._propertyStructureHelper.ownerDocumentTypes();
|
|
101
|
+
if (!docTypesObservable)
|
|
102
|
+
return;
|
|
103
|
+
this.observe(docTypesObservable, (documents) => {
|
|
104
|
+
this._ownerDocumentTypes = documents;
|
|
105
|
+
}, 'observeOwnerDocumentTypes');
|
|
100
106
|
});
|
|
101
107
|
this.observe(this._propertyStructureHelper.propertyStructure, (propertyStructure) => {
|
|
102
108
|
this._propertyStructure = propertyStructure;
|
|
@@ -114,28 +120,22 @@ let UmbDocumentTypeWorkspaceViewEditPropertiesElement = class UmbDocumentTypeWor
|
|
|
114
120
|
return { data: { documentTypeId }, value: propertyData };
|
|
115
121
|
})
|
|
116
122
|
.onSubmit((value) => {
|
|
123
|
+
if (!value.dataType) {
|
|
124
|
+
throw new Error('No data type selected');
|
|
125
|
+
}
|
|
117
126
|
__classPrivateFieldGet(this, _UmbDocumentTypeWorkspaceViewEditPropertiesElement_instances, "m", _UmbDocumentTypeWorkspaceViewEditPropertiesElement_addProperty).call(this, value);
|
|
118
127
|
})
|
|
119
128
|
.observeRouteBuilder((routeBuilder) => {
|
|
120
129
|
this._modalRouteNewProperty = routeBuilder(null);
|
|
121
130
|
});
|
|
122
131
|
}
|
|
123
|
-
connectedCallback() {
|
|
124
|
-
super.connectedCallback();
|
|
125
|
-
const doctypes = this._propertyStructureHelper.ownerDocumentTypes;
|
|
126
|
-
if (!doctypes)
|
|
127
|
-
return;
|
|
128
|
-
this.observe(doctypes, (documents) => {
|
|
129
|
-
this._ownerDocumentTypes = documents;
|
|
130
|
-
}, 'observeOwnerDocumentTypes');
|
|
131
|
-
}
|
|
132
132
|
render() {
|
|
133
133
|
return html `<div id="property-list">
|
|
134
134
|
${repeat(this._propertyStructure, (property) => property.id ?? '' + property.container?.id ?? '' + property.sortOrder ?? '', (property) => {
|
|
135
135
|
// Note: This piece might be moved into the property component
|
|
136
136
|
const inheritedFromDocument = this._ownerDocumentTypes?.find((types) => types.containers?.find((containers) => containers.id === property.container?.id));
|
|
137
137
|
return html `<umb-document-type-workspace-view-edit-property
|
|
138
|
-
data-umb-property-id=${
|
|
138
|
+
data-umb-property-id=${property.id}
|
|
139
139
|
owner-document-type-id=${ifDefined(inheritedFromDocument?.unique)}
|
|
140
140
|
owner-document-type-name=${ifDefined(inheritedFromDocument?.name)}
|
|
141
141
|
?inherited=${property.container?.id !== this.containerId}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { nothing } from '../../../../../../external/lit/index.js';
|
|
2
2
|
import { UmbLitElement } from '../../../../../../shared/lit-element/index.js';
|
|
3
|
-
import type { UmbPropertyTypeModel } from '../../../../../core/content-type/index.js';
|
|
3
|
+
import type { UmbPropertyTypeModel, UmbPropertyTypeScaffoldModel } from '../../../../../core/content-type/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* @element umb-document-type-workspace-view-edit-property
|
|
6
6
|
* @description - Element for displaying a property in an workspace.
|
|
@@ -11,12 +11,12 @@ export declare class UmbDocumentTypeWorkspacePropertyElement extends UmbLitEleme
|
|
|
11
11
|
private _property?;
|
|
12
12
|
/**
|
|
13
13
|
* Property, the data object for the property.
|
|
14
|
-
* @type {UmbPropertyTypeModel}
|
|
14
|
+
* @type {UmbPropertyTypeModel | UmbPropertyTypeScaffoldModel | undefined}
|
|
15
15
|
* @attr
|
|
16
16
|
* @default undefined
|
|
17
17
|
*/
|
|
18
|
-
get property(): UmbPropertyTypeModel | undefined;
|
|
19
|
-
set property(value: UmbPropertyTypeModel | undefined);
|
|
18
|
+
get property(): UmbPropertyTypeModel | UmbPropertyTypeScaffoldModel | undefined;
|
|
19
|
+
set property(value: UmbPropertyTypeModel | UmbPropertyTypeScaffoldModel | undefined);
|
|
20
20
|
/**
|
|
21
21
|
* Inherited, Determines if the property is part of the main document type thats being edited.
|
|
22
22
|
* If true, then the property is inherited from another document type, not a part of the main document type.
|
|
@@ -31,7 +31,7 @@ import { UmbTextStyles } from '../../../../../../shared/style/index.js';
|
|
|
31
31
|
let UmbDocumentTypeWorkspacePropertyElement = class UmbDocumentTypeWorkspacePropertyElement extends UmbLitElement {
|
|
32
32
|
/**
|
|
33
33
|
* Property, the data object for the property.
|
|
34
|
-
* @type {UmbPropertyTypeModel}
|
|
34
|
+
* @type {UmbPropertyTypeModel | UmbPropertyTypeScaffoldModel | undefined}
|
|
35
35
|
* @attr
|
|
36
36
|
* @default undefined
|
|
37
37
|
*/
|
|
@@ -42,7 +42,7 @@ let UmbDocumentTypeWorkspacePropertyElement = class UmbDocumentTypeWorkspaceProp
|
|
|
42
42
|
const oldValue = this._property;
|
|
43
43
|
this._property = value;
|
|
44
44
|
__classPrivateFieldGet(this, _UmbDocumentTypeWorkspacePropertyElement_modalRegistration, "f").setUniquePathValue('propertyId', value?.id?.toString());
|
|
45
|
-
this.setDataType(this._property?.dataType
|
|
45
|
+
this.setDataType(this._property?.dataType?.unique);
|
|
46
46
|
this.requestUpdate('property', oldValue);
|
|
47
47
|
}
|
|
48
48
|
get modalRoute() {
|
|
@@ -72,6 +72,9 @@ let UmbDocumentTypeWorkspacePropertyElement = class UmbDocumentTypeWorkspaceProp
|
|
|
72
72
|
return { data: { documentTypeId }, value: propertyData };
|
|
73
73
|
})
|
|
74
74
|
.onSubmit((result) => {
|
|
75
|
+
if (!result.dataType) {
|
|
76
|
+
throw new Error('No dataType found on property');
|
|
77
|
+
}
|
|
75
78
|
this._partialUpdate(result);
|
|
76
79
|
})
|
|
77
80
|
.observeRouteBuilder((routeBuilder) => {
|
|
@@ -209,7 +212,7 @@ let UmbDocumentTypeWorkspacePropertyElement = class UmbDocumentTypeWorkspaceProp
|
|
|
209
212
|
renderPropertyTags() {
|
|
210
213
|
return this.property
|
|
211
214
|
? html `<div class="types">
|
|
212
|
-
${this.property.dataType
|
|
215
|
+
${this.property.dataType?.unique ? html `<uui-tag look="default">${this._dataTypeName}</uui-tag>` : nothing}
|
|
213
216
|
${this.property.variesByCulture
|
|
214
217
|
? html `<uui-tag look="default">
|
|
215
218
|
<uui-icon name="icon-shuffle"></uui-icon> ${this.localize.term('contentTypeEditor_cultureVariantLabel')}
|
|
@@ -18,7 +18,6 @@ export declare class UmbMediaTypeWorkspaceViewEditPropertiesElement extends UmbL
|
|
|
18
18
|
protected _modalRouteNewProperty?: string;
|
|
19
19
|
_sortModeActive?: boolean;
|
|
20
20
|
constructor();
|
|
21
|
-
connectedCallback(): void;
|
|
22
21
|
render(): import("lit-html").TemplateResult<1>;
|
|
23
22
|
static styles: import("../../../../../../external/lit/index.js").CSSResult[];
|
|
24
23
|
}
|
|
@@ -91,12 +91,18 @@ let UmbMediaTypeWorkspaceViewEditPropertiesElement = class UmbMediaTypeWorkspace
|
|
|
91
91
|
}));
|
|
92
92
|
this._propertyStructureHelper = new UmbContentTypePropertyStructureHelper(this);
|
|
93
93
|
this._propertyStructure = [];
|
|
94
|
-
this.consumeContext(UMB_WORKSPACE_CONTEXT, (workspaceContext) => {
|
|
94
|
+
this.consumeContext(UMB_WORKSPACE_CONTEXT, async (workspaceContext) => {
|
|
95
95
|
this._propertyStructureHelper.setStructureManager(workspaceContext.structure);
|
|
96
96
|
this.observe(workspaceContext.isSorting, (isSorting) => {
|
|
97
97
|
this._sortModeActive = isSorting;
|
|
98
98
|
__classPrivateFieldGet(this, _UmbMediaTypeWorkspaceViewEditPropertiesElement_instances, "m", _UmbMediaTypeWorkspaceViewEditPropertiesElement_setModel).call(this, isSorting);
|
|
99
99
|
}, '_observeIsSorting');
|
|
100
|
+
const mediaTypesObservable = await this._propertyStructureHelper.ownerDocumentTypes();
|
|
101
|
+
if (!mediaTypesObservable)
|
|
102
|
+
return;
|
|
103
|
+
this.observe(mediaTypesObservable, (medias) => {
|
|
104
|
+
this._ownerMediaTypes = medias;
|
|
105
|
+
}, 'observeOwnerMediaTypes');
|
|
100
106
|
});
|
|
101
107
|
this.observe(this._propertyStructureHelper.propertyStructure, (propertyStructure) => {
|
|
102
108
|
this._propertyStructure = propertyStructure;
|
|
@@ -114,21 +120,15 @@ let UmbMediaTypeWorkspaceViewEditPropertiesElement = class UmbMediaTypeWorkspace
|
|
|
114
120
|
return { data: { documentTypeId: mediaTypeId }, value: propertyData }; //TODO: Should we have a separate modal for mediaTypes?
|
|
115
121
|
})
|
|
116
122
|
.onSubmit((value) => {
|
|
123
|
+
if (!value.dataType) {
|
|
124
|
+
throw new Error('No data type selected');
|
|
125
|
+
}
|
|
117
126
|
__classPrivateFieldGet(this, _UmbMediaTypeWorkspaceViewEditPropertiesElement_instances, "m", _UmbMediaTypeWorkspaceViewEditPropertiesElement_addProperty).call(this, value);
|
|
118
127
|
})
|
|
119
128
|
.observeRouteBuilder((routeBuilder) => {
|
|
120
129
|
this._modalRouteNewProperty = routeBuilder(null);
|
|
121
130
|
});
|
|
122
131
|
}
|
|
123
|
-
connectedCallback() {
|
|
124
|
-
super.connectedCallback();
|
|
125
|
-
const mediaTypes = this._propertyStructureHelper.ownerDocumentTypes; //TODO: Should we have a separate propertyStructureHelper for mediaTypes?
|
|
126
|
-
if (!mediaTypes)
|
|
127
|
-
return;
|
|
128
|
-
this.observe(mediaTypes, (medias) => {
|
|
129
|
-
this._ownerMediaTypes = medias;
|
|
130
|
-
}, 'observeOwnerMediaTypes');
|
|
131
|
-
}
|
|
132
132
|
render() {
|
|
133
133
|
return html `<div id="property-list">
|
|
134
134
|
${repeat(this._propertyStructure, (property) => property.id ?? '' + property.container?.id ?? '' + property.sortOrder ?? '', (property) => {
|
|
@@ -72,6 +72,9 @@ let UmbMediaTypeWorkspacePropertyElement = class UmbMediaTypeWorkspacePropertyEl
|
|
|
72
72
|
return { data: { documentTypeId: mediaTypeId }, value: propertyData }; //TODO: Should we have a separate modal for mediaTypes?
|
|
73
73
|
})
|
|
74
74
|
.onSubmit((result) => {
|
|
75
|
+
if (!result.dataType) {
|
|
76
|
+
throw new Error('No dataType found on property');
|
|
77
|
+
}
|
|
75
78
|
this._partialUpdate(result);
|
|
76
79
|
})
|
|
77
80
|
.observeRouteBuilder((routeBuilder) => {
|
|
@@ -209,7 +212,7 @@ let UmbMediaTypeWorkspacePropertyElement = class UmbMediaTypeWorkspacePropertyEl
|
|
|
209
212
|
renderPropertyTags() {
|
|
210
213
|
return this.property
|
|
211
214
|
? html `<div class="types">
|
|
212
|
-
${this.property.dataType
|
|
215
|
+
${this.property.dataType?.unique ? html `<uui-tag look="default">${this._dataTypeName}</uui-tag>` : nothing}
|
|
213
216
|
${this.property.variesByCulture
|
|
214
217
|
? html `<uui-tag look="default">
|
|
215
218
|
<uui-icon name="icon-shuffle"></uui-icon> ${this.localize.term('contentTypeEditor_cultureVariantLabel')}
|
package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.js
CHANGED
|
@@ -139,12 +139,13 @@ let UmbChooseInsertTypeModalElement = class UmbChooseInsertTypeModalElement exte
|
|
|
139
139
|
</uui-button>`
|
|
140
140
|
: ''}
|
|
141
141
|
</div>
|
|
142
|
-
<div class="row">
|
|
142
|
+
<div class="row query-results">
|
|
143
143
|
<span id="results-count">
|
|
144
144
|
${this._templateQuery?.resultCount ?? 0}
|
|
145
145
|
<umb-localize key="template_itemsReturned">items returned, in</umb-localize>
|
|
146
146
|
${this._templateQuery?.executionTime ?? 0} ms
|
|
147
147
|
</span>
|
|
148
|
+
${this._templateQuery?.sampleResults.map((sample) => html `<span><uui-icon name=${sample.icon}></uui-icon>${sample.name}</span>`) ?? ''}
|
|
148
149
|
</div>
|
|
149
150
|
<umb-code-block language="C#" copy>${this._templateQuery?.queryExpression ?? ''}</umb-code-block>
|
|
150
151
|
</uui-box>
|
|
@@ -279,6 +280,16 @@ UmbChooseInsertTypeModalElement.styles = [
|
|
|
279
280
|
#results-count {
|
|
280
281
|
font-weight: bold;
|
|
281
282
|
}
|
|
283
|
+
.query-results {
|
|
284
|
+
flex-direction: column;
|
|
285
|
+
align-items: flex-start;
|
|
286
|
+
gap: 0;
|
|
287
|
+
}
|
|
288
|
+
.query-results span {
|
|
289
|
+
display: flex;
|
|
290
|
+
align-items: center;
|
|
291
|
+
gap: var(--uui-size-1);
|
|
292
|
+
}
|
|
282
293
|
`,
|
|
283
294
|
];
|
|
284
295
|
__decorate([
|