datastake-daf 0.6.834 → 0.6.837
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 +2354 -2200
- package/dist/hooks/index.js +7 -8
- package/dist/pages/index.js +441 -234
- package/dist/services/index.js +7 -8
- package/dist/utils/index.js +18 -0
- package/package.json +1 -1
- package/src/@daf/core/components/AuthForm/index.jsx +34 -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/{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/Dashboards/SupplyChain/components/ChartsContainer/components/GenderDistribution/index.js +1 -1
- package/src/@daf/pages/Dashboards/SupplyChain/components/KeyIndicators/config.js +4 -4
- package/src/@daf/pages/Data/Channels/columns.js +1 -1
- package/src/@daf/pages/Events/Activities/columns.js +1 -2
- package/src/@daf/pages/Events/Incidents/columns.js +1 -2
- package/src/@daf/pages/Events/Testimonials/columns.js +1 -2
- package/src/@daf/pages/Events/columns.js +3 -3
- package/src/@daf/pages/Locations/MineSite/columns.js +1 -1
- package/src/@daf/pages/Stakeholders/Operators/columns.js +0 -2
- package/src/@daf/pages/Stakeholders/Workers/columns.js +1 -3
- package/src/@daf/pages/Summary/Operator/components/KeyInformation/config.js +1 -0
- package/src/@daf/pages/TablePage/create.jsx +6 -6
- package/src/@daf/pages/TablePage/index.jsx +1 -7
- package/src/@daf/services/DashboardService.js +8 -8
- package/src/constants/locales/en/translation.js +6 -0
- package/src/constants/locales/fr/translation.js +6 -0
- package/src/constants/locales/sp/translation.js +6 -0
- package/src/pages.js +1 -1
- package/build/favicon.ico +0 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +0 -25
- package/build/robots.txt +0 -3
- 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/pages/index.js
CHANGED
|
@@ -7476,14 +7476,13 @@ class DashboardService extends BaseService {
|
|
|
7476
7476
|
isUserManager: true
|
|
7477
7477
|
});
|
|
7478
7478
|
}
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
// }
|
|
7479
|
+
getWidgetConflictManagement(url, params, basepath = "dashboard/conflict-management") {
|
|
7480
|
+
return this.apiGet({
|
|
7481
|
+
url: `/${basepath}${url}`,
|
|
7482
|
+
params,
|
|
7483
|
+
isApp: true
|
|
7484
|
+
});
|
|
7485
|
+
}
|
|
7487
7486
|
}
|
|
7488
7487
|
var DashboardService$1 = createLazyService(DashboardService);
|
|
7489
7488
|
|
|
@@ -7495,7 +7494,7 @@ var DashboardService$1 = createLazyService(DashboardService);
|
|
|
7495
7494
|
// basePath: string,
|
|
7496
7495
|
// }
|
|
7497
7496
|
|
|
7498
|
-
const useWidgetFetch
|
|
7497
|
+
const useWidgetFetch = ({
|
|
7499
7498
|
config,
|
|
7500
7499
|
getData = DashboardService$1.getWidget,
|
|
7501
7500
|
onFetch = () => {}
|
|
@@ -7575,7 +7574,7 @@ const getRowConfig$2 = ({
|
|
|
7575
7574
|
t: t,
|
|
7576
7575
|
getRedirectLink: getRedirectLink,
|
|
7577
7576
|
theme: theme,
|
|
7578
|
-
label: "Identified Mine Sites",
|
|
7577
|
+
label: t("Identified Mine Sites"),
|
|
7579
7578
|
link: APP === 'nashiriki' ? '/app/scl' : '/app/production-sites'
|
|
7580
7579
|
}),
|
|
7581
7580
|
render: () => {
|
|
@@ -7588,7 +7587,7 @@ const getRowConfig$2 = ({
|
|
|
7588
7587
|
t: t,
|
|
7589
7588
|
getRedirectLink: getRedirectLink,
|
|
7590
7589
|
theme: theme,
|
|
7591
|
-
label: "Identified Operators",
|
|
7590
|
+
label: t("Identified Operators"),
|
|
7592
7591
|
link: "/app/operators"
|
|
7593
7592
|
}),
|
|
7594
7593
|
render: () => /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -7610,7 +7609,7 @@ const getRowConfig$2 = ({
|
|
|
7610
7609
|
t: t,
|
|
7611
7610
|
getRedirectLink: getRedirectLink,
|
|
7612
7611
|
theme: theme,
|
|
7613
|
-
label: "Associated Documents",
|
|
7612
|
+
label: t("Associated Documents"),
|
|
7614
7613
|
link: "/app/documents"
|
|
7615
7614
|
}),
|
|
7616
7615
|
render: () => /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -7621,7 +7620,7 @@ const getRowConfig$2 = ({
|
|
|
7621
7620
|
t: t,
|
|
7622
7621
|
getRedirectLink: getRedirectLink,
|
|
7623
7622
|
theme: theme,
|
|
7624
|
-
label: "Information Sources",
|
|
7623
|
+
label: t("Information Sources"),
|
|
7625
7624
|
link: "/app/partners"
|
|
7626
7625
|
}),
|
|
7627
7626
|
render: () => /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -8197,7 +8196,7 @@ function KeyIndicators$2({
|
|
|
8197
8196
|
const {
|
|
8198
8197
|
data,
|
|
8199
8198
|
loading
|
|
8200
|
-
} = useWidgetFetch
|
|
8199
|
+
} = useWidgetFetch({
|
|
8201
8200
|
config: fetchConfig
|
|
8202
8201
|
});
|
|
8203
8202
|
const config = React.useMemo(() => {
|
|
@@ -11304,7 +11303,7 @@ function SupplyChainMap({
|
|
|
11304
11303
|
const {
|
|
11305
11304
|
loading,
|
|
11306
11305
|
data
|
|
11307
|
-
} = useWidgetFetch
|
|
11306
|
+
} = useWidgetFetch({
|
|
11308
11307
|
config: defaultConfig
|
|
11309
11308
|
});
|
|
11310
11309
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, {
|
|
@@ -13807,7 +13806,7 @@ function GenderDistribution$1({
|
|
|
13807
13806
|
return renderTooltipJsx({
|
|
13808
13807
|
title: t("Role"),
|
|
13809
13808
|
items: [{
|
|
13810
|
-
label: options?.optionPositionSupplyChain?.find(o => {
|
|
13809
|
+
label: (options?.optionPositionSupplyChain || options?.positionSupplyChainOptions || [])?.find(o => {
|
|
13811
13810
|
return o.value === item.key;
|
|
13812
13811
|
}).label || item.key,
|
|
13813
13812
|
value: data[item.key] || 0
|
|
@@ -13897,7 +13896,7 @@ function ChartsContainer({
|
|
|
13897
13896
|
const {
|
|
13898
13897
|
loading,
|
|
13899
13898
|
data
|
|
13900
|
-
} = useWidgetFetch
|
|
13899
|
+
} = useWidgetFetch({
|
|
13901
13900
|
config: defaultConfig,
|
|
13902
13901
|
onFetch: () => setPreviousRange(selectedRange)
|
|
13903
13902
|
});
|
|
@@ -14196,7 +14195,7 @@ function KeyIndicators$1({
|
|
|
14196
14195
|
const {
|
|
14197
14196
|
data,
|
|
14198
14197
|
loading
|
|
14199
|
-
} = useWidgetFetch
|
|
14198
|
+
} = useWidgetFetch({
|
|
14200
14199
|
config: fetchConfig
|
|
14201
14200
|
});
|
|
14202
14201
|
const config = React.useMemo(() => getRowConfig$1({
|
|
@@ -14433,7 +14432,7 @@ function MineSites$1({
|
|
|
14433
14432
|
const {
|
|
14434
14433
|
data: _formData,
|
|
14435
14434
|
loading: formLoading
|
|
14436
|
-
} = useWidgetFetch
|
|
14435
|
+
} = useWidgetFetch({
|
|
14437
14436
|
config: _formFetchConfig
|
|
14438
14437
|
});
|
|
14439
14438
|
React.useEffect(() => {
|
|
@@ -14462,7 +14461,7 @@ function MineSites$1({
|
|
|
14462
14461
|
data,
|
|
14463
14462
|
loading,
|
|
14464
14463
|
setData
|
|
14465
|
-
} = useWidgetFetch
|
|
14464
|
+
} = useWidgetFetch({
|
|
14466
14465
|
config: dataFetchConfig
|
|
14467
14466
|
});
|
|
14468
14467
|
const tabs = React.useMemo(() => getTabs(t), [t]);
|
|
@@ -14840,7 +14839,7 @@ function AccumulationGraph({
|
|
|
14840
14839
|
const {
|
|
14841
14840
|
data,
|
|
14842
14841
|
loading
|
|
14843
|
-
} = useWidgetFetch
|
|
14842
|
+
} = useWidgetFetch({
|
|
14844
14843
|
config: fetchConfig
|
|
14845
14844
|
});
|
|
14846
14845
|
const selectOptions = React.useMemo(() => [{
|
|
@@ -15188,7 +15187,7 @@ function ContributionsGraph({
|
|
|
15188
15187
|
const {
|
|
15189
15188
|
data,
|
|
15190
15189
|
loading
|
|
15191
|
-
} = useWidgetFetch
|
|
15190
|
+
} = useWidgetFetch({
|
|
15192
15191
|
config: fetchConfig
|
|
15193
15192
|
});
|
|
15194
15193
|
const chartConfig = useContributionsGraph({
|
|
@@ -15318,7 +15317,7 @@ function Triangulation({
|
|
|
15318
15317
|
const {
|
|
15319
15318
|
data: widgetData,
|
|
15320
15319
|
loading
|
|
15321
|
-
} = useWidgetFetch
|
|
15320
|
+
} = useWidgetFetch({
|
|
15322
15321
|
config: fetchConfig
|
|
15323
15322
|
});
|
|
15324
15323
|
const {
|
|
@@ -15479,7 +15478,7 @@ function DataChainOfCustody({
|
|
|
15479
15478
|
const {
|
|
15480
15479
|
data,
|
|
15481
15480
|
loading
|
|
15482
|
-
} = useWidgetFetch
|
|
15481
|
+
} = useWidgetFetch({
|
|
15483
15482
|
config: fetchConfig
|
|
15484
15483
|
});
|
|
15485
15484
|
const mappedData = mapDataForChainOfCustody(Object.keys(data)?.length > 0 ? data : hardcodedData, options, goTo);
|
|
@@ -17102,7 +17101,7 @@ function AssociatedInformation$1({
|
|
|
17102
17101
|
const {
|
|
17103
17102
|
data,
|
|
17104
17103
|
loading
|
|
17105
|
-
} = useWidgetFetch
|
|
17104
|
+
} = useWidgetFetch({
|
|
17106
17105
|
config: defaultConfig
|
|
17107
17106
|
});
|
|
17108
17107
|
console.log({
|
|
@@ -41046,21 +41045,20 @@ const Create = ({
|
|
|
41046
41045
|
form: formConfig,
|
|
41047
41046
|
data: formValue
|
|
41048
41047
|
};
|
|
41048
|
+
const language = React.useMemo(() => user?.language, [user?.language]);
|
|
41049
41049
|
React.useEffect(() => {
|
|
41050
|
-
if (
|
|
41051
|
-
|
|
41052
|
-
|
|
41053
|
-
|
|
41054
|
-
|
|
41055
|
-
|
|
41056
|
-
|
|
41057
|
-
|
|
41058
|
-
|
|
41059
|
-
|
|
41060
|
-
data = formValue;
|
|
41061
|
-
}
|
|
41050
|
+
if (!edit) {
|
|
41051
|
+
getData({
|
|
41052
|
+
namespace,
|
|
41053
|
+
module: APP,
|
|
41054
|
+
view,
|
|
41055
|
+
scope
|
|
41056
|
+
});
|
|
41057
|
+
} else {
|
|
41058
|
+
form = formConfig;
|
|
41059
|
+
data = formValue;
|
|
41062
41060
|
}
|
|
41063
|
-
}, [edit,
|
|
41061
|
+
}, [edit, language, scope, namespace, APP, view]);
|
|
41064
41062
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41065
41063
|
className: "daf-create-form",
|
|
41066
41064
|
children: /*#__PURE__*/jsxRuntime.jsx(DynamicForm, {
|
|
@@ -41707,7 +41705,7 @@ const getColumns$e = ({
|
|
|
41707
41705
|
className: "daf-default-cell"
|
|
41708
41706
|
});
|
|
41709
41707
|
}
|
|
41710
|
-
const positionSupplyChainOptions = [...(
|
|
41708
|
+
const positionSupplyChainOptions = [...(options?.positionSupplyChainOptions || []), ...(options?.optionPositionSupplyChain || [])];
|
|
41711
41709
|
const country = findOptions(v, positionSupplyChainOptions);
|
|
41712
41710
|
return country ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
41713
41711
|
title: country,
|
|
@@ -41727,7 +41725,7 @@ const getColumns$e = ({
|
|
|
41727
41725
|
className: "daf-default-cell"
|
|
41728
41726
|
});
|
|
41729
41727
|
}
|
|
41730
|
-
const subCategoriesOptions = [...(
|
|
41728
|
+
const subCategoriesOptions = [...(options?.subCategoriesOptions || []), ...(options?.subCategory || [])];
|
|
41731
41729
|
const subCategory = findOptions(v, subCategoriesOptions);
|
|
41732
41730
|
return subCategory ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
41733
41731
|
title: subCategory,
|
|
@@ -42100,8 +42098,6 @@ const getColumns$d = ({
|
|
|
42100
42098
|
className: "daf-default-cell"
|
|
42101
42099
|
});
|
|
42102
42100
|
}
|
|
42103
|
-
|
|
42104
|
-
// const country = findOptions(v, data?.options?.positionSupplyChainOptions);
|
|
42105
42101
|
const mineSite = all?.location?.name;
|
|
42106
42102
|
return mineSite ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
42107
42103
|
title: mineSite,
|
|
@@ -42119,7 +42115,7 @@ const getColumns$d = ({
|
|
|
42119
42115
|
className: "daf-default-cell"
|
|
42120
42116
|
});
|
|
42121
42117
|
}
|
|
42122
|
-
const activityAtSiteOptions = [...(
|
|
42118
|
+
const activityAtSiteOptions = [...(options?.activityAtSiteOptions || []), ...(options?.activityAtSite || [])];
|
|
42123
42119
|
const activity = findOptions(v, activityAtSiteOptions);
|
|
42124
42120
|
return activity ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
42125
42121
|
title: activity,
|
|
@@ -42858,14 +42854,14 @@ const getColumns$b = ({
|
|
|
42858
42854
|
if (all.navigationEventType === "other") {
|
|
42859
42855
|
return "-";
|
|
42860
42856
|
}
|
|
42861
|
-
const categoryOptions = (
|
|
42857
|
+
const categoryOptions = (options?.categoryOptions || []).map(c => {
|
|
42862
42858
|
const searchTerm = `typeOfEvent is ${all.navigationEventType}`;
|
|
42863
42859
|
return {
|
|
42864
42860
|
value: c.value,
|
|
42865
42861
|
label: c.label[searchTerm]
|
|
42866
42862
|
};
|
|
42867
42863
|
});
|
|
42868
|
-
const relaxantOptions = [...categoryOptions, ...(
|
|
42864
|
+
const relaxantOptions = [...categoryOptions, ...(options?.eventsType || []), ...(options?.testimonialsType || [])];
|
|
42869
42865
|
const title = relaxantOptions.find(v => v.value === value)?.label || "-";
|
|
42870
42866
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
42871
42867
|
title: title,
|
|
@@ -43280,8 +43276,6 @@ const getColumns$a = ({
|
|
|
43280
43276
|
className: "daf-default-cell"
|
|
43281
43277
|
});
|
|
43282
43278
|
}
|
|
43283
|
-
|
|
43284
|
-
// const country = findOptions(v, data?.options?.positionSupplyChainOptions);
|
|
43285
43279
|
const mineSite = all?.location?.name;
|
|
43286
43280
|
return mineSite ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
43287
43281
|
title: mineSite,
|
|
@@ -43337,7 +43331,7 @@ const getColumns$a = ({
|
|
|
43337
43331
|
"corrective-actions": "correctiveActions",
|
|
43338
43332
|
"activities": "activity"
|
|
43339
43333
|
};
|
|
43340
|
-
const eventCategory = findOptions(v,
|
|
43334
|
+
const eventCategory = findOptions(v, options?.eventCategoryOptions || options?.categoryOptions);
|
|
43341
43335
|
const categoryValue = getEventCategoryBySubject(eventCategory, subjectMap[subject], true);
|
|
43342
43336
|
return categoryValue ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
43343
43337
|
title: categoryValue,
|
|
@@ -43712,8 +43706,6 @@ const getColumns$9 = ({
|
|
|
43712
43706
|
className: "daf-default-cell"
|
|
43713
43707
|
});
|
|
43714
43708
|
}
|
|
43715
|
-
|
|
43716
|
-
// const country = findOptions(v, data?.options?.positionSupplyChainOptions);
|
|
43717
43709
|
const mineSite = all?.location?.name;
|
|
43718
43710
|
return mineSite ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
43719
43711
|
title: mineSite,
|
|
@@ -43765,7 +43757,7 @@ const getColumns$9 = ({
|
|
|
43765
43757
|
className: "daf-default-cell"
|
|
43766
43758
|
});
|
|
43767
43759
|
}
|
|
43768
|
-
const eventCategory = findOptions(v,
|
|
43760
|
+
const eventCategory = findOptions(v, options?.eventCategoryOptions || options?.categoryOptions);
|
|
43769
43761
|
const categoryValue = getEventCategoryBySubject(eventCategory, subject);
|
|
43770
43762
|
return categoryValue ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
43771
43763
|
title: categoryValue,
|
|
@@ -44160,8 +44152,6 @@ const getColumns$8 = ({
|
|
|
44160
44152
|
className: "daf-default-cell"
|
|
44161
44153
|
});
|
|
44162
44154
|
}
|
|
44163
|
-
|
|
44164
|
-
// const country = findOptions(v, data?.options?.positionSupplyChainOptions);
|
|
44165
44155
|
const mineSite = all?.location?.name;
|
|
44166
44156
|
return mineSite ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
44167
44157
|
title: mineSite,
|
|
@@ -44179,7 +44169,7 @@ const getColumns$8 = ({
|
|
|
44179
44169
|
className: "daf-default-cell"
|
|
44180
44170
|
});
|
|
44181
44171
|
}
|
|
44182
|
-
const eventCategory = findOptions(v,
|
|
44172
|
+
const eventCategory = findOptions(v, options?.eventCategoryOptions || options?.categoryOptions);
|
|
44183
44173
|
const categoryValue = getEventCategoryBySubject(eventCategory, subject);
|
|
44184
44174
|
return categoryValue ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
44185
44175
|
title: categoryValue,
|
|
@@ -44794,7 +44784,7 @@ const getColumns$6 = ({
|
|
|
44794
44784
|
className: "daf-default-cell"
|
|
44795
44785
|
});
|
|
44796
44786
|
}
|
|
44797
|
-
const locationCategories = [...(
|
|
44787
|
+
const locationCategories = [...(options?.locationCategories || []), ...(options?.productionSiteCategories || []), ...(options?.locationCategories || [])];
|
|
44798
44788
|
const category = findOptions(v, locationCategories);
|
|
44799
44789
|
return category ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
44800
44790
|
title: category,
|
|
@@ -45689,12 +45679,6 @@ const TablePage = ({
|
|
|
45689
45679
|
breadcrumbs = [],
|
|
45690
45680
|
onDownload
|
|
45691
45681
|
}) => {
|
|
45692
|
-
const _options = React.useMemo(() => {
|
|
45693
|
-
return {
|
|
45694
|
-
...options,
|
|
45695
|
-
...data?.options
|
|
45696
|
-
};
|
|
45697
|
-
}, [options, data?.options]);
|
|
45698
45682
|
const {
|
|
45699
45683
|
activeTab,
|
|
45700
45684
|
selectOptions,
|
|
@@ -45710,7 +45694,7 @@ const TablePage = ({
|
|
|
45710
45694
|
location,
|
|
45711
45695
|
getData,
|
|
45712
45696
|
extendingFilters,
|
|
45713
|
-
options
|
|
45697
|
+
options,
|
|
45714
45698
|
t,
|
|
45715
45699
|
goTo,
|
|
45716
45700
|
user,
|
|
@@ -46035,6 +46019,11 @@ const getKeyIndicatorConfig = ({
|
|
|
46035
46019
|
label: t("Legal Form"),
|
|
46036
46020
|
render: () => {
|
|
46037
46021
|
const subCategory = findOptions(data?.subCategory, options?.subCategoriesOptions || options?.subCategory);
|
|
46022
|
+
console.log({
|
|
46023
|
+
subCategory,
|
|
46024
|
+
initialSub: data?.subCategory,
|
|
46025
|
+
options: options?.subCategoriesOptions || options?.subCategory
|
|
46026
|
+
});
|
|
46038
46027
|
if (subCategory?.length > 22) {
|
|
46039
46028
|
const _subCategory = truncateString(subCategory, 22);
|
|
46040
46029
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
@@ -46415,7 +46404,7 @@ const InformationAvailability = ({
|
|
|
46415
46404
|
const {
|
|
46416
46405
|
data,
|
|
46417
46406
|
loading
|
|
46418
|
-
} = useWidgetFetch
|
|
46407
|
+
} = useWidgetFetch({
|
|
46419
46408
|
config: defaultFetchConfig
|
|
46420
46409
|
});
|
|
46421
46410
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, {
|
|
@@ -46633,7 +46622,7 @@ const useTradeRelationship = ({
|
|
|
46633
46622
|
}), [id, filters?.products, selectedPartners?.partners, selectedPartners?.loading]);
|
|
46634
46623
|
const {
|
|
46635
46624
|
data
|
|
46636
|
-
} = useWidgetFetch
|
|
46625
|
+
} = useWidgetFetch({
|
|
46637
46626
|
config: config
|
|
46638
46627
|
});
|
|
46639
46628
|
const mapItem$1 = data => {
|
|
@@ -47665,7 +47654,7 @@ const Governance = ({
|
|
|
47665
47654
|
const {
|
|
47666
47655
|
data,
|
|
47667
47656
|
loading
|
|
47668
|
-
} = useWidgetFetch
|
|
47657
|
+
} = useWidgetFetch({
|
|
47669
47658
|
config: defaultFetchConfig
|
|
47670
47659
|
});
|
|
47671
47660
|
const graphData = React.useMemo(() => {
|
|
@@ -55554,7 +55543,7 @@ const PlantingLocations = ({
|
|
|
55554
55543
|
const {
|
|
55555
55544
|
loading: plantingLocationsLoading,
|
|
55556
55545
|
data: plantingLocationsData
|
|
55557
|
-
} = useWidgetFetch
|
|
55546
|
+
} = useWidgetFetch({
|
|
55558
55547
|
config: defaultConfig,
|
|
55559
55548
|
getData: customGetData
|
|
55560
55549
|
});
|
|
@@ -56252,7 +56241,7 @@ const CycleOutcomes = ({
|
|
|
56252
56241
|
const {
|
|
56253
56242
|
loading: dataDetailsLoading,
|
|
56254
56243
|
data: dataDetails
|
|
56255
|
-
} = useWidgetFetch
|
|
56244
|
+
} = useWidgetFetch({
|
|
56256
56245
|
config: defaultConfig,
|
|
56257
56246
|
getData: customGetData
|
|
56258
56247
|
});
|
|
@@ -56640,7 +56629,7 @@ const HealthAndSafety = ({
|
|
|
56640
56629
|
const {
|
|
56641
56630
|
loading: pieChartLoading,
|
|
56642
56631
|
data: pieChartData
|
|
56643
|
-
} = useWidgetFetch
|
|
56632
|
+
} = useWidgetFetch({
|
|
56644
56633
|
config: defaultConfig,
|
|
56645
56634
|
getData: customGetData
|
|
56646
56635
|
});
|
|
@@ -56769,7 +56758,7 @@ const CycleIndicators = ({
|
|
|
56769
56758
|
const {
|
|
56770
56759
|
loading: indicatorsLoading,
|
|
56771
56760
|
data: indicatorsData
|
|
56772
|
-
} = useWidgetFetch
|
|
56761
|
+
} = useWidgetFetch({
|
|
56773
56762
|
config: defaultConfig,
|
|
56774
56763
|
getData: customGetData
|
|
56775
56764
|
});
|
|
@@ -57278,7 +57267,7 @@ const CommunityParticipation = ({
|
|
|
57278
57267
|
const {
|
|
57279
57268
|
loading: communityParticipationLoading,
|
|
57280
57269
|
data: communityParticipationData
|
|
57281
|
-
} = useWidgetFetch
|
|
57270
|
+
} = useWidgetFetch({
|
|
57282
57271
|
config: defaultConfig,
|
|
57283
57272
|
getData: customGetData
|
|
57284
57273
|
});
|
|
@@ -57999,7 +57988,7 @@ const AssociatedInformation = ({
|
|
|
57999
57988
|
loading: associatedInformationLoading,
|
|
58000
57989
|
data: associatedInformationData,
|
|
58001
57990
|
setData
|
|
58002
|
-
} = useWidgetFetch
|
|
57991
|
+
} = useWidgetFetch({
|
|
58003
57992
|
config: defaultConfig,
|
|
58004
57993
|
getData: customGetData
|
|
58005
57994
|
});
|
|
@@ -58133,7 +58122,7 @@ const KeyInformation$1 = ({
|
|
|
58133
58122
|
const {
|
|
58134
58123
|
loading: keyInformationLoading,
|
|
58135
58124
|
data: keyInformationData
|
|
58136
|
-
} = useWidgetFetch
|
|
58125
|
+
} = useWidgetFetch({
|
|
58137
58126
|
config: defaultConfig,
|
|
58138
58127
|
getData: customGetData
|
|
58139
58128
|
});
|
|
@@ -58283,7 +58272,7 @@ const KeyInformation = ({
|
|
|
58283
58272
|
const {
|
|
58284
58273
|
loading: keyInformationLoading,
|
|
58285
58274
|
data: keyInformationData
|
|
58286
|
-
} = useWidgetFetch
|
|
58275
|
+
} = useWidgetFetch({
|
|
58287
58276
|
config: defaultConfig,
|
|
58288
58277
|
getData: customGetData
|
|
58289
58278
|
});
|
|
@@ -58340,7 +58329,7 @@ const MonitoringScopeAndFindings = ({
|
|
|
58340
58329
|
const {
|
|
58341
58330
|
loading: monitoringScopeLoading,
|
|
58342
58331
|
data: monitoringScopeData
|
|
58343
|
-
} = useWidgetFetch
|
|
58332
|
+
} = useWidgetFetch({
|
|
58344
58333
|
config: defaultConfig,
|
|
58345
58334
|
getData: customGetData
|
|
58346
58335
|
});
|
|
@@ -59128,7 +59117,7 @@ const MangroveGrowth = ({
|
|
|
59128
59117
|
const {
|
|
59129
59118
|
loading: outcomesLoading,
|
|
59130
59119
|
data: outcomesData
|
|
59131
|
-
} = useWidgetFetch
|
|
59120
|
+
} = useWidgetFetch({
|
|
59132
59121
|
config: defaultConfig,
|
|
59133
59122
|
getData: customGetData
|
|
59134
59123
|
});
|
|
@@ -59408,7 +59397,7 @@ const BiodiversityHabitat = ({
|
|
|
59408
59397
|
const {
|
|
59409
59398
|
loading: outcomesLoading,
|
|
59410
59399
|
data: outcomesData
|
|
59411
|
-
} = useWidgetFetch
|
|
59400
|
+
} = useWidgetFetch({
|
|
59412
59401
|
config: defaultConfig,
|
|
59413
59402
|
getData: customGetData
|
|
59414
59403
|
});
|
|
@@ -59800,7 +59789,7 @@ const SoilWaterProfile = ({
|
|
|
59800
59789
|
const {
|
|
59801
59790
|
loading: outcomesLoading,
|
|
59802
59791
|
data: outcomesData
|
|
59803
|
-
} = useWidgetFetch
|
|
59792
|
+
} = useWidgetFetch({
|
|
59804
59793
|
config: defaultConfig,
|
|
59805
59794
|
getData: customGetData
|
|
59806
59795
|
});
|
|
@@ -60038,7 +60027,7 @@ const StakeholderMapping = ({
|
|
|
60038
60027
|
const {
|
|
60039
60028
|
data,
|
|
60040
60029
|
loading
|
|
60041
|
-
} = useWidgetFetch
|
|
60030
|
+
} = useWidgetFetch({
|
|
60042
60031
|
config: defaultFilter
|
|
60043
60032
|
});
|
|
60044
60033
|
const graphData = React.useMemo(() => {
|
|
@@ -60204,7 +60193,7 @@ const MineDetailsSection = ({
|
|
|
60204
60193
|
const {
|
|
60205
60194
|
data,
|
|
60206
60195
|
loading: loadingData
|
|
60207
|
-
} = useWidgetFetch
|
|
60196
|
+
} = useWidgetFetch({
|
|
60208
60197
|
config: defaultFetchConfig
|
|
60209
60198
|
});
|
|
60210
60199
|
return /*#__PURE__*/jsxRuntime.jsxs("section", {
|
|
@@ -63557,7 +63546,7 @@ const getRowConfig = ({
|
|
|
63557
63546
|
children: t("Reported Incidents")
|
|
63558
63547
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
63559
63548
|
className: "cursor-pointer",
|
|
63560
|
-
onClick: () => goTo(getRedirectLink("/app/
|
|
63549
|
+
onClick: () => goTo(getRedirectLink("/app/incidents")),
|
|
63561
63550
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
63562
63551
|
name: "LinkNewTab",
|
|
63563
63552
|
width: 16,
|
|
@@ -63654,7 +63643,7 @@ function KeyIndicators({
|
|
|
63654
63643
|
const {
|
|
63655
63644
|
data,
|
|
63656
63645
|
loading
|
|
63657
|
-
} = useWidgetFetch
|
|
63646
|
+
} = useWidgetFetch({
|
|
63658
63647
|
config: fetchConfig
|
|
63659
63648
|
});
|
|
63660
63649
|
const config = React.useMemo(() => getRowConfig({
|
|
@@ -63721,7 +63710,7 @@ function MineSites({
|
|
|
63721
63710
|
const {
|
|
63722
63711
|
data,
|
|
63723
63712
|
loading
|
|
63724
|
-
} = useWidgetFetch
|
|
63713
|
+
} = useWidgetFetch({
|
|
63725
63714
|
config: defaultFetchConfig
|
|
63726
63715
|
});
|
|
63727
63716
|
// const { user } = useSelector((state) => state.authentication);
|
|
@@ -63876,19 +63865,195 @@ function MineSites({
|
|
|
63876
63865
|
});
|
|
63877
63866
|
}
|
|
63878
63867
|
|
|
63868
|
+
var isoWeek = createCommonjsModule(function (module, exports) {
|
|
63869
|
+
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){var e="day";return function(t,i,s){var a=function(t){return t.add(4-t.isoWeekday(),e)},d=i.prototype;d.isoWeekYear=function(){return a(this).year()},d.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var i,d,n,o,r=a(this),u=(i=this.isoWeekYear(),d=this.$u,n=(d?s.utc:s)().year(i).startOf("year"),o=4-n.isoWeekday(),n.isoWeekday()>4&&(o+=7),n.add(o,e));return r.diff(u,"week")+1},d.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var n=d.startOf;d.startOf=function(e,t){var i=this.$utils(),s=!!i.u(t)||t;return "isoweek"===i.p(e)?s?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):n.bind(this)(e,t)};}}));
|
|
63870
|
+
});
|
|
63871
|
+
|
|
63872
|
+
dayjs__default["default"].extend(isoWeek);
|
|
63873
|
+
function useTimelineBase({
|
|
63874
|
+
language,
|
|
63875
|
+
selectedRange
|
|
63876
|
+
}) {
|
|
63877
|
+
const locale = React.useMemo(() => language === "sp" ? "es" : language || "en", [language]);
|
|
63878
|
+
const baseMonths = React.useMemo(() => {
|
|
63879
|
+
if (selectedRange === "12") {
|
|
63880
|
+
const y = dayjs__default["default"]().year();
|
|
63881
|
+
const arr = [];
|
|
63882
|
+
for (let i = 0; i < 12; i++) {
|
|
63883
|
+
const d = dayjs__default["default"]().year(y).month(i);
|
|
63884
|
+
arr.push({
|
|
63885
|
+
key: d.format("YYYY-MM"),
|
|
63886
|
+
label: d.locale(locale).format("MMM YYYY"),
|
|
63887
|
+
date: d.toISOString()
|
|
63888
|
+
});
|
|
63889
|
+
}
|
|
63890
|
+
return arr;
|
|
63891
|
+
}
|
|
63892
|
+
if (selectedRange === "3") {
|
|
63893
|
+
const end = dayjs__default["default"]().endOf("month");
|
|
63894
|
+
const start = end.subtract(2, "month").startOf("month");
|
|
63895
|
+
const diff = end.diff(start, "month");
|
|
63896
|
+
const arr = [];
|
|
63897
|
+
for (let i = 0; i <= diff; i++) {
|
|
63898
|
+
const d = start.add(i, "month");
|
|
63899
|
+
arr.push({
|
|
63900
|
+
key: d.format("YYYY-MM"),
|
|
63901
|
+
label: d.locale(locale).format("MMM YYYY"),
|
|
63902
|
+
date: d.toISOString()
|
|
63903
|
+
});
|
|
63904
|
+
}
|
|
63905
|
+
return arr;
|
|
63906
|
+
}
|
|
63907
|
+
return [];
|
|
63908
|
+
}, [locale, selectedRange]);
|
|
63909
|
+
const baseWeeks = React.useMemo(() => {
|
|
63910
|
+
if (selectedRange !== "3") return [];
|
|
63911
|
+
const end = dayjs__default["default"]().endOf("week");
|
|
63912
|
+
const start = end.subtract(12, "week");
|
|
63913
|
+
const diff = end.diff(start, "week");
|
|
63914
|
+
const arr = [];
|
|
63915
|
+
for (let i = 0; i <= diff; i++) {
|
|
63916
|
+
const d = start.add(i, "week");
|
|
63917
|
+
arr.push({
|
|
63918
|
+
key: d.format("GGGG-[W]WW"),
|
|
63919
|
+
label: d.format("[W]WW"),
|
|
63920
|
+
date: d.toISOString()
|
|
63921
|
+
});
|
|
63922
|
+
}
|
|
63923
|
+
return arr;
|
|
63924
|
+
}, [selectedRange]);
|
|
63925
|
+
const severityOrder = ["minor", "moderate", "major"];
|
|
63926
|
+
const mergeWithData = React.useCallback((backendData = []) => {
|
|
63927
|
+
let events = [];
|
|
63928
|
+
if (Array.isArray(backendData)) {
|
|
63929
|
+
backendData.forEach(entry => {
|
|
63930
|
+
if (!entry) return;
|
|
63931
|
+
if (typeof entry === "object" && !Array.isArray(entry)) {
|
|
63932
|
+
Object.values(entry).forEach(arr => {
|
|
63933
|
+
if (Array.isArray(arr)) events.push(...arr);
|
|
63934
|
+
});
|
|
63935
|
+
} else if (Array.isArray(entry)) {
|
|
63936
|
+
events.push(...entry);
|
|
63937
|
+
}
|
|
63938
|
+
});
|
|
63939
|
+
} else if (backendData && typeof backendData === "object") {
|
|
63940
|
+
Object.values(backendData).forEach(arr => {
|
|
63941
|
+
if (Array.isArray(arr)) events.push(...arr);
|
|
63942
|
+
});
|
|
63943
|
+
}
|
|
63944
|
+
if (selectedRange === "12") {
|
|
63945
|
+
const monthBuckets = baseMonths.reduce((acc, m) => {
|
|
63946
|
+
acc[m.key] = [];
|
|
63947
|
+
return acc;
|
|
63948
|
+
}, {});
|
|
63949
|
+
events.forEach(ev => {
|
|
63950
|
+
const d = dayjs__default["default"](ev.date);
|
|
63951
|
+
const key = d.format("YYYY-MM");
|
|
63952
|
+
if (monthBuckets[key]) monthBuckets[key].push(ev);
|
|
63953
|
+
});
|
|
63954
|
+
const res = [];
|
|
63955
|
+
baseMonths.forEach(m => {
|
|
63956
|
+
const arr = monthBuckets[m.key];
|
|
63957
|
+
if (!arr.length) {
|
|
63958
|
+
res.push({
|
|
63959
|
+
label: m.label,
|
|
63960
|
+
key: m.key,
|
|
63961
|
+
severity: "placeholder",
|
|
63962
|
+
category: "placeholder",
|
|
63963
|
+
value: 1,
|
|
63964
|
+
isPlaceholder: true
|
|
63965
|
+
});
|
|
63966
|
+
return;
|
|
63967
|
+
}
|
|
63968
|
+
arr.sort((a, b) => severityOrder.indexOf(a.severity) - severityOrder.indexOf(b.severity)).forEach((ev, idx) => {
|
|
63969
|
+
const source = Array.isArray(ev.source) ? ev.source.join(", ") : ev.source;
|
|
63970
|
+
res.push({
|
|
63971
|
+
...ev,
|
|
63972
|
+
source,
|
|
63973
|
+
label: m.label,
|
|
63974
|
+
key: m.key,
|
|
63975
|
+
indexInGroup: idx + 1,
|
|
63976
|
+
severity: ev.severity || "undetermined",
|
|
63977
|
+
category: ev.severity || "undetermined",
|
|
63978
|
+
value: 1
|
|
63979
|
+
});
|
|
63980
|
+
});
|
|
63981
|
+
});
|
|
63982
|
+
return res;
|
|
63983
|
+
}
|
|
63984
|
+
if (selectedRange === "3") {
|
|
63985
|
+
const weekBuckets = baseWeeks.reduce((acc, w) => {
|
|
63986
|
+
acc[w.key] = [];
|
|
63987
|
+
return acc;
|
|
63988
|
+
}, {});
|
|
63989
|
+
events.forEach(ev => {
|
|
63990
|
+
const d = dayjs__default["default"](ev.date);
|
|
63991
|
+
const key = d.format("GGGG-[W]WW");
|
|
63992
|
+
if (weekBuckets[key]) weekBuckets[key].push(ev);
|
|
63993
|
+
});
|
|
63994
|
+
const res = [];
|
|
63995
|
+
baseWeeks.forEach(w => {
|
|
63996
|
+
const arr = weekBuckets[w.key];
|
|
63997
|
+
if (!arr.length) {
|
|
63998
|
+
res.push({
|
|
63999
|
+
label: w.label,
|
|
64000
|
+
key: w.key,
|
|
64001
|
+
severity: "placeholder",
|
|
64002
|
+
category: "placeholder",
|
|
64003
|
+
value: 1,
|
|
64004
|
+
isPlaceholder: true
|
|
64005
|
+
});
|
|
64006
|
+
return;
|
|
64007
|
+
}
|
|
64008
|
+
arr.sort((a, b) => severityOrder.indexOf(a.severity) - severityOrder.indexOf(b.severity)).forEach((ev, idx) => {
|
|
64009
|
+
const source = Array.isArray(ev.source) ? ev.source.join(", ") : ev.source;
|
|
64010
|
+
res.push({
|
|
64011
|
+
...ev,
|
|
64012
|
+
source,
|
|
64013
|
+
label: w.label,
|
|
64014
|
+
key: w.key,
|
|
64015
|
+
indexInGroup: idx + 1,
|
|
64016
|
+
severity: ev.severity || "undetermined",
|
|
64017
|
+
category: ev.severity || "undetermined",
|
|
64018
|
+
value: 1
|
|
64019
|
+
});
|
|
64020
|
+
});
|
|
64021
|
+
});
|
|
64022
|
+
return res;
|
|
64023
|
+
}
|
|
64024
|
+
return [];
|
|
64025
|
+
}, [selectedRange, baseMonths, baseWeeks]);
|
|
64026
|
+
return {
|
|
64027
|
+
baseMonths,
|
|
64028
|
+
baseWeeks,
|
|
64029
|
+
mergeWithData
|
|
64030
|
+
};
|
|
64031
|
+
}
|
|
64032
|
+
|
|
63879
64033
|
function useIncidentsTimeline({
|
|
63880
|
-
t
|
|
63881
|
-
|
|
64034
|
+
t,
|
|
64035
|
+
language,
|
|
64036
|
+
severityOptions = [],
|
|
64037
|
+
selectedRange = "12"
|
|
63882
64038
|
}) {
|
|
63883
64039
|
const [filters, setFilters] = React.useState({
|
|
63884
64040
|
severity: "all"
|
|
63885
64041
|
});
|
|
64042
|
+
const {
|
|
64043
|
+
baseMonths,
|
|
64044
|
+
baseWeeks,
|
|
64045
|
+
mergeWithData
|
|
64046
|
+
} = useTimelineBase({
|
|
64047
|
+
language,
|
|
64048
|
+
selectedRange
|
|
64049
|
+
});
|
|
63886
64050
|
const filtersConfig = React.useMemo(() => ({
|
|
64051
|
+
language,
|
|
63887
64052
|
filtersConfig: {
|
|
63888
64053
|
severity: {
|
|
63889
64054
|
type: "select",
|
|
63890
64055
|
label: "",
|
|
63891
|
-
placeholder:
|
|
64056
|
+
placeholder: tFn => tFn(""),
|
|
63892
64057
|
style: {
|
|
63893
64058
|
flex: 1
|
|
63894
64059
|
},
|
|
@@ -63902,44 +64067,54 @@ function useIncidentsTimeline({
|
|
|
63902
64067
|
severity: [{
|
|
63903
64068
|
value: "all",
|
|
63904
64069
|
label: t("All")
|
|
63905
|
-
}, ...(
|
|
64070
|
+
}, ...(severityOptions || [])]
|
|
63906
64071
|
},
|
|
63907
64072
|
selectedFilters: filters,
|
|
63908
64073
|
type: "small",
|
|
63909
64074
|
t
|
|
63910
|
-
}), [t, filters,
|
|
64075
|
+
}), [t, language, filters, severityOptions]);
|
|
63911
64076
|
return {
|
|
63912
64077
|
filters,
|
|
63913
|
-
filtersConfig
|
|
64078
|
+
filtersConfig,
|
|
64079
|
+
setFilters,
|
|
64080
|
+
baseMonths,
|
|
64081
|
+
baseWeeks,
|
|
64082
|
+
mergeWithData
|
|
63914
64083
|
};
|
|
63915
64084
|
}
|
|
63916
64085
|
|
|
63917
|
-
function
|
|
64086
|
+
function IncidentsTimeline({
|
|
63918
64087
|
selectedRange,
|
|
63919
64088
|
selectedPartners = {},
|
|
63920
|
-
t
|
|
63921
|
-
|
|
63922
|
-
|
|
63923
|
-
|
|
63924
|
-
|
|
63925
|
-
options = {}
|
|
64089
|
+
t,
|
|
64090
|
+
language,
|
|
64091
|
+
goTo,
|
|
64092
|
+
user,
|
|
64093
|
+
options
|
|
63926
64094
|
}) {
|
|
63927
64095
|
const {
|
|
63928
64096
|
filters,
|
|
63929
|
-
filtersConfig
|
|
64097
|
+
filtersConfig,
|
|
64098
|
+
mergeWithData,
|
|
64099
|
+
baseMonths,
|
|
64100
|
+
baseWeeks
|
|
63930
64101
|
} = useIncidentsTimeline({
|
|
63931
64102
|
t,
|
|
63932
|
-
|
|
64103
|
+
language,
|
|
64104
|
+
severityOptions: options?.severityOptions || [],
|
|
64105
|
+
selectedRange
|
|
63933
64106
|
});
|
|
63934
|
-
const {
|
|
63935
|
-
user
|
|
63936
|
-
} = useSelector(state => state.authentication);
|
|
63937
|
-
React.useCallback(sourceId => {
|
|
63938
|
-
if (user?.company?.id !== sourceId) {
|
|
63939
|
-
return `?sourceId=${sourceId}`;
|
|
63940
|
-
}
|
|
64107
|
+
const getSourceParam = React.useCallback(sourceId => {
|
|
64108
|
+
if (user?.company?.id !== sourceId) return `?sourceId=${sourceId}`;
|
|
63941
64109
|
return "";
|
|
63942
64110
|
}, [user?.company?.id]);
|
|
64111
|
+
const severityColors = React.useMemo(() => ({
|
|
64112
|
+
major: "#cf1322",
|
|
64113
|
+
minor: "#fadb14",
|
|
64114
|
+
moderate: "#fa8c16",
|
|
64115
|
+
undetermined: "#999999",
|
|
64116
|
+
placeholder: "transparent"
|
|
64117
|
+
}), []);
|
|
63943
64118
|
const defaultFetchConfig = React.useMemo(() => ({
|
|
63944
64119
|
url: `/incidents-timeline`,
|
|
63945
64120
|
filters: {
|
|
@@ -63951,67 +64126,99 @@ function IncidentsTime({
|
|
|
63951
64126
|
defaultData: [],
|
|
63952
64127
|
stop: selectedPartners?.loading
|
|
63953
64128
|
}), [filters, selectedRange, selectedPartners]);
|
|
63954
|
-
const
|
|
64129
|
+
const getIncidentsTimelineData = React.useCallback(({
|
|
64130
|
+
url,
|
|
64131
|
+
filters
|
|
64132
|
+
}) => DashboardService$1.getWidgetConflictManagement(url, filters), []);
|
|
63955
64133
|
const {
|
|
63956
64134
|
data,
|
|
63957
64135
|
loading
|
|
63958
|
-
} = useWidgetFetch(
|
|
64136
|
+
} = useWidgetFetch({
|
|
64137
|
+
config: defaultFetchConfig,
|
|
64138
|
+
getData: getIncidentsTimelineData
|
|
64139
|
+
});
|
|
64140
|
+
const renderSeverity = val => {
|
|
64141
|
+
if (val === "major") return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
64142
|
+
style: {
|
|
64143
|
+
color: severityColors.major
|
|
64144
|
+
},
|
|
64145
|
+
children: t("Major")
|
|
64146
|
+
});
|
|
64147
|
+
if (val === "minor") return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
64148
|
+
style: {
|
|
64149
|
+
color: severityColors.minor
|
|
64150
|
+
},
|
|
64151
|
+
children: t("Minor")
|
|
64152
|
+
});
|
|
64153
|
+
if (val === "moderate") return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
64154
|
+
style: {
|
|
64155
|
+
color: severityColors.moderate
|
|
64156
|
+
},
|
|
64157
|
+
children: t("Moderate")
|
|
64158
|
+
});
|
|
64159
|
+
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
64160
|
+
children: t("Undetermined")
|
|
64161
|
+
});
|
|
64162
|
+
};
|
|
64163
|
+
const chartData = React.useMemo(() => mergeWithData(data), [data, mergeWithData]);
|
|
64164
|
+
const categories = React.useMemo(() => {
|
|
64165
|
+
if (selectedRange === "12") return baseMonths.map(m => m.label);
|
|
64166
|
+
return baseWeeks.map(w => w.label);
|
|
64167
|
+
}, [selectedRange, baseMonths, baseWeeks]);
|
|
64168
|
+
const getTooltipContent = React.useCallback(({
|
|
64169
|
+
item
|
|
64170
|
+
}) => {
|
|
64171
|
+
if (!item) return {
|
|
64172
|
+
title: "",
|
|
64173
|
+
items: []
|
|
64174
|
+
};
|
|
64175
|
+
return {
|
|
64176
|
+
title: item.name || item.label || t("Undetermined"),
|
|
64177
|
+
subTitle: renderDateFormatted(item.date, "DD MMM YYYY"),
|
|
64178
|
+
link: true,
|
|
64179
|
+
onClickLink: () => {
|
|
64180
|
+
goTo(`/app/view/incidents/${item.datastakeId}/identification${getSourceParam(item?.sourceId)}`);
|
|
64181
|
+
},
|
|
64182
|
+
items: [{
|
|
64183
|
+
label: t("nashiriki::Source"),
|
|
64184
|
+
value: item?.source || "--"
|
|
64185
|
+
}, item.severity ? {
|
|
64186
|
+
label: t("Severity"),
|
|
64187
|
+
value: renderSeverity(item.severity)
|
|
64188
|
+
} : null].filter(Boolean)
|
|
64189
|
+
};
|
|
64190
|
+
}, [t, goTo, getSourceParam, renderSeverity]);
|
|
63959
64191
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, {
|
|
63960
64192
|
loading: loading,
|
|
63961
64193
|
filtersConfig: filtersConfig,
|
|
63962
|
-
title: t("Incidents Timeline"),
|
|
64194
|
+
title: t("nashiriki::Incidents Timeline"),
|
|
63963
64195
|
className: "with-border-header",
|
|
63964
|
-
|
|
63965
|
-
|
|
63966
|
-
|
|
63967
|
-
|
|
63968
|
-
|
|
64196
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
64197
|
+
className: "mb-4 flex-1 flex flex-column justify-content-center",
|
|
64198
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StackChart, {
|
|
64199
|
+
data: chartData,
|
|
64200
|
+
xFieldKey: "label",
|
|
64201
|
+
categories: categories,
|
|
64202
|
+
seriesField: "severity",
|
|
64203
|
+
colors: severityColors,
|
|
64204
|
+
doConstraints: false,
|
|
64205
|
+
renderTooltip: getTooltipContent
|
|
64206
|
+
})
|
|
63969
64207
|
})
|
|
63970
64208
|
});
|
|
63971
64209
|
}
|
|
63972
|
-
|
|
64210
|
+
IncidentsTimeline.propTypes = {
|
|
63973
64211
|
selectedRange: PropTypes__default["default"].string,
|
|
63974
64212
|
selectedPartners: PropTypes__default["default"].object,
|
|
63975
|
-
t: PropTypes__default["default"].func,
|
|
63976
|
-
|
|
63977
|
-
|
|
63978
|
-
|
|
63979
|
-
|
|
63980
|
-
|
|
64213
|
+
t: PropTypes__default["default"].func.isRequired,
|
|
64214
|
+
language: PropTypes__default["default"].string,
|
|
64215
|
+
goTo: PropTypes__default["default"].func.isRequired,
|
|
64216
|
+
user: PropTypes__default["default"].object,
|
|
64217
|
+
options: PropTypes__default["default"].shape({
|
|
64218
|
+
severityOptions: PropTypes__default["default"].array
|
|
64219
|
+
})
|
|
63981
64220
|
};
|
|
63982
64221
|
|
|
63983
|
-
function useTerritorialDistribution({
|
|
63984
|
-
t = s => {
|
|
63985
|
-
},
|
|
63986
|
-
options = {}
|
|
63987
|
-
}) {
|
|
63988
|
-
const [filters, setFilters] = React.useState({
|
|
63989
|
-
filter1: 'all',
|
|
63990
|
-
filter2: 'all'
|
|
63991
|
-
});
|
|
63992
|
-
const filtersConfig = React.useMemo(t => ({
|
|
63993
|
-
onApply: val => setFilters(val),
|
|
63994
|
-
options: {
|
|
63995
|
-
filter1: [{
|
|
63996
|
-
label: t('All'),
|
|
63997
|
-
value: 'all'
|
|
63998
|
-
}],
|
|
63999
|
-
filter2: [{
|
|
64000
|
-
label: t('All'),
|
|
64001
|
-
value: 'all'
|
|
64002
|
-
}]
|
|
64003
|
-
},
|
|
64004
|
-
selectedFilters: filters,
|
|
64005
|
-
type: 'small',
|
|
64006
|
-
t
|
|
64007
|
-
}), [t, filters]);
|
|
64008
|
-
return {
|
|
64009
|
-
filters,
|
|
64010
|
-
filtersConfig,
|
|
64011
|
-
setFilters,
|
|
64012
|
-
t
|
|
64013
|
-
};
|
|
64014
|
-
}
|
|
64015
64222
|
const getColors = theme => {
|
|
64016
64223
|
return [theme.colorPrimary8, theme.colorPrimary7, theme.colorPrimary5, theme.colorPrimary6, theme.colorPrimary4];
|
|
64017
64224
|
};
|
|
@@ -64026,29 +64233,31 @@ function TerritorialDistribution({
|
|
|
64026
64233
|
goTo = () => {},
|
|
64027
64234
|
getRedirectLink = () => {}
|
|
64028
64235
|
}) {
|
|
64029
|
-
const {
|
|
64030
|
-
filters,
|
|
64031
|
-
filtersConfig
|
|
64032
|
-
} = useTerritorialDistribution({
|
|
64033
|
-
t
|
|
64034
|
-
});
|
|
64035
64236
|
const colors = getColors(theme);
|
|
64036
64237
|
const defaultFetchConfig = React.useMemo(() => ({
|
|
64037
64238
|
url: "/territorial-distribution",
|
|
64239
|
+
basepath: "dashboard/conflict-management",
|
|
64038
64240
|
filters: {
|
|
64039
|
-
...filters,
|
|
64040
64241
|
category,
|
|
64041
64242
|
period: selectedRange,
|
|
64042
64243
|
sources: selectedPartners?.partners || []
|
|
64043
64244
|
},
|
|
64044
|
-
defaultData:
|
|
64245
|
+
defaultData: {},
|
|
64045
64246
|
stop: selectedPartners?.loading
|
|
64046
|
-
}), [
|
|
64247
|
+
}), [category, selectedRange, selectedPartners]);
|
|
64248
|
+
const getData = React.useCallback(({
|
|
64249
|
+
url,
|
|
64250
|
+
filters,
|
|
64251
|
+
basepath
|
|
64252
|
+
}) => {
|
|
64253
|
+
return DashboardService$1.getWidgetConflictManagement(url, filters, basepath);
|
|
64254
|
+
}, []);
|
|
64047
64255
|
const {
|
|
64048
64256
|
data,
|
|
64049
64257
|
loading
|
|
64050
|
-
} = useWidgetFetch
|
|
64051
|
-
config: defaultFetchConfig
|
|
64258
|
+
} = useWidgetFetch({
|
|
64259
|
+
config: defaultFetchConfig,
|
|
64260
|
+
getData
|
|
64052
64261
|
});
|
|
64053
64262
|
const pieData = React.useMemo(() => {
|
|
64054
64263
|
if (!data || Array.isArray(data)) return [];
|
|
@@ -64067,13 +64276,13 @@ function TerritorialDistribution({
|
|
|
64067
64276
|
}, [data, colors]);
|
|
64068
64277
|
const isEmpty = !pieData.length;
|
|
64069
64278
|
const getTooltipChildren = React.useCallback(items => {
|
|
64070
|
-
const item = items[0];
|
|
64279
|
+
const item = Array.isArray(items) ? items[0] : items;
|
|
64071
64280
|
return renderTooltipJsx({
|
|
64072
64281
|
title: item?.label || t("Undetermined"),
|
|
64073
64282
|
link: true,
|
|
64074
64283
|
onClickLink: () => {
|
|
64075
64284
|
if (item?.label) {
|
|
64076
|
-
goTo(`/app/
|
|
64285
|
+
goTo(`/app/incidents?administrativeLevel1=${item?.locationData?.administrativeLevel1}&administrativeLevel2=${item?.locationData?.administrativeLevel2}&country=${item?.locationData?.country}`);
|
|
64077
64286
|
} else {
|
|
64078
64287
|
goTo("/app/incident");
|
|
64079
64288
|
}
|
|
@@ -64088,7 +64297,6 @@ function TerritorialDistribution({
|
|
|
64088
64297
|
loading: loading || parentLoading,
|
|
64089
64298
|
title: t("Territorial Distribution"),
|
|
64090
64299
|
className: "with-border-header",
|
|
64091
|
-
filtersConfig: filtersConfig,
|
|
64092
64300
|
children: /*#__PURE__*/jsxRuntime.jsx(Chart, {
|
|
64093
64301
|
mouseXOffset: 10,
|
|
64094
64302
|
mouseYOffset: 10,
|
|
@@ -64111,7 +64319,9 @@ TerritorialDistribution.propTypes = {
|
|
|
64111
64319
|
selectedRange: PropTypes__default["default"].string
|
|
64112
64320
|
};
|
|
64113
64321
|
|
|
64114
|
-
function useProblemSolvers(
|
|
64322
|
+
function useProblemSolvers({
|
|
64323
|
+
t = () => {}
|
|
64324
|
+
} = {}) {
|
|
64115
64325
|
const [filters, setFilters] = React.useState({
|
|
64116
64326
|
administrativeLevel1: "all"
|
|
64117
64327
|
});
|
|
@@ -64121,25 +64331,25 @@ function useProblemSolvers(t = () => {}) {
|
|
|
64121
64331
|
try {
|
|
64122
64332
|
const {
|
|
64123
64333
|
data
|
|
64124
|
-
} = await DashboardService$1.
|
|
64125
|
-
|
|
64126
|
-
|
|
64127
|
-
|
|
64128
|
-
const actions = data[agentKey]?.actions || [];
|
|
64334
|
+
} = await DashboardService$1.getWidgetConflictManagement("/problem-solvers", {}, "dashboard/conflict-management");
|
|
64335
|
+
const all = Object.keys(data);
|
|
64336
|
+
const options = all.map(key => {
|
|
64337
|
+
const actions = data[key].actions;
|
|
64129
64338
|
return actions.map(action => {
|
|
64130
|
-
|
|
64131
|
-
|
|
64132
|
-
|
|
64339
|
+
if (action.location === undefined) {
|
|
64340
|
+
return;
|
|
64341
|
+
}
|
|
64342
|
+
const administrativeLevel1 = action?.location?.administrativeLevel1;
|
|
64343
|
+
const name = action?.location?.linking?.SCL?.[administrativeLevel1]?.name;
|
|
64133
64344
|
return {
|
|
64134
64345
|
label: name,
|
|
64135
|
-
value:
|
|
64346
|
+
value: administrativeLevel1
|
|
64136
64347
|
};
|
|
64137
|
-
})
|
|
64138
|
-
}).flat();
|
|
64139
|
-
|
|
64140
|
-
setFilterOptions(unique);
|
|
64348
|
+
});
|
|
64349
|
+
}).flat().filter(item => item !== undefined);
|
|
64350
|
+
setFilterOptions(options);
|
|
64141
64351
|
} catch (err) {
|
|
64142
|
-
console.
|
|
64352
|
+
console.log(err);
|
|
64143
64353
|
}
|
|
64144
64354
|
}
|
|
64145
64355
|
fetchOptions();
|
|
@@ -64188,10 +64398,12 @@ function ProblemSolvers({
|
|
|
64188
64398
|
const {
|
|
64189
64399
|
filters,
|
|
64190
64400
|
filtersConfig
|
|
64191
|
-
} = useProblemSolvers(
|
|
64401
|
+
} = useProblemSolvers({
|
|
64402
|
+
t
|
|
64403
|
+
});
|
|
64192
64404
|
const defaultFetchConfig = React.useMemo(() => ({
|
|
64193
|
-
basepath: "conflict-management",
|
|
64194
64405
|
url: "/problem-solvers",
|
|
64406
|
+
basepath: "dashboard/conflict-management",
|
|
64195
64407
|
filters: {
|
|
64196
64408
|
...filters,
|
|
64197
64409
|
period: selectedRange,
|
|
@@ -64200,11 +64412,19 @@ function ProblemSolvers({
|
|
|
64200
64412
|
defaultData: [],
|
|
64201
64413
|
stop: selectedPartners?.loading
|
|
64202
64414
|
}), [filters, selectedRange, selectedPartners]);
|
|
64415
|
+
const getData = React.useCallback(({
|
|
64416
|
+
url,
|
|
64417
|
+
filters,
|
|
64418
|
+
basepath
|
|
64419
|
+
}) => {
|
|
64420
|
+
return DashboardService$1.getWidgetConflictManagement(url, filters, basepath);
|
|
64421
|
+
}, []);
|
|
64203
64422
|
const {
|
|
64204
64423
|
data,
|
|
64205
64424
|
loading
|
|
64206
|
-
} = useWidgetFetch
|
|
64207
|
-
config: defaultFetchConfig
|
|
64425
|
+
} = useWidgetFetch({
|
|
64426
|
+
config: defaultFetchConfig,
|
|
64427
|
+
getData
|
|
64208
64428
|
});
|
|
64209
64429
|
const pieData = React.useMemo(() => {
|
|
64210
64430
|
if (!data || Array.isArray(data)) return [];
|
|
@@ -64303,7 +64523,7 @@ function RisksWidget({
|
|
|
64303
64523
|
}),
|
|
64304
64524
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
64305
64525
|
className: "flex flex-row flex-col-mobile gap-6",
|
|
64306
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
64526
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(IncidentsTimeline, {
|
|
64307
64527
|
selectedRange: range,
|
|
64308
64528
|
selectedPartners: selectedPartners,
|
|
64309
64529
|
t: t,
|
|
@@ -64458,7 +64678,8 @@ function ConflictManagement({
|
|
|
64458
64678
|
goTo = () => {},
|
|
64459
64679
|
getRedirectLink = s => s,
|
|
64460
64680
|
theme = {},
|
|
64461
|
-
options = {}
|
|
64681
|
+
options = {},
|
|
64682
|
+
breadcrumbs = []
|
|
64462
64683
|
}) {
|
|
64463
64684
|
const {
|
|
64464
64685
|
partners,
|
|
@@ -64502,9 +64723,8 @@ function ConflictManagement({
|
|
|
64502
64723
|
};
|
|
64503
64724
|
});
|
|
64504
64725
|
}, [partners, user, theme]);
|
|
64505
|
-
return /*#__PURE__*/jsxRuntime.jsxs(
|
|
64506
|
-
|
|
64507
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DAFHeader, {
|
|
64726
|
+
return /*#__PURE__*/jsxRuntime.jsxs(DashboardLayout, {
|
|
64727
|
+
header: /*#__PURE__*/jsxRuntime.jsx(DAFHeader, {
|
|
64508
64728
|
title: t("conflict-management"),
|
|
64509
64729
|
breadcrumbs: breadCrumbs,
|
|
64510
64730
|
supportText: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -64515,10 +64735,8 @@ function ConflictManagement({
|
|
|
64515
64735
|
children: t("European Union")
|
|
64516
64736
|
})]
|
|
64517
64737
|
}),
|
|
64518
|
-
addedHeader: /*#__PURE__*/jsxRuntime.
|
|
64519
|
-
children:
|
|
64520
|
-
className: "flex-1"
|
|
64521
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Multiselect, {
|
|
64738
|
+
addedHeader: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
64739
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Multiselect, {
|
|
64522
64740
|
options: [...sourceOptions],
|
|
64523
64741
|
isAvatarGroup: true,
|
|
64524
64742
|
canUnselectLast: false,
|
|
@@ -64532,48 +64750,37 @@ function ConflictManagement({
|
|
|
64532
64750
|
dropDownWidth: 200,
|
|
64533
64751
|
selectionType: "checkbox",
|
|
64534
64752
|
defaultSelected: partners.map(p => p.id) || []
|
|
64535
|
-
}, partners?.length)
|
|
64753
|
+
}, partners?.length)
|
|
64536
64754
|
})
|
|
64537
|
-
}),
|
|
64538
|
-
|
|
64539
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
64540
|
-
|
|
64541
|
-
|
|
64542
|
-
|
|
64543
|
-
|
|
64544
|
-
|
|
64545
|
-
|
|
64546
|
-
|
|
64547
|
-
|
|
64548
|
-
|
|
64549
|
-
|
|
64550
|
-
|
|
64551
|
-
|
|
64552
|
-
|
|
64553
|
-
|
|
64554
|
-
|
|
64555
|
-
|
|
64556
|
-
|
|
64557
|
-
|
|
64558
|
-
|
|
64559
|
-
|
|
64560
|
-
|
|
64561
|
-
|
|
64562
|
-
|
|
64563
|
-
|
|
64564
|
-
|
|
64565
|
-
|
|
64566
|
-
selectedPartners: selectedPartners,
|
|
64567
|
-
t: t,
|
|
64568
|
-
goTo: goTo,
|
|
64569
|
-
getRedirectLink: getRedirectLink,
|
|
64570
|
-
theme: theme,
|
|
64571
|
-
APP: APP,
|
|
64572
|
-
options: options
|
|
64573
|
-
})
|
|
64574
|
-
})]
|
|
64575
|
-
})
|
|
64576
|
-
})
|
|
64755
|
+
}),
|
|
64756
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("section", {
|
|
64757
|
+
children: /*#__PURE__*/jsxRuntime.jsx(KeyIndicators, {
|
|
64758
|
+
selectedPartners: selectedPartners,
|
|
64759
|
+
partners: informationSources > 0 ? informationSources : selectedPartners?.partners?.length > 0 ? selectedPartners?.partners?.length : 0,
|
|
64760
|
+
t: t,
|
|
64761
|
+
goTo: goTo,
|
|
64762
|
+
getRedirectLink: getRedirectLink,
|
|
64763
|
+
theme: theme
|
|
64764
|
+
})
|
|
64765
|
+
}), /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
64766
|
+
children: /*#__PURE__*/jsxRuntime.jsx(MineSites, {
|
|
64767
|
+
selectedPartners: selectedPartners,
|
|
64768
|
+
t: t,
|
|
64769
|
+
goTo: goTo,
|
|
64770
|
+
getRedirectLink: getRedirectLink,
|
|
64771
|
+
theme: theme,
|
|
64772
|
+
APP: APP,
|
|
64773
|
+
options: options
|
|
64774
|
+
})
|
|
64775
|
+
}), /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
64776
|
+
children: /*#__PURE__*/jsxRuntime.jsx(RisksWidget, {
|
|
64777
|
+
selectedPartners: selectedPartners,
|
|
64778
|
+
t: t,
|
|
64779
|
+
goTo: goTo,
|
|
64780
|
+
getRedirectLink: getRedirectLink,
|
|
64781
|
+
theme: theme,
|
|
64782
|
+
APP: APP,
|
|
64783
|
+
options: options
|
|
64577
64784
|
})
|
|
64578
64785
|
})]
|
|
64579
64786
|
});
|