@dative-gpi/foundation-core-services 1.1.10 → 1.1.12-test-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.
@@ -4,7 +4,7 @@ import { uuidv4 } from "@dative-gpi/bones-ui";
4
4
 
5
5
  import { getManyDatas } from "@dative-gpi/foundation-core-services/composables";
6
6
 
7
- import { RootMode } from "@dative-gpi/foundation-shared-domain/enums";
7
+ import { PlotPer, RootMode } from "@dative-gpi/foundation-shared-domain/enums";
8
8
 
9
9
  import type { DataFiltersDTO, DataLeafDTO, AggregateValueFilter } from "@dative-gpi/foundation-core-domain/models";
10
10
 
@@ -12,6 +12,7 @@ export const useAggregateValue = () => {
12
12
  const fetching = ref(false);
13
13
  const error = ref<string | null>(null);
14
14
  const value = ref<number | null>(null);
15
+ const unit = ref<string | null>(null);
15
16
 
16
17
  const fetch = async (filter: AggregateValueFilter) => {
17
18
  fetching.value = true;
@@ -21,7 +22,7 @@ export const useAggregateValue = () => {
21
22
  entitiesIds: filter.entitiesIds,
22
23
  entityType: filter.entityType,
23
24
  labelTemplate: "",
24
- aggregateByEntity: 0,
25
+ aggregateByEntity: PlotPer.SinglePlot,
25
26
  aggregationTimeStep: undefined,
26
27
  duration: 0,
27
28
  durationTimeStep: undefined,
@@ -62,8 +63,10 @@ export const useAggregateValue = () => {
62
63
  const dataSerie = await getManyDatas(periodFilters);
63
64
 
64
65
  const dataSerieValue = dataSerie?.[0]?.datas?.[0]?.values?.[0];
66
+ const dataSerieUnit = dataSerie?.[0]?.meta.valueUnits?.[0];;
65
67
 
66
68
  value.value = dataSerieValue == null ? null : Number(dataSerieValue);
69
+ unit.value = dataSerieUnit == null ? null : dataSerieUnit;
67
70
 
68
71
  } catch (exception: any) {
69
72
  error.value = exception.response?.data ?? exception.message;
@@ -76,6 +79,7 @@ export const useAggregateValue = () => {
76
79
  fetching,
77
80
  error,
78
81
  value,
82
+ unit,
79
83
  fetch,
80
84
  };
81
85
  };
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.10",
7
+ "version": "1.1.12-test-1",
8
8
  "description": "",
9
9
  "publishConfig": {
10
10
  "access": "public"
@@ -13,7 +13,7 @@
13
13
  "author": "",
14
14
  "license": "ISC",
15
15
  "dependencies": {
16
- "@dative-gpi/foundation-core-domain": "1.1.10"
16
+ "@dative-gpi/foundation-core-domain": "1.1.12-test-1"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -21,5 +21,5 @@
21
21
  "vue": "3.5.26",
22
22
  "vue-router": "^4.3.0"
23
23
  },
24
- "gitHead": "9fab51b9fc34cd8a60f870ef40e5a437115f2f2b"
24
+ "gitHead": "cbd8470a7f1d0321bb29dde2da2b6c693e146980"
25
25
  }