Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Fix dependencies

Robin Dekkersac2dc9a5e9a8
diff --git a/ui/app/main/package.json b/ui/app/main/package.json
index bc5b0eaf9..3e707cfdf 100644
--- a/ui/app/main/package.json
+++ b/ui/app/main/package.json
@@ -20,6 +20,7 @@
"@openremote/or-asset-viewer": "^1.1.0",
"@openremote/or-header": "^1.1.0",
"@openremote/or-map": "^1.1.0",
+ "@openremote/or-chart": "^1.1.0",
"@openremote/or-rules": "^1.1.0",
"@openremote/or-smart-notify": "^1.1.0",
"@openremote/or-timeline": "^1.1.0",
diff --git a/ui/app/main/tsconfig.json b/ui/app/main/tsconfig.json
index 08402a654..1e74afb8b 100644
--- a/ui/app/main/tsconfig.json
+++ b/ui/app/main/tsconfig.json
@@ -10,12 +10,13 @@
],
"references": [
{ "path": "../../component/core" },
- { "path": "../../component/or-icon" },
+ { "path": "../../component/or-icon" },
{ "path": "../../component/or-header" },
{ "path": "../../component/or-input" },
{ "path": "../../component/or-map" },
- { "path": "../../component/or-asset-tree" },
+ { "path": "../../component/or-asset-tree" },
{ "path": "../../component/or-attribute-input" },
+ { "path": "../../component/or-chart" },
{ "path": "../../component/or-asset-viewer" },
{ "path": "../../component/or-rules" }
]
diff --git a/ui/component/or-asset-viewer/package.json b/ui/component/or-asset-viewer/package.json
index b666ae76f..ef357c742 100644
--- a/ui/component/or-asset-viewer/package.json
+++ b/ui/component/or-asset-viewer/package.json
@@ -21,6 +21,7 @@
"@openremote/or-translate": "^1.1.0",
"@openremote/or-panel": "^1.1.0",
"@openremote/or-map": "^1.1.0",
+ "@openremote/or-chart": "^1.1.0",
"@openremote/rest": "^1.1.0",
"lit-element": "^2.2.1"
},
diff --git a/ui/component/or-asset-viewer/tsconfig.json b/ui/component/or-asset-viewer/tsconfig.json
index 33efa8797..ffe7e24d4 100644
--- a/ui/component/or-asset-viewer/tsconfig.json
+++ b/ui/component/or-asset-viewer/tsconfig.json
@@ -13,6 +13,7 @@
{ "path": "../core" },
{ "path": "../rest" },
{ "path": "../model" },
+ { "path": "../or-chart" },
{ "path": "../or-panel" },
{ "path": "../or-translate" },
{ "path": "../or-icon" },
diff --git a/ui/component/or-chart/package.json b/ui/component/or-chart/package.json
index 2eb8a89ac..ec165abae 100644
--- a/ui/component/or-chart/package.json
+++ b/ui/component/or-chart/package.json
@@ -13,7 +13,7 @@
"license": "AGPL-3.0-or-later",
"dependencies": {
"@material/data-table": "^4.0.0",
- "@material/mwc-dialog": "^0.12.0",
+ "@material/dialog": "^4.0.0",
"@openremote/core": "^1.1.0",
"@openremote/or-input": "^1.1.0",
"@openremote/or-panel": "^1.1.0",
diff --git a/ui/component/or-chart/src/index.ts b/ui/component/or-chart/src/index.ts
index 6948d6c9d..f07058b9f 100644
--- a/ui/component/or-chart/src/index.ts
+++ b/ui/component/or-chart/src/index.ts
@@ -23,8 +23,8 @@ import manager, {
import "@openremote/or-asset-tree";
import "@openremote/or-input";
import "@openremote/or-panel";
-import "@material/mwc-dialog";
-import {Dialog} from "@material/mwc-dialog";
+import "@material/dialog";
+import {MDCDialog} from '@material/dialog';
import "@openremote/or-translate";
import Chart, {ChartTooltipCallback, ChartDataSets} from "chart.js";
import {InputType, OrInputChangedEvent} from "@openremote/or-input";
@@ -332,32 +332,41 @@ export class OrChart extends translate(i18next)(LitElement) {
</div>
</div>
-
- <mwc-dialog id="mwc-dialog-attr" heading="Add attribute">
- <div class="dialog-container">
- <or-asset-tree id="chart-asset-tree"></or-asset-tree>
- ${this._activeAsset && this._activeAsset.attributes ? html`
- <or-input id="chart-attribute-picker"
- .label="${i18next.t("attribute")}"
- .type="${InputType.LIST}"
- .options="${this._getAttributeOptions()}"></or-input>
- `:``}
+ <div id="mdc-dialog"
+ role="alertdialog"
+ aria-modal="true"
+ aria-labelledby="my-dialog-title"
+ aria-describedby="my-dialog-content">
+ <div class="mdc-dialog__container">
+ <div class="mdc-dialog__surface">
+ <h2 class="mdc-dialog__title" id="my-dialog-title">Add attribute</h2>
+ <div class="dialog-container mdc-dialog__content" id="my-dialog-content">
+ <or-asset-tree id="chart-asset-tree"></or-asset-tree>
+ ${this._activeAsset && this._activeAsset.attributes ? html`
+ <or-input id="chart-attribute-picker"
+ .label="${i18next.t("attribute")}"
+ .type="${InputType.LIST}"
+ .options="${this._getAttributeOptions()}"></or-input>
+ `:``}
+ </div>
+ <footer class="mdc-dialog__actions">
+ <or-input class="button"
+ slot="primaryAction"
+ .type="${InputType.BUTTON}"
+ label="${i18next.t("Add")}"
+ class="mdc-button mdc-dialog__button" data-mdc-dialog-action="yes"
+ @click="${this.addAttribute}"></or-input>
+
+ <or-input class="button"
+ slot="secondaryAction"
+ .type="${InputType.BUTTON}"
+ label="${i18next.t("Cancel")}"
+ class="mdc-button mdc-dialog__button" data-mdc-dialog-action="no"></or-input>
+ </footer>
+ </div>
</div>
-
-
- <or-input class="button"
- slot="primaryAction"
- .type="${InputType.BUTTON}"
- label="${i18next.t("Add")}"
- dialogAction="discard"
- @click="${this.addAttribute}"></or-input>
-
- <or-input class="button"
- slot="secondaryAction"
- .type="${InputType.BUTTON}"
- label="${i18next.t("Cancel")}"
- dialogAction="cancel"></or-input>
- </mwc-dialog>
+ <div class="mdc-dialog__scrim"></div>
+ </div>
`;
}
@@ -461,10 +470,11 @@ export class OrChart extends translate(i18next)(LitElement) {
}
_openDialog() {
- if(this.shadowRoot){
- const dialog = this.shadowRoot.getElementById('mwc-dialog-attr') as Dialog;
+ const component = this.shadowRoot!.getElementById("mdc-dialog");
+ if(component){
+ const dialog = new MDCDialog(component);
if(dialog){
- dialog.show();
+ dialog.open();
}
}
}