From 80c57beac926ab52783a2702a1171356a1e6be0a Mon Sep 17 00:00:00 2001 From: Thuc Tran <thuc.tran@silabs.com> Date: Thu, 20 Aug 2020 10:13:34 -0400 Subject: [PATCH] NOJIRA Remove box color handling for commands. Add required field to commands table. Some misc ui typo fixes for attributes --- src/components/ZclAttributeManager.vue | 8 +++-- src/components/ZclCommandManager.vue | 42 ++------------------------ 2 files changed, 8 insertions(+), 42 deletions(-) diff --git a/src/components/ZclAttributeManager.vue b/src/components/ZclAttributeManager.vue index a7705e28..54adfd44 100644 --- a/src/components/ZclAttributeManager.vue +++ b/src/components/ZclAttributeManager.vue @@ -65,7 +65,7 @@ limitations under the License. }}</q-td> <q-td key="required" :props="props" auto-width></q-td> <q-td key="clientServer" :props="props" auto-width>{{ - props.row.side + props.row.side === 'client' ? 'Client' : 'Server' }}</q-td> <q-td key="mfgID" :props="props" auto-width>{{ selectedCluster.manufacturerCode @@ -74,7 +74,6 @@ limitations under the License. ? props.row.manufacturerCode : '-' }}</q-td> - <q-td key="stgOpt" :props="props" auto-width></q-td> <q-td key="singleton" :props="props" auto-width> <q-checkbox class="q-mt-xs" @@ -107,7 +106,9 @@ limitations under the License. " /> </q-td> - <q-td key="type" :props="props" auto-width>{{ props.row.type }}</q-td> + <q-td key="type" :props="props" auto-width>{{ + props.row.type ? props.row.type.toUpperCase() : 'UNKNOWN' + }}</q-td> <q-td key="default" :props="props" auto-width> <q-input dense @@ -363,6 +364,7 @@ export default { }, { name: 'mfgID', + label: 'Mfg Code', align: 'left', field: 'mfgID', sortable: true, diff --git a/src/components/ZclCommandManager.vue b/src/components/ZclCommandManager.vue index cb926fe6..eb8daf59 100644 --- a/src/components/ZclCommandManager.vue +++ b/src/components/ZclCommandManager.vue @@ -45,14 +45,6 @@ limitations under the License. :val="hashCommandIdClusterId(props.row.id, selectedCluster.id)" indeterminate-value="false" keep-color - :color=" - handleColorSelection( - selectionOut, - requiredCommands, - props.row, - selectedCluster.id - ) - " @input=" handleCommandSelection( selectionOut, @@ -91,7 +83,7 @@ limitations under the License. props.row.label }}</q-td> <q-td key="required" :props="props" auto-width> - <!-- TODO --> + {{ isCommandRequired(props.row) ? 'Yes' : '' }} </q-td> <q-td key="mfgId" :props="props" auto-width >{{ @@ -182,36 +174,8 @@ export default { } this.$store.dispatch('zap/updateSelectedCommands', editContext) }, - handleColorSelection(selectedList, recommendedList, command, clusterId) { - let relevantClusterList = - command.source === 'client' - ? this.selectionClusterClient - : this.selectionClusterServer - - let isClusterIncluded = relevantClusterList.includes(clusterId) - let isCommandRecommended = - recommendedList.includes(command.id) || !command.isOptional - let isCommandIncluded = selectedList.includes( - this.hashCommandIdClusterId(command.id, clusterId) - ) - - if (isCommandRecommended && isCommandIncluded && isClusterIncluded) { - return 'green' - } else if ( - isCommandRecommended && - !isCommandIncluded && - isClusterIncluded - ) { - return 'red' - } else if ( - isCommandRecommended && - isCommandIncluded && - !isClusterIncluded - ) { - return 'orange' - } else { - return 'primary' - } + isCommandRequired(command) { + return this.requiredCommands.includes(command.id) || !command.isOptional }, hashCommandIdClusterId(commandId, clusterId) { return Util.cantorPair(commandId, clusterId) -- GitLab