Skip to content

Commit

Permalink
Merge pull request #410 from Mehradml/tdj_0
Browse files Browse the repository at this point in the history
Continuous work from TDJ
  • Loading branch information
tecimovic authored Feb 10, 2022
2 parents 4f3bce3 + 8b5d93f commit 3f7a9b0
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 33 deletions.
3 changes: 1 addition & 2 deletions cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"viewportWidth": 1080,
"viewportHeight": 920,
"video": false,
"testFiles": "**/theme/theme.spec.js",
"ignoreTestFiles": ["**/*.test.js"]
"ignoreTestFiles": ["**/*.test.js","**/custom_xml/custom_xml_vendor.xml","**/custom_xml/custom_xml.spec.js"]
}
7 changes: 5 additions & 2 deletions src-electron/validation/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function validateAttribute(db, endpointTypeId, attributeRef, clusterRef) {
clusterRef
)
let attribute = await queryZcl.selectAttributeById(db, attributeRef)

console.log("mehtest",attribute)
return validateSpecificAttribute(endpointAttribute, attribute)
}

Expand Down Expand Up @@ -68,7 +68,10 @@ async function validateNoDuplicateEndpoints(

function validateSpecificAttribute(endpointAttribute, attribute) {
let defaultAttributeIssues = []
if (!types.isString(attribute.type)) {
if(attribute.isNullable && endpointAttribute.defaultValue == 'null'){
return { defaultValue: defaultAttributeIssues }
}
else if (!types.isString(attribute.type)) {
if (types.isFloat(attribute.type)) {
if (!isValidFloat(endpointAttribute.defaultValue))
defaultAttributeIssues.push('Invalid Float')
Expand Down
18 changes: 17 additions & 1 deletion src/components/ZclAttributeManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ limitations under the License.
bottom-slots
hide-bottom-space
outlined
:disable="
!selection.includes(
hashAttributeIdClusterId(props.row.id, selectedCluster.id)
)
"
:value="
selectionDefault[
hashAttributeIdClusterId(props.row.id, selectedCluster.id)
Expand All @@ -196,7 +201,18 @@ limitations under the License.
selectedCluster.id
)
"
/>
>
<template v-slot:append >
<q-btn v-if="props.row.isNullable" color="secondary" label="Null" size="sm" @click="
handleLocalChange(
null,
'defaultValue',
props.row,
selectedCluster.id
)
" />
</template>
</q-input>
</q-td>
</q-tr>
</template>
Expand Down
9 changes: 9 additions & 0 deletions src/layouts/ZclLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ limitations under the License.
id="preference"
to="/preference"
/>
<q-btn flat @click="homeDialog = !homeDialog" icon="mdi-alert-circle">
<q-tooltip> About </q-tooltip>
</q-btn>
</q-toolbar>
<q-layout
view="hHh Lpr lff"
Expand Down Expand Up @@ -161,6 +164,9 @@ limitations under the License.
</q-page-container>
</q-layout>
</div>
<q-dialog v-model="homeDialog">
<About />
</q-dialog>
</div>
</template>

Expand All @@ -170,6 +176,7 @@ import Exceptions from '../components/Exceptions.vue'
import ZclInformationSetup from '../components/ZclInformationSetup.vue'
import ZclConfiguratorLayout from './ZclConfiguratorLayout.vue'
import SqlQuery from '../components/SqlQuery.vue'
import About from '../pages/About.vue'
const restApi = require(`../../src-shared/rest-api.js`)
const rendApi = require(`../../src-shared/rend-api.js`)
const observable = require('../util/observable.js')
Expand Down Expand Up @@ -245,6 +252,7 @@ export default {
ZclConfiguratorLayout,
SqlQuery,
Exceptions,
About,
},
data() {
return {
Expand All @@ -264,6 +272,7 @@ export default {
index: 0,
maxIndex: 0,
generationDirectory: '',
homeDialog: false,
}
},
computed: {
Expand Down
24 changes: 15 additions & 9 deletions src/pages/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<template>
<div>
<q-img src="~assets/zap_splash.png">
<div class="absolute-bottom text-subtitle1 text-center">
Version {{ version }} (fl {{ featureLevel }}, {{ date }}, #{{ hash }})
<br />
&copy; 2020 by the authors. Released as open-source, under terms of
Apache 2.0 license. {{ version }}
</div>
</q-img>
<div style="width: 100%; height: auto">
<q-card>
<q-card-section
><q-img src="~assets/zap_splash.png">
<div class="absolute-bottom text-subtitle1 text-center">
Version {{ version }} (fl {{ featureLevel }}, {{ date }}, #{{
hash
}})
<br />
&copy; 2020 by the authors. Released as open-source, under terms of
Apache 2.0 license. {{ version }}
</div>
</q-img>
</q-card-section>
</q-card>
</div>
</template>
<script>
Expand Down
22 changes: 3 additions & 19 deletions src/pages/Preference.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ limitations under the License.
-->
<template>
<div>
<q-toolbar class="shadow-2" >
<q-btn
icon="arrow_back"
to="/"
label="Back"
/>
<q-toolbar class="shadow-2">
<q-btn icon="arrow_back" to="/" label="Back" />
</q-toolbar>
<q-splitter v-model="splitterModel" style="height: 100%">
<template v-slot:before>
Expand All @@ -32,11 +28,6 @@ limitations under the License.
icon="mdi-file-document-edit-outline"
label="Generation"
/>
<q-tab
name="About"
icon="mdi-alert-circle"
label="About"
/>
</q-tabs>
</template>

Expand All @@ -49,7 +40,7 @@ limitations under the License.
transition-prev="jump-up"
transition-next="jump-up"
>
<q-tab-panel name="user">
<q-tab-panel name="user">
<PreferenceUser />
</q-tab-panel>
<q-tab-panel name="package">
Expand All @@ -59,11 +50,6 @@ limitations under the License.
<q-tab-panel name="gen">
<PreferenceGeneration />
</q-tab-panel>
<q-tab-panel name="About">
<About />
</q-tab-panel>


</q-tab-panels>
</template>
</q-splitter>
Expand All @@ -73,14 +59,12 @@ limitations under the License.
import PreferencePackage from './PreferencePackage.vue'
import PreferenceGeneration from './PreferenceGeneration.vue'
import PreferenceUser from './PreferenceUser.vue'
import About from './About.vue'
export default {
name: 'Preference',
components: {
PreferencePackage,
PreferenceGeneration,
PreferenceUser,
About,
},
data() {
return {
Expand Down

0 comments on commit 3f7a9b0

Please sign in to comment.