@dative-gpi/foundation-core-components 1.0.56 → 1.0.58-groupings

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.
Files changed (82) hide show
  1. package/components/autocompletes/FSAutocompleteChart.vue +15 -8
  2. package/components/autocompletes/FSAutocompleteDashboard.vue +14 -6
  3. package/components/autocompletes/FSAutocompleteDashboardOrganisation.vue +7 -1
  4. package/components/autocompletes/FSAutocompleteDataCategory.vue +11 -5
  5. package/components/autocompletes/FSAutocompleteDataDefinition.vue +7 -1
  6. package/components/autocompletes/FSAutocompleteGroup.vue +7 -1
  7. package/components/autocompletes/FSAutocompleteLocation.vue +6 -0
  8. package/components/autocompletes/FSAutocompleteManufacturer.vue +8 -0
  9. package/components/autocompletes/FSAutocompleteModel.vue +9 -1
  10. package/components/autocompletes/FSAutocompleteOrganisationType.vue +7 -1
  11. package/components/autocompletes/FSAutocompleteRole.vue +14 -6
  12. package/components/autocompletes/FSAutocompleteServiceAccountRoleOrganisation.vue +7 -1
  13. package/components/autocompletes/FSAutocompleteUserOrganisation.vue +9 -1
  14. package/components/customProperties/FSMetaField.vue +35 -40
  15. package/components/customProperties/FSMetaFormContent.vue +4 -3
  16. package/components/customProperties/FSMetaHistory.vue +2 -2
  17. package/components/customProperties/FSMetaValue.vue +63 -31
  18. package/components/customProperties/helpers.ts +57 -165
  19. package/components/entities/FSBaseEntitiesList.vue +14 -4
  20. package/components/entities/FSDialogSelectEntities.vue +28 -106
  21. package/components/entities/FSEntityField.vue +75 -14
  22. package/components/entities/FSSelectEntitiesList.vue +225 -0
  23. package/components/explorers/FSBaseDevicesExplorer.vue +312 -0
  24. package/components/explorers/FSBaseFoldersExplorer.vue +286 -0
  25. package/components/lists/FSDataTable.vue +23 -21
  26. package/components/lists/alerts/FSBaseAlertsList.vue +95 -97
  27. package/components/lists/alerts/FSButtonAcknowledgeAlert.vue +4 -4
  28. package/components/lists/authTokens/FSBaseAuthTokensList.vue +6 -4
  29. package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +103 -38
  30. package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +104 -39
  31. package/components/lists/charts/FSBaseChartsList.vue +147 -66
  32. package/components/lists/comments/FSBaseCommentsList.vue +39 -23
  33. package/components/lists/connectivityScenarios/FSBaseConnectivityScenariosList.vue +128 -0
  34. package/components/lists/dashboardOrganisationTypes/FSBaseDashboardOrganisationTypesList.vue +39 -7
  35. package/components/lists/dashboards/FSBaseDashboardsList.vue +44 -13
  36. package/components/lists/dashboards/FSSimpleDashboardsList.vue +33 -7
  37. package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +6 -5
  38. package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +6 -4
  39. package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +179 -61
  40. package/components/lists/folders/FSBaseFoldersList.vue +37 -146
  41. package/components/lists/groupings/FSBaseGroupingsList.vue +117 -0
  42. package/components/lists/groups/FSBaseGroupsList.vue +24 -7
  43. package/components/lists/locations/FSBaseLocationsList.vue +52 -13
  44. package/components/lists/models/FSBaseModelsList.vue +45 -15
  45. package/components/lists/roleOrganisationTypes/FSBaseRoleOrganisationTypesList.vue +17 -10
  46. package/components/lists/roleOrganisations/FSBaseRoleOrganisationsList.vue +28 -21
  47. package/components/lists/scenarioOrganisationTypes/FSBaseScenarioOrganisationTypesList.vue +56 -13
  48. package/components/lists/scenarioOrganisations/FSBaseScenarioOrganisationsList.vue +56 -12
  49. package/components/lists/scenarios/FSBaseScenariosList.vue +122 -81
  50. package/components/lists/serviceAccountOrganisations/FSBaseServiceAccountOrganisationsList.vue +31 -18
  51. package/components/lists/serviceAccountRoleOrganisations/FSBaseServiceAccountRoleOrganisationsList.vue +128 -0
  52. package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +30 -19
  53. package/components/lists/userOrganisations/FSChipUserOrganisationsList.vue +61 -0
  54. package/components/tiles/FSChartTile.vue +71 -0
  55. package/components/tiles/FSDashboardOrganisationTile.vue +3 -3
  56. package/components/tiles/FSDashboardOrganisationTypeTile.vue +3 -3
  57. package/components/tiles/FSDashboardShallowTile.vue +3 -3
  58. package/components/tiles/FSDeviceOrganisationTile.vue +12 -5
  59. package/components/tiles/FSFolderTile.vue +3 -3
  60. package/components/tiles/FSGroupTile.vue +3 -3
  61. package/components/tiles/FSLocationTile.vue +5 -3
  62. package/components/tiles/FSModelTile.vue +64 -0
  63. package/components/tiles/FSServiceAccountOrganisationTile.vue +3 -3
  64. package/components/tiles/FSUserOrganisationTile.vue +3 -3
  65. package/components/treeviews/FSTreeViewFolder.vue +15 -3
  66. package/components/treeviews/FSTreeViewGroup.vue +22 -4
  67. package/package.json +9 -9
  68. package/utils/dashboards.ts +3 -3
  69. package/utils/index.ts +0 -1
  70. package/utils/roles.ts +3 -3
  71. package/utils/users.ts +3 -3
  72. package/components/selects/FSAggregationSelector.vue +0 -51
  73. package/components/selects/FSAxisTypeSelector.vue +0 -48
  74. package/components/selects/FSDisplayAsSelector.vue +0 -52
  75. package/components/selects/FSFilterTypeSelector.vue +0 -53
  76. package/components/selects/FSHeatmapRuleSelector.vue +0 -52
  77. package/components/selects/FSOperationOnSelector.vue +0 -51
  78. package/components/selects/FSPlanningTypeSelector.vue +0 -51
  79. package/components/selects/FSPlotPerSelector.vue +0 -51
  80. package/components/selects/FSSelectEntityType.vue +0 -59
  81. package/components/selects/FSSerieTypeSelector.vue +0 -51
  82. package/utils/charts.ts +0 -137
@@ -3,8 +3,9 @@
3
3
  :items="scenarioOrganisationTypes"
4
4
  :itemTo="$props.itemTo"
5
5
  :loading="fetchingScenarioOrganisationTypes"
6
- :modelValue="$props.modelValue"
6
+ :selectable="$props.selectable"
7
7
  :tableCode="$props.tableCode"
8
+ :modelValue="$props.modelValue"
8
9
  @update:modelValue="$emit('update:modelValue', $event)"
9
10
  v-bind="$attrs"
10
11
  >
@@ -25,6 +26,23 @@
25
26
  {{ item.icon }}
26
27
  </FSIcon>
27
28
  </template>
29
+
30
+ <template
31
+ #item.criticity="{ item }"
32
+ >
33
+ <FSRow
34
+ align="center-left"
35
+ >
36
+ <FSIcon
37
+ :color="AlertTools.criticityColor(item.criticity)"
38
+ >
39
+ {{ AlertTools.criticityIcon(item.criticity) }}
40
+ </FSIcon>
41
+ <FSSpan>
42
+ {{ AlertTools.criticityLabel(item.criticity) }}
43
+ </FSSpan>
44
+ </FSRow>
45
+ </template>
28
46
 
29
47
  <template
30
48
  #item.imageId="{ item }"
@@ -34,6 +52,7 @@
34
52
  height="32px"
35
53
  width="32px"
36
54
  :imageId="item.imageId"
55
+ :thumbnail="true"
37
56
  />
38
57
  </template>
39
58
 
@@ -42,7 +61,7 @@
42
61
  >
43
62
  <FSTagGroup
44
63
  variant="slide"
45
- :editable="false"
64
+ :showRemove="false"
46
65
  :tags="item.tags"
47
66
  />
48
67
  </template>
@@ -50,10 +69,14 @@
50
69
  </template>
51
70
 
52
71
  <script lang="ts">
53
- import { defineComponent, type PropType, watch } from "vue";
72
+ import { computed, defineComponent, type PropType, watch } from "vue";
54
73
  import type { RouteLocation } from "vue-router";
55
74
  import _ from "lodash";
56
75
 
76
+ import { Criticity } from "@dative-gpi/foundation-shared-domain/enums";
77
+ import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
78
+ import { AlertTools } from "@dative-gpi/foundation-shared-components/tools";
79
+
57
80
  import type { ScenarioOrganisationTypeFilters, ScenarioOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
58
81
  import { useScenarioOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
59
82
 
@@ -61,39 +84,57 @@ import FSDataTable from "../FSDataTable.vue";
61
84
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
62
85
  import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
63
86
  import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
87
+ import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
64
88
 
65
89
  export default defineComponent({
66
90
  name: "FSBaseScenarioOrganisationTypesList",
67
91
  components: {
68
92
  FSDataTable,
69
- FSIcon,
93
+ FSTagGroup,
70
94
  FSImage,
71
- FSTagGroup
95
+ FSIcon,
96
+ FSRow,
72
97
  },
73
98
  props: {
74
- modelValue: {
75
- type: Array as PropType<string[]>,
76
- default: () => [],
77
- required: false
99
+ tableCode: {
100
+ type: String as PropType<string | null>,
101
+ required: false,
102
+ default: null
78
103
  },
79
104
  scenarioOrganisationTypeFilters: {
80
105
  type: Object as PropType<ScenarioOrganisationTypeFilters>,
81
106
  required: false,
82
107
  default: null
83
108
  },
84
- tableCode: {
85
- type: String,
86
- required: true
87
- },
88
109
  itemTo: {
89
110
  type: Function as PropType<(item: ScenarioOrganisationTypeInfos) => Partial<RouteLocation>>,
90
111
  required: false
91
112
  },
113
+ selectable: {
114
+ type: Boolean,
115
+ required: false,
116
+ default: true
117
+ },
118
+ modelValue: {
119
+ type: Array as PropType<string[]>,
120
+ default: () => [],
121
+ required: false
122
+ }
92
123
  },
93
124
  emits: ["update:modelValue"],
94
125
  setup(props) {
95
126
  const { entities: scenarioOrganisationTypes, fetching: fetchingScenarioOrganisationTypes, getMany: getManyScenarioOrganisationTypes } = useScenarioOrganisationTypes();
96
127
 
128
+ const headersOptions = computed(() => ({
129
+ criticity: {
130
+ fixedFilters: getEnumEntries(Criticity).map(e => ({
131
+ value: e.value,
132
+ text: AlertTools.criticityLabel(e.value)
133
+ })),
134
+ methodFilter: (value: Criticity, item: Criticity) => value == item
135
+ }
136
+ }));
137
+
97
138
  const isSelected = (id: string): boolean => {
98
139
  return props.modelValue.includes(id);
99
140
  };
@@ -107,6 +148,8 @@ export default defineComponent({
107
148
  return {
108
149
  fetchingScenarioOrganisationTypes,
109
150
  scenarioOrganisationTypes,
151
+ headersOptions,
152
+ AlertTools,
110
153
  isSelected
111
154
  };
112
155
  }
@@ -3,8 +3,10 @@
3
3
  :items="scenarioOrganisations"
4
4
  :itemTo="$props.itemTo"
5
5
  :loading="fetchingScenarioOrganisations"
6
- :modelValue="$props.modelValue"
6
+ :selectable="$props.selectable"
7
7
  :tableCode="$props.tableCode"
8
+ :modelValue="$props.modelValue"
9
+ :headersOptions="headersOptions"
8
10
  @update:modelValue="$emit('update:modelValue', $event)"
9
11
  v-bind="$attrs"
10
12
  >
@@ -26,12 +28,29 @@
26
28
  </FSIcon>
27
29
  </template>
28
30
 
31
+ <template
32
+ #item.criticity="{ item }"
33
+ >
34
+ <FSRow
35
+ align="center-left"
36
+ >
37
+ <FSIcon
38
+ :color="AlertTools.criticityColor(item.criticity)"
39
+ >
40
+ {{ AlertTools.criticityIcon(item.criticity) }}
41
+ </FSIcon>
42
+ <FSSpan>
43
+ {{ AlertTools.criticityLabel(item.criticity) }}
44
+ </FSSpan>
45
+ </FSRow>
46
+ </template>
47
+
29
48
  <template
30
49
  #item.tags="{ item }"
31
50
  >
32
51
  <FSTagGroup
33
52
  variant="slide"
34
- :editable="false"
53
+ :showRemove="false"
35
54
  :tags="item.tags"
36
55
  />
37
56
  </template>
@@ -39,48 +58,71 @@
39
58
  </template>
40
59
 
41
60
  <script lang="ts">
42
- import { defineComponent, type PropType, watch } from "vue";
61
+ import { computed, defineComponent, type PropType, watch } from "vue";
43
62
  import type { RouteLocation } from "vue-router";
44
63
  import _ from "lodash";
45
64
 
65
+ import { Criticity } from "@dative-gpi/foundation-shared-domain/enums";
66
+ import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
67
+ import { AlertTools } from "@dative-gpi/foundation-shared-components/tools";
68
+
46
69
  import type { ScenarioOrganisationFilters, ScenarioOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
47
70
  import { useScenarioOrganisations } from "@dative-gpi/foundation-core-services/composables";
48
71
 
49
72
  import FSDataTable from "../FSDataTable.vue";
50
73
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
51
74
  import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
75
+ import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
52
76
 
53
77
  export default defineComponent({
54
78
  name: "FSBaseScenarioOrganisationsList",
55
79
  components: {
56
80
  FSDataTable,
81
+ FSTagGroup,
57
82
  FSIcon,
58
- FSTagGroup
83
+ FSRow
59
84
  },
60
85
  props: {
61
- modelValue: {
62
- type: Array as PropType<string[]>,
63
- default: () => [],
64
- required: false
86
+ tableCode: {
87
+ type: String as PropType<string | null>,
88
+ required: false,
89
+ default: null
65
90
  },
66
91
  scenarioOrganisationFilters: {
67
92
  type: Object as PropType<ScenarioOrganisationFilters>,
68
93
  required: false,
69
94
  default: null
70
95
  },
71
- tableCode: {
72
- type: String,
73
- required: true
74
- },
75
96
  itemTo: {
76
97
  type: Function as PropType<(item: ScenarioOrganisationInfos) => Partial<RouteLocation>>,
77
98
  required: false
78
99
  },
100
+ selectable: {
101
+ type: Boolean,
102
+ required: false,
103
+ default: true
104
+ },
105
+ modelValue: {
106
+ type: Array as PropType<string[]>,
107
+ default: () => [],
108
+ required: false
109
+ }
79
110
  },
80
111
  emits: ["update:modelValue"],
81
112
  setup(props) {
82
113
  const { entities: scenarioOrganisations, fetching: fetchingScenarioOrganisations, getMany: getManyScenarioOrganisations } = useScenarioOrganisations();
83
114
 
115
+
116
+ const headersOptions = computed(() => ({
117
+ criticity: {
118
+ fixedFilters: getEnumEntries(Criticity).map(e => ({
119
+ value: e.value,
120
+ text: AlertTools.criticityLabel(e.value)
121
+ })),
122
+ methodFilter: (value: Criticity, item: Criticity) => value == item
123
+ }
124
+ }));
125
+
84
126
  const isSelected = (id: string): boolean => {
85
127
  return props.modelValue.includes(id);
86
128
  };
@@ -94,6 +136,8 @@ export default defineComponent({
94
136
  return {
95
137
  fetchingScenarioOrganisations,
96
138
  scenarioOrganisations,
139
+ headersOptions,
140
+ AlertTools,
97
141
  isSelected
98
142
  };
99
143
  }
@@ -1,10 +1,12 @@
1
1
  <template>
2
2
  <FSDataTable
3
3
  :loading="fetchingScenarioOrganisationTypes || fetchingScenarioOrganisations"
4
- :headers="headers"
4
+ :headersOptions="headersOptions"
5
+ :extraHeaders="headerAssociation"
5
6
  :items="scenarios"
6
- :tableCode="$props.tableCode"
7
+ :itemTo="routerLink"
7
8
  :modelValue="$props.modelValue"
9
+ :tableCode="$props.tableCode"
8
10
  @update:modelValue="$emit('update:modelValue', $event)"
9
11
  v-bind="$attrs"
10
12
  >
@@ -26,12 +28,29 @@
26
28
  </FSIcon>
27
29
  </template>
28
30
 
31
+ <template
32
+ #item.criticity="{ item }"
33
+ >
34
+ <FSRow
35
+ align="center-left"
36
+ >
37
+ <FSIcon
38
+ :color="AlertTools.criticityColor(item.criticity)"
39
+ >
40
+ {{ AlertTools.criticityIcon(item.criticity) }}
41
+ </FSIcon>
42
+ <FSSpan>
43
+ {{ AlertTools.criticityLabel(item.criticity) }}
44
+ </FSSpan>
45
+ </FSRow>
46
+ </template>
47
+
29
48
  <template
30
49
  #item.tags="{ item }"
31
50
  >
32
51
  <FSTagGroup
33
52
  variant="slide"
34
- :editable="false"
53
+ :showRemove="false"
35
54
  :tags="item.tags"
36
55
  />
37
56
  </template>
@@ -44,24 +63,33 @@ import _ from "lodash";
44
63
 
45
64
  import { useTranslations } from "@dative-gpi/bones-ui";
46
65
 
47
- import {ColorEnum } from "@dative-gpi/foundation-shared-components/models";
66
+ import { Criticity, ApplicationScope } from "@dative-gpi/foundation-shared-domain/enums";
67
+ import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
68
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
69
+ import { AlertTools } from "@dative-gpi/foundation-shared-components/tools"
48
70
 
49
71
  import type { ScenarioOrganisationFilters, ScenarioOrganisationTypeFilters } from "@dative-gpi/foundation-core-domain/models";
50
-
51
- import { useScenarioOrganisations, useScenarioOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
72
+ import { useScenarioOrganisations, useScenarioOrganisationTypes, useRouteOrganisation } from "@dative-gpi/foundation-core-services/composables";
52
73
 
53
74
  import FSDataTable from "../FSDataTable.vue";
54
- import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
55
75
  import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
76
+ import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
77
+ import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
56
78
 
57
79
  export default defineComponent({
58
80
  name: "FSBaseScenariosList",
59
- components: {
81
+ components:{
60
82
  FSDataTable,
83
+ FSTagGroup,
61
84
  FSIcon,
62
- FSTagGroup
85
+ FSRow
63
86
  },
64
87
  props: {
88
+ tableCode: {
89
+ type: String as PropType<string | null>,
90
+ required: false,
91
+ default: null
92
+ },
65
93
  modelValue: {
66
94
  type: Array as PropType<string[]>,
67
95
  default: () => [],
@@ -77,73 +105,60 @@ export default defineComponent({
77
105
  required: false,
78
106
  default: null
79
107
  },
80
- tableCode: {
81
- type: String,
82
- required: true
108
+ showAssociation: {
109
+ type: Boolean,
110
+ required: false,
111
+ default: true
112
+ },
113
+ scope: {
114
+ type: Number as PropType<ApplicationScope>,
115
+ required: false,
116
+ default: ApplicationScope.None
83
117
  }
84
118
  },
85
119
  emits: ["update:modelValue"],
86
- setup(props, { emit }) {
120
+ setup(props) {
87
121
  const { $tr } = useTranslations();
88
122
  const { entities: scenarioOrganisations, fetching: fetchingScenarioOrganisations, getMany: getManyScenarioOrganisations } = useScenarioOrganisations();
89
123
  const { entities: scenarioOrganisationTypes, fetching: fetchingScenarioOrganisationTypes, getMany: getManyScenarioOrganisationTypes } = useScenarioOrganisationTypes();
90
124
 
91
- const isSelected = (value : string): boolean => {
92
- return props.modelValue.includes(value);
93
- };
125
+ const { $r } = useRouteOrganisation();
94
126
 
95
- const headers = computed(() => {
96
- return [
97
- {
98
- text: $tr("entity.scenario.icon", "Icon"),
99
- value: "icon",
127
+ const headerAssociation = computed(() => {
128
+ if(props.showAssociation){
129
+ return [{
130
+ columnId: "association",
131
+ text: $tr("ui.common.association", "Association"),
132
+ value: "association",
100
133
  sortable: false,
101
- },
102
- {
103
- text: $tr("entity.scenario.label", "Label"),
104
- value: "label",
105
- sortable: true
106
- },
107
- {
108
- text: $tr("entity.scenario.modelLabel", "Model label"),
109
- value: "modelLabel",
110
- sortable: true
111
- },
112
- {
113
- text: $tr("entity.scenario.dataCategoryLabel", "Data category label"),
114
- value: "dataCategoryLabel",
115
- sortable: true
116
- },
117
- {
118
- text: $tr("ui.common.action", ""),
119
- value: "action",
120
- sortable: false
121
- }
122
- ];
134
+ filterable: false,
135
+ index: -1,
136
+ hidden: false
137
+ }];
138
+ }
123
139
  });
124
140
 
141
+ const headersOptions = computed(() => ({
142
+ criticity: {
143
+ fixedFilters: getEnumEntries(Criticity).map(e => ({
144
+ value: e.value,
145
+ text: AlertTools.criticityLabel(e.value)
146
+ })),
147
+ methodFilter: (value: Criticity, item: Criticity) => value == item
148
+ }
149
+ }));
125
150
 
126
151
  const scenarios = computed(() => {
127
- return scenarioOrganisations.value.map(c => {
128
- return {
129
- id: `${c.id}_${c.scope}`,
130
- modelId: c.modelId,
131
- dataCategoryId : c.dataCategoryId,
132
- dataCategoryLabel: c.dataCategoryLabel,
133
- scenarioId: c.scenarioId,
134
- scope: c.scope,
135
- label: c.label,
136
- modelLabel: c.modelLabel,
137
- code: c.code,
138
- icon: c.icon,
139
- tags: c.tags,
140
- criticity: c.criticity,
141
- parameters: c.parameters
142
- }
143
- })
144
- .concat(scenarioOrganisationTypes.value.map(c => {
152
+ if(props.scope == ApplicationScope.Organisation){
153
+ return scenarioOrganisations.value
154
+ }
155
+ else if(props.scope == ApplicationScope.OrganisationType){
156
+ return scenarioOrganisationTypes.value
157
+ }
158
+ else{
159
+ return scenarioOrganisations.value.map(c => {
145
160
  return {
146
- id: `${c.id}_${c.scope}`,
161
+ id: c.id,
147
162
  modelId: c.modelId,
148
163
  dataCategoryId : c.dataCategoryId,
149
164
  dataCategoryLabel: c.dataCategoryLabel,
@@ -157,43 +172,69 @@ export default defineComponent({
157
172
  criticity: c.criticity,
158
173
  parameters: c.parameters
159
174
  }
160
- }))
161
- })
162
-
163
- const fetch = () =>{
164
- getManyScenarioOrganisations(props.scenarioOrganisationFilters);
165
- getManyScenarioOrganisationTypes(props.scenarioOrganisationTypeFilters)
166
- }
175
+ })
176
+ .concat(scenarioOrganisationTypes.value.map(c => {
177
+ return {
178
+ id: c.id,
179
+ modelId: c.modelId,
180
+ dataCategoryId : c.dataCategoryId,
181
+ dataCategoryLabel: c.dataCategoryLabel,
182
+ scenarioId: c.scenarioId,
183
+ scope: c.scope,
184
+ label: c.label,
185
+ modelLabel: c.modelLabel,
186
+ code: c.code,
187
+ icon: c.icon,
188
+ tags: c.tags,
189
+ criticity: c.criticity,
190
+ parameters: c.parameters
191
+ }
192
+ }));
193
+ }
194
+ });
167
195
 
168
- const update = (value : string) =>
169
- {
170
- const item = isSelected(value);
196
+ const routerLink = (item: any) => {
197
+ if(item.scope == ApplicationScope.OrganisationType){
198
+ return $r({ name: "scenario-organisation-type", params: { entityId: item.id } });
199
+ }
200
+ else
201
+ {
202
+ return $r({ name: "scenario-organisation", params: { entityId: item.id } });
203
+ }
204
+ };
171
205
 
172
- if(item){
173
- emit("update:modelValue", props.modelValue.filter(m => m != value))
206
+ const fetch = () =>{
207
+ if(props.scope == ApplicationScope.OrganisationType){
208
+ getManyScenarioOrganisationTypes(props.scenarioOrganisationTypeFilters)
209
+ }
210
+ else if(props.scope == ApplicationScope.Organisation){
211
+ getManyScenarioOrganisations(props.scenarioOrganisationFilters);
174
212
  }
175
213
  else{
176
- emit("update:modelValue", [...props.modelValue, value])
214
+ getManyScenarioOrganisations(props.scenarioOrganisationFilters);
215
+ getManyScenarioOrganisationTypes(props.scenarioOrganisationTypeFilters)
177
216
  }
178
217
  }
179
-
180
- watch(() => [props.scenarioOrganisationFilters,props.scenarioOrganisationTypeFilters], (next, previous) => {
218
+
219
+ watch(() => [props.scenarioOrganisationFilters,props.scenarioOrganisationTypeFilters, props.scope], (next, previous) => {
181
220
  if ((!next && !previous) || !_.isEqual(next, previous)) {
182
221
  fetch();
183
222
  }
184
223
  }, { immediate: true });
185
-
224
+
186
225
 
187
226
  return {
188
227
  fetchingScenarioOrganisationTypes,
189
228
  fetchingScenarioOrganisations,
190
229
  scenarioOrganisationTypes,
191
230
  scenarioOrganisations,
231
+ headerAssociation,
232
+ ApplicationScope,
233
+ headersOptions,
234
+ AlertTools,
192
235
  ColorEnum,
193
236
  scenarios,
194
- headers,
195
- isSelected,
196
- update
237
+ routerLink
197
238
  };
198
239
  }
199
240
  });
@@ -3,6 +3,7 @@
3
3
  :items="serviceAccountOrganisations"
4
4
  :itemTo="$props.itemTo"
5
5
  :loading="fetchingServiceAccountOrganisations"
6
+ :selectable="$props.selectable"
6
7
  :tableCode="$props.tableCode"
7
8
  :modelValue="$props.modelValue"
8
9
  @update:modelValue="$emit('update:modelValue', $event)"
@@ -17,6 +18,13 @@
17
18
  v-bind="slotData"
18
19
  />
19
20
  </template>
21
+ <template
22
+ #header.imageId-title
23
+ >
24
+ <FSIcon>
25
+ mdi-panorama-variant-outline
26
+ </FSIcon>
27
+ </template>
20
28
  <template
21
29
  #item.imageId="{ item }"
22
30
  >
@@ -25,6 +33,7 @@
25
33
  height="32px"
26
34
  width="32px"
27
35
  :imageId="item.imageId"
36
+ :thumbnail="true"
28
37
  />
29
38
  </template>
30
39
  <template
@@ -32,7 +41,7 @@
32
41
  >
33
42
  <FSTagGroup
34
43
  variant="slide"
35
- :editable="false"
44
+ :showRemove="false"
36
45
  :tags="item.tags"
37
46
  />
38
47
  </template>
@@ -57,16 +66,12 @@
57
66
  <template
58
67
  #item.tile="{ item, toggleSelect }"
59
68
  >
60
- <FSUserOrganisationTileUI
61
- :imageId="item.imageId"
62
- :label="item.label"
63
- :userType="item.userType"
64
- :roleIcon="item.roleIcon"
65
- :roleLabel="item.roleLabel"
66
- :admin="item.admin"
69
+ <FSServiceAccountOrganisationTileUI
67
70
  :to="$props.itemTo && $props.itemTo(item)"
71
+ :selectable="$props.selectable"
68
72
  :modelValue="isSelected(item.id)"
69
73
  @update:modelValue="toggleSelect(item)"
74
+ v-bind="item"
70
75
  />
71
76
  </template>
72
77
  </FSDataTable>
@@ -81,11 +86,13 @@ import _ from "lodash";
81
86
  import type { ServiceAccountOrganisationFilters, ServiceAccountOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
82
87
  import { userTypeLabel, userValidityLabel } from "@dative-gpi/foundation-core-components/utils";
83
88
  import { useServiceAccountOrganisations } from "@dative-gpi/foundation-core-services/composables";
89
+
84
90
  import FSDataTable from "../FSDataTable.vue";
91
+
85
92
  import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
86
93
  import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
87
94
  import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
88
- import FSUserOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSUserOrganisationTileUI.vue";
95
+ import FSServiceAccountOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSServiceAccountOrganisationTileUI.vue";
89
96
 
90
97
  export default defineComponent({
91
98
  name: "FSBaseServiceAccountOrganisationsList",
@@ -94,26 +101,32 @@ export default defineComponent({
94
101
  FSImage,
95
102
  FSTagGroup,
96
103
  FSSpan,
97
- FSUserOrganisationTileUI
104
+ FSServiceAccountOrganisationTileUI
98
105
  },
99
106
  props: {
107
+ tableCode: {
108
+ type: String as PropType<string | null>,
109
+ required: false,
110
+ default: null
111
+ },
100
112
  serviceAccountOrganisationsFilters: {
101
113
  type: Object as PropType<ServiceAccountOrganisationFilters | null>,
102
114
  required: false,
103
115
  default: null
104
116
  },
117
+ itemTo: {
118
+ type: Function as PropType<(item: ServiceAccountOrganisationInfos) => Partial<RouteLocation>>,
119
+ required: false
120
+ },
121
+ selectable: {
122
+ type: Boolean,
123
+ required: false,
124
+ default: true
125
+ },
105
126
  modelValue: {
106
127
  type: Array as PropType<string[]>,
107
128
  required: false,
108
129
  default: () => []
109
- },
110
- tableCode: {
111
- type: String,
112
- required: true
113
- },
114
- itemTo: {
115
- type: Function as PropType<(item: ServiceAccountOrganisationInfos) => Partial<RouteLocation>>,
116
- required: false
117
130
  }
118
131
  },
119
132
  emits: ["update:modelValue"],