Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/swap to popover container - part 1 #1013

Merged
merged 49 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
13144ab
format
JesmoDev Nov 21, 2023
a6b219e
variant selector
JesmoDev Nov 22, 2023
693906d
property action menu
JesmoDev Nov 22, 2023
7608e76
add css vars to popover layout
JesmoDev Nov 22, 2023
1836916
property action menu
JesmoDev Nov 22, 2023
72645a1
workspace action menu
JesmoDev Nov 22, 2023
6915e08
styling
JesmoDev Nov 23, 2023
367d80c
Merge remote-tracking branch 'origin/main' into feature/swap-to-popov…
JesmoDev Nov 23, 2023
cf862f2
remove padding from popover layout
JesmoDev Nov 23, 2023
5048bd8
use flat structure for menu items
JesmoDev Nov 23, 2023
0c8f0fa
add open state to variant selector to affect expand symbol
JesmoDev Nov 23, 2023
cb99c5e
remove redundant popover attributes
JesmoDev Nov 23, 2023
60bc5a1
remove css vars from popover layout
JesmoDev Nov 23, 2023
f8f29fd
tab group now handles collapsing
JesmoDev Nov 23, 2023
bc08d75
Merge remote-tracking branch 'origin/main' into feature/swap-to-popov…
JesmoDev Nov 28, 2023
6e09b7a
Merge branch 'main' into feature/swap-to-popover-container
JesmoDev Nov 28, 2023
392cfbf
Merge branch 'main' into feature/swap-to-popover-container
nielslyngsoe Nov 30, 2023
b310425
more clean up of header-sections
nielslyngsoe Nov 30, 2023
9677eb7
add expand symbol to actions
nielslyngsoe Nov 30, 2023
db12fe0
remove extra slot declaration
nielslyngsoe Nov 30, 2023
3fe234e
Merge branch 'main' into feature/swap-to-popover-container
JesmoDev Dec 4, 2023
7f0476f
update umb-dropdown to use popover-container
JesmoDev Dec 4, 2023
954c7c1
app language select popover
JesmoDev Dec 4, 2023
13204e8
fix
JesmoDev Dec 4, 2023
6329586
log viewer filter menu
JesmoDev Dec 4, 2023
0958973
fix placement in dropdown
JesmoDev Dec 4, 2023
d361496
log viewer message
JesmoDev Dec 4, 2023
6dff841
add expand symbol
JesmoDev Dec 4, 2023
e7501ca
templating insert menu
JesmoDev Dec 4, 2023
3a42d91
query builder
JesmoDev Dec 4, 2023
03665a5
remove button-with-dropdown
JesmoDev Dec 4, 2023
0c88cdb
cleanup
JesmoDev Dec 4, 2023
668eb79
cleanup
JesmoDev Dec 4, 2023
68d1402
log viewer polling rate
JesmoDev Dec 4, 2023
17d2b4c
cleanup
JesmoDev Dec 4, 2023
5bc944e
dropdown styling
JesmoDev Dec 4, 2023
22c408a
log viewer search input
JesmoDev Dec 4, 2023
61924ea
document table actions column layout
JesmoDev Dec 4, 2023
60802a1
clean
JesmoDev Dec 4, 2023
a032792
TS does not know about popover API types yet
JesmoDev Dec 4, 2023
8e1aedf
Merge remote-tracking branch 'origin/main' into feature/swap-to-popov…
JesmoDev Dec 4, 2023
b5d188f
remove ignorers
nielslyngsoe Dec 5, 2023
9bf4e76
remove ignorer
nielslyngsoe Dec 5, 2023
a8c6410
upgrade TS
nielslyngsoe Dec 5, 2023
6cb6d2e
fit TS issues
nielslyngsoe Dec 5, 2023
13b50d7
clean up context
nielslyngsoe Dec 5, 2023
5a6f52a
comment
nielslyngsoe Dec 5, 2023
1f6ca49
format
nielslyngsoe Dec 5, 2023
bc29133
fix JSON SCHEMA
nielslyngsoe Dec 5, 2023
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
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"lucide",
"Niels",
"pickable",
"popovertarget",
"Registrator",
"svgs",
"templating",
Expand Down
257 changes: 135 additions & 122 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@
"@types/chai": "^4.3.5",
"@types/lodash-es": "^4.17.8",
"@types/mocha": "^10.0.1",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.5.0",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@web/dev-server-esbuild": "^0.4.1",
"@web/dev-server-import-maps": "^0.1.1",
"@web/dev-server-rollup": "^0.6.0",
Expand All @@ -180,7 +180,7 @@
"eslint-plugin-local-rules": "^1.3.2",
"eslint-plugin-storybook": "^0.6.15",
"eslint-plugin-wc": "^2.0.4",
"eslint": "^8.46.0",
"eslint": "^8.55.0",
"lucide-static": "^0.290.0",
"msw": "^1.2.3",
"openapi-typescript-codegen": "^0.25.0",
Expand All @@ -199,7 +199,7 @@
"tiny-glob": "^0.2.9",
"tsc-alias": "^1.8.8",
"typescript-json-schema": "^0.62.0",
"typescript": "^5.1.6",
"typescript": "^5.3.2",
"vite-plugin-static-copy": "^0.17.0",
"vite-tsconfig-paths": "^4.2.0",
"vite": "^4.4.9",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { UMB_BACKOFFICE_CONTEXT_TOKEN } from '../backoffice.context.js';
import type { UmbBackofficeContext } from '../backoffice.context.js';
import { css, CSSResultGroup, html, when, customElement, state, repeat } from '@umbraco-cms/backoffice/external/lit';
import { css, CSSResultGroup, html, customElement, state, repeat } from '@umbraco-cms/backoffice/external/lit';
import type { ManifestSection } from '@umbraco-cms/backoffice/extension-registry';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
import { UmbExtensionManifestInitializer } from '@umbraco-cms/backoffice/extension-api';
Expand Down Expand Up @@ -28,22 +28,30 @@ export class UmbBackofficeHeaderSectionsElement extends UmbLitElement {
private _observeSections() {
if (!this._backofficeContext) return;

this.observe(this._backofficeContext.allowedSections, (allowedSections) => {
const oldValue = this._sections;
this._sections = allowedSections;
this.requestUpdate('_sections', oldValue);
});
this.observe(
this._backofficeContext.allowedSections,
(allowedSections) => {
const oldValue = this._sections;
this._sections = allowedSections;
this.requestUpdate('_sections', oldValue);
},
'observeSections',
);
}

private _observeCurrentSection() {
if (!this._backofficeContext) return;

this.observe(this._backofficeContext.activeSectionAlias, (currentSectionAlias) => {
this._currentSectionAlias = currentSectionAlias || '';
});
this.observe(
this._backofficeContext.activeSectionAlias,
(currentSectionAlias) => {
this._currentSectionAlias = currentSectionAlias || '';
},
'observeCurrentSection',
);
}

private _renderSections() {
render() {
return html`
<uui-tab-group id="tabs">
${repeat(
Expand All @@ -60,10 +68,6 @@ export class UmbBackofficeHeaderSectionsElement extends UmbLitElement {
`;
}

render() {
return html` ${this._renderSections()} `;
}

static styles: CSSResultGroup = [
css`
:host {
Expand Down
44 changes: 23 additions & 21 deletions src/apps/backoffice/components/backoffice-main.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import { UmbSectionContext, UMB_SECTION_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/section';
import type { UmbRoute, UmbRouterSlotChangeEvent } from '@umbraco-cms/backoffice/router';
import type { ManifestSection, UmbSectionElement } from '@umbraco-cms/backoffice/extension-registry';
import {
UmbExtensionManifestInitializer, createExtensionElement
} from '@umbraco-cms/backoffice/extension-api';
import { UmbExtensionManifestInitializer, createExtensionElement } from '@umbraco-cms/backoffice/extension-api';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';

@customElement('umb-backoffice-main')
Expand Down Expand Up @@ -37,7 +35,7 @@
this._sections = sections;
this._createRoutes();
},
'observeAllowedSections'
'observeAllowedSections',
);
}
}
Expand All @@ -47,21 +45,23 @@
const oldValue = this._routes;

// TODO: Refactor this for re-use across the app where the routes are re-generated at any time.
this._routes = this._sections.filter(x => x.manifest).map((section) => {
const existingRoute = this._routes.find((r) => r.alias === section.alias);
if (existingRoute) {
return existingRoute;
} else {
return {
alias: section.alias,
path: this._routePrefix + (section.manifest as ManifestSection).meta.pathname,
component: () => createExtensionElement(section.manifest!, 'umb-section-default'),
setup: (component) => {
(component as UmbSectionElement).manifest = section.manifest as ManifestSection;
},
};
}
});
this._routes = this._sections
.filter((x) => x.manifest)
.map((section) => {
const existingRoute = this._routes.find((r) => r.alias === section.alias);
if (existingRoute) {
return existingRoute;
} else {
return {
alias: section.alias,
path: this._routePrefix + (section.manifest as ManifestSection).meta.pathname,
component: () => createExtensionElement(section.manifest!, 'umb-section-default'),
setup: (component) => {
(component as UmbSectionElement).manifest = section.manifest as ManifestSection;
},
};
}
});

if (this._sections.length > 0) {
this._routes.push({
Expand All @@ -76,10 +76,10 @@

private _onRouteChange = async (event: UmbRouterSlotChangeEvent) => {
const currentPath = event.target.localActiveViewPath || '';
const section = this._sections.find((s) => this._routePrefix + (s.manifest as any).meta.pathname === currentPath);

Check warning on line 79 in src/apps/backoffice/components/backoffice-main.element.ts

View workflow job for this annotation

GitHub Actions / build (20)

Unexpected any. Specify a different type
if (!section) return;
await section.asPromise();
if(section.manifest) {
if (section.manifest) {
this._backofficeContext?.setActiveSectionAlias(section.alias);
this._provideSectionContext(section.manifest);
}
Expand All @@ -105,7 +105,9 @@
:host {
background-color: var(--uui-color-background);
display: block;
height: calc(100% - 60px); // 60 => top header height, TODO: Make sure this comes from somewhere so it is maintainable and eventually responsive.
height: calc(
100% - 60px
); // 60 => top header height, TODO: Make sure this comes from somewhere so it is maintainable and eventually responsive.
}
`,
];
Expand Down
33 changes: 17 additions & 16 deletions src/apps/installer/database/installer-database.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class UmbInstallerDatabaseElement extends UmbLitElement {
};

const { error } = await tryExecute(
InstallResource.postInstallValidateDatabase({ requestBody: databaseDetails })
InstallResource.postInstallValidateDatabase({ requestBody: databaseDetails }),
);

if (error) {
Expand Down Expand Up @@ -199,7 +199,7 @@ export class UmbInstallerDatabaseElement extends UmbLitElement {
this._installerContext.nextStep();

const { error } = await tryExecute(
InstallResource.postInstallSetup({ requestBody: this._installerContext.getData() })
InstallResource.postInstallSetup({ requestBody: this._installerContext.getData() }),
);

if (error) {
Expand Down Expand Up @@ -243,7 +243,7 @@ export class UmbInstallerDatabaseElement extends UmbLitElement {
}

result.push(
this._renderDatabaseName(this.databaseFormData.name ?? this._selectedDatabase.defaultDatabaseName ?? 'umbraco')
this._renderDatabaseName(this.databaseFormData.name ?? this._selectedDatabase.defaultDatabaseName ?? 'umbraco'),
);

if (this._selectedDatabase.requiresCredentials) {
Expand Down Expand Up @@ -271,19 +271,20 @@ export class UmbInstallerDatabaseElement extends UmbLitElement {
</uui-form-layout-item>
`;

private _renderDatabaseName = (value: string) => html` <uui-form-layout-item>
<uui-label for="database-name" slot="label" required>Database Name</uui-label>
<uui-input
type="text"
.value=${value}
id="database-name"
name="name"
label="Database name"
@input=${this._handleChange}
placeholder="umbraco"
required
required-message="Database name is required"></uui-input>
</uui-form-layout-item>`;
private _renderDatabaseName = (value: string) =>
html` <uui-form-layout-item>
<uui-label for="database-name" slot="label" required>Database Name</uui-label>
<uui-input
type="text"
.value=${value}
id="database-name"
name="name"
label="Database name"
@input=${this._handleChange}
placeholder="umbraco"
required
required-message="Database name is required"></uui-input>
</uui-form-layout-item>`;

private _renderCredentials = () => html`
<h2 class="uui-h4">Credentials</h2>
Expand Down
7 changes: 5 additions & 2 deletions src/apps/installer/shared/layout/installer-layout.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ export class UmbInstallerLayoutElement extends LitElement {
max-width: 1200px;
height: 100%;
max-height: 900px;
box-shadow: 0px 1.1px 3.7px rgba(0, 0, 0, 0.091), 0px 3.1px 10.1px rgba(0, 0, 0, 0.13),
0px 7.5px 24.4px rgba(0, 0, 0, 0.169), 0px 25px 81px rgba(0, 0, 0, 0.26);
box-shadow:
0px 1.1px 3.7px rgba(0, 0, 0, 0.091),
0px 3.1px 10.1px rgba(0, 0, 0, 0.13),
0px 7.5px 24.4px rgba(0, 0, 0, 0.169),
0px 25px 81px rgba(0, 0, 0, 0.26);
}

#grid {
Expand Down
5 changes: 4 additions & 1 deletion src/apps/installer/shared/utils.story-helpers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { UmbInstallerContext } from '../installer.context.js';
import { html, type TemplateResult } from '@umbraco-cms/backoffice/external/lit';

export const installerContextProvider = (story: () => Node | string | TemplateResult, installerContext = new UmbInstallerContext()) => html`
export const installerContextProvider = (
story: () => Node | string | TemplateResult,
installerContext = new UmbInstallerContext(),
) => html`
<umb-context-provider
style="display: block;margin: 2rem 25%;padding: 1rem;border: 1px solid #ddd;"
key="umbInstallerContext"
Expand Down
10 changes: 5 additions & 5 deletions src/external/router-slot/config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { PathMatch } from "./model.js";
import { PathMatch } from './model.js';

export const CATCH_ALL_WILDCARD: string = "**";
export const TRAVERSE_FLAG: string = "\\.\\.\\/";
export const CATCH_ALL_WILDCARD: string = '**';
export const TRAVERSE_FLAG: string = '\\.\\.\\/';
export const PARAM_IDENTIFIER: RegExp = /:([^\\/]+)/g;
export const ROUTER_SLOT_TAG_NAME: string = "router-slot";
export const ROUTER_SLOT_TAG_NAME: string = 'router-slot';
export const GLOBAL_ROUTER_EVENTS_TARGET = window;
export const HISTORY_PATCH_NATIVE_KEY: string = `native`;
export const DEFAULT_PATH_MATCH: PathMatch = "prefix";
export const DEFAULT_PATH_MATCH: PathMatch = 'prefix';
Loading
Loading