Skip to content

armgit / core

Public Imported from GitHub
0

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

Rules UI update

Don2fdbc949db47
diff --git a/deployment/manager/shared/locales/en/or.json b/deployment/manager/shared/locales/en/or.json
index 86a936435..f57a3d6d6 100644
--- a/deployment/manager/shared/locales/en/or.json
+++ b/deployment/manager/shared/locales/en/or.json
@@ -108,6 +108,12 @@
"attributes": "Attributes",
"info": "Info",
"notSupported": "Not supported",
+ "ruleName": "Rule name",
+ "value": "Value",
+ "and": "and",
+ "number": "Number",
+ "string": "Text",
+ "operator": "Operator",
"area": "Area",
"timestamp": "Timestamp"
}
diff --git a/deployment/manager/shared/locales/nl/or.json b/deployment/manager/shared/locales/nl/or.json
index 3382ccd76..3e7a7327b 100644
--- a/deployment/manager/shared/locales/nl/or.json
+++ b/deployment/manager/shared/locales/nl/or.json
@@ -5,7 +5,7 @@
"rule_plural": "Regels",
"asset": "Asset",
"asset_plural": "Assets",
- "attribute": "Attribute",
+ "attribute": "Attribuut",
"scenes": "Scenes",
"settings": "Instellingen",
"selectLanguage": "Taal kiezen",
@@ -77,13 +77,13 @@
"ok": "OK",
"cancel": "Annuleren",
"createdOn": "Aangemaakt op",
- "createdOnWithDate": "angemaakt op: {{-date, LLLL}}",
+ "createdOnWithDate": "Aangemaakt op: {{-date, LLLL}}",
"accessPublicRead": "Publiek",
"type": "Type",
"path": "Pad",
"showOnMap": "Tonen op kaart",
"noAssetSelected": "Kies aan de linkerkant een asset uit de lijst",
- "loading": "Aan het laden...",
+ "loading": "Aan het laden...",
"location": "Locatie",
"hour": "Uur",
"day": "Dag",
@@ -105,5 +105,14 @@
"wait": "Wacht",
"history": "Geschiedenis",
"attributes": "Attributen",
- "info": "Info"
+ "info": "Info",
+ "notSupported": "Niet ondersteund",
+ "ruleName": "Regel naam",
+ "value": "Waarde",
+ "and": "en",
+ "number": "Nummer",
+ "string": "Tekst",
+ "operator": "Operator",
+ "area": "Gebied",
+ "timestamp": "Tijdsaanduiding"
}
diff --git a/ui/component/or-asset-tree/src/style.ts b/ui/component/or-asset-tree/src/style.ts
index 536f77496..16d40a3bc 100644
--- a/ui/component/or-asset-tree/src/style.ts
+++ b/ui/component/or-asset-tree/src/style.ts
@@ -103,7 +103,7 @@ export const style = css`
#list {
margin: 0;
color: var(--internal-or-asset-tree-text-color);
- padding: 5px 0;
+ padding: 0;
}
#list, ol {
diff --git a/ui/component/or-input/src/index.ts b/ui/component/or-input/src/index.ts
index 4589951d5..f2c4ba420 100644
--- a/ui/component/or-input/src/index.ts
+++ b/ui/component/or-input/src/index.ts
@@ -92,6 +92,10 @@ const style = css`
--mdc-theme-on-primary: var(--internal-or-input-text-color);
--mdc-theme-secondary: var(--internal-or-input-color);
}
+
+ :host([type=select]) {
+ height: 56px;
+ }
#wrapper {
display: flex;
@@ -142,7 +146,7 @@ const style = css`
.mdc-select__dropdown-icon {
background: none;
}
-
+
.mdc-select--focused .mdc-select__dropdown-icon {
--or-icon-fill: var(--internal-or-input-color);
}
diff --git a/ui/component/or-panel/src/index.ts b/ui/component/or-panel/src/index.ts
index 0b04e66a0..8ecc45033 100644
--- a/ui/component/or-panel/src/index.ts
+++ b/ui/component/or-panel/src/index.ts
@@ -12,8 +12,10 @@ const style = css`
:host {
--internal-or-panel-background-color: var(--or-panel-background-color, var(--or-app-color2, ${unsafeCSS(DefaultColor2)}));
--internal-or-panel-padding: var(--or-panel-padding, 10px);
- --internal-or-panel-heading-margin: var(--or-panel-heading-margin, 0 0 5px 0);
-
+ --internal-or-panel-heading-margin: var(--or-panel-heading-margin, 0 0 5px 7px);
+ --internal-or-panel-border: var(--or-panel-border, 1px solid #e5e5e5);
+ --internal-or-panel-border-radius: var(--or-panel-border-radius, 5px);
+
display: block;
}
@@ -29,10 +31,13 @@ const style = css`
#panel {
padding: var(--internal-or-panel-padding);
background-color: var(--internal-or-panel-background-color);
+ border: var(--internal-or-panel-border);
+ border-radius: var(--internal-or-panel-border-radius);
}
strong {
margin: var(--internal-or-panel-heading-margin);
+ font-size: 16px;
}
`;
@@ -76,12 +81,9 @@ export class OrPanel extends LitElement {
render() {
- let zLevel = this.zLevel || 1;
- zLevel = Math.min(24, Math.max(0, zLevel));
-
return html`
<div id="wrapper">
- <div id="panel" class="mdc-elevation--z${zLevel}">
+ <div id="panel">
${this.heading ? html`<strong>${this.heading}</strong>` : ``}
<slot></slot>
</div>
diff --git a/ui/component/or-rules/src/index.ts b/ui/component/or-rules/src/index.ts
index 069ae54e0..baba15cb4 100644
--- a/ui/component/or-rules/src/index.ts
+++ b/ui/component/or-rules/src/index.ts
@@ -519,7 +519,7 @@ export const style = css`
@customElement("or-rules")
export class OrRules extends translate(i18next)(LitElement) {
- public static DEFAULT_RULESET_NAME = "New rule";
+ public static DEFAULT_RULESET_NAME = "";
static get styles() {
return [
diff --git a/ui/component/or-rules/src/json-viewer/or-rule-action-attribute.ts b/ui/component/or-rules/src/json-viewer/or-rule-action-attribute.ts
index 6fb12da43..a62588ebf 100644
--- a/ui/component/or-rules/src/json-viewer/or-rule-action-attribute.ts
+++ b/ui/component/or-rules/src/json-viewer/or-rule-action-attribute.ts
@@ -5,9 +5,11 @@ import {
AssetDescriptor,
AssetQueryOrderBy$Property,
Attribute,
+ AttributeValueType,
MetaItemType,
RuleActionUpdateAttribute,
- RuleActionWriteAttribute
+ RuleActionWriteAttribute,
+ ValueType
} from "@openremote/model";
import manager, {AssetModelUtil, Util} from "@openremote/core";
import {getAttributeValueTemplate} from "@openremote/or-attribute-input";
@@ -24,7 +26,7 @@ const style = css`
}
:host > * {
- margin-right: 10px;
+ margin-right: 6px;
}
`;
@@ -127,12 +129,13 @@ export class OrRuleActionAttribute extends translate(i18next)(LitElement) {
};
}
- inputTemplate = getAttributeValueTemplate(assetType, attribute, this.readonly || false, false, (v: any) => this.setActionAttributeValue(v), this.config ? this.config.inputProvider : undefined, undefined, "");
+ inputTemplate = getAttributeValueTemplate(assetType, attribute, this.readonly || false, false, (v: any) => this.setActionAttributeValue(v), this.config ? this.config.inputProvider : undefined, undefined,
+ (attribute.type && (attribute.type.valueType == ValueType.BOOLEAN || attribute.type == AttributeValueType.BOOLEAN.name || attribute.type == AttributeValueType.SWITCH_TOGGLE.name)) ? `` : i18next.t("value"));
}
return html`
- <or-input id="matchSelect" .type="${InputType.SELECT}" @or-input-changed="${(e: OrInputChangedEvent) => this._assetId = (e.detail.value)}" ?readonly="${this.readonly}" .options="${idOptions}" .value="${idValue}"></or-input>
- <or-input id="attributeSelect" .label="${i18next.t("attribute")}" .type="${InputType.SELECT}" @or-input-changed="${(e: OrInputChangedEvent) => this.setActionAttributeName(e.detail.value)}" ?readonly="${this.readonly}" .options="${attributes}" .value="${this.action.attributeName}"></or-input>
+ <or-input id="matchSelect" .label="${i18next.t("asset")}" type="${InputType.SELECT}" @or-input-changed="${(e: OrInputChangedEvent) => this._assetId = (e.detail.value)}" ?readonly="${this.readonly}" .options="${idOptions}" .value="${idValue}"></or-input>
+ <or-input id="attributeSelect" .label="${i18next.t("attribute")}" type="${InputType.SELECT}" @or-input-changed="${(e: OrInputChangedEvent) => this.setActionAttributeName(e.detail.value)}" ?readonly="${this.readonly}" .options="${attributes}" .value="${this.action.attributeName}"></or-input>
${inputTemplate ? inputTemplate(this.action.value) : ``}
`;
}
diff --git a/ui/component/or-rules/src/json-viewer/or-rule-asset-query.ts b/ui/component/or-rules/src/json-viewer/or-rule-asset-query.ts
index 677aa345a..d42783e5d 100644
--- a/ui/component/or-rules/src/json-viewer/or-rule-asset-query.ts
+++ b/ui/component/or-rules/src/json-viewer/or-rule-asset-query.ts
@@ -22,7 +22,6 @@ import {
AssetTypeAttributeName,
getAssetIdsFromQuery,
getAssetTypeFromQuery,
- getDescriptorValueType,
RulesConfig
} from "../index";
import {OrSelectChangedEvent} from "@openremote/or-select";
@@ -50,15 +49,15 @@ const style = css`
flex-direction: row;
}
+ .attribute > * {
+ flex-grow: 0;
+ }
+
.attribute, .attribute-editor {
display: flex;
flex-grow: 1;
}
- .attribute > * {
- flex-grow: 0;
- }
-
#idSelect {
margin-right: 3px;
}
@@ -180,9 +179,9 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {
return html`
<div class="attribute-editor">
- <or-input type="${InputType.SELECT}" @or-input-changed="${(e: OrSelectChangedEvent) => this.setAttributeName(attributePredicate, e.detail.value)}" ?readonly="${this.readonly}" .options="${attributes}" .value="${attributeName}"></or-input>
+ <or-input type="${InputType.SELECT}" @or-input-changed="${(e: OrSelectChangedEvent) => this.setAttributeName(attributePredicate, e.detail.value)}" ?readonly="${this.readonly}" .options="${attributes}" .value="${attributeName}" .label="${i18next.t("attribute")}"></or-input>
- ${attributeName ? html`<or-input type="${InputType.SELECT}" @or-input-changed="${(e: OrSelectChangedEvent) => this.setOperator(assetDescriptor, attribute, attributeName, attributePredicate, e.detail.value)}" ?readonly="${this.readonly}" .options="${operators}" .value="${operator}"></or-input>` : ``}
+ ${attributeName ? html`<or-input type="${InputType.SELECT}" @or-input-changed="${(e: OrSelectChangedEvent) => this.setOperator(assetDescriptor, attribute, attributeName, attributePredicate, e.detail.value)}" ?readonly="${this.readonly}" .options="${operators}" .value="${i18next.t("operator")}" .label="${i18next.t("Operator")}"></or-input>` : ``}
${attributePredicate ? this.attributePredicateValueEditorTemplate(assetDescriptor, attributePredicate) : ``}
</div>
@@ -204,22 +203,22 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {
switch (valuePredicate.predicateType) {
case "string":
- return getAttributeValueTemplate(assetType, {name: attributeName!}, this.readonly || false, false, (v: any) => this.setValuePredicateProperty(valuePredicate, "value", v), this.config ? this.config.inputProvider : undefined, undefined, "")(value);
+ return getAttributeValueTemplate(assetType, { name: attributeName! }, this.readonly || false, false, (v: any) => this.setValuePredicateProperty(valuePredicate, "value", v), this.config ? this.config.inputProvider : undefined, undefined, i18next.t("string"))(value);
case "boolean":
return html `<span>NOT IMPLEMENTED</span>`;
case "datetime":
return html `<span>NOT IMPLEMENTED</span>`;
case "number":
if (valuePredicate.operator === AQO.BETWEEN) {
- const inputTemplate1 = getAttributeValueTemplate(assetType, {name: attributeName!}, this.readonly || false, false, (v: any) => this.setValuePredicateProperty(valuePredicate, "value", v), this.config ? this.config.inputProvider : undefined, undefined, "");
- const inputTemplate2 = getAttributeValueTemplate(assetType, {name: attributeName!}, this.readonly || false, false, (v: any) => this.setValuePredicateProperty(valuePredicate, "rangeValue", v), this.config ? this.config.inputProvider : undefined, undefined, "");
+ const inputTemplate1 = getAttributeValueTemplate(assetType, { name: attributeName! }, this.readonly || false, false, (v: any) => this.setValuePredicateProperty(valuePredicate, "value", v), this.config ? this.config.inputProvider : undefined, undefined, i18next.t("between"));
+ const inputTemplate2 = getAttributeValueTemplate(assetType, { name: attributeName! }, this.readonly || false, false, (v: any) => this.setValuePredicateProperty(valuePredicate, "rangeValue", v), this.config ? this.config.inputProvider : undefined, undefined, i18next.t("and"));
return html`
${inputTemplate1(value)}
<span style="display: inline-flex; align-items: center;">&</span>
${inputTemplate2(valuePredicate.rangeValue)}
`;
}
- return getAttributeValueTemplate(assetType, {name: attributeName!}, this.readonly || false, false, (v: any) => this.setValuePredicateProperty(valuePredicate, "value", v), this.config ? this.config.inputProvider : undefined, undefined, "")(value);
+ return getAttributeValueTemplate(assetType, { name: attributeName! }, this.readonly || false, false, (v: any) => this.setValuePredicateProperty(valuePredicate, "value", v), this.config ? this.config.inputProvider : undefined, undefined, i18next.t("number"))(value);
case "string-array":
return html `<span>NOT IMPLEMENTED</span>`;
case "radial":
@@ -299,7 +298,7 @@ export class OrRuleAssetQuery extends translate(i18next)(LitElement) {
return html`
<div class="attribute-group">
- <or-input id="idSelect" type="${InputType.SELECT}" @or-input-changed="${(e: OrInputChangedEvent) => this._assetId = (e.detail.value)}" ?readonly="${this.readonly}" .options="${idOptions}" .value="${idValue}"></or-input>
+ <or-input id="idSelect" type="${InputType.SELECT}" @or-input-changed="${(e: OrInputChangedEvent) => this._assetId = (e.detail.value)}" ?readonly="${this.readonly}" .options="${idOptions}" .value="${idValue}" .label="${i18next.t("asset")}"></or-input>
${this.query.attributes && this.query.attributes.items ? this.query.attributes.items.map((attributePredicate) => {
diff --git a/ui/component/or-rules/src/json-viewer/or-rule-condition.ts b/ui/component/or-rules/src/json-viewer/or-rule-condition.ts
index 7dc52c17c..119414c32 100644
--- a/ui/component/or-rules/src/json-viewer/or-rule-condition.ts
+++ b/ui/component/or-rules/src/json-viewer/or-rule-condition.ts
@@ -178,7 +178,7 @@ class OrRuleCondition extends translate(i18next)(LitElement) {
typeTemplate = html`
<div id="type" style="color: #${buttonColor}">
${getContentWithMenuTemplate(
- html`<or-input class="menu-button" type="${InputType.BUTTON}" .icon="${buttonIcon || ""}"></or-input>`,
+ html`<or-input type="${InputType.BUTTON}" .icon="${buttonIcon || ""}"></or-input>`,
getWhenTypesMenu(this.config, this.assetDescriptors),
type,
(value: string) => this.type = value)}
diff --git a/ui/component/or-rules/src/json-viewer/or-rule-json-viewer.ts b/ui/component/or-rules/src/json-viewer/or-rule-json-viewer.ts
index ac385fc96..e88e55a34 100644
--- a/ui/component/or-rules/src/json-viewer/or-rule-json-viewer.ts
+++ b/ui/component/or-rules/src/json-viewer/or-rule-json-viewer.ts
@@ -54,6 +54,16 @@ const style = css`
:host > * {
flex: 1;
}
+
+ @media screen and (max-width: 1400px) {
+ :host > * {
+ flex-grow: 0;
+ }
+
+ :host {
+ flex-direction: column;
+ }
+ }
`;
@customElement("or-rule-json-viewer")
diff --git a/ui/component/or-rules/src/json-viewer/or-rule-then-otherwise.ts b/ui/component/or-rules/src/json-viewer/or-rule-then-otherwise.ts
index 4b5ade64a..253cd0671 100644
--- a/ui/component/or-rules/src/json-viewer/or-rule-then-otherwise.ts
+++ b/ui/component/or-rules/src/json-viewer/or-rule-then-otherwise.ts
@@ -83,20 +83,26 @@ const style = css`
align-items: center;
}
- .rule-action-action {
+ .rule-action-wrapper {
flex-grow: 1;
- }
-
- .rule-action-action > * {
- margin-right: 20px;
+ display: flex;
+ align-items: center;
}
.rule-action > button {
flex-grow: 0;
}
+
+ .rule-action:hover .button-clear {
+ visibility: visible;
+ }
+
+ or-panel:hover .remove-button.button-clear {
+ visibility: visible;
+ }
or-panel {
- margin: 20px;
+ margin: 10px 10px 20px 10px;
}
#type-selector {
@@ -109,7 +115,7 @@ const style = css`
}
.add-button-wrapper > * {
- margin: 0 5px;
+ margin-right: 6px;
}
`;
@@ -170,9 +176,9 @@ class OrRuleThenOtherwise extends translate(i18next)(LitElement) {
}
typeTemplate = html`
- <div style="color: #${buttonColor}">
+ <div style="color: #${buttonColor}; margin-right: 6px;">
${getContentWithMenuTemplate(
- html`<or-input class="menu-button" type="${InputType.BUTTON}" .icon="${buttonIcon || ""}"></or-input>`,
+ html`<or-input type="${InputType.BUTTON}" .icon="${buttonIcon || ""}"></or-input>`,
getActionTypesMenu(this.config, this.assetDescriptors),
action.action,
(value: string) => this.setActionType(actions, action, value))}
@@ -196,11 +202,13 @@ class OrRuleThenOtherwise extends translate(i18next)(LitElement) {
return html`
<div class="rule-action">
- ${typeTemplate}
- ${template}
- ${thenAllowRemove ? html`
- <button class="button-clear" @click="${() => this.removeAction(action)}"><or-icon icon="close-circle"></or-icon></input>
- ` : ``}
+ <div class="rule-action-wrapper">
+ ${typeTemplate}
+ ${template}
+ </div>
+ ${thenAllowRemove ? html`
+ <button class="button-clear" @click="${() => this.removeAction(action)}"><or-icon icon="close-circle"></or-icon></input>
+ ` : ``}
</div>
`;
}
@@ -215,7 +223,7 @@ class OrRuleThenOtherwise extends translate(i18next)(LitElement) {
${this.thenAllowAdd ? html`
<span class="add-button-wrapper">
${getContentWithMenuTemplate(
- html`<or-input class="menu-button" type="${InputType.BUTTON}" icon="plus"></or-input>`,
+ html`<or-input class="plus-button" type="${InputType.BUTTON}" icon="plus"></or-input>`,
getActionTypesMenu(this.config, this.assetDescriptors),
undefined,
(value: string) => this.addAction(value))}
diff --git a/ui/component/or-rules/src/json-viewer/or-rule-when.ts b/ui/component/or-rules/src/json-viewer/or-rule-when.ts
index cafe8d9d3..cb08a0709 100644
--- a/ui/component/or-rules/src/json-viewer/or-rule-when.ts
+++ b/ui/component/or-rules/src/json-viewer/or-rule-when.ts
@@ -55,7 +55,7 @@ const style = css`
}
or-panel {
- margin: 20px;
+ margin: 10px 10px 20px 10px;
position: relative;
}
@@ -67,6 +67,14 @@ const style = css`
height: 24px;
transform: translate(50%, -50%);
}
+
+ .rule-condition:hover .button-clear {
+ visibility: visible;
+ }
+
+ or-panel:hover .remove-button.button-clear {
+ visibility: visible;
+ }
.add-button-wrapper {
display: flex;
@@ -74,7 +82,7 @@ const style = css`
}
.add-button-wrapper > * {
- margin: 0 5px;
+ margin-right: 6px;
}
`;
@@ -102,7 +110,7 @@ class OrRuleWhen extends translate(i18next)(LitElement) {
const isTopLevel = !parentGroup;
const showAddCondition = !this.readonly && (!this.config || !this.config.controls || this.config.controls.hideWhenAddCondition !== true);
- const showRemoveCondition = !this.readonly && group.items && group.items.length > 1;
+ const showRemoveCondition = !this.readonly;
const showRemoveGroup = !this.readonly;
let wrapper: (content: TemplateResult, item: LogicGroup<RuleCondition> | RuleCondition, parent: LogicGroup<RuleCondition>, isGroup: boolean, isFirst: boolean) => TemplateResult;
@@ -171,7 +179,7 @@ class OrRuleWhen extends translate(i18next)(LitElement) {
addTemplate = html`
<span class="add-button-wrapper">
${getContentWithMenuTemplate(
- html`<or-input type="${InputType.BUTTON}" icon="plus"></or-input>`,
+ html`<or-input class="plus-button" type="${InputType.BUTTON}" icon="plus"></or-input>`,
getWhenTypesMenu(this.config, this.assetDescriptors),
undefined,
(value: string) => this.addCondition(group, value))}
@@ -226,11 +234,11 @@ class OrRuleWhen extends translate(i18next)(LitElement) {
<or-panel>
<span class="add-button-wrapper">
${getContentWithMenuTemplate(
- html`<or-input type="${InputType.BUTTON}" icon="plus"></or-input>`,
+ html`<or-input class="plus-button" type="${InputType.BUTTON}" icon="plus"></or-input>`,
getWhenTypesMenu(this.config, this.assetDescriptors),
undefined,
(value: string) => this.addGroup(this.rule!.when!, value))}
- <strong>${i18next.t(this.rule.when.groups && this.rule.when.groups.length === 0 ? "when": "orWhen")}...</strong>
+ <strong>${i18next.t(this.rule.when.groups == undefined || (this.rule.when.groups && this.rule.when.groups.length === 0) ? "when" : "orWhen")}...</strong>
</span>
</or-panel>
`}
diff --git a/ui/component/or-rules/src/or-rule-viewer.ts b/ui/component/or-rules/src/or-rule-viewer.ts
index 602701fb8..bdfc3993c 100644
--- a/ui/component/or-rules/src/or-rule-viewer.ts
+++ b/ui/component/or-rules/src/or-rule-viewer.ts
@@ -22,12 +22,12 @@ export const style = css`
display: block;
height: 100%;
width: 100%;
+ overflow-y: auto;
}
.wrapper {
display: flex;
flex-direction: column;
- justify-content: center;
align-items: center;
height: 100%;
}
@@ -45,9 +45,7 @@ export const style = css`
height: var(--internal-or-rules-header-height);
z-index: 1;
padding: 0 20px;
- background-color: var(--internal-or-rules-header-background-color);
--or-icon-fill: var(--internal-or-rules-panel-color);
- box-shadow: ${unsafeCSS(DefaultBoxShadow)};
}
#rule-header-controls {
@@ -69,9 +67,11 @@ export const style = css`
margin-right: 10px;
}
- #rule-viewer {
+ #rule-view {
flex-grow: 1;
background-color: var(--internal-or-rules-background-color);
+ padding: 0px 10px;
+ width: calc(100% - 20px);
}
`;
@@ -137,7 +137,7 @@ export class OrRuleViewer extends translate(i18next)(LitElement) {
protected render(): TemplateResult | void {
if (!this.ruleset) {
- return html`<div class="wrapper"><or-translate value="noRuleSelected"></or-translate></div>`;
+ return html`<div class="wrapper" style="justify-content: center"><or-translate value="noRuleSelected"></or-translate></div>`;
}
let viewer: TemplateResult | string = ``;
@@ -148,7 +148,7 @@ export class OrRuleViewer extends translate(i18next)(LitElement) {
} else {
switch (this.ruleset.lang!) {
case RulesetLang.JSON:
- viewer = html`<or-rule-json-viewer id="rule-viewer" .ruleset="${this.ruleset}" .config="${this.config}" .readonly="${this.readonly}"></or-rule-json-viewer>`;
+ viewer = html`<or-rule-json-viewer id="rule-view" .ruleset="${this.ruleset}" .config="${this.config}" .readonly="${this.readonly}"></or-rule-json-viewer>`;
break;
case RulesetLang.GROOVY:
case RulesetLang.JAVASCRIPT:
@@ -162,8 +162,7 @@ export class OrRuleViewer extends translate(i18next)(LitElement) {
return html`
<div class="wrapper">
<div id="rule-header">
- <or-input id="rule-name" .type="${InputType.TEXT}" ?focused="${this._focusName}" .value="${this.ruleset ? this.ruleset.name : null}" ?disabled="${this._isReadonly()}" fullwidth required minlength="3" maxlength="255" @or-input-changed="${(e: OrInputChangedEvent) => this._changeName(e.detail.value)}"></or-input>
-
+ <or-input id="rule-name" outlined .type="${InputType.TEXT}" .label="${i18next.t("ruleName")}" ?focused="${this._focusName}" .value="${this.ruleset ? this.ruleset.name : null}" ?disabled="${this._isReadonly()}" required minlength="3" maxlength="255" @or-input-changed="${(e: OrInputChangedEvent) => this._changeName(e.detail.value)}"></or-input>
<div id="rule-header-controls">
<span id="active-wrapper">
<or-translate value="active"></or-translate>
diff --git a/ui/component/or-rules/src/style.ts b/ui/component/or-rules/src/style.ts
index 36e0efd9a..ac82455c0 100644
--- a/ui/component/or-rules/src/style.ts
+++ b/ui/component/or-rules/src/style.ts
@@ -1,4 +1,5 @@
import {css} from "lit-element";
+import {DefaultColor5} from "@openremote/core";
// language=CSS
export const invalidStyle = css`
@@ -11,14 +12,19 @@ export const invalidStyle = css`
export const buttonStyle = css`
.button-clear {
background: none;
- color: var(--internal-or-rules-button-color);
- --or-icon-fill: var(--internal-or-rules-button-color);
+ color: ${unsafeCSS(DefaultColor2)};
+ --or-icon-fill: ${unsafeCSS(DefaultColor2)};
+ visibility: hidden;
+ display: inline-block;
border: none;
padding: 0;
- display: inline-block;
cursor: pointer;
}
+ .button-clear:hover {
+ --or-icon-fill: var(--internal-or-rules-button-color);
+ }
+
.button-clear:focus {
outline: 0;
}
@@ -26,6 +32,10 @@ export const buttonStyle = css`
.button-clear.hidden {
visibility: hidden;
}
+
+ .plus-button {
+ --or-icon-fill: var(--internal-or-rules-button-color);
+ }
.add-button {
display: inline-block;