Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -420,26 +420,29 @@
const repo = new UmbDataTypeDetailRepository(this);

const propertyTypes = await this.structure.getContentTypeProperties();
const contentTypeVariesByCulture = this.structure.getVariesByCulture();
const contentTypeVariesBySegment = this.structure.getVariesBySegment();
const valueDefinitions = await Promise.all(
propertyTypes.map(async (property) => {
// TODO: Implement caching for data-type requests. [NL]
const dataType = (await repo.requestByUnique(property.dataType.unique)).data;
// This means if its not loaded this will never resolve and the error below will never happen.
if (!dataType) {
throw new Error(`DataType of "${property.dataType.unique}" not found.`);
}
if (!dataType.editorUiAlias) {
throw new Error(`DataType of "${property.dataType.unique}" did not have a editorUiAlias.`);
}

return {
alias: property.alias,
propertyEditorUiAlias: dataType.editorUiAlias,
propertyEditorSchemaAlias: dataType.editorAlias,
config: dataType.values,
typeArgs: {
variesByCulture: property.variesByCulture,
variesBySegment: property.variesBySegment,
// Only vary if the content type varies:
variesByCulture: contentTypeVariesByCulture ? property.variesByCulture : false,
variesBySegment: contentTypeVariesBySegment ? property.variesBySegment : false,

Check warning on line 445 in src/Umbraco.Web.UI.Client/src/packages/content/content/workspace/content-detail-workspace-base.ts

View check run for this annotation

CodeScene Delta Analysis / CodeScene Code Health Review (release/16.5)

❌ Getting worse: Complex Method

_processIncomingData increases in cyclomatic complexity from 10 to 12, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
} as UmbPropertyTypePresetModelTypeModel,
} as UmbPropertyTypePresetModel;
}),
Expand Down
Loading