Skip to content

Commit ffada2f

Browse files
committed
Merge remote-tracking branch 'origin/main' into v14/bugfix/mntp-min-max-validation
2 parents 1149adb + f43c949 commit ffada2f

File tree

291 files changed

+1866
-1177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+1866
-1177
lines changed

eslint.config.js

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import js from "@eslint/js";
2-
import globals from "globals";
3-
import importPlugin from "eslint-plugin-import";
4-
import localRules from "eslint-plugin-local-rules";
5-
import wcPlugin from "eslint-plugin-wc";
6-
import litPlugin from "eslint-plugin-lit";
7-
import litA11yPlugin from "eslint-plugin-lit-a11y";
8-
import storybookPlugin from "eslint-plugin-storybook";
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import importPlugin from 'eslint-plugin-import';
4+
import localRules from 'eslint-plugin-local-rules';
5+
import wcPlugin from 'eslint-plugin-wc';
6+
import litPlugin from 'eslint-plugin-lit';
7+
import litA11yPlugin from 'eslint-plugin-lit-a11y';
8+
import storybookPlugin from 'eslint-plugin-storybook';
99
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
1010
import tseslint from 'typescript-eslint';
1111

@@ -18,11 +18,11 @@ export default [
1818
// Global ignores
1919
{
2020
ignores: [
21-
"**/rollup.config.js",
22-
"**/vite.config.ts",
23-
"src/external",
24-
"src/packages/core/icon-registry/icons",
25-
"src/packages/core/icon-registry/icons.ts"
21+
'**/rollup.config.js',
22+
'**/vite.config.ts',
23+
'src/external',
24+
'src/packages/core/icon-registry/icons',
25+
'src/packages/core/icon-registry/icons.ts',
2626
],
2727
},
2828

@@ -35,52 +35,53 @@ export default [
3535
},
3636
globals: {
3737
...globals.browser,
38-
}
38+
},
3939
},
4040
plugins: {
4141
import: importPlugin,
42-
"local-rules": localRules,
43-
"wc": wcPlugin,
44-
"lit": litPlugin,
45-
"lit-a11y": litA11yPlugin,
46-
"storybook": storybookPlugin
42+
'local-rules': localRules,
43+
wc: wcPlugin,
44+
lit: litPlugin,
45+
'lit-a11y': litA11yPlugin,
46+
storybook: storybookPlugin,
4747
},
4848
rules: {
49-
semi: ["warn", "always"],
50-
"no-unused-vars": "warn",
51-
"no-var": "error",
52-
"import/no-unresolved": "off",
53-
"import/order": ["warn", { "groups": ["builtin", "parent", "sibling", "index", "external"] }],
54-
"import/no-self-import": "error",
55-
"import/no-cycle": ["error", { "maxDepth": 6, "allowUnsafeDynamicCyclicDependency": true }],
56-
"local-rules/bad-type-import": "error",
57-
"local-rules/enforce-element-suffix-on-element-class-name": "error",
58-
"local-rules/enforce-umb-prefix-on-element-name": "error",
59-
"local-rules/ensure-relative-import-use-js-extension": "error",
60-
"local-rules/no-direct-api-import": "warn",
61-
"local-rules/prefer-import-aliases": "error",
62-
"local-rules/prefer-static-styles-last": "warn",
63-
"local-rules/umb-class-prefix": "error",
64-
"local-rules/no-relative-import-to-import-map-module": "error",
65-
"local-rules/enforce-umbraco-external-imports": [
66-
"error",
49+
semi: ['warn', 'always'],
50+
"prettier/prettier": ["warn", {"endOfLine": "auto" }],
51+
'no-unused-vars': 'off', //Let '@typescript-eslint/no-unused-vars' catch the errors to allow unused function parameters (ex: in interfaces)
52+
'no-var': 'error',
53+
'import/no-unresolved': 'off',
54+
'import/order': ['warn', { groups: ['builtin', 'parent', 'sibling', 'index', 'external'] }],
55+
'import/no-self-import': 'error',
56+
'import/no-cycle': ['error', { maxDepth: 6, allowUnsafeDynamicCyclicDependency: true }],
57+
'local-rules/bad-type-import': 'error',
58+
'local-rules/enforce-element-suffix-on-element-class-name': 'error',
59+
'local-rules/enforce-umb-prefix-on-element-name': 'error',
60+
'local-rules/ensure-relative-import-use-js-extension': 'error',
61+
'local-rules/no-direct-api-import': 'warn',
62+
'local-rules/prefer-import-aliases': 'error',
63+
'local-rules/prefer-static-styles-last': 'warn',
64+
'local-rules/umb-class-prefix': 'error',
65+
'local-rules/no-relative-import-to-import-map-module': 'error',
66+
'local-rules/enforce-umbraco-external-imports': [
67+
'error',
6768
{
68-
"exceptions": ["@umbraco-cms", "@open-wc/testing", "@storybook", "msw", ".", "vite"]
69-
}
69+
exceptions: ['@umbraco-cms', '@open-wc/testing', '@storybook', 'msw', '.', 'vite'],
70+
},
7071
],
71-
"local-rules/exported-string-constant-naming": [
72-
"error",
72+
'local-rules/exported-string-constant-naming': [
73+
'error',
7374
{
74-
"excludedFileNames": ["umbraco-package", "input-tiny-mce.defaults"] // TODO: what to do about the tiny mce defaults?
75-
}
75+
excludedFileNames: ['umbraco-package', 'input-tiny-mce.defaults'], // TODO: what to do about the tiny mce defaults?
76+
},
7677
],
77-
"@typescript-eslint/no-non-null-assertion": "off",
78-
"@typescript-eslint/no-explicit-any": "warn",
79-
"@typescript-eslint/no-unused-vars": "warn",
80-
"@typescript-eslint/consistent-type-exports": "error",
81-
"@typescript-eslint/consistent-type-imports": "error",
82-
"@typescript-eslint/no-import-type-side-effects": "warn"
83-
}
78+
'@typescript-eslint/no-non-null-assertion': 'off',
79+
'@typescript-eslint/no-explicit-any': 'warn',
80+
'@typescript-eslint/no-unused-vars': 'error',
81+
'@typescript-eslint/consistent-type-exports': 'error',
82+
'@typescript-eslint/consistent-type-imports': 'error',
83+
'@typescript-eslint/no-import-type-side-effects': 'warn',
84+
},
8485
},
8586

8687
// Pattern-specific overrides
@@ -90,7 +91,7 @@ export default [
9091
languageOptions: {
9192
globals: {
9293
...globals.node,
93-
}
94-
}
94+
},
95+
},
9596
},
9697
];

package-lock.json

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"./code-editor": "./dist-cms/packages/templating/code-editor/index.js",
2626
"./collection": "./dist-cms/packages/core/collection/index.js",
2727
"./components": "./dist-cms/packages/core/components/index.js",
28-
"./content": "./dist-cms/packages/core/content/index.js",
2928
"./content-type": "./dist-cms/packages/core/content-type/index.js",
29+
"./content": "./dist-cms/packages/core/content/index.js",
3030
"./culture": "./dist-cms/packages/core/culture/index.js",
3131
"./current-user": "./dist-cms/packages/user/current-user/index.js",
3232
"./data-type": "./dist-cms/packages/data-type/index.js",
@@ -35,9 +35,9 @@
3535
"./document-blueprint": "./dist-cms/packages/documents/document-blueprints/index.js",
3636
"./document-type": "./dist-cms/packages/documents/document-types/index.js",
3737
"./document": "./dist-cms/packages/documents/documents/index.js",
38-
"./entity": "./dist-cms/packages/core/entity/index.js",
3938
"./entity-action": "./dist-cms/packages/core/entity-action/index.js",
4039
"./entity-bulk-action": "./dist-cms/packages/core/entity-bulk-action/index.js",
40+
"./entity": "./dist-cms/packages/core/entity/index.js",
4141
"./event": "./dist-cms/packages/core/event/index.js",
4242
"./extension-registry": "./dist-cms/packages/core/extension-registry/index.js",
4343
"./icon": "./dist-cms/packages/core/icon-registry/index.js",
@@ -63,6 +63,7 @@
6363
"./picker-input": "./dist-cms/packages/core/picker-input/index.js",
6464
"./property-action": "./dist-cms/packages/core/property-action/index.js",
6565
"./property-editor": "./dist-cms/packages/core/property-editor/index.js",
66+
"./property-type": "./dist-cms/packages/core/property-type/index.js",
6667
"./property": "./dist-cms/packages/core/property/index.js",
6768
"./recycle-bin": "./dist-cms/packages/core/recycle-bin/index.js",
6869
"./relation-type": "./dist-cms/packages/relations/relation-types/index.js",
@@ -73,8 +74,8 @@
7374
"./script": "./dist-cms/packages/templating/scripts/index.js",
7475
"./search": "./dist-cms/packages/search/index.js",
7576
"./section": "./dist-cms/packages/core/section/index.js",
76-
"./settings": "./dist-cms/packages/settings/index.js",
7777
"./server-file-system": "./dist-cms/packages/core/server-file-system/index.js",
78+
"./settings": "./dist-cms/packages/settings/index.js",
7879
"./sorter": "./dist-cms/packages/core/sorter/index.js",
7980
"./static-file": "./dist-cms/packages/static-file/index.js",
8081
"./store": "./dist-cms/packages/core/store/index.js",
@@ -141,7 +142,8 @@
141142
"./src/packages/tags",
142143
"./src/packages/templating",
143144
"./src/packages/property-editors",
144-
"./src/packages/media"
145+
"./src/packages/media",
146+
"./src/packages/user"
145147
],
146148
"scripts": {
147149
"backoffice:test:e2e": "npx playwright test",

src/external/router-slot/router-slot.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class RouterSlot<D = any, P = any> extends HTMLElement implements IRouter
4848
/**
4949
* Method to cancel navigation if changed.
5050
*/
51-
private _cancelNavigation ?:() => void;
51+
private _cancelNavigation?: () => void;
5252

5353
/**
5454
* Listeners on the router.
@@ -208,7 +208,7 @@ export class RouterSlot<D = any, P = any> extends HTMLElement implements IRouter
208208
if (this.isConnected) {
209209
const newMatch = this.getRouteMatch();
210210
// Check if this match matches the current match (aka. If the path has changed), if so we should navigate. [NL]
211-
if(newMatch) {
211+
if (newMatch) {
212212
navigate = shouldNavigate(this.match, newMatch);
213213
}
214214
}
@@ -318,7 +318,6 @@ export class RouterSlot<D = any, P = any> extends HTMLElement implements IRouter
318318
* Returns true if a navigation was made to a new page.
319319
*/
320320
protected async renderPath(path: string | PathFragment): Promise<boolean> {
321-
322321
// Notice: Since this is never called from any other place than one higher in this file(when writing this...), we could just retrieve the path and find a match by using this.getRouteMatch() [NL]
323322
// Find the corresponding route.
324323
const match = matchRoutes(this._routes, path);
@@ -336,7 +335,6 @@ export class RouterSlot<D = any, P = any> extends HTMLElement implements IRouter
336335
// Only change route if its a new route.
337336
const navigate = shouldNavigate(this.match, match);
338337
if (navigate) {
339-
340338
// If another navigation is still begin resolved in this very moment, then we need to cancel that so it does not end up overriding this new navigation.[NL]
341339
this._cancelNavigation?.();
342340
// Listen for another push state event. If another push state event happens
@@ -412,7 +410,7 @@ export class RouterSlot<D = any, P = any> extends HTMLElement implements IRouter
412410
// We have some routes that share the same component instance, those should not be removed and re-appended [NL]
413411
const isTheSameComponent = this.firstChild === page;
414412

415-
if(!isTheSameComponent) {
413+
if (!isTheSameComponent) {
416414
// Remove the old page by clearing the slot
417415
this.clearChildren();
418416
}
@@ -421,7 +419,7 @@ export class RouterSlot<D = any, P = any> extends HTMLElement implements IRouter
421419
// We do this to ensure that we can find the match in the connectedCallback of the page.
422420
this._routeMatch = match;
423421

424-
if(!isTheSameComponent) {
422+
if (!isTheSameComponent) {
425423
if (page) {
426424
// Append the new page
427425
this.appendChild(page);

src/libs/controller-api/controller.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('UmbController', () => {
5151
let hostElement: UmbControllerHostElement;
5252

5353
beforeEach(() => {
54-
hostElement = document.createElement('test-my-controller-host') as UmbControllerHostElement;
54+
hostElement = new UmbTestControllerHostElement();
5555
});
5656

5757
describe('Controller Host Public API', () => {

src/libs/element-api/element.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ describe('UmbElementMixin', () => {
152152
expect(hostElement.hasUmbController(ctrl)).to.be.true;
153153

154154
const ctrl2 = hostElement.observe(myObservable, (value) => {
155+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
155156
const a = value + 'bla';
156157
});
157158

@@ -172,6 +173,7 @@ describe('UmbElementMixin', () => {
172173
const ctrl2 = hostElement.observe(
173174
undefined,
174175
() => {
176+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
175177
const a = 1;
176178
},
177179
'observer',

src/libs/extension-api/controller/base-extension-initializer.controller.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import { UmbSwitchCondition } from '@umbraco-cms/backoffice/extension-registry';
1616
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
1717

1818
@customElement('umb-test-controller-host')
19+
// Element is used in tests
20+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1921
class UmbTestControllerHostElement extends UmbControllerHostElementMixin(HTMLElement) {}
2022

2123
class UmbTestExtensionController extends UmbBaseExtensionInitializer {
@@ -57,12 +59,12 @@ class UmbTestConditionAlwaysInvalid extends UmbControllerBase implements UmbExte
5759

5860
describe('UmbBaseExtensionController', () => {
5961
describe('Manifest without conditions', () => {
60-
let hostElement: UmbControllerHostElement;
62+
//let hostElement: UmbControllerHostElement;
6163
let extensionRegistry: UmbExtensionRegistry<ManifestWithDynamicConditions>;
6264
let manifest: ManifestWithDynamicConditions;
6365

6466
beforeEach(async () => {
65-
hostElement = await fixture(html`<umb-test-controller-host></umb-test-controller-host>`);
67+
//hostElement = await fixture(html`<umb-test-controller-host></umb-test-controller-host>`);
6668
extensionRegistry = new UmbExtensionRegistry();
6769
manifest = {
6870
type: 'section',
@@ -94,12 +96,12 @@ describe('UmbBaseExtensionController', () => {
9496
});
9597

9698
describe('Manifest with empty conditions', () => {
97-
let hostElement: UmbControllerHostElement;
99+
//let hostElement: UmbControllerHostElement;
98100
let extensionRegistry: UmbExtensionRegistry<ManifestWithDynamicConditions>;
99101
let manifest: ManifestWithDynamicConditions;
100102

101103
beforeEach(async () => {
102-
hostElement = await fixture(html`<umb-test-controller-host></umb-test-controller-host>`);
104+
//hostElement = await fixture(html`<umb-test-controller-host></umb-test-controller-host>`);
103105
extensionRegistry = new UmbExtensionRegistry();
104106
manifest = {
105107
type: 'section',

0 commit comments

Comments
 (0)