@dative-gpi/foundation-core-components 1.1.3-groupings → 1.1.3-sandbox-1

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.
@@ -47,8 +47,6 @@ export default defineComponent({
47
47
  return defineAsyncComponent(() => import("../lists/locations/FSBaseLocationsList.vue"));
48
48
  case EntityType.Model:
49
49
  return defineAsyncComponent(() => import("../lists/models/FSBaseModelsList.vue"));
50
- case EntityType.Subgrouping:
51
- return defineAsyncComponent(() => import("../lists/subgroupings/FSBaseSubgroupingsList.vue"));
52
50
  default:
53
51
  return null;
54
52
  };
@@ -64,7 +64,7 @@
64
64
  import { defineComponent, type PropType, computed } from "vue";
65
65
 
66
66
  import { EntityType } from "@dative-gpi/foundation-shared-domain/enums";
67
- import type { DashboardOrganisationFilters, DashboardOrganisationTypeFilters, DashboardShallowFilters, DeviceOrganisationFilters, FolderFilters, GroupFilters, LocationFilters, ModelFilters, SubgroupingFilters, UserOrganisationFilters } from "@dative-gpi/foundation-core-domain/models";
67
+ import type { DashboardOrganisationFilters, DashboardOrganisationTypeFilters, DashboardShallowFilters, DeviceOrganisationFilters, FolderFilters, GroupFilters, LocationFilters, ModelFilters, UserOrganisationFilters } from "@dative-gpi/foundation-core-domain/models";
68
68
 
69
69
  import { TABLES as T } from "../../utils";
70
70
 
@@ -147,10 +147,6 @@ export default defineComponent({
147
147
  return {
148
148
  modelsIds: props.modelValue
149
149
  } satisfies ModelFilters;
150
- case EntityType.Subgrouping:
151
- return {
152
- subgroupingsIds: props.modelValue
153
- } satisfies SubgroupingFilters;
154
150
  default:
155
151
  return undefined;
156
152
  };
@@ -168,8 +164,6 @@ export default defineComponent({
168
164
  return T.LOCATIONS_SELECT;
169
165
  case EntityType.Model:
170
166
  return T.MODELS_SELECT;
171
- case EntityType.Subgrouping:
172
- return T.SUBGROUPINGS_SELECT;
173
167
  default:
174
168
  return null;
175
169
  };
@@ -214,11 +208,6 @@ export default defineComponent({
214
208
  modelsFilters: props.filters,
215
209
  ...attrs
216
210
  };
217
- case EntityType.Subgrouping:
218
- return {
219
- subgroupingFilters: props.filters,
220
- ...attrs
221
- };
222
211
  default:
223
212
  return null;
224
213
  };
@@ -43,8 +43,6 @@ export default defineComponent({
43
43
  return defineAsyncComponent(() => import("../lists/locations/FSSimpleLocationsList.vue"));
44
44
  case EntityType.Model:
45
45
  return defineAsyncComponent(() => import("../lists/models/FSSimpleModelsList.vue"));
46
- case EntityType.Subgrouping:
47
- return defineAsyncComponent(() => import("../lists/subgroupings/FSSimpleSubgroupingsList.vue"));
48
46
  default:
49
47
  return null;
50
48
  };
@@ -89,11 +87,6 @@ export default defineComponent({
89
87
  ...attrs,
90
88
  modelFilters : props.filters
91
89
  };
92
- case EntityType.Subgrouping:
93
- return {
94
- ...attrs,
95
- subgroupingFilters : props.filters
96
- };
97
90
  default:
98
91
  return null;
99
92
  }
@@ -115,25 +115,6 @@
115
115
  {{ item.ownerAddress ? item.ownerAddress.formattedAddress : '' }}
116
116
  </FSSpan>
117
117
  </template>
118
- <template
119
- #item.subgroupings="{ item }"
120
- >
121
- <FSSubgroupingsChipList
122
- :subgroupings="item.subgroupings"
123
- />
124
- </template>
125
- <template
126
- #filter.subgroupings="{ filter }"
127
- >
128
- <FSSubgroupingChip
129
- v-if="filter.value && subgroupingMap[filter.value]"
130
- :groupingLabel="subgroupingMap[filter.value].groupingLabel"
131
- :groupingIcon="subgroupingMap[filter.value].groupingIcon"
132
- :groupingColor="subgroupingMap[filter.value].groupingColor"
133
- :label="subgroupingMap[filter.value].label"
134
- :icon="subgroupingMap[filter.value].icon"
135
- />
136
- </template>
137
118
  <template
138
119
  #item.actions="{ item }"
139
120
  >
@@ -207,19 +188,15 @@ import FSDeviceOrganisationTileUI from "@dative-gpi/foundation-shared-components
207
188
  import FSStatusesCarousel from "@dative-gpi/foundation-shared-components/components/deviceOrganisations/FSStatusesCarousel.vue";
208
189
  import FSConnectivity from "@dative-gpi/foundation-shared-components/components/deviceOrganisations/FSConnectivity.vue";
209
190
  import FSWorstAlert from "@dative-gpi/foundation-shared-components/components/deviceOrganisations/FSWorstAlert.vue";
210
- import FSSubgroupingChip from "@dative-gpi/foundation-shared-components/components/FSSubgroupingChip.vue";
211
191
  import FSIconCheck from "@dative-gpi/foundation-shared-components/components/FSIconCheck.vue";
212
192
  import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
213
193
  import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
214
194
  import FSSpan from '@dative-gpi/foundation-shared-components/components/FSSpan.vue';
215
- import FSSubgroupingsChipList from "../subgroupings/FSSubgroupingsChipList.vue";
216
195
 
217
196
  export default defineComponent({
218
197
  name: "FSBaseDeviceOrganisationsList",
219
198
  components: {
220
199
  FSDeviceOrganisationTileUI,
221
- FSSubgroupingsChipList,
222
- FSSubgroupingChip,
223
200
  FSStatusesCarousel,
224
201
  FSConnectivity,
225
202
  FSWorstAlert,
@@ -284,33 +261,7 @@ export default defineComponent({
284
261
  return entities.value;
285
262
  });
286
263
 
287
- const subgroupingFilters = computed(() => {
288
- const filters: { value: string | null, text: string }[] = [{
289
- value: null,
290
- text: "—"
291
- }];
292
-
293
- const uniqueSubgroupings = _.uniqBy(
294
- entities.value.flatMap(device => device.subgroupings),
295
- 'id'
296
- );
297
-
298
- filters.push(...uniqueSubgroupings.map(subgrouping => ({
299
- value: subgrouping.id,
300
- text: `${subgrouping.groupingLabel} - ${subgrouping.label}`
301
- })));
302
-
303
- return filters.sort((a, b) => a.text.localeCompare(b.text));
304
- });
305
-
306
- const subgroupingMap = computed(() => {
307
- return _.chain(entities.value)
308
- .flatMap(device => device.subgroupings)
309
- .keyBy('id')
310
- .value();
311
- });
312
-
313
- const headersOptions = computed((): Record<string, any> => ({
264
+ const headersOptions = computed(() => ({
314
265
  status: {
315
266
  fixedFilters: [{
316
267
  value: true,
@@ -388,16 +339,6 @@ export default defineComponent({
388
339
  },
389
340
  sort: (a: DeviceOrganisationAlert, b: DeviceOrganisationAlert) => alphanumericSort(a?.criticity, b?.criticity)
390
341
  },
391
- subgroupings: {
392
- fixedFilters: subgroupingFilters.value,
393
- methodFilterRaw: (value: string | null, item: DeviceOrganisationInfos) => {
394
- if (!value) {
395
- return item.subgroupings.length === 0;
396
- }
397
- return item.subgroupings.some(s => s.id === value);
398
- },
399
- sort: (a: any[], b: any[]) => a.length - b.length
400
- },
401
342
  ...customProperties.value.reduce((acc, cp) => ({
402
343
  ...acc,
403
344
  [`meta.${cp.code}`]: {
@@ -441,7 +382,6 @@ export default defineComponent({
441
382
  deviceOrganisations,
442
383
  ConnectivityStatus,
443
384
  customProperties,
444
- subgroupingMap,
445
385
  headersOptions,
446
386
  isSelected
447
387
  };
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "url": "https://github.com/Dative-GPI/foundation-shared-ui.git"
5
5
  },
6
6
  "sideEffects": false,
7
- "version": "1.1.3-groupings",
7
+ "version": "1.1.3-sandbox-1",
8
8
  "description": "",
9
9
  "publishConfig": {
10
10
  "access": "public"
@@ -13,11 +13,11 @@
13
13
  "author": "",
14
14
  "license": "ISC",
15
15
  "dependencies": {
16
- "@dative-gpi/foundation-core-domain": "1.1.3-groupings",
17
- "@dative-gpi/foundation-core-services": "1.1.3-groupings",
18
- "@dative-gpi/foundation-shared-components": "1.1.3-groupings",
19
- "@dative-gpi/foundation-shared-domain": "1.1.3-groupings",
20
- "@dative-gpi/foundation-shared-services": "1.1.3-groupings"
16
+ "@dative-gpi/foundation-core-domain": "1.1.3-sandbox-1",
17
+ "@dative-gpi/foundation-core-services": "1.1.3-sandbox-1",
18
+ "@dative-gpi/foundation-shared-components": "1.1.3-sandbox-1",
19
+ "@dative-gpi/foundation-shared-domain": "1.1.3-sandbox-1",
20
+ "@dative-gpi/foundation-shared-services": "1.1.3-sandbox-1"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -29,5 +29,5 @@
29
29
  "sass": "1.71.1",
30
30
  "sass-loader": "13.3.2"
31
31
  },
32
- "gitHead": "ad40c30f9ecd5b50de62619fa3cfab64e63d7cc5"
32
+ "gitHead": "8857dc338d7d3ec5f09ce9f67b0b359ae25e8e40"
33
33
  }
package/utils/tables.ts CHANGED
@@ -22,7 +22,6 @@ export const GROUPS_SELECT = "ui.tables.group.select";
22
22
  export const LOCATIONS_SELECT = "ui.tables.location.select";
23
23
  export const MODELS_SELECT = "ui.tables.model.select";
24
24
  export const DASHBOARDS_SELECT = "ui.tables.dashboard-mock.select";
25
- export const SUBGROUPINGS_SELECT = "ui.tables.subgrouping.select";
26
25
 
27
26
  export const WIDGET_DASHBOARDS_EXPLORER = "ui.tables.folder-mock.widget";
28
27
 
@@ -1,179 +0,0 @@
1
- <template>
2
- <FSDataTable
3
- :loading="fetchingSubgroupings"
4
- :items="subgroupings"
5
- :itemTo="$props.itemTo"
6
- :tableCode="$props.tableCode"
7
- :selectable="$props.selectable"
8
- :showSearch="true"
9
- :disableIterator="true"
10
- :singleSelect="$props.singleSelect"
11
- :groupBy="groupBy"
12
- :modelValue="$props.modelValue"
13
- @update:modelValue="$emit('update:modelValue', $event)"
14
- v-bind="$attrs"
15
- >
16
- <template
17
- v-for="(_, name) in $slots"
18
- v-slot:[name]="slotData"
19
- >
20
- <slot
21
- :name="name"
22
- v-bind="slotData"
23
- />
24
- </template>
25
- <template
26
- #group-header="{ item }"
27
- >
28
- <FSRow
29
- height="54px"
30
- padding="16px 16px 16px 56px"
31
- align="center-left"
32
- :style="{ backgroundColor: getColors(ColorEnum.Light).base }"
33
- >
34
- <FSGroupingChip
35
- :label="getGroupingLabel(item.value)"
36
- :iconColor="getGroupingColor(item.value)"
37
- :icon="getGroupingIcon(item.value)"
38
- />
39
- </FSRow>
40
- </template>
41
- <template
42
- #item.icon="{ item }"
43
- >
44
- <FSIcon>
45
- {{ item.icon }}
46
- </FSIcon>
47
- </template>
48
- <template
49
- #item.tile="{ item, toggleSelect }"
50
- >
51
- <FSSubgroupingTileUI
52
- :selectable="$props.selectable"
53
- :modelValue="isSelected(item.id)"
54
- :singleSelect="$props.singleSelect"
55
- :deviceOrganisationsCount="item.deviceOrganisationsCount"
56
- :label="item.label"
57
- :icon="item.icon"
58
- :to="$props.itemTo && $props.itemTo(item)"
59
- @update:modelValue="toggleSelect(item)"
60
- />
61
- </template>
62
- </FSDataTable>
63
- </template>
64
-
65
- <script lang="ts">
66
- import { computed, defineComponent, type PropType, watch } from "vue";
67
- import { type RouteLocation } from "vue-router";
68
- import _ from "lodash";
69
-
70
- import type { SubgroupingFilters, SubgroupingInfos } from "@dative-gpi/foundation-core-domain/models";
71
- import { useSubgroupings } from "@dative-gpi/foundation-core-services/composables";
72
-
73
- import FSDataTable from "../FSDataTable.vue";
74
-
75
- import FSSubgroupingTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSSubgroupingTileUI.vue";
76
- import FSGroupingChip from "@dative-gpi/foundation-shared-components/components/FSGroupingChip.vue";
77
- import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
78
- import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
79
-
80
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
81
- import { useColors } from "@dative-gpi/foundation-shared-components/composables";
82
-
83
- export default defineComponent({
84
- name: "FSBaseSubgroupingsList",
85
- components: {
86
- FSSubgroupingTileUI,
87
- FSGroupingChip,
88
- FSDataTable,
89
- FSIcon,
90
- FSRow
91
- },
92
- props: {
93
- tableCode: {
94
- type: String as PropType<string | null>,
95
- required: false,
96
- default: null
97
- },
98
- itemTo: {
99
- type: Function as PropType<(item: SubgroupingInfos) => Partial<RouteLocation>>,
100
- required: false
101
- },
102
- subgroupingFilters: {
103
- type: Object as PropType<SubgroupingFilters>,
104
- required: false,
105
- default: null
106
- },
107
- selectable: {
108
- type: Boolean,
109
- required: false,
110
- default: true
111
- },
112
- singleSelect: {
113
- type: Boolean,
114
- required: false,
115
- default: false
116
- },
117
- modelValue: {
118
- type: Array as PropType<string[]>,
119
- required: false,
120
- default: () => []
121
- }
122
- },
123
- emits: ["update:modelValue"],
124
- setup(props) {
125
- const { getMany: fetchSubgroupings, fetching: fetchingSubgroupings, entities: subgroupings } = useSubgroupings();
126
- const { getColors } = useColors();
127
-
128
- const groupBy = computed(() => ({
129
- key: "groupingId",
130
- order: "asc" as const
131
- }));
132
-
133
- const groupingMap = computed(() => {
134
- return _.chain(subgroupings.value)
135
- .keyBy('groupingId')
136
- .mapValues(s => ({
137
- label: s.groupingLabel,
138
- color: s.groupingColor,
139
- icon: s.groupingIcon
140
- }))
141
- .value();
142
- });
143
-
144
- const getGroupingLabel = (groupingId: string): string => {
145
- return groupingMap.value[groupingId]?.label ?? "";
146
- };
147
-
148
- const getGroupingColor = (groupingId: string): string => {
149
- return groupingMap.value[groupingId]?.color ?? "";
150
- };
151
-
152
- const getGroupingIcon = (groupingId: string): string => {
153
- return groupingMap.value[groupingId]?.icon ?? "";
154
- };
155
-
156
- const isSelected = (id: string) => {
157
- return props.modelValue.includes(id);
158
- };
159
-
160
- watch(() => props.subgroupingFilters, (next, previous) => {
161
- if ((!next && !previous) || !_.isEqual(next, previous)) {
162
- fetchSubgroupings(props.subgroupingFilters);
163
- }
164
- }, { immediate: true });
165
-
166
- return {
167
- fetchingSubgroupings,
168
- getGroupingLabel,
169
- getGroupingColor,
170
- getGroupingIcon,
171
- subgroupings,
172
- isSelected,
173
- getColors,
174
- ColorEnum,
175
- groupBy
176
- };
177
- }
178
- });
179
- </script>
@@ -1,44 +0,0 @@
1
- <template>
2
- <FSSimpleList
3
- :items="subgroupings"
4
- :loading="fetching"
5
- v-bind="$attrs"
6
- />
7
- </template>
8
-
9
- <script lang="ts">
10
- import { defineComponent, type PropType, watch } from "vue";
11
-
12
- import type { SubgroupingFilters } from "@dative-gpi/foundation-core-domain/models";
13
- import { useSubgroupings } from "@dative-gpi/foundation-core-services/composables";
14
-
15
- import FSSimpleList from "@dative-gpi/foundation-shared-components/components/lists/FSSimpleList.vue";
16
-
17
- export default defineComponent({
18
- name: "FSSimpleSubgroupingsList",
19
- components: {
20
- FSSimpleList,
21
- },
22
- props: {
23
- subgroupingFilters: {
24
- type: Object as PropType<SubgroupingFilters>,
25
- required: false,
26
- default: () => ({})
27
- }
28
- },
29
- setup(props) {
30
- const { entities: subgroupings, getMany, fetching } = useSubgroupings();
31
-
32
- const fetch = () => {
33
- getMany(props.subgroupingFilters);
34
- };
35
-
36
- watch(() => props.subgroupingFilters, fetch, { immediate: true });
37
-
38
- return {
39
- subgroupings,
40
- fetching
41
- };
42
- }
43
- });
44
- </script>
@@ -1,45 +0,0 @@
1
- <template>
2
- <FSChipGroup
3
- v-if="$props.subgroupings && $props.subgroupings.length > 0"
4
- :variant="$props.variant"
5
- >
6
- <FSSubgroupingChip
7
- v-for="(item, index) in $props.subgroupings"
8
- :key="index"
9
- :groupingLabel="item.groupingLabel"
10
- :groupingIcon="item.groupingIcon"
11
- :groupingColor="item.groupingColor"
12
- :label="item.label"
13
- :icon="item.icon"
14
- />
15
- </FSChipGroup>
16
- </template>
17
-
18
- <script lang="ts">
19
- import type { PropType} from "vue";
20
- import { defineComponent } from "vue";
21
-
22
- import type { SubgroupingInfos } from "@dative-gpi/foundation-core-domain/models";
23
-
24
- import FSSubgroupingChip from "@dative-gpi/foundation-shared-components/components/FSSubgroupingChip.vue";
25
- import FSChipGroup from "@dative-gpi/foundation-shared-components/components/FSChipGroup.vue";
26
-
27
- export default defineComponent({
28
- name: "FSSubgroupingsChipList",
29
- components: {
30
- FSSubgroupingChip,
31
- FSChipGroup
32
- },
33
- props: {
34
- subgroupings: {
35
- type: Array as PropType<SubgroupingInfos[]>,
36
- required: true
37
- },
38
- variant: {
39
- type: String as PropType<"wrap" | "slide" | "menu">,
40
- required: false,
41
- default: "menu"
42
- }
43
- }
44
- });
45
- </script>