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

Show the tootip with path to the json files so that user can distinguish the...

Show the tootip with path to the json files so that user can distinguish the packages when the name and description are the same (#1235)

JIRA: ZAPP-1288
上级 15f632a6
No related branches found
No related tags found
无相关合并请求
......@@ -80,23 +80,26 @@
</q-td>
<q-td key="category" :props="props">
<div>{{ props.row.category }}</div>
<q-tooltip :offset="[5, 5]">
{{ props.row.path }}
</q-tooltip>
</q-td>
<q-td key="description" :props="props">
<div>{{ props.row.description }}</div>
<q-tooltip :offset="[5, 5]">
{{ props.row.path }}
</q-tooltip>
</q-td>
<q-td key="version" :props="props">
<div>{{ props.row.version }}</div>
</q-td>
<q-td key="status" :props="props">
<div v-if="props.row.hasWarning
|| props.row.hasError">
<q-icon
class="cursor-pointer"
:name="props.row.hasError
? 'error' : 'warning'"
:color="props.row.hasError
? 'red' : 'orange'"
size="2.5em"
<div v-if="props.row.hasWarning || props.row.hasError">
<q-icon
class="cursor-pointer"
:name="props.row.hasError ? 'error' : 'warning'"
:color="props.row.hasError ? 'red' : 'orange'"
size="2.5em"
@click="propertyDataDialog[props.row.id] = true"
/>
<q-dialog v-model="propertyDataDialog[props.row.id]">
......@@ -104,40 +107,35 @@
<q-card-section>
<div class="row items-center">
<div class="col-1">
<q-icon
:name="props.row.hasError
? 'error' : 'warning'"
:color="props.row.hasError
? 'red' : 'orange'"
size="2em"
<q-icon
:name="
props.row.hasError ? 'error' : 'warning'
"
:color="
props.row.hasError ? 'red' : 'orange'
"
size="2em"
/>
</div>
<div class="text-h6 col">
{{ props.row.description }}
{{ props.row.description }}
</div>
<div class="col-1 text-right">
<q-btn
dense
flat
icon="close"
v-close-popup
>
<q-btn dense flat icon="close" v-close-popup>
<q-tooltip>Close</q-tooltip>
</q-btn>
</div>
</div>
<div v-if="props.row.hasError">
<div
class="text-h6"
style="margin-top: 15px;
padding-left: 20px"
<div
class="text-h6"
style="margin-top: 15px; padding-left: 20px"
>
Errors
</div>
<ul>
<li
v-for="(error, index) in
props.row.errors"
<li
v-for="(error, index) in props.row.errors"
:key="'error' + index"
style="margin-bottom: 10px"
>
......@@ -146,17 +144,16 @@
</ul>
</div>
<div v-if="props.row.hasWarning">
<div
class="text-h6"
style="margin-top: 15px;
padding-left: 20px"
<div
class="text-h6"
style="margin-top: 15px; padding-left: 20px"
>
Warnings
</div>
<ul>
<li
v-for="(warning, index) in
props.row.warnings"
<li
v-for="(warning, index) in props.row
.warnings"
:key="index"
style="margin-bottom: 10px"
>
......@@ -168,11 +165,11 @@
</q-card>
</q-dialog>
</div>
<q-icon
v-else
name="check_circle"
color="green"
size="2em"
<q-icon
v-else
name="check_circle"
color="green"
size="2em"
/>
</q-td>
</q-tr>
......@@ -216,23 +213,26 @@
</q-td>
<q-td key="category" :props="props">
<div>{{ props.row.category }}</div>
<q-tooltip :offset="[5, 5]">
{{ props.row.path }}
</q-tooltip>
</q-td>
<q-td key="description" :props="props">
<div>{{ props.row.description }}</div>
<q-tooltip :offset="[5, 5]">
{{ props.row.path }}
</q-tooltip>
</q-td>
<q-td key="version" :props="props">
<div>{{ props.row.version }}</div>
</q-td>
<q-td key="status" :props="props">
<div v-if="props.row.hasWarning
|| props.row.hasError">
<q-icon
class="cursor-pointer"
:name="props.row.hasError
? 'error' : 'warning'"
:color="props.row.hasError
? 'red' : 'orange'"
size="2.5em"
<div v-if="props.row.hasWarning || props.row.hasError">
<q-icon
class="cursor-pointer"
:name="props.row.hasError ? 'error' : 'warning'"
:color="props.row.hasError ? 'red' : 'orange'"
size="2.5em"
@click="genDataDialog[props.row.id] = true"
></q-icon>
<q-dialog v-model="genDataDialog[props.row.id]">
......@@ -240,40 +240,35 @@
<q-card-section>
<div class="row items-center">
<div class="col-1">
<q-icon
:name="props.row.hasError
? 'error' : 'warning'"
:color="props.row.hasError
? 'red' : 'orange'"
size="2em"
<q-icon
:name="
props.row.hasError ? 'error' : 'warning'
"
:color="
props.row.hasError ? 'red' : 'orange'
"
size="2em"
/>
</div>
<div class="text-h6 col">
{{ props.row.description }}
{{ props.row.description }}
</div>
<div class="col-1 text-right">
<q-btn
dense
flat
icon="close"
v-close-popup
>
<q-btn dense flat icon="close" v-close-popup>
<q-tooltip>Close</q-tooltip>
</q-btn>
</div>
</div>
<div v-if="props.row.hasError">
<div
class="text-h6"
style="margin-top: 15px;
padding-left: 20px"
<div
class="text-h6"
style="margin-top: 15px; padding-left: 20px"
>
Errors
</div>
<ul>
<li
v-for="(error, index) in
props.row.errors"
<li
v-for="(error, index) in props.row.errors"
:key="'error' + index"
style="margin-bottom: 10px"
>
......@@ -282,17 +277,16 @@
</ul>
</div>
<div v-if="props.row.hasWarning">
<div
class="text-h6"
style="margin-top: 15px;
padding-left: 20px"
<div
class="text-h6"
style="margin-top: 15px; padding-left: 20px"
>
Warnings
</div>
<ul>
<li
v-for="(warning, index) in
props.row.warnings"
<li
v-for="(warning, index) in props.row
.warnings"
:key="index"
style="margin-bottom: 10px"
>
......@@ -304,11 +298,11 @@
</q-card>
</q-dialog>
</div>
<q-icon
v-else
name="check_circle"
color="green"
size="2em"
<q-icon
v-else
name="check_circle"
color="green"
size="2em"
/>
</q-td>
</q-tr>
......@@ -558,37 +552,40 @@ export default {
},
// classify all notifications by type and package ref
classifyMessages(data) {
return data.reduce((map, row) => {
const key = row.type === 'ERROR' ? 'errorMap' : 'warningMap';
if (!map[key][row.ref]) {
map[key][row.ref] = [];
}
map[key][row.ref].push(row.message);
return map;
}, { warningMap: {}, errorMap: {} });
return data.reduce(
(map, row) => {
const key = row.type === 'ERROR' ? 'errorMap' : 'warningMap'
if (!map[key][row.ref]) {
map[key][row.ref] = []
}
map[key][row.ref].push(row.message)
return map
},
{ warningMap: {}, errorMap: {} }
)
},
// then assign classfied notifications to proper packages
assignWarningsAndErrors(data, warningMap, errorMap) {
data.forEach((row) => {
if (warningMap[row.id]) {
row.hasWarning = true;
row.warnings = warningMap[row.id];
row.hasWarning = true
row.warnings = warningMap[row.id]
} else {
row.hasWarning = false;
row.warnings = [];
row.hasWarning = false
row.warnings = []
}
if (errorMap[row.id]) {
row.hasError = true;
row.errors = errorMap[row.id];
row.hasError = true
row.errors = errorMap[row.id]
} else {
row.hasError = false;
row.errors = [];
row.hasError = false
row.errors = []
}
// set up var for dialog component of each package
this.propertyDataDialog[row.id] = false;
this.genDataDialog[row.id] = false;
this.propertyDataDialog[row.id] = false
this.genDataDialog[row.id] = false
})
}
},
},
created() {
this.$serverPost(restApi.uri.sessionAttempt, this.path).then((result) => {
......@@ -625,13 +622,17 @@ export default {
id: item.sessionId,
})
})
// load package notification data, and assign to both zclProperty & zclGen packages
this.$serverGet(restApi.uri.packageNotification)
.then((resp) => {
const { warningMap, errorMap } = this.classifyMessages(resp.data);
this.assignWarningsAndErrors(this.zclPropertiesRow, warningMap, errorMap);
this.assignWarningsAndErrors(this.zclGenRow, warningMap, errorMap);
const { warningMap, errorMap } = this.classifyMessages(resp.data)
this.assignWarningsAndErrors(
this.zclPropertiesRow,
warningMap,
errorMap
)
this.assignWarningsAndErrors(this.zclGenRow, warningMap, errorMap)
})
.catch((err) => {
console.log(err)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册