Skip to content

Commit

Permalink
Merge pull request #21 from ankur325/v1.6.0-Changes
Browse files Browse the repository at this point in the history
Fixed VendorInfo Defect, added Hex Values for vid/pid
  • Loading branch information
ankur325 authored Jan 4, 2023
2 parents 556a229 + 78ec902 commit fa1b496
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 40 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dcl-ui",
"version": "1.0.5",
"version": "1.0.6",
"description": "A Vuejs based application for managing CSA Distributed Compliance Ledger",
"author": "Comcast Inc.",
"private": true,
Expand Down
19 changes: 17 additions & 2 deletions src/views/Accounts/Accounts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ export default {
document.execCommand('copy');
document.body.removeChild(el);
},
addHexValueToVendorID(vendorID) {
if (vendorID)
return `${vendorID} (0x${vendorID.toString(16)})`;
else
return "Not Set";
},
},
components: {
DataTable,
Expand All @@ -80,6 +87,10 @@ export default {
this.$store.getters[
"zigbeealliance.distributedcomplianceledger.dclauth/getPendingAccountAll"
]();
// Add the hex value to the vendor ID to all the accounts
pendingAccountsArray?.pendingAccount?.forEach(account => {
account.vendorIDHex = this.addHexValueToVendorID(account.vendorID);
});
return pendingAccountsArray?.pendingAccount;
},
Expand All @@ -96,6 +107,10 @@ export default {
this.$store.getters[
"zigbeealliance.distributedcomplianceledger.dclauth/getAccountAll"
]();
// Add the hex value to the vendor ID to all the accounts
allAccountsArray?.account?.forEach(account => {
account.vendorIDHex = this.addHexValueToVendorID(account.vendorID);
});
return allAccountsArray?.account;
},
Expand Down Expand Up @@ -218,7 +233,7 @@ export default {
<span class="mt-3 pi pi-copy p-button-copy"></span></button> </span>
</template>
</Column> -->
<Column field="vendorID" header="Vendor ID" :sortable="true"></Column>
<Column field="vendorIDHex" header="Vendor ID" :sortable="true"></Column>
<Column field="approvals" header="Approvals">
<template #body="row">
<ol>
Expand Down Expand Up @@ -294,7 +309,7 @@ export default {
field="account.base_account.address"
header="Address"
></Column>
<Column field="account.vendorID" header="Vendor ID"></Column>
<Column field="account.vendorIDHex" header="Vendor ID"></Column>
<Column field="account.approvals" header="Approvals">
<template #body="row">
<ol>
Expand Down
42 changes: 28 additions & 14 deletions src/views/Compliance/Compliance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default {
};
},
methods: {},
components: {
DataTable,
Column,
Expand All @@ -38,19 +37,17 @@ export default {
},
computed: {
allComplianceInfo() {
const certifiedModelArray =
this.$store.getters[
"zigbeealliance.distributedcomplianceledger.compliance/getComplianceInfoAll"
]();
return certifiedModelArray?.certifiedModel;
},
allCertifiedModels() {
const certifiedModelArray =
this.$store.getters[
"zigbeealliance.distributedcomplianceledger.compliance/getCertifiedModelAll"
]();
// Add Hex Values for vid, pid
certifiedModelArray?.certifiedModel?.forEach((certifiedModel) => {
certifiedModel.vidHex = this.hexValue(certifiedModel.vid);
certifiedModel.pidHex = this.hexValue(certifiedModel.pid);
});
return certifiedModelArray?.certifiedModel;
},
Expand All @@ -59,6 +56,11 @@ export default {
this.$store.getters[
"zigbeealliance.distributedcomplianceledger.compliance/getRevokedModelAll"
]();
// Add Hex Values for vid, pid
revokedModelArray?.revokedModel?.forEach((revokedModel) => {
revokedModel.vidHex = this.hexValue(revokedModel.vid);
revokedModel.pidHex = this.hexValue(revokedModel.pid);
});
return revokedModelArray?.revokedModel;
},
Expand All @@ -67,6 +69,12 @@ export default {
this.$store.getters[
"zigbeealliance.distributedcomplianceledger.compliance/getProvisionalModelAll"
]();
// Add Hex Values for vid, pid
allProvisionalModels?.provisionalModel?.forEach((provisionalModel) => {
provisionalModel.vidHex = this.hexValue(provisionalModel.vid);
provisionalModel.pidHex = this.hexValue(provisionalModel.pid);
});
return allProvisionalModels?.provisionalModel;
},
Expand Down Expand Up @@ -142,6 +150,12 @@ export default {
dismissProvisionalModelDialog() {
this.showProvisionalModel = false;
},
hexValue(value) {
if (value)
return `${value} (0x${value.toString(16)})`;
else
return value
},
},
};
</script>
Expand Down Expand Up @@ -184,8 +198,8 @@ export default {
header="Certification Type"
:sortable="true"
></Column>
<Column field="vid" header="Vendor ID" :sortable="true"></Column>
<Column field="pid" header="Product ID" :sortable="true"></Column>
<Column field="vidHex" header="Vendor ID" :sortable="true"></Column>
<Column field="pidHex" header="Product ID" :sortable="true"></Column>
<Column
field="softwareVersion"
header="Software Version"
Expand Down Expand Up @@ -243,8 +257,8 @@ export default {
header="Certification Type"
:sortable="true"
></Column>
<Column field="vid" header="Vendor ID" :sortable="true"></Column>
<Column field="pid" header="Product ID" :sortable="true"></Column>
<Column field="vidHex" header="Vendor ID" :sortable="true"></Column>
<Column field="pidHex" header="Product ID" :sortable="true"></Column>
<Column
field="softwareVersion"
header="Software Version"
Expand Down Expand Up @@ -300,8 +314,8 @@ export default {
header="Certification Type"
:sortable="true"
></Column>
<Column field="vid" header="Vendor ID" :sortable="true"></Column>
<Column field="pid" header="Product ID" :sortable="true"></Column>
<Column field="vidHex" header="Vendor ID" :sortable="true"></Column>
<Column field="pidHex" header="Product ID" :sortable="true"></Column>
<Column
field="softwareVersion"
header="Software Version"
Expand Down
6 changes: 3 additions & 3 deletions src/views/Models/ModelInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ export default {
<table>
<tr>
<td class="p-text">Vendor ID</td>
<td>{{ selectedModel.vid }}</td>
<td>{{ selectedModel.vidHex }}</td>
</tr>
<tr>
<td>Product ID</td>
<td>{{ selectedModel.pid }}</td>
<td>{{ selectedModel.pidHex }}</td>
</tr>
<tr>
<td>Device Type ID</td>
<td>{{ selectedModel.deviceTypeId }}</td>
<td>{{ selectedModel.deviceTypeIdHex }}</td>
</tr>
<tr>
<td>Product Name</td>
Expand Down
7 changes: 4 additions & 3 deletions src/views/Models/ModelVersionInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export default {
vid: this.vid,
pid: this.pid,
softwareVersionValid: true,
cdVersionNumber: 1,
});
this.update = false;
}
Expand All @@ -171,11 +172,11 @@ export default {
<table>
<tr>
<td class="p-text">Vendor ID</td>
<td>{{ selectedModelVersion.vid }}</td>
<td>{{ selectedModelVersion.vidHex }}</td>
</tr>
<tr>
<td>Product ID</td>
<td>{{ selectedModelVersion.pid }}</td>
<td>{{ selectedModelVersion.pidHex }}</td>
</tr>
<tr>
<td>Software Version</td>
Expand Down Expand Up @@ -322,7 +323,7 @@ export default {

<!-- Field for cdVersionNumber -->
<div class="field">
<label for="cdVersionNumber">Cd Version Number</label>
<label for="cdVersionNumber">CD Version Number</label>
<InputText
id="cdVersionNumber"
type="text"
Expand Down
14 changes: 13 additions & 1 deletion src/views/Models/ModelVersions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,13 @@ export default {
return null;
}
},
},
getHexValue(value) {
if (value)
return `${value} (0x${value.toString(16)})`;
else
return value;
},
},
components: {
DataTable,
Column,
Expand Down Expand Up @@ -180,6 +186,12 @@ export default {
modelVersions.push(modelVersion.modelVersion);
}
}
// Add hex values to vid and pid
modelVersions.forEach((modelVersion) => {
modelVersion.vidHex = this.getHexValue(modelVersion.vid);
modelVersion.pidHex = this.getHexValue(modelVersion.pid);
});
return modelVersions;
},
Expand Down
21 changes: 18 additions & 3 deletions src/views/Models/Models.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ export default {
return null;
}
},
getHexValue(value) {
if (value)
return `${value} (0x${value.toString(16)})`;
else
return value;
},
},
computed: {
Expand All @@ -135,6 +142,14 @@ export default {
this.$store.getters[
"zigbeealliance.distributedcomplianceledger.model/getModelAll"
]();
// Add hex values for vid and pid
if (ModelInfoArray && ModelInfoArray.model) {
ModelInfoArray.model.forEach((model) => {
model.vidHex = this.getHexValue(model.vid);
model.pidHex = this.getHexValue(model.pid);
model.deviceTypeIdHex = this.getHexValue(model.deviceTypeId);
});
}
return ModelInfoArray?.model;
},
Expand Down Expand Up @@ -199,10 +214,10 @@ export default {
</template>
<Column :expander="true" headerStyle="width: 3rem" />
<Column field="vid" header="Vendor ID" :sortable="true"></Column>
<Column field="pid" header="Product ID" :sortable="true"></Column>
<Column field="vidHex" header="Vendor ID" :sortable="true"></Column>
<Column field="pidHex" header="Product ID" :sortable="true"></Column>
<Column
field="deviceTypeId"
field="deviceTypeIdHex"
header="Device Type ID"
:sortable="true"
></Column>
Expand Down
24 changes: 12 additions & 12 deletions src/views/VendorInfo/VendorInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {
vendorID: null,
vendorName: null,
companyLegalName: null,
companyPrefferedName: null,
companyPreferredName: null,
vendorLandingPageURL: null
}
},
Expand All @@ -46,7 +46,7 @@ export default {
companyLegalName: {
required
},
companyPrefferedName: {},
companyPreferredName: {},
vendorLandingPageURL: {}
}
Expand Down Expand Up @@ -76,7 +76,7 @@ export default {
vendorID: this.vendorID,
vendorName: this.vendorName,
companyLegalName: this.companyLegalName,
companyPrefferedName: this.companyPrefferedName,
companyPreferredName: this.companyPreferredName,
vendorLandingPageURL: this.vendorLandingPageURL
}
})
Expand Down Expand Up @@ -122,7 +122,7 @@ export default {
this.vendorID = this.vendorInfo.vendorID
this.vendorName = this.vendorInfo.vendorName
this.companyLegalName = this.vendorInfo.companyLegalName
this.companyPrefferedName = this.vendorInfo.companyPrefferedName
this.companyPreferredName = this.vendorInfo.companyPreferredName
this.vendorLandingPageURL = this.vendorInfo.vendorLandingPageURL
this.update = true
} else {
Expand All @@ -141,7 +141,7 @@ export default {
<table>
<tr>
<td class="p-text">Vendor ID</td>
<td>{{vendorInfo.vendorID}}</td>
<td>{{vendorInfo.vendorIDHex}}</td>
</tr>
<tr>
<td>Vendor Name</td>
Expand All @@ -152,8 +152,8 @@ export default {
<td>{{vendorInfo.companyLegalName}}</td>
</tr>
<tr>
<td>Company Preffered Name</td>
<td>{{vendorInfo.companyPrefferedName}}</td>
<td>Company Preferred Name</td>
<td>{{vendorInfo.companyPreferredName}}</td>
</tr>
<tr>
<td>Vendor Landing Page URL</td>
Expand Down Expand Up @@ -189,14 +189,14 @@ export default {
/>
</div>

<!-- Field for companyPrefferedName -->
<!-- Field for companyPreferredName -->
<div class="field">
<label for="companyPrefferedName">Company Preffered Name</label>
<label for="companyPreferredName">Company Preferred Name</label>
<InputText
id="companyPrefferedName"
id="companyPreferredName"
type="text"
v-model="v$.companyPrefferedName.$model"
:class="{ 'p-invalid': v$.companyPrefferedName.$invalid && submitted }"
v-model="v$.companyPreferredName.$model"
:class="{ 'p-invalid': v$.companyPreferredName.$invalid && submitted }"
/>
</div>

Expand Down
7 changes: 6 additions & 1 deletion src/views/VendorInfo/Vendors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export default {
this.$store.getters[
"zigbeealliance.distributedcomplianceledger.vendorinfo/getVendorInfoAll"
]();
// Add the vendorID as Hex String to all the vendorInfo
vendorInfoArray?.vendorInfo?.forEach((vendorInfo) => {
vendorInfo.vendorIDHex = `${vendorInfo.vendorID} (0x${vendorInfo.vendorID.toString(16)})`;
});
return vendorInfoArray?.vendorInfo;
},
Expand Down Expand Up @@ -100,7 +104,8 @@ export default {
</div>
</template>
<Column field="vendorID" header="Vendor ID"></Column>
<Column field="vendorIDHex" header="Vendor ID">
</Column>
<Column field="vendorName" header="Vendor Name"></Column>
<Column field="companyLegalName" header="Company Legal Name"></Column>
<Column
Expand Down

0 comments on commit fa1b496

Please sign in to comment.