Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions src/Umbraco.Web.UI.Client/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ class UmbStoryBookElement extends UmbLitElement {
super();
new UmbExtensionsApiInitializer(this, umbExtensionsRegistry, 'globalContext', [this]);
new UmbExtensionsApiInitializer(this, umbExtensionsRegistry, 'store', [this]);
// TODO: Remove this in Umbraco 18, use the repository instead
new UmbExtensionsApiInitializer(this, umbExtensionsRegistry, 'treeStore', [this]);
new UmbExtensionsApiInitializer(this, umbExtensionsRegistry, 'itemStore', [this]);

this._umbIconRegistry.setIcons(icons);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export class ExampleCustomPickerTreePropertyEditorDataSource
const data = {
items: rootItems,
total: rootItems.length,
totalBefore: 0,
totalAfter: 0,
};

return { data };
Expand All @@ -49,6 +51,8 @@ export class ExampleCustomPickerTreePropertyEditorDataSource
const data = {
items: items,
total: items.length,
totalBefore: 0,
totalAfter: 0,
};

return { data };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class ExampleTreeLocalDataSource extends UmbControllerBase implements Umb
// TODO: handle skip, take, foldersOnly.
console.log(args);
const rootItems: Array<ExampleTreeItemModel> = EXAMPLE_TREE_DATA.filter((item) => item.parent.unique === null);
return { data: { items: rootItems, total: rootItems.length } };
return { data: { items: rootItems, total: rootItems.length, totalBefore: 0, totalAfter: 0 } };
}

async getChildrenOf(args: UmbTreeChildrenOfRequestArgs) {
Expand All @@ -79,7 +79,7 @@ export class ExampleTreeLocalDataSource extends UmbControllerBase implements Umb
(item) => item.parent.unique === args.parent.unique && item.parent.entityType === args.parent.entityType,
);

return { data: { items: children, total: children.length } };
return { data: { items: children, total: children.length, totalBefore: 0, totalAfter: 0 } };
}

async getAncestorsOf(args: UmbTreeAncestorsOfRequestArgs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ describe('UmbBlockListToBlockClipboardCopyPropertyValueTranslator', () => {
alias: 'headline',
editorAlias: 'Umbraco.TextBox',
value: 'Headline value',
entityType: '',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ describe('UmbBlockToBlockGridClipboardPastePropertyValueTranslator', () => {
alias: 'headline',
editorAlias: 'Umbraco.TextBox',
value: 'Headline value',
entityType: '',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ describe('UmbBlockListToBlockClipboardCopyPropertyValueTranslator', () => {
alias: 'headline',
editorAlias: 'Umbraco.TextBox',
value: 'Headline value',
entityType: '',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ describe('UmbGridBlockToBlockGridClipboardPastePropertyValueTranslator', () => {
alias: 'headline',
editorAlias: 'Umbraco.TextBox',
value: 'Headline value',
entityType: '',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ describe('UmbBlockListToBlockClipboardCopyPropertyValueTranslator', () => {
alias: 'headline',
editorAlias: 'Umbraco.TextBox',
value: 'Headline value',
entityType: '',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ describe('UmbBlockToBlockListClipboardPastePropertyValueTranslator', () => {
alias: 'headline',
editorAlias: 'Umbraco.TextBox',
value: 'Headline value',
entityType: '',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ export class UmbBlockRteEntryElement extends UmbLitElement implements UmbPropert
if (!this._showActions) return nothing;
return html`
<uui-action-bar>
${this.#renderEditAction()} ${this.#renderEditSettingsAction()} ${this.#renderCopyToClipboardAction()}${this.#renderDeleteAction()}
${this.#renderEditAction()} ${this.#renderEditSettingsAction()}
${this.#renderCopyToClipboardAction()}${this.#renderDeleteAction()}
</uui-action-bar>
`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ describe('UmbBlockSingleToBlockClipboardCopyPropertyValueTranslator', () => {
alias: 'headline',
editorAlias: 'Umbraco.TextBox',
value: 'Headline value',
entityType: '',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ describe('UmbBlockToBlockSingleClipboardPastePropertyValueTranslator', () => {
alias: 'headline',
editorAlias: 'Umbraco.TextBox',
value: 'Headline value',
entityType: '',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './block-inserted.event.js';
export * from './block-inserted.event.js';
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export abstract class UmbContentTypeWorkspaceContextBase<
let { data } = await request;

if (data) {
data = await this._scaffoldProcessData(data);
data = await this._processIncomingData(data);

if (this.modalContext) {
// Notice if the preset comes with values, they will overwrite the scaffolded values... [NL]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement {
UMB_EDIT_PROPERTY_TYPE_WORKSPACE_PATH_PATTERN.generateLocal({ unique: this.property.unique })}>
${this.#renderPropertyName()} ${this.#renderPropertyTags()}
<uui-action-bar>
<uui-button label="${this.localize.term('actions_delete')}" data-mark="action:delete" @click="${this.#requestRemove}">
<uui-button
label="${this.localize.term('actions_delete')}"
data-mark="action:delete"
@click="${this.#requestRemove}">
<uui-icon name="delete"></uui-icon>
</uui-button>
</uui-action-bar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('UmbMergeContentVariantDataController', () => {
alias: 'test',
culture: null,
segment: null,
entityType: '',

value: {
nestedValue: {
editorAlias: 'some-editor',
Expand All @@ -95,7 +95,7 @@ describe('UmbMergeContentVariantDataController', () => {
alias: 'test',
culture: null,
segment: null,
entityType: '',

value: {
nestedValue: {
editorAlias: 'some-editor',
Expand Down Expand Up @@ -125,7 +125,7 @@ describe('UmbMergeContentVariantDataController', () => {
alias: 'test',
culture: null,
segment: null,
entityType: '',

value: {
nestedValue: {
editorAlias: 'some-editor',
Expand All @@ -146,7 +146,7 @@ describe('UmbMergeContentVariantDataController', () => {
alias: 'test',
culture: null,
segment: null,
entityType: '',

value: {
nestedValue: {
editorAlias: 'some-editor',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ export interface UmbElementDetailModel {
export interface UmbElementValueModel<ValueType = unknown> extends UmbPropertyValueData<ValueType> {
culture: string | null;
editorAlias: string;
/**
* @deprecated, we do not use entityType on values anymore. To be removed in Umbraco v.18.
* Just remove the property.
*/
entityType?: string;
segment: string | null;
}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { UmbContentDetailModel, UmbElementValueModel } from '../types.js';

Check warning on line 1 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 (v18/dev)

❌ New issue: Overall Code Complexity

This module has a mean cyclomatic complexity of 4.03 across 40 functions. The mean complexity threshold is 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.
import { UmbContentCollectionManager } from '../collection/index.js';
import { UmbContentWorkspaceDataManager } from '../manager/index.js';
import { UmbMergeContentVariantDataController } from '../controller/merge-content-variant-data.controller.js';
Expand Down Expand Up @@ -398,20 +398,6 @@
this.#languages.setValue(data?.items ?? []);
}

/**
* @deprecated Call `_loadSegmentsFor` instead. `loadSegments` will be removed in v.18.
* (note this was introduced in v.17, and deprecated in v.17.0.1)
*/
protected async loadSegments() {
console.warn('Stop using loadSegments, call _loadSegmentsFor instead. loadSegments will be removed in v.18.');
const unique = await firstValueFrom(this.unique);
if (!unique) {
this._segments.setValue([]);
return;
}
this._loadSegmentsFor(unique);
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
protected async _loadSegmentsFor(unique: string): Promise<void> {
console.warn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,35 +386,6 @@ export class UmbDefaultCollectionContext<
super.destroy();
}

/**
* Sets the manifest for the collection.
* @param {ManifestCollection} manifest - The manifest for the collection.
* @memberof UmbCollectionContext
* @deprecated Use set the `.manifest` property instead.
*/
public setManifest(manifest: ManifestCollection | undefined) {
if (this._manifest === manifest) return;
this._manifest = manifest;

if (!this._manifest) return;
this.#observeRepository(this._manifest.meta.repositoryAlias);
}

/**
* Returns the manifest for the collection.
* @returns {ManifestCollection} - The manifest for the collection.
* @memberof UmbCollectionContext
* @deprecated Use the `.manifest` property instead.
*/
public getManifest(): ManifestCollection | undefined {
new UmbDeprecation({
removeInVersion: '18.0.0',
deprecated: 'getManifest',
solution: 'Use .manifest property instead',
}).warn();
return this._manifest;
}

/**
* Returns the items in the collection.
* @returns {Array<CollectionItemType>} - The items in the collection.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { ManifestCollection } from './extensions/types.js';
import type { UmbCollectionItemModel } from './item/types.js';
import type { Observable } from '@umbraco-cms/backoffice/external/rxjs';
import type { UmbEntityUnique } from '@umbraco-cms/backoffice/entity';
Expand Down Expand Up @@ -56,8 +55,6 @@ export type UmbCollectionBulkActionConfiguration = {
export interface UmbCollectionContext {
setConfig(config: UmbCollectionConfiguration): void;
getConfig(): UmbCollectionConfiguration | undefined;
setManifest(manifest: ManifestCollection): void;
getManifest(): ManifestCollection | undefined;
requestCollection(): Promise<void>;
requestItemHref?(item: UmbCollectionItemModel): Promise<string | undefined>;
pagination: UmbPaginationManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ export interface UmbConditionsCollectionView {
entityType: string;
}

/**
* @deprecated Use {@link UmbConditionsCollectionView} instead. This will be removed in Umbraco 18.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/naming-convention
export interface ConditionsCollectionView extends UmbConditionsCollectionView {}

declare global {
interface UmbExtensionManifestMap {
umbCollectionView: ManifestCollectionView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@ export class UmbDeleteEntityBulkAction<
> extends UmbEntityBulkActionBase<MetaKindType> {
#localize = new UmbLocalizationController(this);
#items: Array<any> = [];
/**
* @deprecated this has been turned into a private property and cannot be used from v.18. Will be removed in v.18
*/
protected get _items() {
return this.#items;
}
/**
* @deprecated this has been turned into a private property and cannot be used from v.18. Will be removed in v.18
*/
protected set _items(value: Array<any>) {
this.#items = value;
}

override async execute() {
if (this.selection?.length === 0) {
Expand Down
4 changes: 0 additions & 4 deletions src/Umbraco.Web.UI.Client/src/packages/core/entry-point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ import '@umbraco-cms/backoffice/entity-item';
export const onInit: UmbEntryPointOnInit = (host, extensionRegistry) => {
new UmbExtensionsApiInitializer(host, extensionRegistry, 'globalContext', [host]);
new UmbExtensionsApiInitializer(host, extensionRegistry, 'store', [host]);
/**
* TODO: Remove this in Umbraco 18, use the repository instead
*/
new UmbExtensionsApiInitializer(host, extensionRegistry, 'treeStore', [host]);
new UmbExtensionsApiInitializer(host, extensionRegistry, 'itemStore', [host]);

extensionRegistry.registerMany(coreManifests);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
import type { ManifestApi } from '@umbraco-cms/backoffice/extension-api';
import type { UmbItemStore } from '@umbraco-cms/backoffice/store';
import type { UmbTreeStore } from '@umbraco-cms/backoffice/tree';

export interface ManifestStore extends ManifestApi<any> {
type: 'store';
}

/**
* Manifest for a tree store.
* @deprecated - You do not need to register a treeStore manifest anymore, as the tree repository will be queried each time it is needed. This will be removed in Umbraco 18.
*/
export interface ManifestTreeStore extends ManifestApi<UmbTreeStore<any>> {
type: 'treeStore';
}

export interface ManifestItemStore extends ManifestApi<UmbItemStore<any>> {
type: 'itemStore';
}

export type UmbStoreExtensions = ManifestStore | ManifestTreeStore | ManifestItemStore;
export type UmbStoreExtensions = ManifestStore | ManifestItemStore;

declare global {
interface UmbExtensionManifestMap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { UMB_MENU_STRUCTURE_WORKSPACE_CONTEXT } from './menu-structure-workspace
import { UMB_SECTION_SIDEBAR_MENU_SECTION_CONTEXT } from './section-sidebar-menu/index.js';
import { createExtensionApiByAlias } from '@umbraco-cms/backoffice/extension-registry';
import { linkEntityExpansionEntries } from '@umbraco-cms/backoffice/utils';
import { UmbArrayState, UmbObjectState } from '@umbraco-cms/backoffice/observable-api';
import { UmbArrayState } from '@umbraco-cms/backoffice/observable-api';
import { UmbAncestorsEntityContext, UmbParentEntityContext, type UmbEntityModel } from '@umbraco-cms/backoffice/entity';
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
import { UMB_MODAL_CONTEXT } from '@umbraco-cms/backoffice/modal';
Expand All @@ -29,12 +29,6 @@ export abstract class UmbMenuTreeStructureWorkspaceContextBase extends UmbContex
#structure = new UmbArrayState<UmbStructureItemModel>([], (x) => x.unique);
public readonly structure = this.#structure.asObservable();

#parent = new UmbObjectState<UmbStructureItemModel | undefined>(undefined);
/**
* @deprecated Will be removed in v.18: Use UMB_PARENT_ENTITY_CONTEXT instead.
*/
public readonly parent = this.#parent.asObservable();

protected _sectionContext?: typeof UMB_SECTION_CONTEXT.TYPE;

#parentContext = new UmbParentEntityContext(this);
Expand All @@ -45,8 +39,6 @@ export abstract class UmbMenuTreeStructureWorkspaceContextBase extends UmbContex

constructor(host: UmbControllerHost, args: UmbMenuTreeStructureWorkspaceContextBaseArgs) {
super(host, UMB_MENU_STRUCTURE_WORKSPACE_CONTEXT);
// 'UmbMenuStructureWorkspaceContext' is Obsolete, will be removed in v.18
this.provideContext('UmbMenuStructureWorkspaceContext', this);
this.#args = args;

this.consumeContext(UMB_MODAL_CONTEXT, (modalContext) => {
Expand Down Expand Up @@ -171,9 +163,6 @@ export abstract class UmbMenuTreeStructureWorkspaceContextBase extends UmbContex
We filter out the current item unique to handle any case where it could show up */
const parent = structureItems.filter((item) => item.unique !== this.#workspaceContext?.getUnique()).pop();

// TODO: remove this when the parent gets removed from the structure interface
this.#parent.setValue(parent);

const parentEntity = parent
? {
unique: parent.unique,
Expand Down Expand Up @@ -220,7 +209,6 @@ export abstract class UmbMenuTreeStructureWorkspaceContextBase extends UmbContex
override destroy(): void {
super.destroy();
this.#structure.destroy();
this.#parent.destroy();
this.#parentContext.destroy();
this.#ancestorContext.destroy();
}
Expand Down
Loading
Loading