@dative-gpi/foundation-core-components 0.1.120 → 1.0.0

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 (45) hide show
  1. package/components/autocompletes/FSAutocompleteChart.vue +208 -0
  2. package/components/autocompletes/FSAutocompleteDashboard.vue +33 -37
  3. package/components/autocompletes/FSAutocompleteDashboardOrganisation.vue +115 -0
  4. package/components/autocompletes/FSAutocompleteDataCategory.vue +16 -25
  5. package/components/autocompletes/FSAutocompleteDataDefinition.vue +17 -26
  6. package/components/autocompletes/FSAutocompleteGroup.vue +18 -27
  7. package/components/autocompletes/FSAutocompleteLocation.vue +22 -31
  8. package/components/autocompletes/FSAutocompleteManufacturer.vue +8 -8
  9. package/components/autocompletes/FSAutocompleteModel.vue +4 -4
  10. package/components/autocompletes/FSAutocompleteOrganisationType.vue +4 -4
  11. package/components/autocompletes/FSAutocompleteRole.vue +30 -34
  12. package/components/autocompletes/FSAutocompleteUserOrganisation.vue +20 -34
  13. package/components/customProperties/FSMetaField.vue +139 -107
  14. package/components/customProperties/FSMetaFormContent.vue +3 -2
  15. package/components/customProperties/FSMetaGrid.vue +4 -3
  16. package/components/customProperties/FSMetaHistory.vue +3 -2
  17. package/components/customProperties/FSMetaValue.vue +4 -2
  18. package/components/customProperties/helpers.ts +2 -1
  19. package/components/lists/FSDataTable.vue +48 -133
  20. package/components/selects/FSAggregationSelector.vue +51 -0
  21. package/components/selects/FSAxisTypeSelector.vue +48 -0
  22. package/components/selects/FSDataCategorySelector.vue +62 -0
  23. package/components/selects/FSDataDefinitionSelector.vue +66 -0
  24. package/components/selects/FSDisplayAsSelector.vue +52 -0
  25. package/components/selects/FSFilterTypeSelector.vue +53 -0
  26. package/components/selects/FSHeatmapRuleSelector.vue +52 -0
  27. package/components/selects/FSModelSelector.vue +56 -0
  28. package/components/selects/FSOperationOnSelector.vue +51 -0
  29. package/components/selects/FSPlanningTypeSelector.vue +50 -0
  30. package/components/selects/FSPlotPerSelector.vue +51 -0
  31. package/components/selects/FSSelectSelectedEntities.vue +59 -0
  32. package/components/selects/FSSerieTypeSelector.vue +51 -0
  33. package/components/tiles/FSDashboardOrganisationTile.vue +3 -2
  34. package/components/tiles/FSDashboardOrganisationTypeTile.vue +3 -2
  35. package/components/tiles/FSDashboardShallowTile.vue +4 -3
  36. package/components/tiles/FSFolderTile.vue +2 -1
  37. package/components/tiles/FSUserOrganisationTile.vue +21 -21
  38. package/components/treeviews/FSTreeViewFolder.vue +77 -0
  39. package/components/treeviews/FSTreeViewGroup.vue +77 -0
  40. package/package.json +14 -12
  41. package/utils/charts.ts +136 -0
  42. package/utils/dashboards.ts +6 -5
  43. package/utils/index.ts +1 -0
  44. package/utils/roles.ts +2 -1
  45. package/utils/users.ts +11 -2
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <FSSelectField
3
+ :label="label ?? $tr('ui.common.serie-type','Serie type')"
4
+ :items="serieTypeItems"
5
+ :modelValue="modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ v-bind="$attrs"
8
+ />
9
+ </template>
10
+
11
+ <script lang="ts">
12
+ import { computed, defineComponent, type PropType } from "vue";
13
+
14
+ import {SerieType} from "@dative-gpi/foundation-core-domain/models";
15
+
16
+ import FSSelectField from "@dative-gpi/foundation-shared-components/components/fields/FSSelectField.vue";
17
+
18
+ import {serieTypeLabel, getEnumEntries} from "../../utils";
19
+
20
+ export default defineComponent({
21
+ components: {
22
+ FSSelectField
23
+ },
24
+ props: {
25
+ modelValue: {
26
+ type: Number as PropType<SerieType>,
27
+ required: false
28
+ },
29
+ label: {
30
+ type: String,
31
+ required: false
32
+ }
33
+ },
34
+ emits: ['update:modelValue'],
35
+ setup() {
36
+
37
+ const serieTypeItems = computed(()=>{
38
+ return getEnumEntries(SerieType).map((f)=>{
39
+ return {
40
+ id: f.value,
41
+ label: serieTypeLabel(f.value)
42
+ }
43
+ })
44
+ });
45
+
46
+ return {
47
+ serieTypeItems
48
+ }
49
+ }
50
+ })
51
+ </script>
@@ -7,11 +7,12 @@
7
7
  />
8
8
  <FSDashboardOrganisationTileUI
9
9
  v-else-if="entity"
10
- :label="entity.label"
11
10
  :code="entity.code"
12
- :bottomColor="entity.colors"
13
11
  :icon="entity.icon"
12
+ :label="entity.label"
13
+ :imageId="entity.imageId"
14
14
  :editable="$props.editable"
15
+ :bottomColor="entity.colors"
15
16
  :modelValue="$props.modelValue"
16
17
  @update:modelValue="(value) => $emit('update:modelValue', value)"
17
18
  v-bind="$attrs"
@@ -7,11 +7,12 @@
7
7
  />
8
8
  <FSDashboardOrganisationTypeTileUI
9
9
  v-else-if="entity"
10
- :label="entity.label"
11
10
  :code="entity.code"
12
- :bottomColor="entity.colors"
13
11
  :icon="entity.icon"
12
+ :label="entity.label"
13
+ :imageId="entity.imageId"
14
14
  :editable="$props.editable"
15
+ :bottomColor="entity.colors"
15
16
  :modelValue="$props.modelValue"
16
17
  @update:modelValue="(value) => $emit('update:modelValue', value)"
17
18
  v-bind="$attrs"
@@ -7,11 +7,12 @@
7
7
  />
8
8
  <FSDashboardShallowTileUI
9
9
  v-else-if="entity"
10
- :label="entity.label"
11
- :code="entity.code"
12
- :bottomColor="entity.colors"
13
10
  :icon="entity.icon"
11
+ :code="entity.code"
12
+ :label="entity.label"
13
+ :imageId="entity.imageId"
14
14
  :editable="$props.editable"
15
+ :bottomColor="entity.colors"
15
16
  :modelValue="$props.modelValue"
16
17
  @update:modelValue="(value) => $emit('update:modelValue', value)"
17
18
  v-bind="$attrs"
@@ -11,6 +11,7 @@
11
11
  :code="entity.code"
12
12
  :bottomColor="entity.colors"
13
13
  :icon="entity.icon"
14
+ :imageId="entity.imageId"
14
15
  :editable="$props.editable"
15
16
  :modelValue="$props.modelValue"
16
17
  @update:modelValue="(value) => $emit('update:modelValue', value)"
@@ -21,7 +22,7 @@
21
22
  <script lang="ts">
22
23
  import { defineComponent, onMounted, watch } from "vue";
23
24
 
24
- import { useDashboardOrganisation, useFolder } from "@dative-gpi/foundation-core-services/composables";
25
+ import { useFolder } from "@dative-gpi/foundation-core-services/composables";
25
26
 
26
27
  import FSFolderTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSFolderTileUI.vue";
27
28
  import FSLoadTile from "@dative-gpi/foundation-shared-components/components/tiles/FSLoadTile.vue";
@@ -1,25 +1,25 @@
1
1
  <template>
2
- <FSLoadTile
3
- v-if="getting"
4
- :editable="$props.editable"
5
- :modelValue="modelValue"
6
- @update:modelValue="(value) => $emit('update:modelValue', value)"
7
- />
8
- <FSGroupTileUI
9
- v-else-if="entity"
10
- :imageId="entity.imageId"
11
- :name="entity.name"
12
- :label="entity.label"
13
- :userType="entity.userType"
14
- :roleLabel="entity.roleLabel"
15
- :roleIcon="entity.roleIcon"
16
- :admin="entity.admin"
17
- :editable="$props.editable"
18
- :modelValue="modelValue"
19
- @update:modelValue="(value) => $emit('update:modelValue', value)"
20
- v-bind="$attrs"
21
- />
22
- </template>
2
+ <FSLoadTile
3
+ v-if="getting"
4
+ :editable="$props.editable"
5
+ :modelValue="modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ />
8
+ <FSUserOrganisationTileUI
9
+ v-else-if="entity"
10
+ :imageId="entity.imageId"
11
+ :name="entity.name"
12
+ :label="entity.label"
13
+ :userType="entity.userType"
14
+ :roleLabel="entity.roleLabel"
15
+ :roleIcon="entity.roleIcon"
16
+ :admin="entity.admin"
17
+ :editable="$props.editable"
18
+ :modelValue="modelValue"
19
+ @update:modelValue="$emit('update:modelValue', $event)"
20
+ v-bind="$attrs"
21
+ />
22
+ </template>
23
23
 
24
24
  <script lang="ts">
25
25
  import { defineComponent, onMounted, watch } from "vue";
@@ -0,0 +1,77 @@
1
+ <template>
2
+ <FSTreeViewField
3
+ :multiple="$props.multiple"
4
+ :loading="fetchingFolders"
5
+ :items="folders"
6
+ :modelValue="$props.modelValue"
7
+ @update:modelValue="onUpdate"
8
+ v-bind="$attrs"
9
+ >
10
+ <template
11
+ #menu-prepend="{ item }"
12
+ >
13
+ <FSIcon
14
+ v-if="item.icon"
15
+ >
16
+ {{ item.icon }}
17
+ </FSIcon>
18
+ </template>
19
+ </FSTreeViewField>
20
+ </template>
21
+
22
+ <script lang="ts">
23
+ import { defineComponent, type PropType } from "vue";
24
+
25
+ import { useTreeView } from "@dative-gpi/foundation-shared-components/composables";
26
+ import { type FolderFilters } from "@dative-gpi/foundation-core-domain/models";
27
+ import { useFolders } from "@dative-gpi/foundation-core-services/composables";
28
+
29
+ import FSTreeViewField from "@dative-gpi/foundation-shared-components/components/fields/FSTreeViewField.vue";
30
+ import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
31
+
32
+ export default defineComponent({
33
+ name: "FSTreeViewFolder",
34
+ components: {
35
+ FSTreeViewField,
36
+ FSIcon
37
+ },
38
+ props: {
39
+ folderFilters: {
40
+ type: Object as PropType<FolderFilters>,
41
+ required: false,
42
+ default: null
43
+ },
44
+ modelValue: {
45
+ type: [Array, String] as PropType<string[] | string | null>,
46
+ required: false,
47
+ default: null
48
+ },
49
+ multiple: {
50
+ type: Boolean,
51
+ required: false,
52
+ default: false
53
+ }
54
+ },
55
+ emits: ["update:modelValue"],
56
+ setup(props, { emit }) {
57
+ const { getMany: getManyFolders, fetching: fetchingFolders, entities: folders } = useFolders();
58
+
59
+ const fetch = () => {
60
+ return getManyFolders({ ...props.folderFilters });
61
+ };
62
+
63
+ const { onUpdate } = useTreeView(
64
+ folders,
65
+ [() => props.folderFilters],
66
+ emit,
67
+ fetch
68
+ );
69
+
70
+ return {
71
+ fetchingFolders,
72
+ folders,
73
+ onUpdate
74
+ };
75
+ }
76
+ });
77
+ </script>
@@ -0,0 +1,77 @@
1
+ <template>
2
+ <FSTreeViewField
3
+ :multiple="$props.multiple"
4
+ :loading="fetchingGroups"
5
+ :items="groups"
6
+ :modelValue="$props.modelValue"
7
+ @update:modelValue="onUpdate"
8
+ v-bind="$attrs"
9
+ >
10
+ <template
11
+ #menu-prepend="{ item }"
12
+ >
13
+ <FSIcon
14
+ v-if="item.icon"
15
+ >
16
+ {{ item.icon }}
17
+ </FSIcon>
18
+ </template>
19
+ </FSTreeViewField>
20
+ </template>
21
+
22
+ <script lang="ts">
23
+ import { defineComponent, type PropType } from "vue";
24
+
25
+ import { useTreeView } from "@dative-gpi/foundation-shared-components/composables";
26
+ import { type GroupFilters } from "@dative-gpi/foundation-core-domain/models";
27
+ import { useGroups } from "@dative-gpi/foundation-core-services/composables";
28
+
29
+ import FSTreeViewField from "@dative-gpi/foundation-shared-components/components/fields/FSTreeViewField.vue";
30
+ import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
31
+
32
+ export default defineComponent({
33
+ name: "FSTreeViewGroup",
34
+ components: {
35
+ FSTreeViewField,
36
+ FSIcon
37
+ },
38
+ props: {
39
+ groupFilters: {
40
+ type: Object as PropType<GroupFilters>,
41
+ required: false,
42
+ default: null
43
+ },
44
+ modelValue: {
45
+ type: [Array, String] as PropType<string[] | string | null>,
46
+ required: false,
47
+ default: null
48
+ },
49
+ multiple: {
50
+ type: Boolean,
51
+ required: false,
52
+ default: false
53
+ }
54
+ },
55
+ emits: ["update:modelValue"],
56
+ setup(props, { emit }) {
57
+ const { getMany: getManyGroups, fetching: fetchingGroups, entities: groups } = useGroups();
58
+
59
+ const fetch = () => {
60
+ return getManyGroups({ ...props.groupFilters });
61
+ };
62
+
63
+ const { onUpdate } = useTreeView(
64
+ groups,
65
+ [() => props.groupFilters],
66
+ emit,
67
+ fetch
68
+ );
69
+
70
+ return {
71
+ fetchingGroups,
72
+ groups,
73
+ onUpdate
74
+ };
75
+ }
76
+ });
77
+ </script>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-core-components",
3
3
  "sideEffects": false,
4
- "version": "0.1.120",
4
+ "version": "1.0.0",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,19 +10,21 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-core-domain": "0.1.120",
14
- "@dative-gpi/foundation-core-services": "0.1.120",
15
- "@dative-gpi/foundation-shared-components": "0.1.120",
16
- "@dative-gpi/foundation-shared-domain": "0.1.120",
17
- "@dative-gpi/foundation-shared-services": "0.1.120",
13
+ "@dative-gpi/foundation-core-domain": "1.0.0",
14
+ "@dative-gpi/foundation-core-services": "1.0.0",
15
+ "@dative-gpi/foundation-shared-components": "1.0.0",
16
+ "@dative-gpi/foundation-shared-domain": "1.0.0",
17
+ "@dative-gpi/foundation-shared-services": "1.0.0"
18
+ },
19
+ "peerDependencies": {
20
+ "@dative-gpi/bones-ui": "^0.0.75",
18
21
  "color": "^4.2.3",
19
- "vue": "^3.4.23",
20
- "vuedraggable": "^4.1.0"
22
+ "vue": "^3.4.29"
21
23
  },
22
24
  "devDependencies": {
23
- "@types/color": "^3.0.6",
24
- "sass": "^1.69.5",
25
- "sass-loader": "^13.3.2"
25
+ "@types/color": "3.0.6",
26
+ "sass": "1.71.1",
27
+ "sass-loader": "13.3.2"
26
28
  },
27
- "gitHead": "ea777a3a70e01d2b96981b2cb2e3da7b3af5f59c"
29
+ "gitHead": "93365f65d39d6c9cc3821ffb48cba187200deaf9"
28
30
  }
@@ -0,0 +1,136 @@
1
+ import { AggregationType, AxisType, ChartOrigin, DisplayAs, FilterType, HeatmapRule, OperationOn, PlanningType, PlotPer, SerieType } from "@dative-gpi/foundation-core-domain/models";
2
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
3
+ import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
4
+
5
+ const { $tr } = useTranslationsProvider();
6
+
7
+ export const chartOriginLabel = (type: ChartOrigin): string => {
8
+ switch (type) {
9
+ case ChartOrigin.None: return $tr("ui.chart-type.none", "None");
10
+ case ChartOrigin.Organisation: return $tr("ui.chart-type.organisation", "Custom");
11
+ case ChartOrigin.OrganisationType: return $tr("ui.chart-type.organisation-type", "Shared");
12
+ }
13
+ };
14
+
15
+ export const chartOriginColor = (type: ChartOrigin): ColorBase => {
16
+ switch (type) {
17
+ case ChartOrigin.None: return ColorEnum.Error;
18
+ case ChartOrigin.Organisation: return ColorEnum.Primary;
19
+ case ChartOrigin.OrganisationType: return ColorEnum.Warning;
20
+ }
21
+ };
22
+
23
+ export const aggregationTypeLabel = (aggregationType : AggregationType): string => {
24
+ switch (aggregationType) {
25
+ case AggregationType.Sum: return $tr("ui.common.sum", "Sum");
26
+ case AggregationType.Cardinal: return $tr("ui.common.cardinal", "Cardinal");
27
+ case AggregationType.Mean: return $tr("ui.common.cean", "Mean");
28
+ case AggregationType.Median: return $tr("ui.common.median", "Median");
29
+ case AggregationType.First: return $tr("ui.common.first", "First");
30
+ case AggregationType.Last: return $tr("ui.common.last", "Last");
31
+ case AggregationType.Difference: return $tr("ui.common.difference", "Difference");
32
+ case AggregationType.Minimum: return $tr("ui.common.minimum", "Minimum");
33
+ case AggregationType.Maximum: return $tr("ui.common.maximum", "Maximum");
34
+ case AggregationType.Range: return $tr("ui.common.range", "Range");
35
+ default : return $tr("ui.common.none", "None");
36
+ }
37
+ };
38
+
39
+ export const axisTypeLabel = (axisType: AxisType | number): string => {
40
+ switch (axisType) {
41
+ case AxisType.Date: return $tr("ui.common.date", "Date");
42
+ case AxisType.Value: return $tr("ui.common.value", "Value");
43
+ case AxisType.Category: return $tr("ui.common.category", "Category");
44
+ default: return $tr("ui.common.none", "None");
45
+ }
46
+ };
47
+
48
+ export const displayAsLabel = (display: DisplayAs | number): string => {
49
+ switch (display) {
50
+ case DisplayAs.Bars: return $tr("ui.common.bars", "Bars");
51
+ case DisplayAs.Lines: return $tr("ui.common.lines", "Lines");
52
+ case DisplayAs.Points: return $tr("ui.common.point", "Points");
53
+ default: return $tr("ui.common.none", "None");
54
+ }
55
+ };
56
+
57
+ export const filterTypeLabel = (filterType: FilterType | number): string => {
58
+ switch (filterType) {
59
+ case FilterType.Contains: return $tr("ui.common.contains", "contains");
60
+ case FilterType.Different: return "≠";
61
+ case FilterType.EndsWith: return $tr("ui.common.end-width", "end with") ;
62
+ case FilterType.Equal: return "=";
63
+ case FilterType.Less: return "<";
64
+ case FilterType.LessOrEqual: return "≤";
65
+ case FilterType.More: return ">";
66
+ case FilterType.MoreOrEqual: return "≥";
67
+ case FilterType.StartsWith: return $tr("ui.common.starts-with", "start with");
68
+ default: return $tr("ui.common.none", "None");
69
+ }
70
+ };
71
+
72
+ export const heatmapRuleLabel = (heatMap: HeatmapRule | number): string => {
73
+ switch (heatMap) {
74
+ case HeatmapRule.Gradient: return $tr("ui.common.gradient", "Gradient");
75
+ case HeatmapRule.Ranges: return $tr("ui.common.ranges", "Ranges");
76
+ case HeatmapRule.Fixed : return $tr("ui.common.fixed", "Fixed");
77
+ default: return $tr("ui.common.none", "None");
78
+ }
79
+ };
80
+
81
+ export const operationOnLabel = (operationOn: OperationOn | number): string => {
82
+ switch (operationOn) {
83
+ case OperationOn.SameEntity: return $tr("ui.common.same-entity", "Same entity");
84
+ case OperationOn.SameGroup: return $tr("ui.common.same-group", "Same group");
85
+ case OperationOn.SameGroupAndEntity: return $tr("ui.common.same-group-entity", "Same group and entity");
86
+ default: return $tr("ui.common.none", "None");
87
+ }
88
+ };
89
+
90
+ export const planningTypeLabel = (planningType : PlanningType | number): string => {
91
+ switch (planningType) {
92
+ case PlanningType.UntilNext: return $tr("ui.common.until-next", "Until next");
93
+ case PlanningType.ElapsedTime: return $tr("ui.common.elapsed-time", "Elapsed time");
94
+ case PlanningType.SinglePoint: return $tr("ui.common.single-point", "Single point");
95
+ default: return $tr("ui.common.none", "None");
96
+ }
97
+ };
98
+
99
+ export const plotPerLabel = (plotper: PlotPer | number): string => {
100
+ switch (plotper) {
101
+ case PlotPer.SinglePlot: return $tr("ui.common.single-slot", "Single slot");
102
+ case PlotPer.Model: return $tr("ui.common.model", "Model");
103
+ case PlotPer.Group: return $tr("ui.common.group", "Group");
104
+ case PlotPer.Location: return $tr("ui.common.location", "Location");
105
+ case PlotPer.Device: return $tr("ui.common.device", "Device");
106
+ default: return $tr("ui.common.none", "None");
107
+ }
108
+ };
109
+
110
+ export const serieTypeLabel = (serieType : SerieType): string => {
111
+ switch (serieType) {
112
+ case SerieType.Lines: return $tr("ui.common.lines", "Lines");
113
+ case SerieType.Area: return $tr("ui.common.area", "Area");
114
+ case SerieType.Range: return $tr("ui.common.range", "Range");
115
+ case SerieType.Histogram: return $tr("ui.common.histogram", "Histogram");
116
+ case SerieType.Operation: return $tr("ui.common.operation", "Operation");
117
+ case SerieType.Planning: return $tr("ui.common.planning", "Planning");
118
+ case SerieType.ScatterPlot: return $tr("ui.common.scatter-plot", "Scatter plot");
119
+ case SerieType.Top: return $tr("ui.common.top", "Top");
120
+ case SerieType.Bars: return $tr("ui.common.bars", "Bars");
121
+ case SerieType.StackedBars: return $tr("ui.common.stacked-bars", "Stacked bars");
122
+ case SerieType.Pie: return $tr("ui.common.pie", "Pie");
123
+ case SerieType.Heatmap: return $tr('ui.common.heatmap', 'Heatmap');
124
+ case SerieType.Slider: return $tr("ui.common.slider", "Slider");
125
+ case SerieType.Gauge: return $tr("ui.common.gauge", "Gauge");
126
+ case SerieType.ScoreCard: return $tr("ui.common.score-card", "Score card");
127
+ case SerieType.Table: return $tr("ui.common.table", "Table");
128
+ default: return "";
129
+ }
130
+ };
131
+
132
+ export const getEnumEntries = (e: any) => {
133
+ return Object.keys(e)
134
+ .filter(key => isNaN(Number(key)))
135
+ .map(key => ({key : key, value : e[key]}));
136
+ };
@@ -1,15 +1,16 @@
1
1
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
2
- import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
3
- import { DashboardType } from "@dative-gpi/foundation-core-domain/models"
2
+ import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
3
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
4
+ import { DashboardType } from "@dative-gpi/foundation-shared-domain/models"
4
5
 
5
6
  const { $tr } = useTranslationsProvider();
6
7
 
7
8
  export const dashboardTypeLabel = (type: DashboardType): string => {
8
9
  switch (type) {
9
- case DashboardType.None: return $tr("ui.role-type.none", "None");
10
+ case DashboardType.None: return $tr("ui.dashboard-type.none", "None");
10
11
  case DashboardType.Organisation:
11
- case DashboardType.Shallow: return $tr("ui.role-type.organisation", "Custom");
12
- case DashboardType.OrganisationType: return $tr("ui.role-type.organisation-type", "Shared");
12
+ case DashboardType.Shallow: return $tr("ui.dashboard-type.organisation", "Custom");
13
+ case DashboardType.OrganisationType: return $tr("ui.dashboard-type.organisation-type", "Shared");
13
14
  }
14
15
  };
15
16
 
package/utils/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./charts";
1
2
  export * from "./dashboards";
2
3
  export * from "./roles";
3
4
  export * from "./users";
package/utils/roles.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
2
- import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
2
+ import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
3
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
3
4
  import { RoleType } from "@dative-gpi/foundation-core-domain/models"
4
5
 
5
6
  const { $tr } = useTranslationsProvider();
package/utils/users.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
2
- import { UserType } from "@dative-gpi/foundation-core-domain/models"
2
+ import { UserType, UserValidityState } from "@dative-gpi/foundation-core-domain/models"
3
3
 
4
4
  const { $tr } = useTranslationsProvider();
5
5
 
@@ -17,4 +17,13 @@ export const userTypeIcon = (type: UserType): string => {
17
17
  case UserType.ServiceAccount: return "mdi-puzzle-outline";
18
18
  case UserType.Extension: return "mdi-cog-outline";
19
19
  }
20
- };
20
+ };
21
+
22
+ export const userValidityLabel = (validity: UserValidityState): string => {
23
+ switch (validity) {
24
+ case UserValidityState.InvitationNotSent: return $tr("ui.user-validity.invitation-not-sent", "Invitation not sent");
25
+ case UserValidityState.InvitationSent: return $tr("ui.user-validity.invitation-sent", "Invitation sent");
26
+ case UserValidityState.AccountCreated: return $tr("ui.user-validity.account-created", "Not validated");
27
+ case UserValidityState.AccountValidated: return $tr("ui.user-validity.account-validated", "Validated");
28
+ }
29
+ }