@dative-gpi/foundation-core-components 1.0.91 → 1.0.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@
3
3
  :items="chartOrganisationTypes"
4
4
  :itemTo="$props.itemTo"
5
5
  :loading="fetchingChartOrganisationTypes"
6
+ :headersOptions="headersOptions"
6
7
  :tableCode="$props.tableCode"
7
8
  :modelValue="$props.modelValue"
8
9
  @update:modelValue="$emit('update:modelValue', $event)"
@@ -50,6 +51,20 @@
50
51
  :tags="item.tags"
51
52
  />
52
53
  </template>
54
+ <template
55
+ #item.chartType="{ item }"
56
+ >
57
+ <FSRow
58
+ :wrap="false"
59
+ >
60
+ <FSIcon
61
+ :icon="chartIcon(item.chartType)"
62
+ />
63
+ <FSText>
64
+ {{ chartTypeLabel(item.chartType) }}
65
+ </FSText>
66
+ </FSRow>
67
+ </template>
53
68
  <template
54
69
  #item.modelsLabels="{ item }"
55
70
  >
@@ -74,22 +89,22 @@
74
89
  </template>
75
90
 
76
91
  <script lang="ts">
77
- import _ from "lodash";
78
- import { defineComponent, type PropType, watch } from "vue";
92
+ import { computed, defineComponent, type PropType, watch } from "vue";
79
93
  import type { RouteLocation } from "vue-router";
94
+ import _ from "lodash";
80
95
 
81
- import {ColorEnum} from "@dative-gpi/foundation-shared-components/models";
82
-
83
- import type { ChartOrganisationTypeFilters, ChartOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
84
-
96
+ import type { ChartModelLabel, ChartOrganisationTypeFilters, ChartOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
85
97
  import { useChartOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
98
+ import { chartTypeLabel, chartIcon } from "@dative-gpi/foundation-shared-components/tools";
99
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
86
100
 
87
101
  import FSChartTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSChartTileUI.vue";
88
- import FSDataTable from "../FSDataTable.vue";
89
102
  import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
90
103
  import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
91
104
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
92
105
 
106
+ import FSDataTable from "../FSDataTable.vue";
107
+
93
108
  export default defineComponent({
94
109
  name: "FSBaseChartOrganisationTypesList",
95
110
  components: {
@@ -122,9 +137,24 @@ export default defineComponent({
122
137
  },
123
138
  emits: ["update:modelValue"],
124
139
  setup(props) {
125
-
126
140
  const { entities: chartOrganisationTypes, fetching: fetchingChartOrganisationTypes, getMany: getManyChartOrganisationTypes } = useChartOrganisationTypes();
127
141
 
142
+ const headersOptions = computed(() => ({
143
+ modelsLabels: {
144
+ fixedFilters: chartOrganisationTypes.value.map(c => c.modelsLabels).reduce((acc, models) => {
145
+ for (const m of models) {
146
+ if (!acc.map((m) => m.id).includes(m.id)) {
147
+ acc.push(m);
148
+ }
149
+ }
150
+ return acc;
151
+ }, []).map((m) => ({
152
+ value: m.id,
153
+ text: m.label
154
+ })),
155
+ methodFilter: (value: string, items: ChartModelLabel[]) => items.some(ml => ml.id == value)
156
+ }}));
157
+
128
158
  const isSelected = (id: string): boolean => {
129
159
  return props.modelValue.includes(id);
130
160
  };
@@ -140,10 +170,13 @@ export default defineComponent({
140
170
  }, { immediate: true });
141
171
 
142
172
  return {
143
- ColorEnum,
144
173
  fetchingChartOrganisationTypes,
145
174
  chartOrganisationTypes,
146
- isSelected
175
+ headersOptions,
176
+ ColorEnum,
177
+ chartTypeLabel,
178
+ isSelected,
179
+ chartIcon
147
180
  };
148
181
  }
149
182
  });
@@ -3,6 +3,7 @@
3
3
  :items="chartOrganisations"
4
4
  :itemTo="$props.itemTo"
5
5
  :loading="fetchingChartOrganisations"
6
+ :headersOptions="headersOptions"
6
7
  :tableCode="$props.tableCode"
7
8
  :modelValue="$props.modelValue"
8
9
  @update:modelValue="$emit('update:modelValue', $event)"
@@ -70,25 +71,40 @@
70
71
  :to="$props.itemTo && $props.itemTo(item)"
71
72
  />
72
73
  </template>
74
+ <template
75
+ #item.chartType="{ item }"
76
+ >
77
+ <FSRow
78
+ :wrap="false"
79
+ >
80
+ <FSIcon
81
+ :icon="chartIcon(item.chartType)"
82
+ />
83
+ <FSText>
84
+ {{ chartTypeLabel(item.chartType) }}
85
+ </FSText>
86
+ </FSRow>
87
+ </template>
73
88
  </FSDataTable>
74
89
  </template>
75
90
 
76
91
  <script lang="ts">
77
- import { defineComponent, type PropType, watch } from "vue";
92
+ import { computed, defineComponent, type PropType, watch } from "vue";
78
93
  import type { RouteLocation } from "vue-router";
79
94
  import _ from "lodash";
80
95
 
81
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
82
-
83
- import { type ChartOrganisationFilters, type ChartOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
96
+ import type { ChartModelLabel, ChartOrganisationFilters, ChartOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
97
+ import { chartTypeLabel, chartIcon } from "@dative-gpi/foundation-shared-components/tools";
84
98
  import { useChartOrganisations } from "@dative-gpi/foundation-core-services/composables";
99
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
85
100
 
86
- import FSDataTable from "../FSDataTable.vue";
87
101
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
88
102
  import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
89
103
  import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
90
104
  import FSChartTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSChartTileUI.vue";
91
105
 
106
+ import FSDataTable from "../FSDataTable.vue";
107
+
92
108
  export default defineComponent({
93
109
  name: "FSBaseChartOrganisationsList",
94
110
  components: {
@@ -121,9 +137,25 @@ export default defineComponent({
121
137
  },
122
138
  emits: ["update:modelValue"],
123
139
  setup(props) {
124
-
125
140
  const { entities: chartOrganisations, fetching: fetchingChartOrganisations, getMany: getManyChartOrganisations } = useChartOrganisations();
126
141
 
142
+ const headersOptions = computed(() => ({
143
+ modelsLabels: {
144
+ fixedFilters: chartOrganisations.value.map(c => c.modelsLabels).reduce((acc, models) => {
145
+ for (const m of models) {
146
+ if (!acc.map((m) => m.id).includes(m.id)) {
147
+ acc.push(m);
148
+ }
149
+ }
150
+ return acc;
151
+ }, []).map((m) => ({
152
+ value: m.id,
153
+ text: m.label
154
+ })),
155
+ methodFilter: (value: string, items: ChartModelLabel[]) => items.some(ml => ml.id == value)
156
+ }}));
157
+
158
+
127
159
  const isSelected = (id: string): boolean => {
128
160
  return props.modelValue.includes(id);
129
161
  };
@@ -139,10 +171,13 @@ export default defineComponent({
139
171
  }, { immediate: true });
140
172
 
141
173
  return {
142
- ColorEnum,
143
174
  fetchingChartOrganisations,
144
175
  chartOrganisations,
145
- isSelected
176
+ headersOptions,
177
+ ColorEnum,
178
+ chartTypeLabel,
179
+ isSelected,
180
+ chartIcon
146
181
  };
147
182
  }
148
183
  });
@@ -2,6 +2,7 @@
2
2
  <FSDataTable
3
3
  defaultMode="iterator"
4
4
  :loading="fetchingChartOrganisationTypes || fetchingChartOrganisations"
5
+ :headersOptions="headersOptions"
5
6
  :items="charts"
6
7
  :tableCode="$props.tableCode"
7
8
  :modelValue="$props.modelValue"
@@ -50,6 +51,20 @@
50
51
  :tags="item.tags"
51
52
  />
52
53
  </template>
54
+ <template
55
+ #item.chartType="{ item }"
56
+ >
57
+ <FSRow
58
+ :wrap="false"
59
+ >
60
+ <FSIcon
61
+ :icon="chartIcon(item.chartType)"
62
+ />
63
+ <FSText>
64
+ {{ chartTypeLabel(item.chartType) }}
65
+ </FSText>
66
+ </FSRow>
67
+ </template>
53
68
  <template
54
69
  #item.modelsLabels="{ item }"
55
70
  >
@@ -78,16 +93,16 @@
78
93
  import { defineComponent, type PropType, watch, computed } from "vue";
79
94
  import _ from "lodash";
80
95
 
81
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
82
-
83
- import type { ChartOrganisationFilters, ChartOrganisationTypeFilters } from "@dative-gpi/foundation-core-domain/models";
84
-
96
+ import type { ChartModelLabel, ChartOrganisationFilters, ChartOrganisationTypeFilters } from "@dative-gpi/foundation-core-domain/models";
85
97
  import { useChartOrganisations, useChartOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
98
+ import { chartTypeLabel, chartIcon } from "@dative-gpi/foundation-shared-components/tools";
99
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
86
100
 
87
101
  import FSChartTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSChartTileUI.vue";
88
102
  import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
89
103
  import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
90
104
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
105
+
91
106
  import FSDataTable from "../FSDataTable.vue";
92
107
 
93
108
  export default defineComponent({
@@ -123,7 +138,6 @@ export default defineComponent({
123
138
  },
124
139
  emits: ["update:modelValue", "update:scope"],
125
140
  setup(props, { emit }) {
126
-
127
141
  const { entities: chartOrganisations, fetching: fetchingChartOrganisations, getMany: getManyChartOrganisations } = useChartOrganisations();
128
142
  const { entities: chartOrganisationTypes, fetching: fetchingChartOrganisationTypes, getMany: getManyChartOrganisationTypes } = useChartOrganisationTypes();
129
143
 
@@ -137,60 +151,69 @@ export default defineComponent({
137
151
  }
138
152
 
139
153
  const charts = computed(() => {
140
- return chartOrganisations.value.map(c => {
141
- return {
142
- id: c.id,
143
- imageId: c.imageId,
144
- chartId: c.chartId,
145
- chartCategoryId: c.chartCategoryId,
146
- chartCategoryLabel: c.chartCategoryLabel,
147
- scope: c.scope,
148
- label: c.label,
149
- title: c.title,
150
- code: c.code,
151
- icon: c.icon,
152
- tags: c.tags,
153
- multiple: c.multiple,
154
- chartType: c.chartType,
155
- modelsLabels: c.modelsLabels
156
- }
157
- })
158
- .concat(chartOrganisationTypes.value.map(c => {
159
- return {
160
- id: c.id,
161
- imageId: c.imageId,
162
- chartId: c.chartId,
163
- chartCategoryId: c.chartCategoryId,
164
- chartCategoryLabel: c.chartCategoryLabel,
165
- scope: c.scope,
166
- label: c.label,
167
- title: c.title,
168
- code: c.code,
169
- icon: c.icon,
170
- tags: c.tags,
171
- multiple: c.multiple,
172
- chartType: c.chartType,
173
- modelsLabels: c.modelsLabels
154
+ return chartOrganisations.value.map(c => ({
155
+ id: c.id,
156
+ imageId: c.imageId,
157
+ chartId: c.chartId,
158
+ chartCategoryId: c.chartCategoryId,
159
+ chartCategoryLabel: c.chartCategoryLabel,
160
+ scope: c.scope,
161
+ label: c.label,
162
+ title: c.title,
163
+ code: c.code,
164
+ icon: c.icon,
165
+ tags: c.tags,
166
+ multiple: c.multiple,
167
+ chartType: c.chartType,
168
+ modelsLabels: c.modelsLabels
169
+ })).concat(chartOrganisationTypes.value.map(c => ({
170
+ id: c.id,
171
+ imageId: c.imageId,
172
+ chartId: c.chartId,
173
+ chartCategoryId: c.chartCategoryId,
174
+ chartCategoryLabel: c.chartCategoryLabel,
175
+ scope: c.scope,
176
+ label: c.label,
177
+ title: c.title,
178
+ code: c.code,
179
+ icon: c.icon,
180
+ tags: c.tags,
181
+ multiple: c.multiple,
182
+ chartType: c.chartType,
183
+ modelsLabels: c.modelsLabels
184
+ })));
185
+ });
186
+
187
+ const headersOptions = computed(() => ({
188
+ modelsLabels: {
189
+ fixedFilters: chartOrganisationTypes.value.map(c => c.modelsLabels).reduce((acc, models) => {
190
+ for(const m of models){
191
+ if(!acc.map((m) => m.id).includes(m.id)){
192
+ acc.push(m);
193
+ }
174
194
  }
175
- }))
176
- })
195
+ return acc;
196
+ }, []).map((m) => ({
197
+ value: m.id,
198
+ text: m.label
199
+ })),
200
+ methodFilter: (value: string, items: ChartModelLabel[]) => items.some(ml => ml.id == value)
201
+ }}));
177
202
 
178
- const update = (value : string) =>
179
- {
203
+ const update = (value : string) => {
180
204
  const item = isSelected(value);
181
-
182
- if(item){
183
- onSelect(props.modelValue.filter(m => m != value))
205
+ if (item) {
206
+ onSelect(props.modelValue.filter(m => m != value));
184
207
  }
185
- else{
186
- onSelect([...props.modelValue, value])
208
+ else {
209
+ onSelect([...props.modelValue, value]);
187
210
  }
188
211
  }
189
212
 
190
213
  const onSelect = (values: string[] | null) => {
191
214
  if(!values){
192
- emit("update:modelValue", [])
193
- emit("update:scope", [])
215
+ emit("update:modelValue", []);
216
+ emit("update:scope", []);
194
217
  return;
195
218
  }
196
219
  const selectedItems = charts.value.filter(i => values.includes(i.id));
@@ -209,9 +232,12 @@ export default defineComponent({
209
232
  fetchingChartOrganisations,
210
233
  chartOrganisationTypes,
211
234
  chartOrganisations,
235
+ headersOptions,
212
236
  ColorEnum,
213
237
  charts,
238
+ chartTypeLabel,
214
239
  isSelected,
240
+ chartIcon,
215
241
  onSelect,
216
242
  update
217
243
  };
@@ -21,20 +21,24 @@
21
21
  :userImageId="currentUser?.imageId"
22
22
  />
23
23
  </FSRow>
24
- <FSCommentTileUI
25
- v-for="comment in orderedComments"
26
- :key="comment.id"
27
- :timestamp="epochToLongTimeFormat(comment.timestamp)"
28
- :userName="comment.userName"
29
- :userImageId="comment.userImageId"
30
- :canEditRemove="currentUser?.id === comment.userId"
31
- :comment="comment.comment"
32
- :edited="comment.edited"
33
- :removing="removing"
34
- :id="comment.id"
35
- @edit="updateComment"
36
- @remove="removeComment(comment.id)"
37
- />
24
+ <FSCol
25
+ gap="12px"
26
+ >
27
+ <FSCommentTileUI
28
+ v-for="comment in orderedComments"
29
+ :key="comment.id"
30
+ :timestamp="epochToLongTimeFormat(comment.timestamp)"
31
+ :userName="comment.userName"
32
+ :userImageId="comment.userImageId"
33
+ :canEditRemove="currentUser?.id === comment.userId"
34
+ :comment="comment.comment"
35
+ :edited="comment.edited"
36
+ :removing="removing"
37
+ :id="comment.id"
38
+ @edit="updateComment"
39
+ @remove="removeComment(comment.id)"
40
+ />
41
+ </FSCol>
38
42
  </FSCol>
39
43
  </template>
40
44
 
@@ -278,7 +278,14 @@ export default defineComponent({
278
278
  value: ConnectivityStatus.Connected,
279
279
  text: connectivityLabel(ConnectivityStatus.Connected)
280
280
  }],
281
- methodFilter: (value: ConnectivityStatus, item: DeviceConnectivityDetails) => !item.status && !value || item.status == value,
281
+ methodFilter: (value: ConnectivityStatus, item: DeviceConnectivityDetails) => {
282
+ switch(value) {
283
+ case ConnectivityStatus.None:
284
+ return !item.status;
285
+ default:
286
+ return item.status == value;
287
+ }
288
+ },
282
289
  sort: (a: DeviceConnectivityDetails, b: DeviceConnectivityDetails) => alphanumericSort(a?.status, b?.status)
283
290
  },
284
291
  connectivity: {
@@ -298,7 +305,14 @@ export default defineComponent({
298
305
  value: ConnectivityStatus.Connected,
299
306
  text: connectivityLabel(ConnectivityStatus.Connected)
300
307
  }],
301
- methodFilter: (value: ConnectivityStatus, item: DeviceConnectivityDetails) => !item.status && !value || item.status == value,
308
+ methodFilter: (value: ConnectivityStatus, item: DeviceConnectivityDetails) => {
309
+ switch(value) {
310
+ case ConnectivityStatus.None:
311
+ return !item.status;
312
+ default:
313
+ return item.status == value;
314
+ }
315
+ },
302
316
  sort: (a: DeviceConnectivityDetails, b: DeviceConnectivityDetails) => alphanumericSort(a?.status, b?.status)
303
317
  },
304
318
  worstAlert: {
@@ -316,9 +330,9 @@ export default defineComponent({
316
330
  }))): undefined,
317
331
  methodFilterRaw: (value: any, item: DeviceOrganisationInfos) => {
318
332
  if (cp.useOnlyAllowedValues) {
319
- return (!Object.keys(cp.allowedValues).includes(item.meta[cp.code])) && !value || item.meta[cp.code] === value;
333
+ return (!Object.keys(cp.allowedValues).includes(item.meta[cp.code])) && !value || item.meta[cp.code] == value
320
334
  }
321
- return !item.meta[cp.code] && !value || item.meta[cp.code] === value;
335
+ return item.meta[cp.code] == value
322
336
  },
323
337
  sort: (a: string, b: string) => alphanumericSort(a, b)
324
338
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-core-components",
3
3
  "sideEffects": false,
4
- "version": "1.0.91",
4
+ "version": "1.0.92",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,11 +10,11 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-core-domain": "1.0.91",
14
- "@dative-gpi/foundation-core-services": "1.0.91",
15
- "@dative-gpi/foundation-shared-components": "1.0.91",
16
- "@dative-gpi/foundation-shared-domain": "1.0.91",
17
- "@dative-gpi/foundation-shared-services": "1.0.91"
13
+ "@dative-gpi/foundation-core-domain": "1.0.92",
14
+ "@dative-gpi/foundation-core-services": "1.0.92",
15
+ "@dative-gpi/foundation-shared-components": "1.0.92",
16
+ "@dative-gpi/foundation-shared-domain": "1.0.92",
17
+ "@dative-gpi/foundation-shared-services": "1.0.92"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -26,5 +26,5 @@
26
26
  "sass": "1.71.1",
27
27
  "sass-loader": "13.3.2"
28
28
  },
29
- "gitHead": "996da7085e717a1b1c0a9e58d6d3cc40b4aadb2b"
29
+ "gitHead": "5b512a8eaedd84fb5f24896d01891a9a6c838ec5"
30
30
  }