Skip to content
代码片段 群组 项目
未验证 提交 1fc5cc45 编辑于 作者: paulr34's avatar paulr34 提交者: GitHub
浏览文件

matter centric UI (#1278)

* matter centric UI

* only allow selection of server if Matter project

* removing cypress tests because Zigbee and Matter GUI diverged - follow up task for separating them

* centralizing data
上级 6d55a454
No related branches found
No related tags found
无相关合并请求
...@@ -29,46 +29,4 @@ describe('Testing cluster filters', () => { ...@@ -29,46 +29,4 @@ describe('Testing cluster filters', () => {
}) })
} }
) )
it(
'enable power configuration cluster',
{ retries: { runMode: 2, openMode: 2 } },
() => {
cy.get('[data-test="filter-input"]').click({ force: true })
cy.get('.q-virtual-scroll__content > :nth-child(1)').click()
cy.fixture('data').then((data) => {
cy.get('tbody').children().should('contain', data.cluster2)
})
cy.get('#General').click({ force: true })
cy.get(
'#General > .q-expansion-item__container > .q-expansion-item__content > .q-card > .q-card__section > .row > .q-table__container > .q-table__middle > .q-table > tbody > :nth-child(2) > :nth-child(6) > .q-field > .q-field__inner > .q-field__control'
).click({ force: true })
cy.fixture('data').then((data) => {
cy.get('.q-virtual-scroll__content > :nth-child(3)')
.contains(data.server1)
.click()
})
cy.get(
'.v-step-7 > .q-field > .q-field__inner > .q-field__control'
).click({ force: true })
}
)
it(
'checks if power configuration exists',
{ retries: { runMode: 2, openMode: 2 } },
() => {
cy.get('.q-virtual-scroll__content > :nth-child(2)').click({
force: true,
multiple: true,
})
cy.fixture('data').then((data) => {
cy.get('tbody').children().should('contain', data.cluster2)
})
}
)
it('Close all the clusters', () => {
cy.dataCy('cluster-btn-closeall').click()
cy.get('[data-test=Cluster').each(($row) => {
cy.wrap($row).should('have.class', 'q-expansion-item--collapsed')
})
})
}) })
...@@ -25,21 +25,5 @@ describe( ...@@ -25,21 +25,5 @@ describe(
.type(data.cluster4) .type(data.cluster4)
}) })
}) })
it('Enabling Client & Server', () => {
cy.get(
':nth-child(6) > .q-field > .q-field__inner > .q-field__control'
).click({ force: true })
cy.fixture('data').then((data) => {
cy.get('.q-menu').contains(data.server2).click()
})
})
it('Check Configuration page', () => {
cy.get(':nth-child(7) > .q-btn > .q-btn__content > .notranslate').click({
force: true,
})
cy.fixture('data').then((data) => {
cy.get('tr.table_body').contains(data.attribute3).should('be.visible')
})
})
} }
) )
...@@ -123,8 +123,14 @@ limitations under the License. ...@@ -123,8 +123,14 @@ limitations under the License.
" "
/> />
</q-td> </q-td>
<q-td key="singleton" :props="props" auto-width> <q-td
key="singleton"
v-if="enableSingleton"
:props="props"
auto-width
>
<q-checkbox <q-checkbox
v-if="enableSingleton"
class="q-mt-xs" class="q-mt-xs"
:model-value="selectionSingleton" :model-value="selectionSingleton"
:val="hashAttributeIdClusterId(props.row.id, selectedCluster.id)" :val="hashAttributeIdClusterId(props.row.id, selectedCluster.id)"
...@@ -140,8 +146,9 @@ limitations under the License. ...@@ -140,8 +146,9 @@ limitations under the License.
" "
/> />
</q-td> </q-td>
<q-td key="bounded" :props="props" auto-width> <q-td key="bounded" v-if="enableBounded" :props="props" auto-width>
<q-checkbox <q-checkbox
v-if="enableBounded"
class="q-mt-xs" class="q-mt-xs"
:model-value="selectionBounded" :model-value="selectionBounded"
:val="hashAttributeIdClusterId(props.row.id, selectedCluster.id)" :val="hashAttributeIdClusterId(props.row.id, selectedCluster.id)"
...@@ -410,97 +417,110 @@ export default { ...@@ -410,97 +417,110 @@ export default {
rowsPerPage: 0, rowsPerPage: 0,
sortBy: 'clientServer', sortBy: 'clientServer',
}, },
columns: [ columns: [],
{
name: 'status',
required: false,
label: '',
align: 'left',
style: 'width:1%',
},
{
name: 'included',
label: 'Enabled',
field: 'included',
align: 'left',
},
{
name: 'attrID',
align: 'left',
label: 'Attribute ID',
field: 'attrID',
sortable: true,
style: 'max-width: 90px',
headerStyle: 'max-width: 90px',
},
{
name: 'attrName',
label: 'Attribute',
field: 'attrName',
align: 'left',
sortable: true,
},
{
name: 'required',
label: 'Required',
field: 'required',
align: 'left',
sortable: true,
},
{
name: 'clientServer',
label: 'Client/Server',
field: 'clientServer',
align: 'left',
sortable: true,
},
{
name: 'mfgID',
label: 'Mfg Code',
align: 'left',
field: 'mfgID',
sortable: true,
},
{
name: 'storageOption',
label: 'Storage Option',
align: 'left',
field: 'storageOption',
sortable: true,
},
{
name: 'singleton',
align: 'left',
label: 'Singleton',
field: 'singleton',
sortable: true,
},
{
name: 'bounded',
align: 'left',
label: 'Bounded',
field: 'bounded',
sortable: true,
},
{
name: 'type',
align: 'left',
label: 'Type',
field: 'type',
sortable: true,
},
{
name: 'default',
align: 'left',
label: 'Default',
field: 'default',
style: 'min-width: 180px',
headerStyle: 'min-width: 180px',
},
],
forcedExternal: [], forcedExternal: [],
enableSingleton: false,
enableBounded: false,
} }
}, },
mounted() {
this.columns = [
{
name: 'status',
required: false,
label: '',
align: 'left',
style: 'width:1%',
},
{
name: 'included',
label: 'Enabled',
field: 'included',
align: 'left',
},
{
name: 'attrID',
align: 'left',
label: 'Attribute ID',
field: 'attrID',
sortable: true,
style: 'max-width: 90px',
headerStyle: 'max-width: 90px',
},
{
name: 'attrName',
label: 'Attribute',
field: 'attrName',
align: 'left',
sortable: true,
},
{
name: 'required',
label: 'Required',
field: 'required',
align: 'left',
sortable: true,
},
{
name: 'clientServer',
label: 'Client/Server',
field: 'clientServer',
align: 'left',
sortable: true,
},
{
name: 'mfgID',
label: 'Mfg Code',
align: 'left',
field: 'mfgID',
sortable: true,
},
{
name: 'storageOption',
label: 'Storage Option',
align: 'left',
field: 'storageOption',
sortable: true,
},
...(this.enableSingleton
? [
{
name: 'singleton',
align: 'left',
label: 'Singleton',
field: 'singleton',
sortable: true,
},
]
: []),
...(this.enableBounded
? [
{
name: 'bounded',
align: 'left',
label: 'Bounded',
field: 'bounded',
sortable: true,
},
]
: []),
{
name: 'type',
align: 'left',
label: 'Type',
field: 'type',
sortable: true,
},
{
name: 'default',
align: 'left',
label: 'Default',
field: 'default',
style: 'min-width: 180px',
headerStyle: 'min-width: 180px',
},
]
},
created() { created() {
if (this.$serverGet != null) { if (this.$serverGet != null) {
this.forcedExternal = [] this.forcedExternal = []
......
...@@ -32,7 +32,7 @@ limitations under the License. ...@@ -32,7 +32,7 @@ limitations under the License.
min="0" min="0"
/> />
<q-input <q-input
v-if="$store.state.zap.isProfileIdShown" v-if="enableProfileId"
label="Profile ID" label="Profile ID"
v-model="computedProfileId" v-model="computedProfileId"
ref="profile" ref="profile"
...@@ -136,6 +136,7 @@ limitations under the License. ...@@ -136,6 +136,7 @@ limitations under the License.
<div class="q-gutter-md row"> <div class="q-gutter-md row">
<q-input <q-input
v-if="enableNetworkId"
label="Network" label="Network"
type="number" type="number"
v-model="shownEndpoint.networkIdentifier" v-model="shownEndpoint.networkIdentifier"
...@@ -198,6 +199,7 @@ limitations under the License. ...@@ -198,6 +199,7 @@ limitations under the License.
import * as RestApi from '../../src-shared/rest-api' import * as RestApi from '../../src-shared/rest-api'
import * as DbEnum from '../../src-shared/db-enum' import * as DbEnum from '../../src-shared/db-enum'
import CommonMixin from '../util/common-mixin' import CommonMixin from '../util/common-mixin'
import uiOptions from '../util/ui-options'
const _ = require('lodash') const _ = require('lodash')
import * as dbEnum from '../../src-shared/db-enum.js' import * as dbEnum from '../../src-shared/db-enum.js'
...@@ -205,7 +207,7 @@ export default { ...@@ -205,7 +207,7 @@ export default {
name: 'ZclCreateModifyEndpoint', name: 'ZclCreateModifyEndpoint',
props: ['endpointReference'], props: ['endpointReference'],
emits: ['saveOrCreateValidated', 'updateData'], emits: ['saveOrCreateValidated', 'updateData'],
mixins: [CommonMixin], mixins: [CommonMixin, uiOptions],
watch: { watch: {
deviceTypeRefAndDeviceIdPair(val) { deviceTypeRefAndDeviceIdPair(val) {
this.setDeviceTypeCallback(val) this.setDeviceTypeCallback(val)
...@@ -254,13 +256,6 @@ export default { ...@@ -254,13 +256,6 @@ export default {
} else { } else {
this.shownEndpoint.endpointIdentifier = this.getSmallestUnusedEndpointId() this.shownEndpoint.endpointIdentifier = this.getSmallestUnusedEndpointId()
} }
const enableMatterFeatures =
this.$store.state.zap.selectedZapConfig?.zclProperties?.category ===
'matter'
this.enableMultipleDevice = enableMatterFeatures
this.enablePrimaryDevice = enableMatterFeatures
this.enableParentEndpoint = enableMatterFeatures
}, },
data() { data() {
return { return {
...@@ -275,9 +270,6 @@ export default { ...@@ -275,9 +270,6 @@ export default {
saveOrCreateCloseFlag: false, saveOrCreateCloseFlag: false,
deviceTypeTmp: [], // Temp store for the selected device types deviceTypeTmp: [], // Temp store for the selected device types
primaryDeviceTypeTmp: null, // Temp store for the selected primary device type primaryDeviceTypeTmp: null, // Temp store for the selected primary device type
enableMultipleDevice: false,
enablePrimaryDevice: false,
enableParentEndpoint: false,
endpointIds: [], endpointIds: [],
} }
}, },
...@@ -484,14 +476,10 @@ export default { ...@@ -484,14 +476,10 @@ export default {
} }
}, },
saveOrCreateHandler() { saveOrCreateHandler() {
let profile = this.$store.state.zap.isProfileIdShown let profile = this.enableProfileId ? this.$refs.profile.validate() : true
? this.$refs.profile.validate()
: true
if ( if (
this.$refs.endpoint.validate() && this.$refs.endpoint.validate() &&
this.$refs.device.validate() && this.$refs.device.validate() &&
this.$refs.network.validate() &&
(this.$refs.version?.validate?.() ?? (this.$refs.version?.validate?.() ??
!this.$refs.version?.includes((v) => !(v >= 0))) && !this.$refs.version?.includes((v) => !(v >= 0))) &&
profile profile
......
...@@ -219,6 +219,7 @@ limitations under the License. ...@@ -219,6 +219,7 @@ limitations under the License.
<script> <script>
import CommonMixin from '../util/common-mixin' import CommonMixin from '../util/common-mixin'
import restApi from '../../src-shared/rest-api' import restApi from '../../src-shared/rest-api'
import uiOptions from '../util/ui-options'
let ZclClusterRoleAction = { let ZclClusterRoleAction = {
Add: 'add', Add: 'add',
...@@ -230,8 +231,23 @@ let ZclClusterRole = { server: 'server', client: 'client' } ...@@ -230,8 +231,23 @@ let ZclClusterRole = { server: 'server', client: 'client' }
export default { export default {
name: 'ZclDomainClusterView', name: 'ZclDomainClusterView',
props: ['domainName', 'clusters'], props: ['domainName', 'clusters'],
mixins: [CommonMixin], mixins: [CommonMixin, uiOptions],
computed: { computed: {
clusterSelectionOptions() {
if (this.enableServerOnly) {
return [
{ label: 'Not Enabled', client: false, server: false },
{ label: 'Server', client: false, server: true },
]
} else {
return [
{ label: 'Not Enabled', client: false, server: false },
{ label: 'Client', client: true, server: false },
{ label: 'Server', client: false, server: true },
{ label: 'Client & Server', client: true, server: true },
]
}
},
showStatus: { showStatus: {
get() { get() {
return !this.$store.state.zap.standalone return !this.$store.state.zap.standalone
...@@ -524,12 +540,6 @@ export default { ...@@ -524,12 +540,6 @@ export default {
ZclClusterRole, ZclClusterRole,
showEnableAllClustersDialog: false, showEnableAllClustersDialog: false,
uc_label: 'uc label', uc_label: 'uc label',
clusterSelectionOptions: [
{ label: 'Not Enabled', client: false, server: false },
{ label: 'Client', client: true, server: false },
{ label: 'Server', client: false, server: true },
{ label: 'Client & Server', client: true, server: true },
],
columns: [ columns: [
{ {
name: 'status', name: 'status',
......
...@@ -265,6 +265,7 @@ limitations under the License. ...@@ -265,6 +265,7 @@ limitations under the License.
<script> <script>
import ZclCreateModifyEndpoint from './ZclCreateModifyEndpoint.vue' import ZclCreateModifyEndpoint from './ZclCreateModifyEndpoint.vue'
import CommonMixin from '../util/common-mixin' import CommonMixin from '../util/common-mixin'
import uiOptions from '../util/ui-options'
import * as Storage from '../util/storage' import * as Storage from '../util/storage'
import restApi from '../../src-shared/rest-api' import restApi from '../../src-shared/rest-api'
import * as Util from '../util/util' import * as Util from '../util/util'
...@@ -273,7 +274,7 @@ import * as dbEnum from '../../src-shared/db-enum.js' ...@@ -273,7 +274,7 @@ import * as dbEnum from '../../src-shared/db-enum.js'
export default { export default {
name: 'ZclEndpointCard', name: 'ZclEndpointCard',
props: ['endpointReference'], props: ['endpointReference'],
mixins: [CommonMixin], mixins: [CommonMixin, uiOptions],
components: { ZclCreateModifyEndpoint }, components: { ZclCreateModifyEndpoint },
data() { data() {
return { return {
...@@ -552,10 +553,6 @@ export default { ...@@ -552,10 +553,6 @@ export default {
this.selectedReporting = [] this.selectedReporting = []
this.getEndpointCardData() this.getEndpointCardData()
//only show Matter features if Matter is selected //only show Matter features if Matter is selected
const enableMatterFeatures =
this.$store.state.zap.selectedZapConfig?.zclProperties?.category ===
'matter'
this.enableParentEndpoint = enableMatterFeatures
} }
}, },
} }
......
// mixin.js
export default {
data() {
return {
enableProfileId: false,
enableNetworkId: false,
enableMultipleDevice: false,
enablePrimaryDevice: false,
enableParentEndpoint: false,
enableServerOnly: false,
enableSingleton: false,
enableBounded: false,
}
},
mounted() {
const enableZigbeeFeatures =
this.$store.state.zap.selectedZapConfig?.zclProperties?.category ===
'zigbee'
this.enableProfileId = enableZigbeeFeatures
this.enableNetworkId = enableZigbeeFeatures
this.enableSingleton = enableZigbeeFeatures
this.enableBounded = enableZigbeeFeatures
const enableMatterFeatures =
this.$store.state.zap.selectedZapConfig?.zclProperties?.category ===
'matter'
this.enableMultipleDevice = enableMatterFeatures
this.enablePrimaryDevice = enableMatterFeatures
this.enableParentEndpoint = enableMatterFeatures
this.enableServerOnly = enableMatterFeatures
},
}
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册