rename create item utils funcion
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { UmbEntityData } from './entity.data.js';
|
||||
import { createFileSystemTreeItem, createItem, createTextFileItem } from './utils.js';
|
||||
import { createFileSystemTreeItem, createFileItemResponseModelBaseModel, createTextFileItem } from './utils.js';
|
||||
import {
|
||||
CreateTextFileViewModelBaseModel,
|
||||
FileSystemTreeItemPresentationModel,
|
||||
@@ -125,7 +125,7 @@ class UmbStylesheetData extends UmbEntityData<StylesheetDBItem> {
|
||||
}
|
||||
|
||||
getStylesheetItem(path: string): StylesheetDBItem | undefined {
|
||||
return createItem(this.data.find((item) => item.path === path));
|
||||
return createFileItemResponseModelBaseModel(this.data.find((item) => item.path === path));
|
||||
}
|
||||
|
||||
getStylesheet(path: string): StylesheetResponseModel | undefined {
|
||||
@@ -146,21 +146,21 @@ class UmbStylesheetData extends UmbEntityData<StylesheetDBItem> {
|
||||
getRules(path: string): Array<RichTextRuleModel> {
|
||||
return [
|
||||
{
|
||||
"name": "bjjh",
|
||||
"selector": "h1",
|
||||
"styles": "color: blue;"
|
||||
name: 'bjjh',
|
||||
selector: 'h1',
|
||||
styles: 'color: blue;',
|
||||
},
|
||||
{
|
||||
"name": "comeone",
|
||||
"selector": "h1",
|
||||
"styles": "color: blue;"
|
||||
name: 'comeone',
|
||||
selector: 'h1',
|
||||
styles: 'color: blue;',
|
||||
},
|
||||
{
|
||||
"name": "lol",
|
||||
"selector": "h1",
|
||||
"styles": "color: blue;"
|
||||
}
|
||||
]
|
||||
name: 'lol',
|
||||
selector: 'h1',
|
||||
styles: 'color: blue;',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
insertFolder(item: CreateTextFileViewModelBaseModel) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import type {
|
||||
FileSystemTreeItemPresentationModel,
|
||||
DocumentResponseModel,
|
||||
TextFileResponseModelBaseModel,
|
||||
FileItemResponseModelBaseModel,
|
||||
} from '@umbraco-cms/backoffice/backend-api';
|
||||
|
||||
export const createEntityTreeItem = (item: any): EntityTreeItemResponseModel => {
|
||||
@@ -40,7 +41,7 @@ export const createContentTreeItem = (item: any): ContentTreeItemResponseModel &
|
||||
|
||||
// TODO: remove isTrashed type extension when we have found a solution to trashed items
|
||||
export const createDocumentTreeItem = (
|
||||
item: DocumentResponseModel
|
||||
item: DocumentResponseModel,
|
||||
): DocumentTreeItemResponseModel & { isTrashed: boolean } => {
|
||||
return {
|
||||
...createContentTreeItem(item),
|
||||
@@ -81,7 +82,7 @@ export const createTextFileItem = (item: any): TextFileResponseModelBaseModel =>
|
||||
content: item.content,
|
||||
});
|
||||
|
||||
export const createItem = (item: any): any => ({
|
||||
export const createFileItemResponseModelBaseModel = (item: any): FileItemResponseModelBaseModel => ({
|
||||
path: item.path,
|
||||
name: item.name,
|
||||
icon: item.icon,
|
||||
|
||||
Reference in New Issue
Block a user