Merge branch 'main' of https://github.com/umbraco/Umbraco.CMS.Backoffice
This commit is contained in:
3
src/Umbraco.Web.UI.Client/.gitignore
vendored
3
src/Umbraco.Web.UI.Client/.gitignore
vendored
@@ -13,6 +13,9 @@ dist-ssr
|
||||
types
|
||||
*.local
|
||||
|
||||
## testing
|
||||
/coverage/
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
|
||||
1887
src/Umbraco.Web.UI.Client/package-lock.json
generated
1887
src/Umbraco.Web.UI.Client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,8 @@
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"preview": "vite preview --open",
|
||||
"test": "echo 'TODO: Implement test'",
|
||||
"test": "web-test-runner --coverage",
|
||||
"test:watch": "web-test-runner --watch",
|
||||
"lint": "eslint . --ext .ts --cache",
|
||||
"lint:fix": "npm run lint -- --fix",
|
||||
"format": "prettier 'src/**/*.ts'",
|
||||
@@ -32,6 +33,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@umbraco-ui/uui": "^0.2.1",
|
||||
"element-internals-polyfill": "^1.1.4",
|
||||
"lit": "^2.2.4",
|
||||
"openapi-typescript-fetch": "^1.1.3",
|
||||
"rxjs": "^7.5.5"
|
||||
@@ -42,6 +44,9 @@
|
||||
"@types/mocha": "^9.1.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.24.0",
|
||||
"@typescript-eslint/parser": "^5.24.0",
|
||||
"@web/dev-server-esbuild": "^0.3.0",
|
||||
"@web/test-runner": "^0.13.28",
|
||||
"@web/test-runner-playwright": "^0.8.8",
|
||||
"eslint": "^8.15.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-import-resolver-typescript": "^2.7.1",
|
||||
|
||||
@@ -177,7 +177,8 @@ export class UmbBackofficeHeader extends UmbContextConsumerMixin(LitElement) {
|
||||
.subscribe((sectionExtensions: any) => {
|
||||
this._sections = sectionExtensions.filter((section: any) => this._allowedSection.includes(section.alias));
|
||||
this._visibleSections = this._sections;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
const currentSectionAlias = this._sections.find(section => section.name === this._location?.params?.section)?.alias;
|
||||
if (!currentSectionAlias) return;
|
||||
this._sectionContext?.setCurrent(currentSectionAlias);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Observable, ReplaySubject } from 'rxjs';
|
||||
|
||||
import { UmbRouterBeforeEnterEvent } from './router-before-enter.event';
|
||||
import { UmbRouterBeforeLeaveEvent } from './router-before-leave.event';
|
||||
|
||||
@@ -10,7 +11,7 @@ export interface UmbRoute {
|
||||
|
||||
export interface UmbRouteLocation {
|
||||
pathname: string;
|
||||
params: object;
|
||||
params: Record<string, any>;
|
||||
fullPath: string;
|
||||
route: UmbRoute;
|
||||
}
|
||||
|
||||
12
src/Umbraco.Web.UI.Client/temp-schema-generator/README.md
Normal file
12
src/Umbraco.Web.UI.Client/temp-schema-generator/README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# What is this?
|
||||
|
||||
This folder contains the schema generator which resides here temporarily until Umbraco provides a proper way to generate schemas in its own repository.
|
||||
|
||||
## How do I use it?
|
||||
|
||||
1. Run `npm install` in this folder.
|
||||
2. Update any schema through `api.ts` and then run `npm run generate` to simulate a new schema.
|
||||
3. You then need to go to the main folder and run `npm run generate:api` to generate the API fetchers and interfaces.
|
||||
1. This is the only thing that will remain in the final version.
|
||||
|
||||
We are using the excellent tool `@airtasker/spot` to decorate the schema methods. [You can read more about it here](https://github.com/airtasker/spot).
|
||||
22
src/Umbraco.Web.UI.Client/web-test-runner.config.mjs
Normal file
22
src/Umbraco.Web.UI.Client/web-test-runner.config.mjs
Normal file
@@ -0,0 +1,22 @@
|
||||
import { esbuildPlugin } from '@web/dev-server-esbuild';
|
||||
import { playwrightLauncher } from '@web/test-runner-playwright';
|
||||
|
||||
export default {
|
||||
nodeResolve: true,
|
||||
files: 'src/**/*.test.ts',
|
||||
plugins: [esbuildPlugin({ ts: true, target: 'auto' })],
|
||||
browsers: [
|
||||
playwrightLauncher({ product: 'chromium' }),
|
||||
playwrightLauncher({ product: 'firefox' }),
|
||||
playwrightLauncher({ product: 'webkit' }),
|
||||
],
|
||||
testRunnerHtml: (testFramework) =>
|
||||
`<html>
|
||||
<body>
|
||||
<script type="module" src="${testFramework}"></script>
|
||||
<script type="module">
|
||||
import 'element-internals-polyfill';
|
||||
</script>
|
||||
</body>
|
||||
</html>`,
|
||||
};
|
||||
Reference in New Issue
Block a user