Skip to content

armgit / core

Public Imported from GitHub
0

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

UI updates: Various updates:

Rich Turnera7a79eedbcf0
diff --git a/ui/component/core/src/asset-mixin.ts b/ui/component/core/src/asset-mixin.ts
index cca6f7f4f..c82ea4766 100644
--- a/ui/component/core/src/asset-mixin.ts
+++ b/ui/component/core/src/asset-mixin.ts
@@ -102,12 +102,13 @@ export const subscribe = (eventProviderFactory: EventProviderFactory) => <T exte
*/
public async _addEventSubscriptions(): Promise<void> {
const isAttributes = !!this._attributeRefs;
+ const isAsset = !!this._assetIds;
const ids: string[] | AttributeRef[] | undefined = this._attributeRefs ? this._attributeRefs : this._assetIds;
if (ids && ids.length > 0) {
this._subscriptionIds = [];
- if (!isAttributes) {
+ if (isAsset) {
const assetSubscriptionId = await eventProviderFactory.getEventProvider()!.subscribeAssetEvents(ids, true, (event) => this._onEvent(event));
// Check if the same IDs are in place
const currentIds: string[] | AttributeRef[] | undefined = this._attributeRefs ? this._attributeRefs : this._assetIds;
@@ -117,13 +118,15 @@ export const subscribe = (eventProviderFactory: EventProviderFactory) => <T exte
}
this._subscriptionIds.push(assetSubscriptionId);
}
+
const subscriptionId = await eventProviderFactory.getEventProvider()!.subscribeAttributeEvents(ids, isAttributes, (event) => this._onEvent(event));
+ // Check if the same IDs are in place
const currentIds: string[] | AttributeRef[] | undefined = this._attributeRefs ? this._attributeRefs : this._assetIds;
if (!this._subscriptionIds || !Util.objectsEqual(ids, currentIds)) {
eventProviderFactory.getEventProvider()!.unsubscribe(subscriptionId);
- } else {
- this._subscriptionIds.push(subscriptionId);
+ return;
}
+ this._subscriptionIds.push(subscriptionId);
}
}
diff --git a/ui/component/or-app/src/or-header.ts b/ui/component/or-app/src/or-header.ts
index d67136b3f..f24cb280f 100644
--- a/ui/component/or-app/src/or-header.ts
+++ b/ui/component/or-app/src/or-header.ts
@@ -402,7 +402,7 @@ export class OrHeader extends LitElement {
`,
getHeaderMenuItems(secondaryItems),
undefined,
- (values: string | string[]) => this._onSecondaryMenuSelect(values as string)) : ``}
+ (value) => this._onSecondaryMenuSelect(value as string)) : ``}
</div>
<div id="menu-btn-mobile">
<button id="menu-btn" class="menu-btn" title="Menu" @click="${this._toggleDrawer}"><or-icon icon="${this._drawerOpened ? "close" : "menu"}"></or-icon></button>
@@ -460,7 +460,7 @@ export class OrHeader extends LitElement {
realmTemplate,
menuItems,
currentRealm ? currentRealm.realm : undefined,
- (values: string | string[]) => callback(values as string))}
+ (value) => callback(value as string))}
`;
}
diff --git a/ui/component/or-asset-viewer/src/index.ts b/ui/component/or-asset-viewer/src/index.ts
index e541fd710..df3ce7bda 100644
--- a/ui/component/or-asset-viewer/src/index.ts
+++ b/ui/component/or-asset-viewer/src/index.ts
@@ -638,7 +638,7 @@ export function getPanelContent(panelName: string, asset: Asset, attributes: { [
const config: any = manager.console.retrieveData("OrAssetConfig");
const viewSelector = asset.id ? asset.id : window.location.hash;
- if (config) {
+ if (config && config.views) {
const view = config.views[viewSelector];
if (view) {
selectedAttributes = [...view]
@@ -790,7 +790,7 @@ export function getAttributeTemplate(asset: Asset, attribute: Attribute<any>, ho
}
return html`
- <or-attribute-input class="force-btn-padding" .assetType="${asset!.type}" .attribute="${attribute}" .assetId="${asset.id!}" .disabled="${attrDisabled}" .label="${attrLabel}" .readonly="${attrReadonly}" .disableButton="${attrDisableButton}" .inputType="${attrInputType}" .hasHelperText="${!attrDisableHelper}" .fullWidth="${attribute.name === 'location' ? true : false}"></or-attribute-input>
+ <or-attribute-input class="force-btn-padding" disablesubscribe .assetType="${asset!.type}" .attribute="${attribute}" .assetId="${asset.id!}" .disabled="${attrDisabled}" .label="${attrLabel}" .readonly="${attrReadonly}" .disableButton="${attrDisableButton}" .inputType="${attrInputType}" .hasHelperText="${!attrDisableHelper}" .fullWidth="${attribute.name === 'location' ? true : false}"></or-attribute-input>
`;
}
@@ -935,62 +935,62 @@ export async function saveAsset(asset: Asset): Promise<SaveResult> {
// TODO: Add webpack/rollup to build so consumers aren't forced to use the same tooling
const tableStyle = require("@material/data-table/dist/mdc.data-table.css");
-@customElement("or-asset-viewer")
-export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElement)) {
-
- public static DEFAULT_VIEWER_CONFIG: AssetViewerConfig = {
- viewerStyles: {
+export const DEFAULT_VIEWER_CONFIG: AssetViewerConfig = {
+ viewerStyles: {
+ },
+ panels: {
+ group: {
+ type: "group",
+ title: "underlyingAssets"
},
- panels: {
- group: {
- type: "group",
- title: "underlyingAssets"
+ info: {
+ type: "info",
+ hideOnMobile: true,
+ properties: {
+ include:[]
},
- info: {
- type: "info",
- hideOnMobile: true,
- properties: {
- include:[]
- },
- attributes: {
- include: ["notes", "manufacturer", "model"]
- }
- },
- setup: {
- type: "setup",
- title: "setup",
- hideOnMobile: false
+ attributes: {
+ include: ["notes", "manufacturer", "model"]
+ }
+ },
+ setup: {
+ type: "setup",
+ title: "setup",
+ hideOnMobile: false
+ },
+ location: {
+ type: "info",
+ properties: {
+ include:[]
},
- location: {
- type: "info",
- properties: {
- include:[]
- },
- attributes: {
- include: ["location"],
- itemConfig: {
- location: {
- label: "",
- readonly: true
- }
+ attributes: {
+ include: ["location"],
+ itemConfig: {
+ location: {
+ label: "",
+ readonly: true
}
}
+ }
+ },
+ attributes: {
+ type: "info",
+ properties: {
+ include:[]
},
attributes: {
- type: "info",
- properties: {
- include:[]
- },
- attributes: {
- exclude: ["location", "notes", "manufacturer", "model", "status"]
- }
- },
- history: {
- type: "history"
+ exclude: ["location", "notes", "manufacturer", "model"]
}
+ },
+ history: {
+ type: "history"
}
- };
+ }
+};
+
+@customElement("or-asset-viewer")
+export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElement)) {
static get styles() {
return [
@@ -1317,18 +1317,24 @@ export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElem
}
if (event.eventType === "attribute") {
+
+ // Inject the attribute as we don't subscribe to events from individual attribute inputs
const attributeEvent = event as AttributeEvent;
const attrName = attributeEvent.attributeState!.ref!.name!;
if (attributeEvent.attributeState!.deleted && this.asset && this.asset.attributes) {
delete this.asset.attributes[attrName];
this.asset = {...this.asset};
+ } else if (this.asset && this.asset.attributes && this.asset.attributes[attrName]) {
+ this.asset.attributes[attrName].value = attributeEvent.attributeState!.value;
+ this.asset.attributes[attrName].timestamp = attributeEvent.timestamp;
+ this.asset = {...this.asset};
}
}
}
protected _getPanelConfig(asset: Asset): AssetViewerConfig {
- const config = {...OrAssetViewer.DEFAULT_VIEWER_CONFIG};
+ const config = {...DEFAULT_VIEWER_CONFIG};
if (this.config) {
diff --git a/ui/component/or-attribute-card/src/index.ts b/ui/component/or-attribute-card/src/index.ts
index 78bf2e439..f26bf1d49 100644
--- a/ui/component/or-attribute-card/src/index.ts
+++ b/ui/component/or-attribute-card/src/index.ts
@@ -382,7 +382,7 @@ export class OrAttributeCard extends LitElement {
}
],
undefined,
- (option: string | string[]) => this.handleMenuSelect(option as ContextMenuOption))}
+ (option) => this.handleMenuSelect(option as ContextMenuOption))}
</div>
<div class="panel-content">
<div class="mainvalue-wrapper">
diff --git a/ui/component/or-attribute-input/src/index.ts b/ui/component/or-attribute-input/src/index.ts
index 9860211d5..efaf14858 100644
--- a/ui/component/or-attribute-input/src/index.ts
+++ b/ui/component/or-attribute-input/src/index.ts
@@ -504,7 +504,7 @@ export class OrAttributeInput extends subscribe(manager)(translate(i18next)(LitE
@property({type: Boolean})
public disableButton?: boolean;
- @property({type: Boolean})
+ @property({type: Boolean, attribute: true})
public disableSubscribe: boolean = false;
@property({type: Boolean})
diff --git a/ui/component/or-mwc-components/src/or-mwc-input.ts b/ui/component/or-mwc-components/src/or-mwc-input.ts
index 408f44baf..1854ef373 100644
--- a/ui/component/or-mwc-components/src/or-mwc-input.ts
+++ b/ui/component/or-mwc-components/src/or-mwc-input.ts
@@ -340,11 +340,12 @@ export const getValueHolderInputTemplateProvider: ValueInputProviderGenerator =
} else if (notEmptyConstraint && !pattern) {
pattern = ".+";
}
- if ((!options.disabled && !options.readonly) && allowedValuesConstraint && allowedValuesConstraint.allowedValues) {
+ if (allowedValuesConstraint && allowedValuesConstraint.allowedValues) {
const allowedLabels = allowedValuesConstraint.allowedValueNames && allowedValuesConstraint.allowedValueNames.length === allowedValuesConstraint.allowedValues.length ? allowedValuesConstraint.allowedValueNames : undefined;
selectOptions = allowedValuesConstraint.allowedValues.map((v, i) => {
- const label = allowedLabels ? allowedLabels[i] : typeof v === "string" ? Util.getAllowedValueLabel(v) : "" + i;
- return ["" + v, label || "" + v];
+ let label = allowedLabels ? allowedLabels[i] : "" + v;
+ label = Util.getAllowedValueLabel(label)!;
+ return [v, label || "" + v];
});
inputType = InputType.SELECT;
@@ -668,7 +669,7 @@ export class OrMwcInput extends LitElement {
public placeHolder?: string;
@property({type: Array})
- public options?: (string | [string, string])[];
+ public options?: any[] | any;
@property({type: Boolean})
public autoSelect?: boolean;
@@ -858,7 +859,7 @@ export class OrMwcInput extends LitElement {
?checked="${this.value && this.value.includes(optValue)}"
?required="${this.required}"
?disabled="${this.disabled || this.readonly}"
- @change="${(e: Event) => this.onValueChange((e.target as HTMLInputElement), (e.target as HTMLInputElement).value)}"
+ @change="${(e: Event) => this.onValueChange((e.target as HTMLInputElement), optValue)}"
class="mdc-radio__native-control"/>
<div class="mdc-radio__background">
<div class="mdc-radio__outer-circle"></div>
@@ -993,6 +994,7 @@ export class OrMwcInput extends LitElement {
<div class="mdc-select__anchor" role="button"
aria-haspopup="listbox"
aria-expanded="false"
+ aria-disabled="${""+(this.disabled || this.readonly)}"
aria-labelledby="label selected-text">
<span class="mdc-select__ripple"></span>
${outlined ? this.renderOutlined(labelTemplate) : labelTemplate}
@@ -1036,7 +1038,7 @@ export class OrMwcInput extends LitElement {
value: optValue
},
index,
- Array.isArray(this.value) ? this.value as string[] : this.value ? [this.value as string] : undefined,
+ Array.isArray(this.value) ? this.value as any[] : this.value ? [this.value as any] : [],
this.multiple ? ListType.MULTI_TICK : ListType.SELECT,
false,
itemClickHandler
@@ -1090,7 +1092,13 @@ export class OrMwcInput extends LitElement {
`;
}
case InputType.CHECKBOX_LIST:
-
+ if (!Array.isArray(this.value)) {
+ if (this.value === null || this.value === undefined) {
+ this.value = [];
+ } else {
+ this.value = [this.value];
+ }
+ }
const optsCheckboxList = this.resolveOptions(this.options);
this._selectedIndex = -1;
return html`
@@ -1103,12 +1111,19 @@ export class OrMwcInput extends LitElement {
<div id="field" class="mdc-form-field">
<div id="component" class="mdc-checkbox">
<input type="checkbox"
- id="elem"
?checked="${this.value && this.value.includes(optValue)}"
?required="${this.required}"
name="${optValue}"
?disabled="${this.disabled || this.readonly}"
- @change="${(e: Event) => this.onValueChange((e.target as HTMLInputElement), {name: (e.target as HTMLInputElement).name, checked: (e.target as HTMLInputElement).checked})}"
+ @change="${(e: Event) => {
+ let val: any[] = this.value;
+ if ((e.target as HTMLInputElement).checked) {
+ val = [optValue,...val];
+ } else {
+ val = val.filter((v: any) => v !== optValue);
+ }
+ this.onValueChange((e.target as HTMLInputElement), val);
+ }}"
class="mdc-checkbox__native-control" id="elem-${optValue}"/>
<label for="elem-${optValue}"><or-translate value="${optDisplay}"></or-translate></label>
@@ -1134,7 +1149,7 @@ export class OrMwcInput extends LitElement {
?required="${this.required}"
?disabled="${this.disabled || this.readonly}"
@change="${(e: Event) => this.onValueChange((e.target as HTMLInputElement), (e.target as HTMLInputElement).checked)}"
- class="mdc-checkbox__native-control" id="elem"/>
+ class="mdc-checkbox__native-control" />
<div class="mdc-checkbox__background">
<svg class="mdc-checkbox__checkmark" viewBox="0 0 24 24">
<path class="mdc-checkbox__checkmark-path" fill="none" d="M1.73,12.91 8.1,19.28 22.79,4.59"></path>
@@ -1469,6 +1484,7 @@ export class OrMwcInput extends LitElement {
if (_changedProperties.has("options")) {
(this._mdcComponent as MDCSelect).layoutOptions();
}
+ (this._mdcComponent as MDCSelect).disabled = !!(this.disabled || this.readonly);
(this._mdcComponent as MDCSelect).useDefaultValidation = !this.multiple;
(this._mdcComponent as MDCSelect).valid = !this.required || (!this.multiple && (this._mdcComponent as MDCSelect).valid) || (this.multiple && Array.isArray(this.value) && (this.value as []).length > 0);
const selectedText = this.getSelectedTextValue();
@@ -1486,11 +1502,11 @@ export class OrMwcInput extends LitElement {
} else if (this.type === InputType.CHECKBOX && this._mdcComponent) {
const checkbox = this._mdcComponent as MDCCheckbox;
checkbox.checked = !!this.value;
- checkbox.disabled = this.disabled || this.readonly;
+ checkbox.disabled = !!(this.disabled || this.readonly);
}
if (this._mdcComponent) {
- (this._mdcComponent as any).required = this.required;
+ (this._mdcComponent as any).required = !!this.required;
}
}
@@ -1640,15 +1656,16 @@ export class OrMwcInput extends LitElement {
}
}
- protected resolveOptions(options: (string | [string, string])[] | undefined): [string, string][] | undefined {
- let resolved: [string, string][] | undefined;
+ protected resolveOptions(options: any[] | undefined): [any, string][] | undefined {
+ let resolved: [any, string][] | undefined;
if (options && options.length > 0) {
resolved = options.map(opt => {
if (Array.isArray(opt)) {
- return opt as [string, string];
+ return opt as [any, string];
} else {
- return [opt, i18next.t(opt, {defaultValue: Util.camelCaseToSentenceCase(opt)})]
+ const optStr = "" + opt;
+ return [opt, i18next.t(optStr, {defaultValue: Util.camelCaseToSentenceCase(optStr)})]
}
});
}
diff --git a/ui/component/or-mwc-components/src/or-mwc-list.ts b/ui/component/or-mwc-components/src/or-mwc-list.ts
index aa213a1b5..d62c288ff 100644
--- a/ui/component/or-mwc-components/src/or-mwc-list.ts
+++ b/ui/component/or-mwc-components/src/or-mwc-list.ts
@@ -24,7 +24,7 @@ export interface ListItem {
text?: string;
translate?: boolean;
secondaryText?: string;
- value: string;
+ value: any;
data?: any;
styleMap?: {[style: string]: string};
}
@@ -93,7 +93,7 @@ export function getListTemplate(type: ListType, content: TemplateResult, isTwoLi
`;
}
-export function getItemTemplate(item: ListItem | null, index: number, selectedValues: string | string[] | undefined, type: ListType, translate?: boolean, itemClickCallback?: (e: MouseEvent, item: ListItem) => void): TemplateResult {
+export function getItemTemplate(item: ListItem | null, index: number, selectedValues: any[], type: ListType, translate?: boolean, itemClickCallback?: (e: MouseEvent, item: ListItem) => void): TemplateResult {
if (item === null) {
// Divider
@@ -103,7 +103,7 @@ export function getItemTemplate(item: ListItem | null, index: number, selectedVa
const listItem = item as ListItem;
const multiSelect = type === ListType.MULTI_CHECKBOX || type === ListType.MULTI_TICK;
const value = listItem.value;
- const isSelected = type !== ListType.PLAIN && (selectedValues === value || (Array.isArray(selectedValues) && selectedValues.length > 0 && ((multiSelect && selectedValues.some((v) => v === value)) || (!multiSelect && selectedValues[0] === value))));
+ const isSelected = type !== ListType.PLAIN && selectedValues.length > 0 && selectedValues.some((v) => v === value);
const text = listItem.text !== undefined ? listItem.text : listItem.value;
const secondaryText = listItem.secondaryText;
let role: string | undefined = "menuitem";
@@ -280,7 +280,7 @@ export class OrMwcList extends LitElement {
}
protected render() {
- const content = !this.listItems ? html`` : html`${this.listItems.map((listItem, index) => getItemTemplate(listItem, index, this.values, this.type))}`;
+ const content = !this.listItems ? html`` : html`${this.listItems.map((listItem, index) => getItemTemplate(listItem, index, (Array.isArray(this.values) ? this.values : this.values ? [this.values] : []), this.type))}`;
const isTwoLine = this.listItems && this.listItems.some((item) => item && !!item.secondaryText);
return getListTemplate(this.type, content, isTwoLine, undefined, (ev) => this._onSelected(ev));
}
diff --git a/ui/component/or-mwc-components/src/or-mwc-menu.ts b/ui/component/or-mwc-components/src/or-mwc-menu.ts
index 102b96073..b37739013 100644
--- a/ui/component/or-mwc-components/src/or-mwc-menu.ts
+++ b/ui/component/or-mwc-components/src/or-mwc-menu.ts
@@ -18,11 +18,11 @@ import {getItemTemplate, getListTemplate, ListItem, ListType, MDCListActionEvent
// @ts-ignore
const menuStyle = require("@material/menu/dist/mdc.menu.css");
-export class OrMwcMenuChangedEvent extends CustomEvent<string | string[]> {
+export class OrMwcMenuChangedEvent extends CustomEvent<any[] | any> {
public static readonly NAME = "or-mwc-menu-changed";
- constructor(values: string | string[]) {
+ constructor(values: any[] | any) {
super(OrMwcMenuChangedEvent.NAME, {
detail: values,
bubbles: true,
@@ -50,7 +50,7 @@ declare global {
}
}
-export function getContentWithMenuTemplate(content: TemplateResult, menuItems: (ListItem | ListItem[] | null)[], selectedValues: string[] | string | undefined, valueChangedCallback: (values: string[] | string) => void, closedCallback?: () => void, multiSelect = false, translateValues = true): TemplateResult {
+export function getContentWithMenuTemplate(content: TemplateResult, menuItems: (ListItem | ListItem[] | null)[], selectedValues: any[] | any, valueChangedCallback: (values: any[] | any) => void, closedCallback?: () => void, multiSelect = false, translateValues = true): TemplateResult {
const openMenu = (evt: Event) => {
if (!menuItems) {
@@ -107,7 +107,7 @@ export class OrMwcMenu extends LitElement {
public menuItems?: (ListItem | ListItem[] | null)[];
@property({type: Array})
- public values?: string[] | string;
+ public values?: any[] | any;
@property({type: Boolean, attribute: true})
public multiSelect?: boolean;
@@ -173,7 +173,7 @@ export class OrMwcMenu extends LitElement {
`;
}
- return getItemTemplate(item, index, this.values, type, translate, (e, item) => this._itemClicked(e, item));
+ return getItemTemplate(item, index, (Array.isArray(this.values) ? this.values : this.values ? [this.values] : []), type, translate, (e, item) => this._itemClicked(e, item));
})}`;
}
@@ -216,7 +216,7 @@ export class OrMwcMenu extends LitElement {
if (!Array.isArray(this.values)) {
this.values = this.values ? [this.values] : [];
}
- const index = this.values.findIndex((v) => v === value);
+ const index = this.values.findIndex((v: any) => v === value);
if (index >= 0) {
this.values.splice(index, 1);
} else {
@@ -224,6 +224,6 @@ export class OrMwcMenu extends LitElement {
}
this.requestUpdate();
}
- this.dispatchEvent(new OrMwcMenuChangedEvent(this.values));
+ this.dispatchEvent(new OrMwcMenuChangedEvent(this.values!));
}
}
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 327e60164..142d35392 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
@@ -188,7 +188,7 @@ class OrRuleCondition extends translate(i18next)(LitElement) {
html`<or-mwc-input type="${InputType.BUTTON}" .icon="${buttonIcon || ""}"></or-mwc-input>`,
getWhenTypesMenu(this.config, this.assetInfos),
type,
- (values: string[] | string) => this.type = values as ConditionType)}
+ (value) => this.type = value as ConditionType)}
</div>
`;
}
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 85f38d170..e0a2cf3b9 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
@@ -312,7 +312,7 @@ class OrRuleThenOtherwise extends translate(i18next)(LitElement) {
html`<or-mwc-input type="${InputType.BUTTON}" .icon="${buttonIcon || ""}"></or-mwc-input>`,
getActionTypesMenu(this.config, this.assetInfos),
action.action,
- (values: string[] | string) => this.setActionType(actions, action, values as string))}
+ (value) => this.setActionType(actions, action, value as string))}
</div>
`;
}
@@ -362,7 +362,7 @@ class OrRuleThenOtherwise extends translate(i18next)(LitElement) {
html`<or-mwc-input class="plus-button" type="${InputType.BUTTON}" icon="plus"></or-mwc-input>`,
getActionTypesMenu(this.config, this.assetInfos),
undefined,
- (values: string[] | string) => this.addAction(values as string))}
+ (value) => this.addAction(value as string))}
<span>${i18next.t("rulesEditorAddAction")}</span>
</span>
` : ``}
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 ec79ec44a..f7707d732 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
@@ -197,7 +197,7 @@ class OrRuleWhen extends translate(i18next)(LitElement) {
html`<or-mwc-input class="plus-button" type="${InputType.BUTTON}" icon="plus"></or-mwc-input>`,
getWhenTypesMenu(this.config, this.assetInfos),
undefined,
- (values: string[] | string) => this.addCondition(group, values as string))}
+ (value) => this.addCondition(group, value as string))}
<span>${i18next.t("rulesEditorAddCondition")}</span>
</span>
`;
@@ -252,7 +252,7 @@ class OrRuleWhen extends translate(i18next)(LitElement) {
html`<or-mwc-input class="plus-button" type="${InputType.BUTTON}" icon="plus"></or-mwc-input>`,
getWhenTypesMenu(this.config, this.assetInfos),
undefined,
- (values: string[] | string) => this.addGroup(this.rule!.when!, values as string))}
+ (value) => this.addGroup(this.rule!.when!, value as string))}
<strong>${i18next.t(!this.rule.when.groups || this.rule.when.groups.length === 0 ? "when" : "orWhen")}...</strong>
</span>
</or-panel>