Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7560f67
Migrate barchart settings in Insights UI to or-vaadin-dialog and or-v…
MartinaeyNL Sep 3, 2026
51e6991
Replace attribute selector of group asset with or-vaadin-dialog and o…
MartinaeyNL Sep 3, 2026
28d7c6f
Migrate map/realm styling delete prompts on appearance page to Vaadin…
MartinaeyNL Sep 3, 2026
d078604
Apply spotless
MartinaeyNL Sep 3, 2026
4b01ac8
Migrate map dialogs of Rules page its When clause to Vaadin
MartinaeyNL Sep 3, 2026
51faef2
Minor fixes
MartinaeyNL Sep 3, 2026
5720903
Apply spotless
MartinaeyNL Sep 3, 2026
8d319a3
Merge branch 'master' into feature/more-vaadin-dialogs
MartinaeyNL Sep 21, 2026
0fcac80
Merge branch 'master' into feature/more-vaadin-dialogs
MartinaeyNL Sep 25, 2026
7612d55
Migrate JSON dialogs of the appearance page to Vaadin
MartinaeyNL Sep 25, 2026
65aef6b
Apply spotless
MartinaeyNL Sep 25, 2026
4f259a6
Fix for users list not being scrollable in the notification form
MartinaeyNL Sep 25, 2026
14b2429
Migrate Insights chart time dialog to Vaadin equivalenyt
MartinaeyNL Sep 25, 2026
d4e3d92
Migrate delete realm dialog from the Realms page to Vaadin
MartinaeyNL Sep 29, 2026
aeea93b
Merge branch 'master' into feature/more-vaadin-dialogs
MartinaeyNL Sep 29, 2026
8088239
Migrate Insights bar chart dialog to Vaadin
MartinaeyNL Sep 29, 2026
b05e6a4
Apply spotless
MartinaeyNL Sep 29, 2026
428a1d2
Migrate 'add gateway tunnel' dialog with input fields to Vaadin
MartinaeyNL Sep 29, 2026
0325019
Migrate 'add realm configuration' dialogs on appearance page to Vaadin
MartinaeyNL Sep 29, 2026
0912eb9
Migrate GeoJSON dialog on appearance page to Vaadin
MartinaeyNL Sep 29, 2026
a946207
Adjust to broken test; forgot to change 'OK' to the new 'delete' with…
MartinaeyNL Sep 29, 2026
3498fff
Migrate asset tree dialog on edit/add users page to Vaadin
MartinaeyNL Sep 29, 2026
245ff85
WIP
MartinaeyNL Sep 29, 2026
1d35795
Migrate asset selection of Insights assettypes-panel (map+table widge…
MartinaeyNL Sep 29, 2026
38d83f6
Apply spotless
MartinaeyNL Sep 29, 2026
48b8549
Migrate JSON editor in Manager interconnect page to Vaadin
MartinaeyNL Sep 29, 2026
55e069b
Fix for test cleanup failing because it was accidentally detecting tw…
MartinaeyNL Sep 30, 2026
a227a8a
Migrate 'change parents of multiple assets when selected' dialog to V…
MartinaeyNL Sep 30, 2026
bf084ff
Migrate 'add asset' dialog on Assets page to Vaadin
MartinaeyNL Sep 30, 2026
e592c69
Migrate asset dialogs (change parent, add attribute, add meta item) t…
MartinaeyNL Sep 30, 2026
40b7d83
Code cleanup and fix several cases where dialog was not closed.
MartinaeyNL Oct 1, 2026
52418bf
More cleanup, revert textual changes in OK/cancel buttons, and other …
MartinaeyNL Oct 1, 2026
448b380
Address changes after running an AI review of the PR
MartinaeyNL Oct 1, 2026
df46f7d
Minor cleanup
MartinaeyNL Oct 1, 2026
df77b15
Revert notification form changes, as a separate PR is created by Ekho…
MartinaeyNL Oct 1, 2026
5b8d9f5
Merge branch 'master' into feature/more-vaadin-dialogs
MartinaeyNL Oct 1, 2026
a985827
Remove duplicate and/or unused code
MartinaeyNL Oct 1, 2026
983732e
Fix realm delete button color, and fixed height for assettypes-panel …
MartinaeyNL Oct 1, 2026
b7c113a
Merge branch 'main' into feature/more-vaadin-dialogs
MartinaeyNL Oct 15, 2026
f55639c
Additional commit for resolving merge conflict; put back tunnel valid…
MartinaeyNL Oct 15, 2026
50cb020
Minor text adjustment with or-translate on gateway tunnel page after …
MartinaeyNL Oct 15, 2026
0b6cb72
Adjust styling to be aligned with the design after feedback
MartinaeyNL Oct 15, 2026
5142cc5
Migrate checkboxes of adding meta items to Vaadin after feedback. App…
MartinaeyNL Oct 15, 2026
4fde9d9
Migrate or-attribute-input location picker dialog to Vaadin
MartinaeyNL Oct 16, 2026
92ba2c8
Remove MWC dependency from or-map
MartinaeyNL Oct 16, 2026
9bae7e6
Fix yarn.lock
MartinaeyNL Oct 16, 2026
eb16c0b
Adjust test for adding configuration items after Vaadin migration.
MartinaeyNL Oct 16, 2026
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
90 changes: 39 additions & 51 deletions ui/app/manager/src/components/configuration/or-conf-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import { html } from "lit";
import { OrElement } from "@openremote/or-element";
import { customElement, property } from "lit/decorators.js";
import "@openremote/or-components/or-ace-editor";
import type { DialogAction } from "@openremote/or-mwc-components/or-mwc-dialog";
import { OrMwcDialog, showDialog } from "@openremote/or-mwc-components/or-mwc-dialog";
import { type OrVaadinDialog, showDialog } from "@openremote/or-vaadin-components/or-vaadin-dialog";
import { createRef, type Ref, ref } from "lit/directives/ref.js";
import type { OrAceEditor, OrAceEditorChangedEvent } from "@openremote/or-components/or-ace-editor";
import type { ManagerAppConfig, MapConfig } from "@openremote/model";
import type { OrVaadinButton } from "@openremote/or-vaadin-components/or-vaadin-button";

@customElement("or-conf-json")
export class OrConfJson extends OrElement {
Expand All @@ -34,6 +34,7 @@ export class OrConfJson extends OrElement {
public heading: string;

protected _aceEditor: Ref<OrAceEditor> = createRef();
protected _updateButton: Ref<OrVaadinButton> = createRef();

public beforeSave(): false | string | undefined {
if (!this._aceEditor.value) {
Expand All @@ -48,7 +49,7 @@ export class OrConfJson extends OrElement {
}

protected _showConfigDialog() {
let dialog: OrMwcDialog;
let dialog: OrVaadinDialog | undefined;
const _saveConfig = () => {
const config = this.beforeSave();
if (config) {
Expand All @@ -59,55 +60,42 @@ export class OrConfJson extends OrElement {
return false;
};

const dialogActions: DialogAction[] = [
{
actionName: "cancel",
content: "cancel",
},
{
actionName: "ok",
content: "update",
action: _saveConfig,
},
];

dialog = new OrMwcDialog()
.setActions(dialogActions)
.setHeading(this.heading)
.setContent(html`
<or-ace-editor
${ref(this._aceEditor)}
.value="${this.config}"
@or-ace-editor-changed="${(ev: OrAceEditorChangedEvent) => {
const okButton = dialog.actions?.find((action) => action.actionName === "ok");
if (okButton) {
okButton.disabled = !ev.detail.valid;
dialog.requestUpdate();
}
}}"
></or-ace-editor>
`)
.setStyles(html`
<style>
.mdc-dialog__surface {
width: 1024px;
overflow-x: visible !important;
overflow-y: visible !important;
}
#dialog-content {
border-top-width: 1px;
border-top-style: solid;
border-bottom-width: 1px;
border-bottom-style: solid;
padding: 0;
overflow: visible;
height: 60vh;
}
</style>
`)
.setDismissAction(null);
const onCancel = () => {
dialog?.close();
};
const onOk = () => {
if (_saveConfig()) {
dialog?.close();
}
};

showDialog(dialog);
dialog = showDialog(
this.shadowRoot!,
html`
<or-vaadin-dialog width="768px" no-close-on-esc no-close-on-outside-click>
<h2 slot="header-content">${this.heading}</h2>
<or-ace-editor
${ref(this._aceEditor)}
.value="${this.config}"
style="aspect-ratio: 1/1;"
@or-ace-editor-changed="${(ev: OrAceEditorChangedEvent) => {
if (this._updateButton.value) {
this._updateButton.value.disabled = !ev.detail.valid;
dialog?.requestUpdate();
}
}}"
></or-ace-editor>
<div slot="footer" style="width: 100%; display: flex; justify-content: space-between">
<or-vaadin-button theme="tertiary" @click=${onCancel}>
<or-translate value="cancel"></or-translate>
</or-vaadin-button>
<or-vaadin-button theme="primary" ${ref(this._updateButton)} @click=${onOk}>
<or-translate value="update"></or-translate>
</or-vaadin-button>
</div>
</or-vaadin-dialog>
`
);
}

render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { when } from "lit/directives/when.js";
import "@openremote/or-components/or-file-uploader";
import { i18next } from "@openremote/or-translate";
import type { MapRealmConfig } from "@openremote/model";
import { type DialogAction, OrMwcDialog, showDialog } from "@openremote/or-mwc-components/or-mwc-dialog";
import { getConfirmDialogContent, showConfirmDialog } from "@openremote/or-vaadin-components/or-vaadin-confirm-dialog";
import type { OrVaadinToggle } from "@openremote/or-vaadin-components/or-vaadin-toggle";
import type { OrMapLongPressEvent } from "@openremote/or-map";
import type { LngLat } from "maplibre-gl";
Expand Down Expand Up @@ -57,37 +57,13 @@ export class OrConfMapCard extends OrElement {
}

protected _showRemoveMapDialog() {
const dialogActions: DialogAction[] = [
{
actionName: "cancel",
content: "cancel",
},
{
default: true,
actionName: "ok",
content: "yes",
action: () => {
this.dispatchEvent(new CustomEvent("remove"));
},
},
];
showDialog(
new OrMwcDialog()
.setHeading(i18next.t("delete"))
.setActions(dialogActions)
.setContent(html` ${i18next.t("configuration.deleteMapCustomizationConfirm")} `)
.setStyles(html`
<style>
.mdc-dialog__surface {
padding: 4px 8px;
}

#dialog-content {
padding: 24px;
}
</style>
`)
.setDismissAction(null)
showConfirmDialog(
this.shadowRoot!,
html`
<or-vaadin-confirm-dialog @confirm=${() => this.dispatchEvent(new CustomEvent("remove"))}>
${getConfirmDialogContent("error", "delete", "configuration.deleteMapCustomizationConfirm", "delete", "cancel")}
</or-vaadin-confirm-dialog>
`
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import type { GeoJsonConfig } from "@openremote/model";
import { OrMwcDialog, showDialog } from "@openremote/or-mwc-components/or-mwc-dialog";
import { type OrVaadinDialog, showDialog } from "@openremote/or-vaadin-components/or-vaadin-dialog";
import { html } from "lit";
import { OrElement } from "@openremote/or-element";
import { customElement, property, state } from "lit/decorators.js";
import "@openremote/or-components/or-ace-editor";
import type { OrAceEditorChangedEvent } from "@openremote/or-components/or-ace-editor";
import type { OrAceEditor, OrAceEditorChangedEvent } from "@openremote/or-components/or-ace-editor";
import type { OrVaadinButton } from "@openremote/or-vaadin-components/or-vaadin-button";
import { createRef, type Ref, ref } from "lit/directives/ref.js";

@customElement("or-conf-map-geojson")
export class OrConfMapGeoJson extends OrElement {
Expand All @@ -32,71 +34,58 @@ export class OrConfMapGeoJson extends OrElement {
@state()
protected _jsonValid: boolean = true;

protected _dialog: OrMwcDialog;
protected _dialog: OrVaadinDialog;
// Value of or-ace-editor without state to prevent UI update
protected _aceEditorValue: string;

/* -------------- */

protected render() {
return html`
<or-vaadin-button @click=${() => this.showDialog()}>
<or-vaadin-button @click=${() => this._showDialog()}>
<or-icon slot="prefix" icon="pencil"></or-icon>
<or-translate value="configuration.geoJson"></or-translate>
</or-vaadin-button>
`;
}

protected showDialog() {
protected _showDialog() {
const buttonRef: Ref<OrVaadinButton> = createRef();
const editorRef: Ref<OrAceEditor> = createRef();
const onOk = () => {
this.geoJson = this.parseGeoJson(this._aceEditorValue); // update with new value
this.dispatchEvent(new CustomEvent("update", { detail: { value: this.geoJson } }));
this._dialog?.close();
};
this._dialog = showDialog(
new OrMwcDialog()
.setHeading("GeoJSON editor")
.setStyles(
html` <style>
.mdc-dialog__surface {
width: 1024px;
overflow-x: visible !important;
overflow-y: visible !important;
}
#dialog-content {
border-top-width: 1px;
border-top-style: solid;
border-bottom-width: 1px;
border-bottom-style: solid;
padding: 0;
overflow: visible;
height: 60vh;
}
</style>`
)
.setActions([
{
actionName: "close",
content: "close",
},
{
actionName: "ok",
content: "update",
disabled: !this._jsonValid,
action: () => {
this.geoJson = this.parseGeoJson(this._aceEditorValue); // update with new value
this.dispatchEvent(new CustomEvent("update", { detail: { value: this.geoJson } }));
},
},
])
.setContent(
() =>
html` <or-ace-editor
.value="${this.geoJson?.source}"
@or-ace-editor-changed="${(ev: OrAceEditorChangedEvent) => {
this._jsonValid = ev.detail.valid;
if (this._jsonValid) {
this._aceEditorValue = ev.detail.value;
}
}}"
></or-ace-editor>`
)
.setDismissAction(null)
this.shadowRoot!,
html`
<or-vaadin-dialog width="768px" no-close-on-esc no-close-on-outside-click>
<h2 slot="header-content">
<span>GeoJSON editor</span>
</h2>
<or-ace-editor
${ref(editorRef)}
.value="${this.geoJson?.source}"
style="width: 100%; aspect-ratio: 1/1;"
@or-ace-editor-changed="${(ev: OrAceEditorChangedEvent) => {
this._jsonValid = ev.detail.valid;
buttonRef.value!.disabled = !this._jsonValid;
if (this._jsonValid) {
this._aceEditorValue = ev.detail.value;
}
}}"
></or-ace-editor>
<div slot="footer" style="width: 100%; display: flex; justify-content: space-between">
<or-vaadin-button theme="tertiary" @click=${() => this._dialog?.close()}>
<or-translate value="close"></or-translate>
</or-vaadin-button>
<or-vaadin-button theme="primary" ${ref(buttonRef)} disabled @click=${onOk}>
<or-translate value="update"></or-translate>
</or-vaadin-button>
</div>
</or-vaadin-dialog>
`
);
}

Expand Down
Loading
Loading