@umbraco-cms/backoffice 17.0.0 → 17.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cms/assets/lang/da.js +5 -5
- package/dist-cms/assets/lang/en.js +1 -1
- package/dist-cms/packages/content/content/workspace/content-detail-workspace-base.d.ts +4 -3
- package/dist-cms/packages/content/content/workspace/content-detail-workspace-base.js +25 -19
- package/dist-cms/packages/content/content-type/workspace/content-type-workspace-context-base.js +0 -1
- package/dist-cms/packages/core/tree/tree-item/tree-item-children.manager.js +69 -10
- package/dist-cms/packages/core/workspace/entity-detail/entity-detail-workspace-base.js +2 -3
- package/dist-cms/packages/data-type/reference/info-app/manifests.js +8 -4
- package/dist-cms/packages/documents/documents/reference/info-app/manifests.js +8 -4
- package/dist-cms/packages/documents/documents/workspace/document-workspace.context.d.ts +1 -1
- package/dist-cms/packages/documents/documents/workspace/document-workspace.context.js +10 -12
- package/dist-cms/packages/management-api/tree/tree-data.request-manager.js +3 -0
- package/dist-cms/packages/media/media/reference/info-app/manifests.js +8 -4
- package/dist-cms/packages/members/member/reference/info-app/manifests.js +8 -4
- package/dist-cms/packages/relations/relations/reference/workspace-info-app/entity-references-workspace-view-info.element.d.ts +1 -2
- package/dist-cms/packages/relations/relations/reference/workspace-info-app/entity-references-workspace-view-info.element.js +9 -3
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/umbraco-package.json +1 -1
- package/package.json +1 -1
|
@@ -548,7 +548,7 @@ export default {
|
|
|
548
548
|
chooseMediaStartNode: 'Vælg startnode for medie',
|
|
549
549
|
selectMediaType: 'Vælg medietype',
|
|
550
550
|
selectIcon: 'Vælg ikon',
|
|
551
|
-
selectItem: 'Vælg
|
|
551
|
+
selectItem: 'Vælg element',
|
|
552
552
|
selectLink: 'Vælg link',
|
|
553
553
|
addLink: 'Tilføj Link',
|
|
554
554
|
updateLink: 'Opdater Link',
|
|
@@ -2199,10 +2199,10 @@ export default {
|
|
|
2199
2199
|
labelUsedByDocuments: 'Brugt i Dokumenter',
|
|
2200
2200
|
labelUsedByMembers: 'Brugt i Medlemmer',
|
|
2201
2201
|
labelUsedByMedia: 'Brugt i Medier',
|
|
2202
|
-
itemHasNoReferences: '
|
|
2203
|
-
labelUsedByDocumentTypes: '
|
|
2204
|
-
labelUsedByItems: '
|
|
2205
|
-
labelDependsOnThis: '
|
|
2202
|
+
itemHasNoReferences: 'Ingen referencer',
|
|
2203
|
+
labelUsedByDocumentTypes: 'Refereret af følgende Dokument Typer',
|
|
2204
|
+
labelUsedByItems: 'Refereret af',
|
|
2205
|
+
labelDependsOnThis: 'Følgende elementer er afhængige af dette',
|
|
2206
2206
|
labelUsedItems: 'The following items are referenced',
|
|
2207
2207
|
labelUsedDescendants: 'The following descendant items have dependencies',
|
|
2208
2208
|
labelDependentDescendants: 'The following descending items have dependencies',
|
|
@@ -2268,7 +2268,7 @@ export default {
|
|
|
2268
2268
|
unpublishWarning: 'This item or its descendants is being used. Unpublishing can lead to broken links on your website. Please take the appropriate actions.',
|
|
2269
2269
|
deleteDisabledWarning: 'This item or its descendants is being used. Therefore, deletion has been disabled.',
|
|
2270
2270
|
listViewDialogWarning: 'The following items you are trying to %0% are used by other content.',
|
|
2271
|
-
labelUsedByItems: 'Referenced by
|
|
2271
|
+
labelUsedByItems: 'Referenced by',
|
|
2272
2272
|
labelDependsOnThis: 'The following items depend on this',
|
|
2273
2273
|
labelDependentDescendants: 'The following descending items have dependencies',
|
|
2274
2274
|
labelMoreReferences: (count) => {
|
|
@@ -81,11 +81,12 @@ export declare abstract class UmbContentDetailWorkspaceContextBase<DetailModelTy
|
|
|
81
81
|
getVariantValidationContext(variantId: UmbVariantId): UmbValidationController | undefined;
|
|
82
82
|
constructor(host: UmbControllerHost, args: UmbContentDetailWorkspaceContextArgs<DetailModelType, ContentTypeDetailModelType, VariantModelType, VariantOptionModelType>);
|
|
83
83
|
loadLanguages(): Promise<void>;
|
|
84
|
-
protected loadSegments(): Promise<void>;
|
|
85
84
|
/**
|
|
86
|
-
* @deprecated Call `
|
|
85
|
+
* @deprecated Call `_loadSegmentsFor` instead. `loadSegments` will be removed in v.18.
|
|
86
|
+
* (note this was introduced in v.17, and deprecated in v.17.0.1)
|
|
87
87
|
*/
|
|
88
|
-
protected
|
|
88
|
+
protected loadSegments(): Promise<void>;
|
|
89
|
+
protected _loadSegmentsFor(unique: string): Promise<void>;
|
|
89
90
|
protected _processIncomingData(data: DetailModelType): Promise<DetailModelType>;
|
|
90
91
|
/**
|
|
91
92
|
* Get the name of a variant
|
|
@@ -221,12 +221,6 @@ export class UmbContentDetailWorkspaceContextBase extends UmbEntityDetailWorkspa
|
|
|
221
221
|
this.observe(this.variesBySegment, (varies) => {
|
|
222
222
|
this._data.setVariesBySegment(varies);
|
|
223
223
|
this.#variesBySegment = varies;
|
|
224
|
-
if (varies) {
|
|
225
|
-
this.loadSegments();
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
this._segments.setValue([]);
|
|
229
|
-
}
|
|
230
224
|
}, null);
|
|
231
225
|
this.observe(this.structure.contentTypeDataTypeUniques, (dataTypeUniques) => {
|
|
232
226
|
this.#dataTypeItemManager.setUniques(dataTypeUniques);
|
|
@@ -238,16 +232,24 @@ export class UmbContentDetailWorkspaceContextBase extends UmbEntityDetailWorkspa
|
|
|
238
232
|
const { data } = await this.#languageRepository.requestCollection({});
|
|
239
233
|
this.#languages.setValue(data?.items ?? []);
|
|
240
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* @deprecated Call `_loadSegmentsFor` instead. `loadSegments` will be removed in v.18.
|
|
237
|
+
* (note this was introduced in v.17, and deprecated in v.17.0.1)
|
|
238
|
+
*/
|
|
241
239
|
async loadSegments() {
|
|
240
|
+
console.warn('Stop using loadSegments, call _loadSegmentsFor instead. loadSegments will be removed in v.18.');
|
|
241
|
+
const unique = await firstValueFrom(this.unique);
|
|
242
|
+
if (!unique) {
|
|
243
|
+
this._segments.setValue([]);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
this._loadSegmentsFor(unique);
|
|
247
|
+
}
|
|
248
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
249
|
+
async _loadSegmentsFor(unique) {
|
|
242
250
|
console.warn(`UmbContentDetailWorkspaceContextBase: Segments are not implemented in the workspace context for "${this.getEntityType()}" types.`);
|
|
243
251
|
this._segments.setValue([]);
|
|
244
252
|
}
|
|
245
|
-
/**
|
|
246
|
-
* @deprecated Call `_processIncomingData` instead. `_scaffoldProcessData` will be removed in v.18.
|
|
247
|
-
*/
|
|
248
|
-
_scaffoldProcessData(data) {
|
|
249
|
-
return this._processIncomingData(data);
|
|
250
|
-
}
|
|
251
253
|
async _processIncomingData(data) {
|
|
252
254
|
const contentTypeUnique = data[this.#contentTypePropertyName].unique;
|
|
253
255
|
if (!contentTypeUnique) {
|
|
@@ -255,20 +257,24 @@ export class UmbContentDetailWorkspaceContextBase extends UmbEntityDetailWorkspa
|
|
|
255
257
|
}
|
|
256
258
|
// Load the content type structure, usually this comes from the data, but in this case we are making the data, and we need this to be able to complete the data. [NL]
|
|
257
259
|
await this.structure.loadType(contentTypeUnique);
|
|
260
|
+
// Load segments if varying by segment, or reset to empty array:
|
|
261
|
+
if (this.#variesBySegment) {
|
|
262
|
+
await this._loadSegmentsFor(data.unique);
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
this._segments.setValue([]);
|
|
266
|
+
}
|
|
258
267
|
// Set culture and segment for all values:
|
|
259
268
|
const cultures = this.#languages.getValue().map((x) => x.unique);
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
269
|
+
let segments;
|
|
270
|
+
if (this.#variesBySegment) {
|
|
271
|
+
segments = this._segments.getValue().map((s) => s.alias);
|
|
263
272
|
}
|
|
264
|
-
// TODO: Add Segments for Presets:
|
|
265
|
-
const segments = this.structure.variesBySegment ? [] : undefined;
|
|
266
273
|
const repo = new UmbDataTypeDetailRepository(this);
|
|
267
274
|
const propertyTypes = await this.structure.getContentTypeProperties();
|
|
268
275
|
const contentTypeVariesByCulture = this.structure.getVariesByCulture();
|
|
269
|
-
const contentTypeVariesBySegment = this.structure.
|
|
276
|
+
const contentTypeVariesBySegment = this.structure.getVariesBySegment();
|
|
270
277
|
const valueDefinitions = await Promise.all(propertyTypes.map(async (property) => {
|
|
271
|
-
// TODO: Implement caching for data-type requests. [NL]
|
|
272
278
|
const dataType = (await repo.requestByUnique(property.dataType.unique)).data;
|
|
273
279
|
// This means if its not loaded this will never resolve and the error below will never happen.
|
|
274
280
|
if (!dataType) {
|
package/dist-cms/packages/content/content-type/workspace/content-type-workspace-context-base.js
CHANGED
|
@@ -37,7 +37,6 @@ export class UmbContentTypeWorkspaceContextBase extends UmbEntityDetailWorkspace
|
|
|
37
37
|
this._getDataPromise = request;
|
|
38
38
|
let { data } = await request;
|
|
39
39
|
if (data) {
|
|
40
|
-
data = await this._processIncomingData(data);
|
|
41
40
|
data = await this._scaffoldProcessData(data);
|
|
42
41
|
if (this.modalContext) {
|
|
43
42
|
// Notice if the preset comes with values, they will overwrite the scaffolded values... [NL]
|
|
@@ -208,7 +208,7 @@ export class UmbTreeItemChildrenManager extends UmbControllerBase {
|
|
|
208
208
|
async #loadChildren(reload = false) {
|
|
209
209
|
if (this.#loadChildrenRetries > this.#requestMaxRetries) {
|
|
210
210
|
this.#loadChildrenRetries = 0;
|
|
211
|
-
this.#resetChildren();
|
|
211
|
+
this.#resetChildren('error');
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
214
214
|
const repository = this.#treeContext?.getRepository();
|
|
@@ -284,7 +284,7 @@ export class UmbTreeItemChildrenManager extends UmbControllerBase {
|
|
|
284
284
|
We cancel the base target and load using skip/take pagination instead.
|
|
285
285
|
This can happen if deep linked to a non existing item or all retries have failed.
|
|
286
286
|
*/
|
|
287
|
-
this.#resetChildren();
|
|
287
|
+
this.#resetChildren(this.#children.getValue().length === 0 ? 'empty' : 'fallback');
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
if (data) {
|
|
@@ -305,7 +305,7 @@ export class UmbTreeItemChildrenManager extends UmbControllerBase {
|
|
|
305
305
|
if (this.#loadPrevItemsRetries > this.#requestMaxRetries) {
|
|
306
306
|
// If we have exceeded the maximum number of retries, we need to reset the base target and load from the top
|
|
307
307
|
this.#loadPrevItemsRetries = 0;
|
|
308
|
-
this.#resetChildren();
|
|
308
|
+
this.#resetChildren('error');
|
|
309
309
|
return;
|
|
310
310
|
}
|
|
311
311
|
const repository = this.#treeContext?.getRepository();
|
|
@@ -349,7 +349,7 @@ export class UmbTreeItemChildrenManager extends UmbControllerBase {
|
|
|
349
349
|
If we can't find a new end target we reload the children from the top.
|
|
350
350
|
We cancel the base target and load using skip/take pagination instead.
|
|
351
351
|
*/
|
|
352
|
-
this.#resetChildren();
|
|
352
|
+
this.#resetChildren(this.#children.getValue().length === 0 ? 'empty' : 'fallback');
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
if (data) {
|
|
@@ -373,7 +373,7 @@ export class UmbTreeItemChildrenManager extends UmbControllerBase {
|
|
|
373
373
|
if (this.#loadNextItemsRetries > this.#requestMaxRetries) {
|
|
374
374
|
// If we have exceeded the maximum number of retries, we need to reset the base target and load from the top
|
|
375
375
|
this.#loadNextItemsRetries = 0;
|
|
376
|
-
this.#resetChildren();
|
|
376
|
+
this.#resetChildren('error');
|
|
377
377
|
return;
|
|
378
378
|
}
|
|
379
379
|
const repository = this.#treeContext?.getRepository();
|
|
@@ -425,7 +425,7 @@ export class UmbTreeItemChildrenManager extends UmbControllerBase {
|
|
|
425
425
|
If we can't find a new end target we reload the children from the top.
|
|
426
426
|
We cancel the base target and load using skip/take pagination instead.
|
|
427
427
|
*/
|
|
428
|
-
this.#resetChildren();
|
|
428
|
+
this.#resetChildren(this.#children.getValue().length === 0 ? 'empty' : 'fallback');
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
if (data) {
|
|
@@ -469,12 +469,71 @@ export class UmbTreeItemChildrenManager extends UmbControllerBase {
|
|
|
469
469
|
this.offsetPagination.clear();
|
|
470
470
|
this.targetPagination.clear();
|
|
471
471
|
}
|
|
472
|
-
|
|
472
|
+
/**
|
|
473
|
+
* Loads children using offset pagination only.
|
|
474
|
+
* This is a "safe" fallback that does NOT:
|
|
475
|
+
* - Use target pagination
|
|
476
|
+
* - Retry with new targets
|
|
477
|
+
* - Call #resetChildren (preventing recursion)
|
|
478
|
+
* - Throw errors (fails gracefully)
|
|
479
|
+
*/
|
|
480
|
+
async #loadChildrenWithOffsetPagination() {
|
|
481
|
+
const repository = this.#treeContext?.getRepository();
|
|
482
|
+
if (!repository) {
|
|
483
|
+
// Terminal fallback - fail silently rather than throwing
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
this.#isLoading.setValue(true);
|
|
487
|
+
const parent = this.getStartNode() || this.getTreeItem();
|
|
488
|
+
const foldersOnly = this.getFoldersOnly();
|
|
489
|
+
const additionalArgs = this.getAdditionalRequestArgs();
|
|
490
|
+
const offsetPaging = {
|
|
491
|
+
skip: 0, // Always from the start
|
|
492
|
+
take: this.offsetPagination.getPageSize(),
|
|
493
|
+
};
|
|
494
|
+
const { data } = parent?.unique
|
|
495
|
+
? await repository.requestTreeItemsOf({
|
|
496
|
+
parent: { unique: parent.unique, entityType: parent.entityType },
|
|
497
|
+
skip: offsetPaging.skip,
|
|
498
|
+
take: offsetPaging.take,
|
|
499
|
+
paging: offsetPaging,
|
|
500
|
+
foldersOnly,
|
|
501
|
+
...additionalArgs,
|
|
502
|
+
})
|
|
503
|
+
: await repository.requestTreeRootItems({
|
|
504
|
+
skip: offsetPaging.skip,
|
|
505
|
+
take: offsetPaging.take,
|
|
506
|
+
paging: offsetPaging,
|
|
507
|
+
foldersOnly,
|
|
508
|
+
...additionalArgs,
|
|
509
|
+
});
|
|
510
|
+
if (data) {
|
|
511
|
+
const items = data.items;
|
|
512
|
+
this.#children.setValue(items);
|
|
513
|
+
this.setHasChildren(data.total > 0);
|
|
514
|
+
this.offsetPagination.setTotalItems(data.total);
|
|
515
|
+
}
|
|
516
|
+
// Note: On error, we simply don't update state - UI shows stale data
|
|
517
|
+
// This is the terminal fallback, no further recovery
|
|
518
|
+
this.#isLoading.setValue(false);
|
|
519
|
+
}
|
|
520
|
+
async #resetChildren(reason = 'error') {
|
|
521
|
+
// Clear pagination state
|
|
473
522
|
this.targetPagination.clear();
|
|
474
523
|
this.offsetPagination.clear();
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
524
|
+
// Reset retry counters to prevent any lingering retry state
|
|
525
|
+
this.#loadChildrenRetries = 0;
|
|
526
|
+
this.#loadPrevItemsRetries = 0;
|
|
527
|
+
this.#loadNextItemsRetries = 0;
|
|
528
|
+
// Load using offset pagination only - this is our terminal fallback
|
|
529
|
+
await this.#loadChildrenWithOffsetPagination();
|
|
530
|
+
// Only show notification for actual errors
|
|
531
|
+
if (reason === 'error') {
|
|
532
|
+
const notificationManager = await this.getContext(UMB_NOTIFICATION_CONTEXT);
|
|
533
|
+
notificationManager?.peek('danger', {
|
|
534
|
+
data: { message: 'Menu loading failed. Showing the first items again.' },
|
|
535
|
+
});
|
|
536
|
+
}
|
|
478
537
|
}
|
|
479
538
|
#onPageChange;
|
|
480
539
|
#listenForActionEvents() {
|
|
@@ -231,7 +231,7 @@ export class UmbEntityDetailWorkspaceContextBase extends UmbSubmittableWorkspace
|
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
else if (data) {
|
|
234
|
-
const processedData = await this.
|
|
234
|
+
const processedData = await this._scaffoldProcessData(data);
|
|
235
235
|
this._data.setPersisted(processedData);
|
|
236
236
|
this._data.setCurrent(processedData);
|
|
237
237
|
this.observe(asObservable?.(), (entity) => this.#onDetailStoreChange(entity), 'umbEntityDetailTypeStoreObserver');
|
|
@@ -281,7 +281,6 @@ export class UmbEntityDetailWorkspaceContextBase extends UmbSubmittableWorkspace
|
|
|
281
281
|
this._getDataPromise = request;
|
|
282
282
|
let { data } = await request;
|
|
283
283
|
if (data) {
|
|
284
|
-
data = await this._processIncomingData(data);
|
|
285
284
|
data = await this._scaffoldProcessData(data);
|
|
286
285
|
if (this.modalContext) {
|
|
287
286
|
// Notice if the preset comes with values, they will overwrite the scaffolded values... [NL]
|
|
@@ -301,7 +300,7 @@ export class UmbEntityDetailWorkspaceContextBase extends UmbSubmittableWorkspace
|
|
|
301
300
|
* @returns {Promise<DetailModelType>} The processed data.
|
|
302
301
|
*/
|
|
303
302
|
async _scaffoldProcessData(data) {
|
|
304
|
-
return data;
|
|
303
|
+
return await this._processIncomingData(data);
|
|
305
304
|
}
|
|
306
305
|
async _processIncomingData(data) {
|
|
307
306
|
return data;
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { UMB_DATA_TYPE_WORKSPACE_ALIAS } from '../../workspace/constants.js';
|
|
2
2
|
import { UMB_DATA_TYPE_REFERENCE_REPOSITORY_ALIAS } from '../constants.js';
|
|
3
|
-
import { UMB_WORKSPACE_CONDITION_ALIAS } from '../../../core/workspace/index.js';
|
|
3
|
+
import { UMB_WORKSPACE_CONDITION_ALIAS, UMB_WORKSPACE_ENTITY_IS_NEW_CONDITION_ALIAS, } from '../../../core/workspace/index.js';
|
|
4
4
|
export const manifests = [
|
|
5
5
|
{
|
|
6
6
|
type: 'workspaceInfoApp',
|
|
7
7
|
kind: 'entityReferences',
|
|
8
8
|
name: 'Data Type References Workspace Info App',
|
|
9
9
|
alias: 'Umb.WorkspaceInfoApp.DataType.References',
|
|
10
|
+
meta: {
|
|
11
|
+
referenceRepositoryAlias: UMB_DATA_TYPE_REFERENCE_REPOSITORY_ALIAS,
|
|
12
|
+
},
|
|
10
13
|
conditions: [
|
|
11
14
|
{
|
|
12
15
|
alias: UMB_WORKSPACE_CONDITION_ALIAS,
|
|
13
16
|
match: UMB_DATA_TYPE_WORKSPACE_ALIAS,
|
|
14
17
|
},
|
|
18
|
+
{
|
|
19
|
+
alias: UMB_WORKSPACE_ENTITY_IS_NEW_CONDITION_ALIAS,
|
|
20
|
+
match: false,
|
|
21
|
+
},
|
|
15
22
|
],
|
|
16
|
-
meta: {
|
|
17
|
-
referenceRepositoryAlias: UMB_DATA_TYPE_REFERENCE_REPOSITORY_ALIAS,
|
|
18
|
-
},
|
|
19
23
|
},
|
|
20
24
|
];
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { UMB_DOCUMENT_WORKSPACE_ALIAS } from '../../workspace/constants.js';
|
|
2
2
|
import { UMB_DOCUMENT_REFERENCE_REPOSITORY_ALIAS } from '../constants.js';
|
|
3
|
-
import { UMB_WORKSPACE_CONDITION_ALIAS } from '../../../../core/workspace/index.js';
|
|
3
|
+
import { UMB_WORKSPACE_CONDITION_ALIAS, UMB_WORKSPACE_ENTITY_IS_NEW_CONDITION_ALIAS, } from '../../../../core/workspace/index.js';
|
|
4
4
|
export const manifests = [
|
|
5
5
|
{
|
|
6
6
|
type: 'workspaceInfoApp',
|
|
7
7
|
kind: 'entityReferences',
|
|
8
8
|
name: 'Document References Workspace Info App',
|
|
9
9
|
alias: 'Umb.WorkspaceInfoApp.Document.References',
|
|
10
|
+
meta: {
|
|
11
|
+
referenceRepositoryAlias: UMB_DOCUMENT_REFERENCE_REPOSITORY_ALIAS,
|
|
12
|
+
},
|
|
10
13
|
conditions: [
|
|
11
14
|
{
|
|
12
15
|
alias: UMB_WORKSPACE_CONDITION_ALIAS,
|
|
13
16
|
match: UMB_DOCUMENT_WORKSPACE_ALIAS,
|
|
14
17
|
},
|
|
18
|
+
{
|
|
19
|
+
alias: UMB_WORKSPACE_ENTITY_IS_NEW_CONDITION_ALIAS,
|
|
20
|
+
match: false,
|
|
21
|
+
},
|
|
15
22
|
],
|
|
16
|
-
meta: {
|
|
17
|
-
referenceRepositoryAlias: UMB_DOCUMENT_REFERENCE_REPOSITORY_ALIAS,
|
|
18
|
-
},
|
|
19
23
|
},
|
|
20
24
|
];
|
|
@@ -18,7 +18,7 @@ export declare class UmbDocumentWorkspaceContext extends UmbContentDetailWorkspa
|
|
|
18
18
|
readonly templateId: import("rxjs").Observable<string | null>;
|
|
19
19
|
constructor(host: UmbControllerHost);
|
|
20
20
|
resetState(): void;
|
|
21
|
-
protected
|
|
21
|
+
protected _loadSegmentsFor(unique: string): Promise<void>;
|
|
22
22
|
create(parent: UmbEntityModel, documentTypeUnique: string, blueprintUnique?: string): Promise<UmbDocumentDetailModel | undefined>;
|
|
23
23
|
/** @deprecated will be removed in v.18 */
|
|
24
24
|
getCollectionAlias(): string;
|
|
@@ -152,18 +152,16 @@ export class UmbDocumentWorkspaceContext extends UmbContentDetailWorkspaceContex
|
|
|
152
152
|
super.resetState();
|
|
153
153
|
this.#isTrashedContext.setIsTrashed(false);
|
|
154
154
|
}
|
|
155
|
-
async
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
this._segments.setValue(data?.items ?? []);
|
|
166
|
-
}, '_loadSegmentsUnique');
|
|
155
|
+
async _loadSegmentsFor(unique) {
|
|
156
|
+
if (!unique) {
|
|
157
|
+
this._segments.setValue([]);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const { data } = await this.#documentSegmentRepository.getDocumentByIdSegmentOptions(unique, {
|
|
161
|
+
skip: 0,
|
|
162
|
+
take: 9999,
|
|
163
|
+
});
|
|
164
|
+
this._segments.setValue(data?.items ?? []);
|
|
167
165
|
}
|
|
168
166
|
async create(parent, documentTypeUnique, blueprintUnique) {
|
|
169
167
|
if (blueprintUnique) {
|
|
@@ -137,6 +137,9 @@ export class UmbManagementApiTreeDataRequestManager extends UmbControllerBase {
|
|
|
137
137
|
return args.take !== undefined ? args.take : this.#defaultTakeSize;
|
|
138
138
|
}
|
|
139
139
|
#getTargetResultHasValidParents(data, parentUnique) {
|
|
140
|
+
if (!data) {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
140
143
|
return data.every((item) => {
|
|
141
144
|
if (item.parent) {
|
|
142
145
|
return item.parent.id === parentUnique;
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { UMB_MEDIA_WORKSPACE_ALIAS } from '../../workspace/constants.js';
|
|
2
2
|
import { UMB_MEDIA_REFERENCE_REPOSITORY_ALIAS } from '../constants.js';
|
|
3
|
-
import { UMB_WORKSPACE_CONDITION_ALIAS } from '../../../../core/workspace/index.js';
|
|
3
|
+
import { UMB_WORKSPACE_CONDITION_ALIAS, UMB_WORKSPACE_ENTITY_IS_NEW_CONDITION_ALIAS, } from '../../../../core/workspace/index.js';
|
|
4
4
|
export const manifests = [
|
|
5
5
|
{
|
|
6
6
|
type: 'workspaceInfoApp',
|
|
7
7
|
kind: 'entityReferences',
|
|
8
8
|
name: 'Media References Workspace Info App',
|
|
9
9
|
alias: 'Umb.WorkspaceInfoApp.Media.References',
|
|
10
|
+
meta: {
|
|
11
|
+
referenceRepositoryAlias: UMB_MEDIA_REFERENCE_REPOSITORY_ALIAS,
|
|
12
|
+
},
|
|
10
13
|
conditions: [
|
|
11
14
|
{
|
|
12
15
|
alias: UMB_WORKSPACE_CONDITION_ALIAS,
|
|
13
16
|
match: UMB_MEDIA_WORKSPACE_ALIAS,
|
|
14
17
|
},
|
|
18
|
+
{
|
|
19
|
+
alias: UMB_WORKSPACE_ENTITY_IS_NEW_CONDITION_ALIAS,
|
|
20
|
+
match: false,
|
|
21
|
+
},
|
|
15
22
|
],
|
|
16
|
-
meta: {
|
|
17
|
-
referenceRepositoryAlias: UMB_MEDIA_REFERENCE_REPOSITORY_ALIAS,
|
|
18
|
-
},
|
|
19
23
|
},
|
|
20
24
|
];
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { UMB_MEMBER_WORKSPACE_ALIAS } from '../../workspace/constants.js';
|
|
2
2
|
import { UMB_MEMBER_REFERENCE_REPOSITORY_ALIAS } from '../constants.js';
|
|
3
|
-
import { UMB_WORKSPACE_CONDITION_ALIAS } from '../../../../core/workspace/index.js';
|
|
3
|
+
import { UMB_WORKSPACE_CONDITION_ALIAS, UMB_WORKSPACE_ENTITY_IS_NEW_CONDITION_ALIAS, } from '../../../../core/workspace/index.js';
|
|
4
4
|
export const manifests = [
|
|
5
5
|
{
|
|
6
6
|
type: 'workspaceInfoApp',
|
|
7
7
|
kind: 'entityReferences',
|
|
8
8
|
name: 'Member References Workspace Info App',
|
|
9
9
|
alias: 'Umb.WorkspaceInfoApp.Member.References',
|
|
10
|
+
meta: {
|
|
11
|
+
referenceRepositoryAlias: UMB_MEMBER_REFERENCE_REPOSITORY_ALIAS,
|
|
12
|
+
},
|
|
10
13
|
conditions: [
|
|
11
14
|
{
|
|
12
15
|
alias: UMB_WORKSPACE_CONDITION_ALIAS,
|
|
13
16
|
match: UMB_MEMBER_WORKSPACE_ALIAS,
|
|
14
17
|
},
|
|
18
|
+
{
|
|
19
|
+
alias: UMB_WORKSPACE_ENTITY_IS_NEW_CONDITION_ALIAS,
|
|
20
|
+
match: false,
|
|
21
|
+
},
|
|
15
22
|
],
|
|
16
|
-
meta: {
|
|
17
|
-
referenceRepositoryAlias: UMB_MEMBER_REFERENCE_REPOSITORY_ALIAS,
|
|
18
|
-
},
|
|
19
23
|
},
|
|
20
24
|
];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ManifestWorkspaceInfoAppEntityReferencesKind } from './types.js';
|
|
2
|
-
import { nothing } from '../../../../../external/lit/index.js';
|
|
3
2
|
import { UmbLitElement } from '../../../../core/lit-element/index.js';
|
|
4
3
|
export declare class UmbEntityReferencesWorkspaceInfoAppElement extends UmbLitElement {
|
|
5
4
|
#private;
|
|
@@ -10,7 +9,7 @@ export declare class UmbEntityReferencesWorkspaceInfoAppElement extends UmbLitEl
|
|
|
10
9
|
private _total;
|
|
11
10
|
private _items?;
|
|
12
11
|
constructor();
|
|
13
|
-
render():
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
14
13
|
static styles: import("lit").CSSResult[];
|
|
15
14
|
}
|
|
16
15
|
export { UmbEntityReferencesWorkspaceInfoAppElement as element };
|
|
@@ -74,8 +74,6 @@ let UmbEntityReferencesWorkspaceInfoAppElement = class UmbEntityReferencesWorksp
|
|
|
74
74
|
this.#getReferences();
|
|
75
75
|
}
|
|
76
76
|
render() {
|
|
77
|
-
if (!this._items?.length)
|
|
78
|
-
return nothing;
|
|
79
77
|
return html `
|
|
80
78
|
<umb-workspace-info-app-layout headline="#references_labelUsedByItems">
|
|
81
79
|
<div id="content">${this.#renderItems()} ${this.#renderReferencePagination()}</div>
|
|
@@ -84,7 +82,10 @@ let UmbEntityReferencesWorkspaceInfoAppElement = class UmbEntityReferencesWorksp
|
|
|
84
82
|
}
|
|
85
83
|
#renderItems() {
|
|
86
84
|
if (!this._items)
|
|
87
|
-
return;
|
|
85
|
+
return nothing;
|
|
86
|
+
if (this._items.length === 0) {
|
|
87
|
+
return html `<umb-localize class="noItems" key="references_itemHasNoReferences"></umb-localize>`;
|
|
88
|
+
}
|
|
88
89
|
return html `
|
|
89
90
|
<uui-ref-list>
|
|
90
91
|
${repeat(this._items, (item) => item.unique, (item) => html `<umb-entity-item-ref .item=${item}></umb-entity-item-ref>`)}
|
|
@@ -116,6 +117,11 @@ let UmbEntityReferencesWorkspaceInfoAppElement = class UmbEntityReferencesWorksp
|
|
|
116
117
|
display: contents;
|
|
117
118
|
}
|
|
118
119
|
|
|
120
|
+
.noItems {
|
|
121
|
+
display: block;
|
|
122
|
+
margin: var(--uui-size-space-2);
|
|
123
|
+
}
|
|
124
|
+
|
|
119
125
|
#content {
|
|
120
126
|
display: block;
|
|
121
127
|
padding: var(--uui-size-space-3) var(--uui-size-space-4);
|