Skip to content

armgit / core

Public Imported from GitHub
0

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

Bug fix for add attribute dialog (Fixes #437)

Rich Turner948b344e8040
diff --git a/ui/component/or-asset-viewer/src/or-add-attribute-panel.ts b/ui/component/or-asset-viewer/src/or-add-attribute-panel.ts
index 3e7d3fbc9..2da9183b6 100644
--- a/ui/component/or-asset-viewer/src/or-add-attribute-panel.ts
+++ b/ui/component/or-asset-viewer/src/or-add-attribute-panel.ts
@@ -110,7 +110,7 @@ export class OrAddAttributePanel extends LitElement {
</div>
<div id="wrapper" class="hidden">
<or-mwc-input id="name-input" .type="${InputType.TEXT}" .label="${i18next.t("name")}" pattern="\\w+" required @keyup="${(ev: KeyboardEvent) => this.onNameChanged((ev.target as OrMwcInput).currentValue)}" @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onNameChanged(ev.detail.value)}"></or-mwc-input>
- <or-mwc-input id="type-input" .type="${InputType.SELECT}" .value="${this.attribute ? this.attribute.type : undefined}" .options="${this.attributeValueTypes}" .label="${i18next.t("valueType")}" @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onValueTypeChanged(ev.detail.value)}"></or-mwc-input>
+ <or-mwc-input id="type-input" .type="${InputType.SELECT}" .value="${this.attribute && this.attribute.type ? this.attribute.type.replace("[]", "") : undefined}" .options="${this.attributeValueTypes}" .label="${i18next.t("valueType")}" @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onValueTypeChanged(ev.detail.value)}"></or-mwc-input>
<or-mwc-input id="array-checkbox" .type="${InputType.CHECKBOX}" .value="${this.isArray}" .label="${i18next.t("array")}" @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onArrayChanged(ev.detail.value, 1)}"></or-mwc-input>
<or-mwc-input id="array-input" .type="${InputType.NUMBER}" ?disabled="${!this.isArray}" .value="${this.arrayDimensions}" min="1" max="2" .label="${i18next.t("arrayDimensions")}" @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this.onArrayChanged(true, ev.detail.value)}"></or-mwc-input>
</div>