Move + Rename input-collection-configuration element to input-content-type-collection-configuration (#19041)

* move to content-type module

* make name more explicit

* add total to text

* update threshold

* remove completed todo
This commit is contained in:
Mads Rasmussen
2025-04-15 11:27:06 +02:00
committed by GitHub
parent 37e25c3b2b
commit e6ab1d9a6b
8 changed files with 26 additions and 21 deletions

View File

@@ -2,8 +2,8 @@ import fs from 'fs';
import path from 'path';
import { createImportMap } from '../importmap/index.js';
const ILLEGAL_CORE_IMPORTS_THRESHOLD = 7;
const SELF_IMPORTS_THRESHOLD = 9;
const ILLEGAL_CORE_IMPORTS_THRESHOLD = 6;
const SELF_IMPORTS_THRESHOLD = 8;
const clientProjectRoot = path.resolve(import.meta.dirname, '../../');
const modulePrefix = '@umbraco-cms/backoffice/';
@@ -142,7 +142,9 @@ function reportIllegalImportsFromCore() {
`Illegal imports found in ${total} core modules. ${total - ILLEGAL_CORE_IMPORTS_THRESHOLD} more than the threshold.`,
);
} else {
console.log(`✅ Success! Still under the threshold of ${ILLEGAL_CORE_IMPORTS_THRESHOLD} illegal imports. `);
console.log(
`✅ Success! Still (${total}) under the threshold of ${ILLEGAL_CORE_IMPORTS_THRESHOLD} illegal imports. `,
);
}
console.log(`\n\n`);
@@ -191,4 +193,3 @@ report();
// TODO:
// - Check what packages another package depends on (not modules) - This will be used when we split the tsconfig into multiple configs
// - Check for circular module imports
// - Report if a module imports itself

View File

@@ -1,3 +1,5 @@
import './content-type-workspace-editor-header.element.js';
import './input-content-type-collection-configuration/input-content-type-collection-configuration.element.js';
export * from './content-type-workspace-editor-header.element.js';
export * from './input-content-type-collection-configuration/input-content-type-collection-configuration.element.js';

View File

@@ -0,0 +1 @@
export * from './input-content-type-collection-configuration.element.js';

View File

@@ -9,10 +9,11 @@ import {
import { UmbModalRouteRegistrationController } from '@umbraco-cms/backoffice/router';
import { UmbFormControlMixin } from '@umbraco-cms/backoffice/validation';
@customElement('umb-input-collection-configuration')
export class UmbInputCollectionConfigurationElement extends UmbFormControlMixin<string, typeof UmbLitElement>(
UmbLitElement,
) {
@customElement('umb-input-content-type-collection-configuration')
export class UmbInputContentTypeCollectionConfigurationElement extends UmbFormControlMixin<
string,
typeof UmbLitElement
>(UmbLitElement) {
protected override getFormElement() {
return undefined;
}
@@ -122,10 +123,8 @@ export class UmbInputCollectionConfigurationElement extends UmbFormControlMixin<
];
}
export default UmbInputCollectionConfigurationElement;
declare global {
interface HTMLElementTagNameMap {
'umb-input-collection-configuration': UmbInputCollectionConfigurationElement;
'umb-input-content-type-collection-configuration': UmbInputContentTypeCollectionConfigurationElement;
}
}

View File

@@ -10,7 +10,6 @@ export * from './footer-layout/index.js';
export * from './header-app/index.js';
export * from './history/index.js';
export * from './icon/index.js';
export * from './input-collection-configuration/index.js';
export * from './input-color/index.js';
export * from './input-date/index.js';
export * from './input-dropdown/index.js';

View File

@@ -1 +0,0 @@
export * from './input-collection-configuration.element.js';

View File

@@ -4,8 +4,10 @@ import { UMB_DOCUMENT_TYPE_WORKSPACE_CONTEXT } from '../../document-type-workspa
import { css, html, customElement, state } from '@umbraco-cms/backoffice/external/lit';
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import type { UmbContentTypeSortModel } from '@umbraco-cms/backoffice/content-type';
import type { UmbInputCollectionConfigurationElement } from '@umbraco-cms/backoffice/components';
import type {
UmbContentTypeSortModel,
UmbInputContentTypeCollectionConfigurationElement,
} from '@umbraco-cms/backoffice/content-type';
import type { UmbWorkspaceViewElement } from '@umbraco-cms/backoffice/workspace';
import type { UUIToggleElement } from '@umbraco-cms/backoffice/external/uui';
@@ -98,14 +100,14 @@ export class UmbDocumentTypeWorkspaceViewStructureElement extends UmbLitElement
<umb-property-layout alias="collection" label="${this.localize.term('contentTypeEditor_collection')}">
<div slot="description">${this.localize.term('contentTypeEditor_collectionDescription')}</div>
<div slot="editor">
<umb-input-collection-configuration
<umb-input-content-type-collection-configuration
default-value="c0808dd3-8133-4e4b-8ce8-e2bea84a96a4"
.value=${this._collection ?? undefined}
@change=${(e: CustomEvent) => {
const unique = (e.target as UmbInputCollectionConfigurationElement).value as string;
const unique = (e.target as UmbInputContentTypeCollectionConfigurationElement).value as string;
this.#workspaceContext?.setCollection({ unique });
}}>
</umb-input-collection-configuration>
</umb-input-content-type-collection-configuration>
</div>
</umb-property-layout>
</uui-box>

View File

@@ -4,8 +4,10 @@ import { UMB_MEDIA_TYPE_WORKSPACE_CONTEXT } from '../../media-type-workspace.con
import { css, html, customElement, state } from '@umbraco-cms/backoffice/external/lit';
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
import type { UmbContentTypeSortModel } from '@umbraco-cms/backoffice/content-type';
import type { UmbInputCollectionConfigurationElement } from '@umbraco-cms/backoffice/components';
import type {
UmbContentTypeSortModel,
UmbInputContentTypeCollectionConfigurationElement,
} from '@umbraco-cms/backoffice/content-type';
import type { UmbWorkspaceViewElement } from '@umbraco-cms/backoffice/workspace';
import type { UUIToggleElement } from '@umbraco-cms/backoffice/external/uui';
@@ -101,7 +103,7 @@ export class UmbMediaTypeWorkspaceViewStructureElement extends UmbLitElement imp
default-value="3a0156c4-3b8c-4803-bdc1-6871faa83fff"
.value=${this._collection}
@change=${(e: CustomEvent) => {
const unique = (e.target as UmbInputCollectionConfigurationElement).value as string;
const unique = (e.target as UmbInputContentTypeCollectionConfigurationElement).value as string;
this.#workspaceContext?.setCollection({ unique });
}}>
</umb-input-collection-configuration>