Merge pull request #1616 from umbraco/bugfix/check-for-tree-root-items

Bugfix: Check for tree root items
This commit is contained in:
Lee Kelleher
2024-04-16 07:42:30 +01:00
committed by GitHub
13 changed files with 52 additions and 13 deletions

View File

@@ -15,11 +15,14 @@ export class UmbDataTypeTreeRepository
}
async requestTreeRoot() {
const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 1 });
const hasChildren = treeRootData ? treeRootData.total > 0 : false;
const data: UmbDataTypeTreeRootModel = {
unique: null,
entityType: UMB_DATA_TYPE_ROOT_ENTITY_TYPE,
name: '#treeHeaders_dataTypes',
hasChildren: true,
hasChildren,
isFolder: true,
};

View File

@@ -15,11 +15,14 @@ export class UmbDictionaryTreeRepository
}
async requestTreeRoot() {
const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 1 });
const hasChildren = treeRootData ? treeRootData.total > 0 : false;
const data: UmbDictionaryTreeRootModel = {
unique: null,
entityType: UMB_DICTIONARY_ROOT_ENTITY_TYPE,
name: '#treeHeaders_dictionary',
hasChildren: true,
hasChildren,
isFolder: true,
};

View File

@@ -15,11 +15,14 @@ export class UmbDocumentBlueprintTreeRepository
}
async requestTreeRoot() {
const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 1 });
const hasChildren = treeRootData ? treeRootData.total > 0 : false;
const data: UmbDocumentBlueprintTreeRootModel = {
unique: null,
entityType: UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE,
name: 'Document Blueprints',
hasChildren: true,
hasChildren,
isFolder: true,
};

View File

@@ -15,11 +15,14 @@ export class UmbDocumentTypeTreeRepository
}
async requestTreeRoot() {
const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 1 });
const hasChildren = treeRootData ? treeRootData.total > 0 : false;
const data: UmbDocumentTypeTreeRootModel = {
unique: null,
entityType: UMB_DOCUMENT_TYPE_ROOT_ENTITY_TYPE,
name: '#treeHeaders_documentTypes',
hasChildren: true,
hasChildren,
isFolder: true,
};

View File

@@ -15,11 +15,14 @@ export class UmbDocumentTreeRepository
}
async requestTreeRoot() {
const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 1 });
const hasChildren = treeRootData ? treeRootData.total > 0 : false;
const data: UmbDocumentTreeRootModel = {
unique: null,
entityType: UMB_DOCUMENT_ROOT_ENTITY_TYPE,
name: '#treeHeaders_content',
hasChildren: true,
hasChildren,
isFolder: true,
};

View File

@@ -15,11 +15,14 @@ export class UmbMediaTypeTreeRepository
}
async requestTreeRoot() {
const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 1 });
const hasChildren = treeRootData ? treeRootData.total > 0 : false;
const data: UmbMediaTypeTreeRootModel = {
unique: null,
entityType: UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE,
name: '#treeHeaders_mediaTypes',
hasChildren: true,
hasChildren,
isFolder: true,
};

View File

@@ -15,11 +15,14 @@ export class UmbMediaTreeRepository
}
async requestTreeRoot() {
const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 1 });
const hasChildren = treeRootData ? treeRootData.total > 0 : false;
const data: UmbMediaTreeRootModel = {
unique: null,
entityType: UMB_MEDIA_ROOT_ENTITY_TYPE,
name: '#treeHeaders_media',
hasChildren: true,
hasChildren,
isFolder: true,
};

View File

@@ -15,11 +15,14 @@ export class UmbMemberTypeTreeRepository
}
async requestTreeRoot() {
const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 1 });
const hasChildren = treeRootData ? treeRootData.total > 0 : false;
const data: UmbMemberTypeTreeRootModel = {
unique: null,
entityType: UMB_MEMBER_TYPE_ROOT_ENTITY_TYPE,
name: '#treeHeaders_memberTypes',
hasChildren: true,
hasChildren,
isFolder: true,
};

View File

@@ -15,11 +15,14 @@ export class UmbStaticFileTreeRepository
}
async requestTreeRoot() {
const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 1 });
const hasChildren = treeRootData ? treeRootData.total > 0 : false;
const data: UmbStaticFileTreeRootModel = {
unique: null,
entityType: UMB_STATIC_FILE_ROOT_ENTITY_TYPE,
name: 'Static Files',
hasChildren: true,
hasChildren,
isFolder: true,
};

View File

@@ -15,11 +15,14 @@ export class UmbPartialViewTreeRepository
}
async requestTreeRoot() {
const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 1 });
const hasChildren = treeRootData ? treeRootData.total > 0 : false;
const data: UmbPartialViewTreeRootModel = {
unique: null,
entityType: UMB_PARTIAL_VIEW_ROOT_ENTITY_TYPE,
name: '#treeHeaders_partialViews',
hasChildren: true,
hasChildren,
isFolder: true,
};

View File

@@ -12,11 +12,14 @@ export class UmbScriptTreeRepository extends UmbTreeRepositoryBase<UmbScriptTree
}
async requestTreeRoot() {
const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 1 });
const hasChildren = treeRootData ? treeRootData.total > 0 : false;
const data: UmbScriptTreeRootModel = {
unique: null,
entityType: UMB_SCRIPT_ROOT_ENTITY_TYPE,
name: '#treeHeaders_scripts',
hasChildren: true,
hasChildren,
isFolder: true,
};

View File

@@ -14,11 +14,14 @@ export class UmbStylesheetTreeRepository extends UmbTreeRepositoryBase<
}
async requestTreeRoot() {
const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 1 });
const hasChildren = treeRootData ? treeRootData.total > 0 : false;
const data: UmbStylesheetTreeRootModel = {
unique: null,
entityType: UMB_STYLESHEET_ROOT_ENTITY_TYPE,
name: '#treeHeaders_stylesheets',
hasChildren: true,
hasChildren,
isFolder: true,
};

View File

@@ -15,11 +15,14 @@ export class UmbTemplateTreeRepository
}
async requestTreeRoot() {
const { data: treeRootData } = await this._treeSource.getRootItems({ skip: 0, take: 1 });
const hasChildren = treeRootData ? treeRootData.total > 0 : false;
const data: UmbTemplateTreeRootModel = {
unique: null,
entityType: UMB_TEMPLATE_ROOT_ENTITY_TYPE,
name: '#treeHeaders_templates',
hasChildren: true,
hasChildren,
isFolder: true,
};