Skip to content

armgit / core

Public Imported from GitHub
0

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

Add return to invalid or-input value

Robin Dekkersf4c57778c0c8
diff --git a/manager/src/main/java/org/openremote/manager/setup/builtin/ManagerTestSetup.java b/manager/src/main/java/org/openremote/manager/setup/builtin/ManagerTestSetup.java
index 010afa6ee..84a606edc 100644
--- a/manager/src/main/java/org/openremote/manager/setup/builtin/ManagerTestSetup.java
+++ b/manager/src/main/java/org/openremote/manager/setup/builtin/ManagerTestSetup.java
@@ -617,7 +617,7 @@ public class ManagerTestSetup extends AbstractManagerSetup {
true,
ConsoleAppConfig.MenuPosition.BOTTOM_LEFT,
null,
- "#FAFAFA",
+ "#4D9D2A",
"#AFAFAF",
new ConsoleAppConfig.AppLink[] {
new ConsoleAppConfig.AppLink("Map", "https://demo.openremote.io/main/#!geofences?realm=smartcity&consoleProviders=geofence push storage")
diff --git a/ui/app/or-app/src/index.ts b/ui/app/or-app/src/index.ts
index c1f3eba22..91432a3c6 100644
--- a/ui/app/or-app/src/index.ts
+++ b/ui/app/or-app/src/index.ts
@@ -401,7 +401,7 @@ export class OrApp<S extends AppStateKeyed> extends LitElement {
let consoleStyles;
if(manager.consoleAppConfig) {
const consoleAppConfig = manager.consoleAppConfig;
- const primary = "#4D9D2A" //consoleAppConfig.primaryColor;
+ const primary = consoleAppConfig.primaryColor;
const secondary = consoleAppConfig.secondaryColor;
consoleStyles = html`<style>:host {--or-console-primary-color:${primary};--or-console-secondary-color:${secondary};}</style>`;
}
diff --git a/ui/component/or-attribute-history/src/index.ts b/ui/component/or-attribute-history/src/index.ts
index c43f97b71..4eea7a7f9 100644
--- a/ui/component/or-attribute-history/src/index.ts
+++ b/ui/component/or-attribute-history/src/index.ts
@@ -316,8 +316,8 @@ export class OrAttributeHistory extends translate(i18next)(LitElement) {
<or-input .type="${InputType.SELECT}" ?disabled="${disabled}" .label="${i18next.t("timeframe")}" @or-input-changed="${(evt: OrInputChangedEvent) => this.period = evt.detail.value}" .value="${this.period}" .options="${this._getPeriodOptions()}"></or-input>
<div id="ending-controls">
<or-input id="ending-date" .type="${InputType.DATETIME}" ?disabled="${disabled}" label="${i18next.t("ending")}" .value="${this.fromTimestamp}" @or-input-changed="${(evt: OrInputChangedEvent) => this._updateTimestamp(moment(evt.detail.value as string).toDate())}"></or-input>
- <or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-left" @click="${() => this._updateTimestamp(this.fromTimestamp!, false)}"></or-icon>
- <or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-right" @click="${() => this._updateTimestamp(this.fromTimestamp!, true)}"></or-icon>
+ <or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-left" @click="${() => this._updateTimestamp(this.fromTimestamp!, false, 0)}"></or-icon>
+ <or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-right" @click="${() => this._updateTimestamp(this.fromTimestamp!, true, 0)}"></or-icon>
<or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-double-right" @click="${() => this._updateTimestamp(new Date())}"></or-icon>
</div>
</div>
@@ -712,7 +712,7 @@ export class OrAttributeHistory extends translate(i18next)(LitElement) {
this._data = response.data;
}
}
- protected _updateTimestamp(timestamp: Date, forward?: boolean) {
+ protected _updateTimestamp(timestamp: Date, forward?: boolean, timeout=1500) {
if (this._updateTimestampTimer) {
window.clearTimeout(this._updateTimestampTimer);
@@ -725,7 +725,7 @@ export class OrAttributeHistory extends translate(i18next)(LitElement) {
newMoment.add(forward ? 1 : -1, this.period);
}
this.fromTimestamp = newMoment.toDate()
- }, 1000);
+ }, timeout);
}
diff --git a/ui/component/or-chart/src/index.ts b/ui/component/or-chart/src/index.ts
index 8199d17fe..f821ab4a0 100644
--- a/ui/component/or-chart/src/index.ts
+++ b/ui/component/or-chart/src/index.ts
@@ -465,8 +465,8 @@ export class OrChart extends translate(i18next)(LitElement) {
?disabled="${disabled}"
.value="${this.timestamp}"
@or-input-changed="${(evt: OrInputChangedEvent) => this._updateTimestamp(moment(evt.detail.value as string).toDate())}"></or-input>
- <or-icon class="button-icon" icon="chevron-left" @click="${() => this._updateTimestamp(this.timestamp!, false)}"></or-icon>
- <or-icon class="button-icon" icon="chevron-right" @click="${() =>this._updateTimestamp(this.timestamp!, true)}"></or-icon>
+ <or-icon class="button-icon" icon="chevron-left" @click="${() => this._updateTimestamp(this.timestamp!, false, undefined, 0)}"></or-icon>
+ <or-icon class="button-icon" icon="chevron-right" @click="${() =>this._updateTimestamp(this.timestamp!, true, undefined, 0)}"></or-icon>
</div>
${this.periodCompare ? html `
<div class="period-controls">
@@ -477,8 +477,8 @@ export class OrChart extends translate(i18next)(LitElement) {
?disabled="${disabled}"
.value="${this.compareTimestamp}"
@or-input-changed="${(evt: OrInputChangedEvent) => this._updateTimestamp(moment(evt.detail.value as string).toDate(), undefined, true)}"></or-input>
- <or-icon class="button-icon" icon="chevron-left" @click="${() => this._updateTimestamp(this.compareTimestamp!, false, true)}"></or-icon>
- <or-icon class="button-icon" icon="chevron-right" @click="${() => this._updateTimestamp(this.compareTimestamp!, true, true)}"></or-icon>
+ <or-icon class="button-icon" icon="chevron-left" @click="${() => this._updateTimestamp(this.compareTimestamp!, false, true, 0)}"></or-icon>
+ <or-icon class="button-icon" icon="chevron-right" @click="${() => this._updateTimestamp(this.compareTimestamp!, true, true, 0)}"></or-icon>
</div>
` : html``}
@@ -1122,7 +1122,7 @@ export class OrChart extends translate(i18next)(LitElement) {
return interval;
}
- protected _updateTimestamp(timestamp: Date, forward?: boolean, compare=false) {
+ protected _updateTimestamp(timestamp: Date, forward?: boolean, compare=false, timeout=1500) {
if (this._updateTimestampTimer) {
window.clearTimeout(this._updateTimestampTimer);
@@ -1139,7 +1139,7 @@ export class OrChart extends translate(i18next)(LitElement) {
} else {
this.timestamp = newMoment.toDate()
}
- }, 1000);
+ }, timeout);
}
}
diff --git a/ui/component/or-input/src/index.ts b/ui/component/or-input/src/index.ts
index b08fb03a6..daf3b7a9e 100644
--- a/ui/component/or-input/src/index.ts
+++ b/ui/component/or-input/src/index.ts
@@ -447,7 +447,7 @@ const style = css`
.or-input--rounded {
border-radius: 50% !important;
}
-
+
.mdc-text-field__input::-webkit-calendar-picker-indicator {
display: block;
}
@@ -1247,6 +1247,7 @@ export class OrInput extends LitElement {
if (this._mdcComponent instanceof MDCTextField) {
this._mdcComponent.valid = valid;
}
+ if(!valid) return
}
const previousValue = this.value;
diff --git a/ui/component/or-rules/src/or-rule-validity.ts b/ui/component/or-rules/src/or-rule-validity.ts
index 8b2dbcfde..dee278513 100644
--- a/ui/component/or-rules/src/or-rule-validity.ts
+++ b/ui/component/or-rules/src/or-rule-validity.ts
@@ -87,7 +87,7 @@ export class OrRuleValidity extends translate(i18next)(LitElement) {
break;
case "start":
const newStartDate = moment(value);
- if(newStartDate.isValid()) {
+ if(newStartDate.isValid()) {
validity.start = newStartDate.set({hour:0,minute:0,second:0,millisecond:0}).toDate().getTime();
if (this.getValidityType() === "validityRecurrence") {
origOptions!.dtstart = newStartDate.toDate();
diff --git a/ui/component/or-table/src/index.ts b/ui/component/or-table/src/index.ts
index 773dcf655..8a4315698 100644
--- a/ui/component/or-table/src/index.ts
+++ b/ui/component/or-table/src/index.ts
@@ -25,6 +25,7 @@ const style = css`
.mdc-data-table {
width: 100%;
+ overflow: auto;
max-height: 500px;
}