datastake-daf 0.6.835 → 0.6.838
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/index.js +720 -727
- package/dist/hooks/index.js +23 -11
- package/dist/pages/index.js +426 -196
- package/dist/services/index.js +7 -8
- package/dist/style/datastake/mapbox-gl.css +330 -0
- package/package.json +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/hook.js +3 -3
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/index.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/index.jsx +2 -6
- package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/index.jsx +0 -1
- package/src/@daf/hooks/useWidgetFetch.js +20 -7
- package/src/@daf/{core/components/Screens → pages/Dashboards}/ConflictManagement/components/KeyIndicators/config.js +2 -3
- package/src/@daf/{core/components/Screens → pages/Dashboards}/ConflictManagement/components/KeyIndicators/index.js +2 -2
- package/src/@daf/{core/components/Screens → pages/Dashboards}/ConflictManagement/components/MineSite/index.js +3 -3
- package/src/@daf/pages/Dashboards/ConflictManagement/components/RisksWidget/components/IncidentsTime/config.js +206 -0
- package/src/@daf/pages/Dashboards/ConflictManagement/components/RisksWidget/components/IncidentsTime/hook.js +48 -0
- package/src/@daf/pages/Dashboards/ConflictManagement/components/RisksWidget/components/IncidentsTime/index.js +154 -0
- package/src/@daf/pages/Dashboards/ConflictManagement/components/RisksWidget/components/ProblemSolver/hook.js +83 -0
- package/src/@daf/{core/components/Screens → pages/Dashboards}/ConflictManagement/components/RisksWidget/components/ProblemSolver/index.js +14 -7
- package/src/@daf/pages/Dashboards/ConflictManagement/components/RisksWidget/components/TerritorialDistribution/config.js +10 -0
- package/src/@daf/{core/components/Screens → pages/Dashboards}/ConflictManagement/components/RisksWidget/components/TerritorialDistribution/index.js +18 -13
- package/src/@daf/{core/components/Screens → pages/Dashboards}/ConflictManagement/components/RisksWidget/index.js +1 -1
- package/src/@daf/{core/components/Screens → pages/Dashboards}/ConflictManagement/index.js +17 -19
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/PlantingLocations/index.jsx +5 -5
- package/src/@daf/services/DashboardService.js +8 -8
- package/src/pages.js +1 -1
- package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/IncidentsTime/hook.js +0 -32
- package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/IncidentsTime/index.js +0 -73
- package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/ProblemSolver/hook.js +0 -86
- package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/TerritorialDistribution/config.js +0 -34
- /package/src/@daf/{core/components/Screens → pages/Dashboards}/ConflictManagement/components/MineSite/helper.js +0 -0
- /package/src/@daf/{core/components/Screens → pages/Dashboards}/ConflictManagement/components/RisksWidget/config.js +0 -0
package/dist/hooks/index.js
CHANGED
|
@@ -2277,14 +2277,13 @@ class DashboardService extends BaseService {
|
|
|
2277
2277
|
isUserManager: true
|
|
2278
2278
|
});
|
|
2279
2279
|
}
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
// }
|
|
2280
|
+
getWidgetConflictManagement(url, params, basepath = "dashboard/conflict-management") {
|
|
2281
|
+
return this.apiGet({
|
|
2282
|
+
url: `/${basepath}${url}`,
|
|
2283
|
+
params,
|
|
2284
|
+
isApp: true
|
|
2285
|
+
});
|
|
2286
|
+
}
|
|
2288
2287
|
}
|
|
2289
2288
|
var DashboardService$1 = createLazyService(DashboardService);
|
|
2290
2289
|
|
|
@@ -2308,6 +2307,8 @@ const useWidgetFetch = ({
|
|
|
2308
2307
|
} = config;
|
|
2309
2308
|
const [data, setData] = React.useState(defaultData || {});
|
|
2310
2309
|
const [loading, setLoading] = React.useState(false);
|
|
2310
|
+
const [initFetchDone, setInitFetchDone] = React.useState(false);
|
|
2311
|
+
const isMounted = React.useRef(true);
|
|
2311
2312
|
const fetchData = async () => {
|
|
2312
2313
|
if (stop) {
|
|
2313
2314
|
return;
|
|
@@ -2317,6 +2318,7 @@ const useWidgetFetch = ({
|
|
|
2317
2318
|
const {
|
|
2318
2319
|
data
|
|
2319
2320
|
} = await getData(rest);
|
|
2321
|
+
if (!isMounted.current) return;
|
|
2320
2322
|
setData(data || defaultData);
|
|
2321
2323
|
if (isErrorResponse(data)) {
|
|
2322
2324
|
const errorMessage = getErrorMessage(data);
|
|
@@ -2324,18 +2326,28 @@ const useWidgetFetch = ({
|
|
|
2324
2326
|
return;
|
|
2325
2327
|
}
|
|
2326
2328
|
onFetch();
|
|
2329
|
+
setInitFetchDone(true);
|
|
2327
2330
|
} catch (err) {
|
|
2328
2331
|
console.log(err);
|
|
2329
2332
|
}
|
|
2330
|
-
|
|
2333
|
+
if (isMounted.current) {
|
|
2334
|
+
setLoading(false);
|
|
2335
|
+
}
|
|
2331
2336
|
};
|
|
2337
|
+
React.useEffect(() => {
|
|
2338
|
+
isMounted.current = true;
|
|
2339
|
+
return () => {
|
|
2340
|
+
isMounted.current = false;
|
|
2341
|
+
};
|
|
2342
|
+
}, []);
|
|
2332
2343
|
React.useEffect(() => {
|
|
2333
2344
|
fetchData();
|
|
2334
|
-
}, [JSON.stringify(
|
|
2345
|
+
}, [JSON.stringify(config)]);
|
|
2335
2346
|
return {
|
|
2336
2347
|
data,
|
|
2337
2348
|
loading,
|
|
2338
|
-
setData
|
|
2349
|
+
setData,
|
|
2350
|
+
initFetchDone
|
|
2339
2351
|
};
|
|
2340
2352
|
};
|
|
2341
2353
|
|