diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/documents/document-types/workspace/views/templates/document-type-workspace-view-templates.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/documents/document-types/workspace/views/templates/document-type-workspace-view-templates.element.ts index 02f97109c3..8563844b9f 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/documents/document-types/workspace/views/templates/document-type-workspace-view-templates.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/documents/document-types/workspace/views/templates/document-type-workspace-view-templates.element.ts @@ -49,13 +49,13 @@ export class UmbDocumentTypeWorkspaceViewTemplatesElement extends UmbLitElement if (!this._workspaceContext) return; } - async #changeDefaultKey(e: CustomEvent) { - // save new default key - console.log('workspace: default template key', e); + async #changeDefaultId(e: CustomEvent) { + // save new default id + console.log('workspace: default template id', e); } #changeAllowedKeys(e: CustomEvent) { - // save new allowed keys + // save new allowed ids console.log('workspace: allowed templates changed', e); } @@ -67,7 +67,7 @@ export class UmbDocumentTypeWorkspaceViewTemplatesElement extends UmbLitElement diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/repository/sources/data-type-folder.server.data.ts b/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/repository/sources/data-type-folder.server.data.ts index 880ab05097..dffb153689 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/repository/sources/data-type-folder.server.data.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/repository/sources/data-type-folder.server.data.ts @@ -28,7 +28,7 @@ export class UmbDataTypeFolderServerDataSource implements UmbFolderDataSource { } /** - * Creates a Data Type folder with the given key from the server + * Creates a Data Type folder with the given id from the server * @param {string} parentId * @return {*} * @memberof UmbDataTypeFolderServerDataSource @@ -45,7 +45,7 @@ export class UmbDataTypeFolderServerDataSource implements UmbFolderDataSource { } /** - * Fetches a Data Type folder with the given key from the server + * Fetches a Data Type folder with the given id from the server * @param {string} id * @return {*} * @memberof UmbDataTypeFolderServerDataSource @@ -95,7 +95,7 @@ export class UmbDataTypeFolderServerDataSource implements UmbFolderDataSource { } /** - * Deletes a Data Type folder with the given key on the server + * Deletes a Data Type folder with the given id on the server * @param {string} id * @return {*} * @memberof UmbDataTypeServerDataSource diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/repository/sources/data-type.server.data.ts b/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/repository/sources/data-type.server.data.ts index 2968de03b3..9ef4e96de1 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/repository/sources/data-type.server.data.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/repository/sources/data-type.server.data.ts @@ -32,7 +32,7 @@ export class UmbDataTypeServerDataSource } /** - * Fetches a Data Type with the given key from the server + * Fetches a Data Type with the given id from the server * @param {string} id * @return {*} * @memberof UmbDataTypeServerDataSource @@ -71,7 +71,7 @@ export class UmbDataTypeServerDataSource */ async insert(dataType: CreateDataTypeRequestModel & { id: string }) { if (!dataType) throw new Error('Data Type is missing'); - if (!dataType.id) throw new Error('Data Type key is missing'); + if (!dataType.id) throw new Error('Data Type id is missing'); tryExecuteAndNotify( this.#host, diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/repository/sources/data-type.tree.server.data.ts b/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/repository/sources/data-type.tree.server.data.ts index 1930d90f4c..22364ce3da 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/repository/sources/data-type.tree.server.data.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/repository/sources/data-type.tree.server.data.ts @@ -31,7 +31,7 @@ export class UmbDataTypeTreeServerDataSource implements UmbTreeDataSource { } /** - * Fetches the children of a given parent key from the server + * Fetches the children of a given parent id from the server * @param {(string | null)} parentId * @return {*} * @memberof UmbDataTypeTreeServerDataSource @@ -48,8 +48,8 @@ export class UmbDataTypeTreeServerDataSource implements UmbTreeDataSource { } /** - * Fetches the items for the given keys from the server - * @param {Array} keys + * Fetches the items for the given ids from the server + * @param {Array} ids * @return {*} * @memberof UmbDataTypeTreeServerDataSource */ diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/settings/relation-types/repository/sources/index.ts b/src/Umbraco.Web.UI.Client/src/backoffice/settings/relation-types/repository/sources/index.ts index 5080a513de..e00c22f97b 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/settings/relation-types/repository/sources/index.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/settings/relation-types/repository/sources/index.ts @@ -3,5 +3,5 @@ import { EntityTreeItemResponseModel, PagedEntityTreeItemResponseModel } from '@ export interface RelationTypeTreeDataSource { getRootItems(): Promise>; - getItems(key: Array): Promise>; + getItems(ids: Array): Promise>; } diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/settings/relation-types/repository/sources/relation-type.tree.server.data.ts b/src/Umbraco.Web.UI.Client/src/backoffice/settings/relation-types/repository/sources/relation-type.tree.server.data.ts index bb9b460799..6afc19326f 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/settings/relation-types/repository/sources/relation-type.tree.server.data.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/settings/relation-types/repository/sources/relation-type.tree.server.data.ts @@ -65,7 +65,7 @@ export class RelationTypeTreeServerDataSource implements RelationTypeTreeDataSou } /** - * Fetches the items for the given keys from the server + * Fetches the items for the given ids from the server * @param {Array} ids * @return {*} * @memberof RelationTypeTreeServerDataSource diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/collection.context.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/collection.context.ts index 00c214e16f..9668a51d68 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/collection.context.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/collection/collection.context.ts @@ -156,12 +156,12 @@ export class UmbCollectionContext k !== key); + public deselect(id: string) { + this.#selection.filter((k) => k !== id); } // TODO: how can we make sure to call this. diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-document-picker/input-document-picker.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-document-picker/input-document-picker.element.ts index 7108bde02b..d87623d464 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-document-picker/input-document-picker.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-document-picker/input-document-picker.element.ts @@ -125,7 +125,7 @@ export class UmbInputDocumentPickerElement extends FormControlMixin(UmbLitElemen } private _openPicker() { - // We send a shallow copy(good enough as its just an array of keys) of our this._selectedIds, as we don't want the modal to manipulate our data: + // We send a shallow copy(good enough as its just an array of ids) of our this._selectedIds, as we don't want the modal to manipulate our data: const modalHandler = this._modalContext?.open(UMB_DOCUMENT_PICKER_MODAL, { multiple: this.max === 1 ? false : true, selection: [...this._selectedIds], diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-document-type-picker/input-document-type-picker.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-document-type-picker/input-document-type-picker.element.ts index c8bd62c1e7..c3f844b898 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-document-type-picker/input-document-type-picker.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-document-type-picker/input-document-type-picker.element.ts @@ -80,7 +80,7 @@ export class UmbInputDocumentTypePickerElement extends FormControlMixin(UmbLitEl } private _openPicker() { - // We send a shallow copy(good enough as its just an array of keys) of our this._selectedIds, as we don't want the modal to manipulate our data: + // We send a shallow copy(good enough as its just an array of ids) of our this._selectedIds, as we don't want the modal to manipulate our data: const modalHandler = this._modalContext?.open(UMB_DOCUMENT_TYPE_PICKER_MODAL, { multiple: true, selection: [...this._selectedIds], diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-language-picker/input-language-picker.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-language-picker/input-language-picker.element.ts index 263d9c76f0..df04084af4 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-language-picker/input-language-picker.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-language-picker/input-language-picker.element.ts @@ -68,16 +68,16 @@ export class UmbInputLanguagePickerElement extends FormControlMixin(UmbLitElemen public get selectedIsoCodes(): Array { return this._selectedIsoCodes; } - public set selectedIsoCodes(keys: Array) { - this._selectedIsoCodes = keys; - super.value = keys.join(','); + public set selectedIsoCodes(isoCodes: Array) { + this._selectedIsoCodes = isoCodes; + super.value = isoCodes.join(','); this._observePickedItems(); } @property() - public set value(keysString: string) { - if (keysString !== this._value) { - this.selectedIsoCodes = keysString.split(/[ ,]+/); + public set value(isoCodesString: string) { + if (isoCodesString !== this._value) { + this.selectedIsoCodes = isoCodesString.split(/[ ,]+/); } } diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-list-base/input-list-base.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-list-base/input-list-base.ts index 37e134229b..2128b126e5 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-list-base/input-list-base.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-list-base/input-list-base.ts @@ -51,8 +51,8 @@ export class UmbInputListBaseElement extends UmbLitElement { }); } - protected removeFromSelection(key: string) { - this.value = this.value.filter((k) => k !== key); + protected removeFromSelection(id: string) { + this.value = this.value.filter((k) => k !== id); this.selectionUpdated(); } diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-media-picker/input-media-picker.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-media-picker/input-media-picker.element.ts index cbdcbe4a73..f324ca44be 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-media-picker/input-media-picker.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-media-picker/input-media-picker.element.ts @@ -139,7 +139,7 @@ export class UmbInputMediaPickerElement extends FormControlMixin(UmbLitElement) } private _openPicker() { - // We send a shallow copy(good enough as its just an array of keys) of our this._selectedIds, as we don't want the modal to manipulate our data: + // We send a shallow copy(good enough as its just an array of ids) of our this._selectedIds, as we don't want the modal to manipulate our data: const modalHandler = this._modalContext?.open(UMB_MEDIA_PICKER_MODAL, { multiple: this.max === 1 ? false : true, selection: [...this._selectedIds], diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-number-range/input-number-range.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-number-range/input-number-range.element.ts index 46910eb48f..20e021b98c 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-number-range/input-number-range.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/input-number-range/input-number-range.element.ts @@ -5,24 +5,19 @@ import { FormControlMixin } from '@umbraco-ui/uui-base/lib/mixins'; import { UmbLitElement } from '@umbraco-cms/internal/lit-element'; function getNumberOrUndefined(value: string) { - const num = parseInt(value, 10); - return isNaN(num) ? undefined : num; + const num = parseInt(value, 10); + return isNaN(num) ? undefined : num; } @customElement('umb-input-number-range') export class UmbInputNumberRangeElement extends FormControlMixin(UmbLitElement) { - static styles = [ - UUITextStyles, - css` + static styles = [UUITextStyles, css``]; - `, - ]; + @property({ type: String, attribute: 'min-label' }) + minLabel = 'Low value'; - @property({type: String, attribute:'min-label'}) - minLabel = "Low value" - - @property({type: String, attribute:'max-label'}) - maxLabel = "High value" + @property({ type: String, attribute: 'max-label' }) + maxLabel = 'High value'; @state() private _minValue?: number; @@ -30,8 +25,8 @@ export class UmbInputNumberRangeElement extends FormControlMixin(UmbLitElement) public get minValue() { return this._minValue; } - public set minValue(keys: number | undefined) { - this._minValue = keys; + public set minValue(value: number | undefined) { + this._minValue = value; this.updateValue(); } @@ -41,22 +36,22 @@ export class UmbInputNumberRangeElement extends FormControlMixin(UmbLitElement) public get maxValue() { return this._maxValue; } - public set maxValue(keys: number | undefined) { - this._maxValue = keys; + public set maxValue(value: number | undefined) { + this._maxValue = value; this.updateValue(); } private updateValue() { - const newValue = (this._minValue || this._maxValue) ? (this._minValue || '')+','+(this._maxValue || '') : ''; - if(super.value !== newValue) { + const newValue = this._minValue || this._maxValue ? (this._minValue || '') + ',' + (this._maxValue || '') : ''; + if (super.value !== newValue) { super.value = newValue; } } @property() - public set value(keysString: string) { - if(keysString !== this._value) { - const splittedValue = keysString.split(/[ ,]+/); + public set value(valueString: string) { + if (valueString !== this._value) { + const splittedValue = valueString.split(/[ ,]+/); this.minValue = getNumberOrUndefined(splittedValue[0]); this.maxValue = getNumberOrUndefined(splittedValue[1]); } @@ -66,26 +61,29 @@ export class UmbInputNumberRangeElement extends FormControlMixin(UmbLitElement) super(); } - protected getFormElement() { - return this; - } + protected getFormElement() { + return this; + } - private _onMinInput(e:InputEvent) { + private _onMinInput(e: InputEvent) { this.minValue = Number((e.target as HTMLInputElement).value); this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true })); } - private _onMaxInput(e:InputEvent) { + private _onMaxInput(e: InputEvent) { this.maxValue = Number((e.target as HTMLInputElement).value); this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true })); } - - render() { - return html``; + return html` + – + `; } - } export default UmbInputNumberRangeElement; diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/tree/tree.context.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/tree/tree.context.ts index 29608b4f11..89020e9acd 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/tree/tree.context.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/tree/tree.context.ts @@ -3,7 +3,6 @@ import { UmbTreeRepository } from '@umbraco-cms/backoffice/repository'; import type { ManifestTree } from '@umbraco-cms/backoffice/extensions-registry'; import { DeepState, UmbObserverController } from '@umbraco-cms/backoffice/observable-api'; import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller'; -import { UmbContextConsumerController } from '@umbraco-cms/backoffice/context-api'; import { createExtensionClass, umbExtensionsRegistry } from '@umbraco-cms/backoffice/extensions-api'; export interface UmbTreeContext { @@ -12,7 +11,7 @@ export interface UmbTreeContext { readonly selection: Observable>; setSelectable(value: boolean): void; setSelection(value: Array): void; - select(key: string): void; + select(id: string): void; } export class UmbTreeContextBase implements UmbTreeContext { @@ -75,17 +74,17 @@ export class UmbTreeContextBase implements UmbTreeContext { this.#selection.next(value); } - public select(key: string) { + public select(id: string) { const oldSelection = this.#selection.getValue(); - if (oldSelection.indexOf(key) !== -1) return; + if (oldSelection.indexOf(id) !== -1) return; - const selection = [...oldSelection, key]; + const selection = [...oldSelection, id]; this.#selection.next(selection); } - public deselect(key: string) { + public deselect(id: string) { const selection = this.#selection.getValue(); - this.#selection.next(selection.filter((x) => x !== key)); + this.#selection.next(selection.filter((x) => x !== id)); } public async requestRootItems() { diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/templating/templates/repository/sources/index.ts b/src/Umbraco.Web.UI.Client/src/backoffice/templating/templates/repository/sources/index.ts index d5365167d7..c93ced1dd9 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/templating/templates/repository/sources/index.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/templating/templates/repository/sources/index.ts @@ -7,5 +7,5 @@ import type { export interface TemplateTreeDataSource { getRootItems(): Promise>; getChildrenOf(parentId: string): Promise>; - getItems(key: Array): Promise>; + getItems(ids: Array): Promise>; } diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/sources/dictionary.detail.server.data.ts b/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/sources/dictionary.detail.server.data.ts index 9a0de80937..4de279d9a0 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/sources/dictionary.detail.server.data.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/sources/dictionary.detail.server.data.ts @@ -66,7 +66,7 @@ export class UmbDictionaryDetailServerDataSource implements DictionaryDetailData */ async update(dictionary: DictionaryDetails) { if (!dictionary.id) { - const error: ProblemDetailsModel = { title: 'Dictionary key is missing' }; + const error: ProblemDetailsModel = { title: 'Dictionary id is missing' }; return { error }; } diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/sources/dictionary.details.server.data.interface.ts b/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/sources/dictionary.details.server.data.interface.ts index fba60eaeaf..269a4610b0 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/sources/dictionary.details.server.data.interface.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/sources/dictionary.details.server.data.interface.ts @@ -10,11 +10,11 @@ import type { DataSourceResponse } from '@umbraco-cms/backoffice/repository'; export interface DictionaryDetailDataSource { createScaffold(parentId: string): Promise>; list(skip?: number, take?: number): Promise>; - get(key: string): Promise>; + get(id: string): Promise>; insert(data: DictionaryDetails): Promise; update(dictionary: DictionaryItemResponseModel): Promise; - delete(key: string): Promise; - export(key: string, includeChildren: boolean): Promise>; + delete(id: string): Promise; + export(id: string, includeChildren: boolean): Promise>; import(fileName: string, parentId?: string): Promise>; upload(formData: ImportDictionaryRequestModel): Promise>; // TODO - temp only diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/sources/dictionary.tree.server.data.ts b/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/sources/dictionary.tree.server.data.ts index c2a2c5ca3e..9113af0673 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/sources/dictionary.tree.server.data.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/translation/dictionary/repository/sources/dictionary.tree.server.data.ts @@ -31,14 +31,14 @@ export class DictionaryTreeServerDataSource implements UmbTreeDataSource { } /** - * Fetches the children of a given parent key from the server + * Fetches the children of a given parent id from the server * @param {(string | null)} parentId * @return {*} * @memberof DictionaryTreeServerDataSource */ async getChildrenOf(parentId: string | null) { if (!parentId) { - const error: ProblemDetailsModel = { title: 'Parent key is missing' }; + const error: ProblemDetailsModel = { title: 'Parent id is missing' }; return { error }; } diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/users/user-section/views/users/list-view-layouts/grid/workspace-view-users-grid.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/users/user-section/views/users/list-view-layouts/grid/workspace-view-users-grid.element.ts index 3ed1b5d986..0cdb0edede 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/users/user-section/views/users/list-view-layouts/grid/workspace-view-users-grid.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/users/user-section/views/users/list-view-layouts/grid/workspace-view-users-grid.element.ts @@ -85,13 +85,13 @@ export class UmbWorkspaceViewUsersGridElement extends UmbLitElement { this.observe(this._usersContext.selection, (selection) => (this._selection = selection)); } - private _isSelected(key: string) { - return this._selection.includes(key); + private _isSelected(id: string) { + return this._selection.includes(id); } //TODO How should we handle url stuff? - private _handleOpenCard(key: string) { - history.pushState(null, '', 'section/users/view/users/user/' + key); //TODO Change to a tag with href and make dynamic + private _handleOpenCard(id: string) { + history.pushState(null, '', 'section/users/view/users/user/' + id); //TODO Change to a tag with href and make dynamic } private _selectRowHandler(user: UserEntity) { @@ -104,8 +104,8 @@ export class UmbWorkspaceViewUsersGridElement extends UmbLitElement { private _getUserGroupNames(ids: Array) { return ids - .map((key: string) => { - return this._userGroups.find((x) => x.id === key)?.name; + .map((id: string) => { + return this._userGroups.find((x) => x.id === id)?.name; }) .join(', '); } diff --git a/src/Umbraco.Web.UI.Client/src/core/mocks/data/entity.data.ts b/src/Umbraco.Web.UI.Client/src/core/mocks/data/entity.data.ts index c0fb1ac135..9237f22a99 100644 --- a/src/Umbraco.Web.UI.Client/src/core/mocks/data/entity.data.ts +++ b/src/Umbraco.Web.UI.Client/src/core/mocks/data/entity.data.ts @@ -49,8 +49,8 @@ export class UmbEntityData extends UmbData { trash(ids: Array) { const trashedItems: Array = []; - ids.forEach((key) => { - const item = this.getById(key); + ids.forEach((id) => { + const item = this.getById(id); if (!item) return; // TODO: how do we handle trashed items? diff --git a/src/Umbraco.Web.UI.Client/src/core/mocks/data/languages.data.ts b/src/Umbraco.Web.UI.Client/src/core/mocks/data/languages.data.ts index c43cc33406..142e8b426d 100644 --- a/src/Umbraco.Web.UI.Client/src/core/mocks/data/languages.data.ts +++ b/src/Umbraco.Web.UI.Client/src/core/mocks/data/languages.data.ts @@ -12,8 +12,8 @@ class UmbLanguagesData extends UmbData { return this.data.slice(skip, take); } - getByKey(key: string) { - return this.data.find((item) => item.isoCode === key); + getByKey(isoCode: string) { + return this.data.find((item) => item.isoCode === isoCode); } insert(language: LanguageResponseModel) { diff --git a/src/Umbraco.Web.UI.Client/src/core/mocks/domains/media-type.handlers.ts b/src/Umbraco.Web.UI.Client/src/core/mocks/domains/media-type.handlers.ts index 59e3c212c9..c7f6cfdc13 100644 --- a/src/Umbraco.Web.UI.Client/src/core/mocks/domains/media-type.handlers.ts +++ b/src/Umbraco.Web.UI.Client/src/core/mocks/domains/media-type.handlers.ts @@ -17,7 +17,7 @@ export const handlers = [ }), rest.get('/umbraco/management/api/v1/tree/media-type/item', (req, res, ctx) => { - const ids = req.url.searchParams.getAll('key'); + const ids = req.url.searchParams.getAll('id'); if (!ids) return; const items = umbMediaTypeData.getTreeItem(ids); diff --git a/src/Umbraco.Web.UI.Client/src/core/mocks/domains/member-group.handlers.ts b/src/Umbraco.Web.UI.Client/src/core/mocks/domains/member-group.handlers.ts index db4ce18195..a438855cdb 100644 --- a/src/Umbraco.Web.UI.Client/src/core/mocks/domains/member-group.handlers.ts +++ b/src/Umbraco.Web.UI.Client/src/core/mocks/domains/member-group.handlers.ts @@ -9,7 +9,7 @@ export const handlers = [ }), rest.get('/umbraco/management/api/v1/tree/member-group/item', (req, res, ctx) => { - const ids = req.url.searchParams.getAll('key'); + const ids = req.url.searchParams.getAll('id'); if (!ids) return; const items = umbMemberGroupData.getTreeItem(ids); diff --git a/src/Umbraco.Web.UI.Client/src/core/mocks/domains/member-type.handlers.ts b/src/Umbraco.Web.UI.Client/src/core/mocks/domains/member-type.handlers.ts index 694a7f9bef..4905f5fc1e 100644 --- a/src/Umbraco.Web.UI.Client/src/core/mocks/domains/member-type.handlers.ts +++ b/src/Umbraco.Web.UI.Client/src/core/mocks/domains/member-type.handlers.ts @@ -9,7 +9,7 @@ export const handlers = [ }), rest.get('/umbraco/management/api/v1/tree/member-type/item', (req, res, ctx) => { - const ids = req.url.searchParams.getAll('key'); + const ids = req.url.searchParams.getAll('id'); if (!ids) return; const items = umbMemberTypeData.getTreeItem(ids); diff --git a/src/Umbraco.Web.UI.Client/src/core/mocks/domains/member.handlers.ts b/src/Umbraco.Web.UI.Client/src/core/mocks/domains/member.handlers.ts index aa4d404356..b3a45839ae 100644 --- a/src/Umbraco.Web.UI.Client/src/core/mocks/domains/member.handlers.ts +++ b/src/Umbraco.Web.UI.Client/src/core/mocks/domains/member.handlers.ts @@ -9,7 +9,7 @@ export const handlers = [ }), rest.get('/umbraco/management/api/v1/tree/member/item', (req, res, ctx) => { - const ids = req.url.searchParams.getAll('key'); + const ids = req.url.searchParams.getAll('id'); if (!ids) return; const items = umbMemberData.getTreeItem(ids); diff --git a/src/Umbraco.Web.UI.Client/src/core/mocks/domains/tree-media.handlers.ts b/src/Umbraco.Web.UI.Client/src/core/mocks/domains/tree-media.handlers.ts index 3a0b3b4e29..666bd348ed 100644 --- a/src/Umbraco.Web.UI.Client/src/core/mocks/domains/tree-media.handlers.ts +++ b/src/Umbraco.Web.UI.Client/src/core/mocks/domains/tree-media.handlers.ts @@ -16,7 +16,7 @@ export const handlers = [ }), rest.get('/umbraco/management/api/v1/tree/media/item', (req, res, ctx) => { - const ids = req.url.searchParams.getAll('key'); + const ids = req.url.searchParams.getAll('id'); if (!ids) return; const items = umbMediaData.getTreeItem(ids);