@hisptz/dhis2-analytics 2.1.33 → 2.1.35
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.
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js +6 -2
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js.map +1 -1
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js +6 -2
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts.map +1 -1
- package/package.json +10 -6
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var hooks = require('../../MapLayer/components/GoogleEngineLayer/hooks');
|
|
4
4
|
var engine_js = require('../../MapLayer/components/GoogleEngineLayer/services/engine.js');
|
|
5
|
-
var reactQuery = require('react-query');
|
|
6
5
|
var react = require('react');
|
|
7
6
|
var reactHookForm = require('react-hook-form');
|
|
8
7
|
var lodash = require('lodash');
|
|
9
8
|
var constants = require('../../MapLayer/components/GoogleEngineLayer/constants');
|
|
9
|
+
var reactQuery = require('@tanstack/react-query');
|
|
10
10
|
|
|
11
11
|
function useDatasetInfo(shouldRun, config) {
|
|
12
12
|
const { refresh } = hooks.useGoogleEngineToken();
|
|
@@ -20,7 +20,11 @@ function useDatasetInfo(shouldRun, config) {
|
|
|
20
20
|
return engine.getPeriod();
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
const { data, error, isLoading } = reactQuery.useQuery(
|
|
23
|
+
const { data, error, isLoading } = reactQuery.useQuery({
|
|
24
|
+
queryKey: [config],
|
|
25
|
+
enabled: shouldRun,
|
|
26
|
+
queryFn: getInfo
|
|
27
|
+
});
|
|
24
28
|
const periods = react.useMemo(() => {
|
|
25
29
|
const features = data?.features;
|
|
26
30
|
return features?.map((feature) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/hooks/data.ts"],"names":["useGoogleEngineToken","EarthEngine","useQuery","useMemo","useWatch","find","EARTH_ENGINE_LAYERS"],"mappings":";;;;;;;;;;AASO,SAAS,cAAA,CACf,WACA,MAAA,EACC;AACD,EAAA,MAAM,EAAE,OAAA,EAAQ,GAAIA,0BAAA,EAAqB;AAEzC,EAAA,eAAe,OAAA,GAAU;AACxB,IAAA,IAAI,MAAA,EAAQ;AACX,MAAA,MAAM,SAAA,GAAY,MAAM,OAAA,EAAQ;AAChC,MAAA,MAAMC,qBAAA,CAAY,QAAA,CAAS,SAAA,CAAU,KAAA,EAAO,OAAO,CAAA;AACnD,MAAA,MAAM,MAAA,GAAS,IAAIA,qBAAA,CAAY;AAAA,QAC9B,OAAA,EAAS;AAAA,OACT,CAAA;AACD,MAAA,OAAO,OAAO,SAAA,EAAU;AAAA,IACzB;AAAA,EACD;AAEA,EAAA,MAAM,EAAE,
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/hooks/data.ts"],"names":["useGoogleEngineToken","EarthEngine","useQuery","useMemo","useWatch","find","EARTH_ENGINE_LAYERS"],"mappings":";;;;;;;;;;AASO,SAAS,cAAA,CACf,WACA,MAAA,EACC;AACD,EAAA,MAAM,EAAE,OAAA,EAAQ,GAAIA,0BAAA,EAAqB;AAEzC,EAAA,eAAe,OAAA,GAAU;AACxB,IAAA,IAAI,MAAA,EAAQ;AACX,MAAA,MAAM,SAAA,GAAY,MAAM,OAAA,EAAQ;AAChC,MAAA,MAAMC,qBAAA,CAAY,QAAA,CAAS,SAAA,CAAU,KAAA,EAAO,OAAO,CAAA;AACnD,MAAA,MAAM,MAAA,GAAS,IAAIA,qBAAA,CAAY;AAAA,QAC9B,OAAA,EAAS;AAAA,OACT,CAAA;AACD,MAAA,OAAO,OAAO,SAAA,EAAU;AAAA,IACzB;AAAA,EACD;AAEA,EAAA,MAAM,EAAE,IAAA,EAAM,KAAA,EAAO,SAAA,KAAcC,mBAAA,CAAS;AAAA,IAC3C,QAAA,EAAU,CAAC,MAAM,CAAA;AAAA,IACjB,OAAA,EAAS,SAAA;AAAA,IACT,OAAA,EAAS;AAAA,GACT,CAAA;AAED,EAAA,MAAM,OAAA,GAAUC,cAAQ,MAAM;AAC7B,IAAA,MAAM,WAAY,IAAA,EAAc,QAAA;AAChC,IAAA,OAAO,QAAA,EAAU,GAAA,CAAI,CAAC,OAAA,KAAiB;AACtC,MAAA,OAAO,IAAI,IAAA;AAAA,QACV,OAAA,EAAS,WAAW,mBAAmB;AAAA,SACrC,WAAA,EAAY;AAAA,IAChB,CAAC,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,IAAI,CAAC,CAAA;AAET,EAAA,OAAO;AAAA,IACN,OAAA,EAAS,SAAA;AAAA,IACT,KAAA;AAAA,IACA;AAAA,GACD;AACD;AAEO,SAAS,OAAA,GAAU;AACzB,EAAA,MAAM,OAAOC,sBAAA,CAAS;AAAA,IACrB,IAAA,EAAM;AAAA,GACN,CAAA;AACD,EAAA,OAAOC,WAAA,CAAKC,6BAAA,EAAqB,CAAC,IAAA,EAAM,IAAI,CAAC,CAAA;AAC9C","file":"data.js","sourcesContent":["import { EarthEngineOptions } from \"../../MapLayer/components/GoogleEngineLayer/interfaces\";\nimport { useGoogleEngineToken } from \"../../MapLayer/components/GoogleEngineLayer/hooks\";\nimport { EarthEngine } from \"../../MapLayer/components/GoogleEngineLayer/services/engine.js\";\nimport { useMemo } from \"react\";\nimport { useWatch } from \"react-hook-form\";\nimport { find } from \"lodash\";\nimport { EARTH_ENGINE_LAYERS } from \"../../MapLayer/components/GoogleEngineLayer/constants\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nexport function useDatasetInfo(\n\tshouldRun: boolean,\n\tconfig?: EarthEngineOptions,\n) {\n\tconst { refresh } = useGoogleEngineToken();\n\n\tasync function getInfo() {\n\t\tif (config) {\n\t\t\tconst tokenData = await refresh();\n\t\t\tawait EarthEngine.setToken(tokenData.token, refresh);\n\t\t\tconst engine = new EarthEngine({\n\t\t\t\toptions: config,\n\t\t\t});\n\t\t\treturn engine.getPeriod();\n\t\t}\n\t}\n\n\tconst { data, error, isLoading } = useQuery({\n\t\tqueryKey: [config],\n\t\tenabled: shouldRun,\n\t\tqueryFn: getInfo,\n\t});\n\n\tconst periods = useMemo(() => {\n\t\tconst features = (data as any)?.features;\n\t\treturn features?.map((feature: any) => {\n\t\t\treturn new Date(\n\t\t\t\tfeature?.properties[\"system:time_start\"],\n\t\t\t)?.getFullYear();\n\t\t});\n\t}, [data]);\n\n\treturn {\n\t\tloading: isLoading,\n\t\terror: error as any,\n\t\tperiods,\n\t};\n}\n\nexport function useType() {\n\tconst type = useWatch({\n\t\tname: \"type\",\n\t});\n\treturn find(EARTH_ENGINE_LAYERS, [\"id\", type]);\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useGoogleEngineToken } from '../../MapLayer/components/GoogleEngineLayer/hooks';
|
|
2
2
|
import { EarthEngine } from '../../MapLayer/components/GoogleEngineLayer/services/engine.js';
|
|
3
|
-
import { useQuery } from 'react-query';
|
|
4
3
|
import { useMemo } from 'react';
|
|
5
4
|
import { useWatch } from 'react-hook-form';
|
|
6
5
|
import { find } from 'lodash';
|
|
7
6
|
import { EARTH_ENGINE_LAYERS } from '../../MapLayer/components/GoogleEngineLayer/constants';
|
|
7
|
+
import { useQuery } from '@tanstack/react-query';
|
|
8
8
|
|
|
9
9
|
function useDatasetInfo(shouldRun, config) {
|
|
10
10
|
const { refresh } = useGoogleEngineToken();
|
|
@@ -18,7 +18,11 @@ function useDatasetInfo(shouldRun, config) {
|
|
|
18
18
|
return engine.getPeriod();
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
const { data, error, isLoading } = useQuery(
|
|
21
|
+
const { data, error, isLoading } = useQuery({
|
|
22
|
+
queryKey: [config],
|
|
23
|
+
enabled: shouldRun,
|
|
24
|
+
queryFn: getInfo
|
|
25
|
+
});
|
|
22
26
|
const periods = useMemo(() => {
|
|
23
27
|
const features = data?.features;
|
|
24
28
|
return features?.map((feature) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/hooks/data.ts"],"names":[],"mappings":";;;;;;;;AASO,SAAS,cAAA,CACf,WACA,MAAA,EACC;AACD,EAAA,MAAM,EAAE,OAAA,EAAQ,GAAI,oBAAA,EAAqB;AAEzC,EAAA,eAAe,OAAA,GAAU;AACxB,IAAA,IAAI,MAAA,EAAQ;AACX,MAAA,MAAM,SAAA,GAAY,MAAM,OAAA,EAAQ;AAChC,MAAA,MAAM,WAAA,CAAY,QAAA,CAAS,SAAA,CAAU,KAAA,EAAO,OAAO,CAAA;AACnD,MAAA,MAAM,MAAA,GAAS,IAAI,WAAA,CAAY;AAAA,QAC9B,OAAA,EAAS;AAAA,OACT,CAAA;AACD,MAAA,OAAO,OAAO,SAAA,EAAU;AAAA,IACzB;AAAA,EACD;AAEA,EAAA,MAAM,EAAE,
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/hooks/data.ts"],"names":[],"mappings":";;;;;;;;AASO,SAAS,cAAA,CACf,WACA,MAAA,EACC;AACD,EAAA,MAAM,EAAE,OAAA,EAAQ,GAAI,oBAAA,EAAqB;AAEzC,EAAA,eAAe,OAAA,GAAU;AACxB,IAAA,IAAI,MAAA,EAAQ;AACX,MAAA,MAAM,SAAA,GAAY,MAAM,OAAA,EAAQ;AAChC,MAAA,MAAM,WAAA,CAAY,QAAA,CAAS,SAAA,CAAU,KAAA,EAAO,OAAO,CAAA;AACnD,MAAA,MAAM,MAAA,GAAS,IAAI,WAAA,CAAY;AAAA,QAC9B,OAAA,EAAS;AAAA,OACT,CAAA;AACD,MAAA,OAAO,OAAO,SAAA,EAAU;AAAA,IACzB;AAAA,EACD;AAEA,EAAA,MAAM,EAAE,IAAA,EAAM,KAAA,EAAO,SAAA,KAAc,QAAA,CAAS;AAAA,IAC3C,QAAA,EAAU,CAAC,MAAM,CAAA;AAAA,IACjB,OAAA,EAAS,SAAA;AAAA,IACT,OAAA,EAAS;AAAA,GACT,CAAA;AAED,EAAA,MAAM,OAAA,GAAU,QAAQ,MAAM;AAC7B,IAAA,MAAM,WAAY,IAAA,EAAc,QAAA;AAChC,IAAA,OAAO,QAAA,EAAU,GAAA,CAAI,CAAC,OAAA,KAAiB;AACtC,MAAA,OAAO,IAAI,IAAA;AAAA,QACV,OAAA,EAAS,WAAW,mBAAmB;AAAA,SACrC,WAAA,EAAY;AAAA,IAChB,CAAC,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,IAAI,CAAC,CAAA;AAET,EAAA,OAAO;AAAA,IACN,OAAA,EAAS,SAAA;AAAA,IACT,KAAA;AAAA,IACA;AAAA,GACD;AACD;AAEO,SAAS,OAAA,GAAU;AACzB,EAAA,MAAM,OAAO,QAAA,CAAS;AAAA,IACrB,IAAA,EAAM;AAAA,GACN,CAAA;AACD,EAAA,OAAO,IAAA,CAAK,mBAAA,EAAqB,CAAC,IAAA,EAAM,IAAI,CAAC,CAAA;AAC9C","file":"data.js","sourcesContent":["import { EarthEngineOptions } from \"../../MapLayer/components/GoogleEngineLayer/interfaces\";\nimport { useGoogleEngineToken } from \"../../MapLayer/components/GoogleEngineLayer/hooks\";\nimport { EarthEngine } from \"../../MapLayer/components/GoogleEngineLayer/services/engine.js\";\nimport { useMemo } from \"react\";\nimport { useWatch } from \"react-hook-form\";\nimport { find } from \"lodash\";\nimport { EARTH_ENGINE_LAYERS } from \"../../MapLayer/components/GoogleEngineLayer/constants\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nexport function useDatasetInfo(\n\tshouldRun: boolean,\n\tconfig?: EarthEngineOptions,\n) {\n\tconst { refresh } = useGoogleEngineToken();\n\n\tasync function getInfo() {\n\t\tif (config) {\n\t\t\tconst tokenData = await refresh();\n\t\t\tawait EarthEngine.setToken(tokenData.token, refresh);\n\t\t\tconst engine = new EarthEngine({\n\t\t\t\toptions: config,\n\t\t\t});\n\t\t\treturn engine.getPeriod();\n\t\t}\n\t}\n\n\tconst { data, error, isLoading } = useQuery({\n\t\tqueryKey: [config],\n\t\tenabled: shouldRun,\n\t\tqueryFn: getInfo,\n\t});\n\n\tconst periods = useMemo(() => {\n\t\tconst features = (data as any)?.features;\n\t\treturn features?.map((feature: any) => {\n\t\t\treturn new Date(\n\t\t\t\tfeature?.properties[\"system:time_start\"],\n\t\t\t)?.getFullYear();\n\t\t});\n\t}, [data]);\n\n\treturn {\n\t\tloading: isLoading,\n\t\terror: error as any,\n\t\tperiods,\n\t};\n}\n\nexport function useType() {\n\tconst type = useWatch({\n\t\tname: \"type\",\n\t});\n\treturn find(EARTH_ENGINE_LAYERS, [\"id\", type]);\n}\n"]}
|
package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/hooks/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAS5F,wBAAgB,cAAc,CAC7B,SAAS,EAAE,OAAO,EAClB,MAAM,CAAC,EAAE,kBAAkB;;
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/hooks/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAS5F,wBAAgB,cAAc,CAC7B,SAAS,EAAE,OAAO,EAClB,MAAM,CAAC,EAAE,kBAAkB;;WAgCV,GAAG;;EAGpB;AAED,wBAAgB,OAAO,mCAKtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hisptz/dhis2-analytics",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.35",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"package.json"
|
|
18
18
|
],
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@dhis2/app-runtime": "^3.
|
|
20
|
+
"@dhis2/app-runtime": "^3.16.0",
|
|
21
21
|
"@dhis2/d2-i18n": "^1.1.3",
|
|
22
22
|
"@dhis2/ui": "^10.9.1",
|
|
23
23
|
"@google/earthengine": "^1.5.21",
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
"react-dom": "^18.3.1",
|
|
45
45
|
"react-error-boundary": "^4.0.12",
|
|
46
46
|
"react-hook-form": "^7.43.9",
|
|
47
|
-
"react-query": "^3.39.3",
|
|
48
47
|
"styled-jsx": "^5.1.2",
|
|
49
48
|
"tsup": "^8.4.0",
|
|
50
49
|
"typescript": "^5.3.3",
|
|
@@ -77,10 +76,11 @@
|
|
|
77
76
|
"react-to-print": "^3.0.1",
|
|
78
77
|
"screenfull": "^6.0.2",
|
|
79
78
|
"xlsx": "^0.18.5",
|
|
80
|
-
"@hisptz/dhis2-
|
|
81
|
-
"@hisptz/dhis2-
|
|
79
|
+
"@hisptz/dhis2-ui": "2.0.52",
|
|
80
|
+
"@hisptz/dhis2-utils": "2.0.19"
|
|
82
81
|
},
|
|
83
82
|
"peerDependencies": {
|
|
83
|
+
"@dhis2/app-runtime": "^3",
|
|
84
84
|
"classnames": "^2",
|
|
85
85
|
"highcharts": "^12",
|
|
86
86
|
"highcharts-react-official": "^3",
|
|
@@ -88,7 +88,11 @@
|
|
|
88
88
|
"zod": "^3"
|
|
89
89
|
},
|
|
90
90
|
"publishConfig": {
|
|
91
|
-
"access": "public"
|
|
91
|
+
"access": "public",
|
|
92
|
+
"provenance": true
|
|
93
|
+
},
|
|
94
|
+
"repository": {
|
|
95
|
+
"url": "https://github.com/hisptz/dhis2-utils"
|
|
92
96
|
},
|
|
93
97
|
"scripts": {
|
|
94
98
|
"build": "tsup && tsc",
|