@ax2/xms-dashboard-module
Advanced tools
+2
-2
| { | ||
| "name": "@ax2/xms-dashboard-module", | ||
| "version": "0.2.4-alpha.68+1e94eb3", | ||
| "version": "0.2.4-alpha.69+82c6994", | ||
| "main": "src/main.js", | ||
@@ -43,3 +43,3 @@ "publishConfig": { | ||
| }, | ||
| "gitHead": "1e94eb369661bcafa1f5a076303b1a51fe5e2297" | ||
| "gitHead": "82c699460509c4908a832c508f8d57fa5b75f7ea" | ||
| } |
| <template> | ||
| <WidgetTemplate | ||
| :title="title" | ||
| :loading="$apolloData.queries.datas.loading" | ||
| :loading="isLoading" | ||
| :filters="filters" | ||
@@ -9,3 +9,3 @@ @updateFilters="updateFilters" | ||
| <apexchart | ||
| v-if="!$apolloData.queries.datas.loading" | ||
| v-if="!isLoading && datas && isEmpty !== true" | ||
| :options="datas.options" | ||
@@ -15,2 +15,8 @@ :series="datas.series" | ||
| /> | ||
| <p v-else-if="!isLoading && error"> | ||
| {{ error }} | ||
| </p> | ||
| <p v-else-if="!isLoading && isEmpty"> | ||
| No data to display | ||
| </p> | ||
| </WidgetTemplate> | ||
@@ -49,3 +55,2 @@ </template> | ||
| show: false, | ||
| loading: true, | ||
| responsive: [ | ||
@@ -59,4 +64,5 @@ { | ||
| } | ||
| } | ||
| }, | ||
| ], | ||
| error: null, | ||
| query: ` | ||
@@ -85,2 +91,6 @@ query Query($query: String, $chartType: String, $groupByVariable: String, $labels: [String]){ | ||
| result (data) { | ||
| if (data.error) { | ||
| this.error = data.error; | ||
| return; | ||
| } | ||
| data.data.datas.options = { ...data.data.datas.options, ...{ legend: { position: 'bottom'} } }; | ||
@@ -115,2 +125,13 @@ return data.data.datas; | ||
| }, | ||
| isLoading () { | ||
| return this.$apolloData.queries.datas.loading; | ||
| }, | ||
| isEmpty () { | ||
| switch (this.options.type) { | ||
| case 'area': | ||
| case 'pie': | ||
| return get(this.datas, 'options.xaxis.categories', []).length === 0 && get(this.datas, 'series[0].data', []).length === 0; | ||
| } | ||
| return false; | ||
| } | ||
| }, | ||
@@ -117,0 +138,0 @@ beforeDestroy () { |
@@ -37,2 +37,7 @@ <template> | ||
| }, | ||
| entity: { | ||
| type: String, | ||
| required: false, | ||
| default: null, | ||
| }, | ||
| query: { | ||
@@ -68,3 +73,3 @@ type: String, | ||
| return { | ||
| text: header, | ||
| text: this.entity && this.$t(`${this.entity}.${header}`) !== `${this.entity}.${header}` ? this.$t(`${this.entity}.${header}`) : this.$t(header), | ||
| value: header | ||
@@ -78,5 +83,3 @@ }; | ||
| }, | ||
| methods: { | ||
| }, | ||
| }; | ||
| </script> |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
20097
3.87%