datastake-daf 0.6.761 → 0.6.763
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 +84 -86
- package/dist/hooks/index.js +0 -4
- package/dist/pages/index.js +52 -28
- package/dist/utils/index.js +0 -6
- package/package.json +1 -1
- package/src/@daf/core/components/Graphs/StakeholderMappings/index.jsx +2 -0
- package/src/@daf/core/components/Graphs/components/BaseGraph.jsx +2 -1
- package/src/@daf/core/components/Screens/Users/config.js +0 -1
- package/src/@daf/hooks/useFilters.js +0 -2
- package/src/@daf/pages/Dashboards/SupplyChain/components/KeyIndicators/config.js +1 -1
- package/src/@daf/pages/Dashboards/UserDashboard/components/DataCompilation/index.jsx +1 -0
- package/src/@daf/pages/Dashboards/UserDashboard/components/DataConsilidation/index.jsx +0 -1
- package/src/@daf/pages/Dashboards/UserDashboard/config.js +1 -1
- package/src/@daf/pages/Events/config.js +0 -1
- package/src/@daf/pages/Locations/MineSite/columns.js +3 -3
- package/src/@daf/pages/Locations/MineSite/config.js +0 -1
- package/src/helpers/breadCrumbs.js +0 -2
package/dist/components/index.js
CHANGED
|
@@ -9930,44 +9930,44 @@ function useAjaxModal$2({
|
|
|
9930
9930
|
}
|
|
9931
9931
|
|
|
9932
9932
|
const mergeObject = obj => {
|
|
9933
|
-
return Object.entries(obj || {}).reduce((acc,
|
|
9934
|
-
let [key, value] = _ref;
|
|
9933
|
+
return Object.entries(obj || {}).reduce((acc, [key, value]) => {
|
|
9935
9934
|
if (typeof value === "object" && !Array.isArray(value) && value !== null) {
|
|
9936
|
-
return
|
|
9935
|
+
return {
|
|
9936
|
+
...acc,
|
|
9937
|
+
...value
|
|
9938
|
+
};
|
|
9937
9939
|
}
|
|
9938
|
-
return
|
|
9940
|
+
return {
|
|
9941
|
+
...acc,
|
|
9939
9942
|
[key]: value
|
|
9940
|
-
}
|
|
9943
|
+
};
|
|
9941
9944
|
}, {});
|
|
9942
9945
|
};
|
|
9943
|
-
const handleDataLinkGroupWithTableKeys =
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
|
|
9957
|
-
|
|
9958
|
-
TreeNodeComponent
|
|
9959
|
-
} = _ref2;
|
|
9946
|
+
const handleDataLinkGroupWithTableKeys = ({
|
|
9947
|
+
config,
|
|
9948
|
+
inputConfig,
|
|
9949
|
+
inputKey,
|
|
9950
|
+
value,
|
|
9951
|
+
level,
|
|
9952
|
+
t,
|
|
9953
|
+
rootForm,
|
|
9954
|
+
allData,
|
|
9955
|
+
user,
|
|
9956
|
+
getApiBaseUrl = () => {},
|
|
9957
|
+
getAppHeader = () => {},
|
|
9958
|
+
app,
|
|
9959
|
+
TreeNodeComponent
|
|
9960
|
+
}) => {
|
|
9960
9961
|
if (!(config.type === 'dataLinkGroup' || config.type === 'dataLink')) {
|
|
9961
9962
|
return null;
|
|
9962
9963
|
}
|
|
9963
|
-
if (
|
|
9964
|
+
if (inputConfig?.type !== 'dataLink' || !inputConfig?.meta?.tableKeys) {
|
|
9964
9965
|
const parentInputKeys = Object.keys(config.inputs || {});
|
|
9965
9966
|
const isHandledBySiblingDataLink = parentInputKeys.some(otherInputKey => {
|
|
9966
9967
|
const otherConfig = config.inputs[otherInputKey];
|
|
9967
|
-
if (
|
|
9968
|
-
|
|
9969
|
-
const
|
|
9970
|
-
const additionalTableKeys = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.additionalTableKeys) || [];
|
|
9968
|
+
if (otherConfig?.type === 'dataLink') {
|
|
9969
|
+
const siblingTableKeys = otherConfig?.meta?.tableKeys || [];
|
|
9970
|
+
const additionalTableKeys = config.meta?.additionalTableKeys || [];
|
|
9971
9971
|
const allSiblingKeys = [...siblingTableKeys, ...additionalTableKeys];
|
|
9972
9972
|
return allSiblingKeys.includes(inputKey) && otherInputKey !== inputKey;
|
|
9973
9973
|
}
|
|
@@ -9981,26 +9981,23 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
9981
9981
|
return null;
|
|
9982
9982
|
}
|
|
9983
9983
|
const tableKeys = inputConfig.meta.tableKeys;
|
|
9984
|
-
const additionalTableKeys =
|
|
9984
|
+
const additionalTableKeys = config.meta?.additionalTableKeys || [];
|
|
9985
9985
|
const parentInputKeys = Object.keys(config.inputs || {});
|
|
9986
9986
|
const siblingInputsMatchingTableKeys = parentInputKeys.filter(siblingKey => siblingKey !== inputKey).filter(siblingKey => tableKeys.includes(siblingKey) || additionalTableKeys.includes(siblingKey));
|
|
9987
9987
|
[...new Set([...tableKeys, ...siblingInputsMatchingTableKeys])];
|
|
9988
|
-
const isAjaxModal = React.useMemo(() =>
|
|
9989
|
-
var _inputConfig$meta2;
|
|
9990
|
-
return !!(inputConfig !== null && inputConfig !== void 0 && (_inputConfig$meta2 = inputConfig.meta) !== null && _inputConfig$meta2 !== void 0 && _inputConfig$meta2.namespace);
|
|
9991
|
-
}, [inputConfig]);
|
|
9988
|
+
const isAjaxModal = React.useMemo(() => !!inputConfig?.meta?.namespace, [inputConfig]);
|
|
9992
9989
|
const ajaxModalValues = useAjaxModal$2({
|
|
9993
9990
|
name: inputKey,
|
|
9994
9991
|
user,
|
|
9995
|
-
namespace: inputConfig
|
|
9996
|
-
skipFetch: inputConfig
|
|
9992
|
+
namespace: inputConfig?.meta?.namespace,
|
|
9993
|
+
skipFetch: inputConfig?.meta?.skipFetch,
|
|
9997
9994
|
isAjaxModal,
|
|
9998
|
-
formScope: inputConfig
|
|
9995
|
+
formScope: inputConfig?.meta?.formScope,
|
|
9999
9996
|
APP: app,
|
|
10000
9997
|
apiBaseUrl: getApiBaseUrl(),
|
|
10001
9998
|
_getAppHeader: getAppHeader
|
|
10002
9999
|
});
|
|
10003
|
-
const dataLinkForm = ajaxModalValues
|
|
10000
|
+
const dataLinkForm = ajaxModalValues?.form;
|
|
10004
10001
|
const createInputsAndValues = item => {
|
|
10005
10002
|
const inputs = {};
|
|
10006
10003
|
const values = {};
|
|
@@ -10012,12 +10009,12 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10012
10009
|
'videos': 'Video'
|
|
10013
10010
|
};
|
|
10014
10011
|
tableKeys.filter(tableKey => tableKey !== 'datastakeId').forEach(tableKey => {
|
|
10015
|
-
|
|
10016
|
-
const formInputConfig = (dataLinkForm === null || dataLinkForm === void 0 ? void 0 : dataLinkForm[tableKey]) || (dataLinkForm === null || dataLinkForm === void 0 || (_dataLinkForm$identif = dataLinkForm['identification']) === null || _dataLinkForm$identif === void 0 ? void 0 : _dataLinkForm$identif[tableKey]);
|
|
10012
|
+
const formInputConfig = dataLinkForm?.[tableKey] || dataLinkForm?.['identification']?.[tableKey];
|
|
10017
10013
|
if (formInputConfig) {
|
|
10018
|
-
inputs[tableKey] =
|
|
10014
|
+
inputs[tableKey] = {
|
|
10015
|
+
...formInputConfig,
|
|
10019
10016
|
label: uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : formInputConfig.label || formInputConfig.tableLabel || tableKey
|
|
10020
|
-
}
|
|
10017
|
+
};
|
|
10021
10018
|
if (formInputConfig.label && typeof formInputConfig.label === 'object') {
|
|
10022
10019
|
const dynamicLabelKeys = Object.keys(formInputConfig.label);
|
|
10023
10020
|
let resolvedLabel = null;
|
|
@@ -10025,7 +10022,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10025
10022
|
const parts = labelKey.split(' is ');
|
|
10026
10023
|
if (parts.length === 2) {
|
|
10027
10024
|
const [conditionKey, conditionValue] = parts;
|
|
10028
|
-
if (
|
|
10025
|
+
if (item?.[conditionKey] === conditionValue) {
|
|
10029
10026
|
resolvedLabel = formInputConfig.label[labelKey];
|
|
10030
10027
|
break;
|
|
10031
10028
|
}
|
|
@@ -10033,37 +10030,37 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10033
10030
|
}
|
|
10034
10031
|
inputs[tableKey].label = resolvedLabel || Object.values(formInputConfig.label)[0] || (uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : tableKey);
|
|
10035
10032
|
}
|
|
10036
|
-
values[tableKey] = item
|
|
10033
|
+
values[tableKey] = item?.[tableKey];
|
|
10037
10034
|
} else {
|
|
10038
|
-
var _item$linking;
|
|
10039
10035
|
inputs[tableKey] = {
|
|
10040
10036
|
label: uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : tableKey,
|
|
10041
|
-
type: inputConfig
|
|
10037
|
+
type: inputConfig?.type
|
|
10042
10038
|
};
|
|
10043
|
-
values[tableKey] =
|
|
10039
|
+
values[tableKey] = item?.linking?.SCL?.[item?.[tableKey]]?.name || item?.[tableKey];
|
|
10044
10040
|
}
|
|
10045
10041
|
});
|
|
10046
10042
|
siblingInputsMatchingTableKeys.forEach(siblingKey => {
|
|
10047
10043
|
const siblingConfig = config.inputs[siblingKey];
|
|
10048
10044
|
if (siblingConfig) {
|
|
10049
|
-
inputs[siblingKey] =
|
|
10045
|
+
inputs[siblingKey] = {
|
|
10046
|
+
...siblingConfig,
|
|
10050
10047
|
label: siblingConfig.label || siblingKey
|
|
10051
|
-
}
|
|
10052
|
-
values[siblingKey] = item
|
|
10048
|
+
};
|
|
10049
|
+
values[siblingKey] = item?.[siblingKey];
|
|
10053
10050
|
}
|
|
10054
10051
|
});
|
|
10055
|
-
if (dataLinkForm
|
|
10052
|
+
if (dataLinkForm?.identification && typeof dataLinkForm.identification === 'object') {
|
|
10056
10053
|
Object.keys(dataLinkForm.identification).filter(fieldKey => fieldKey !== 'datastakeId' && !tableKeys.includes(fieldKey)).filter(fieldKey => {
|
|
10057
10054
|
const formInputConfig = dataLinkForm.identification[fieldKey];
|
|
10058
10055
|
return formInputConfig && typeof formInputConfig === 'object' && !Array.isArray(formInputConfig);
|
|
10059
10056
|
}).forEach(fieldKey => {
|
|
10060
|
-
var _item$linking2;
|
|
10061
10057
|
const formInputConfig = dataLinkForm.identification[fieldKey];
|
|
10062
|
-
inputs[fieldKey] =
|
|
10058
|
+
inputs[fieldKey] = {
|
|
10059
|
+
...formInputConfig,
|
|
10063
10060
|
label: uploadTypeFields.includes(fieldKey) ? uploadTypeLabels[fieldKey] : formInputConfig.label || formInputConfig.tableLabel || fieldKey
|
|
10064
|
-
}
|
|
10065
|
-
if (formInputConfig
|
|
10066
|
-
const dynamicLabelKeys = Object.keys(formInputConfig
|
|
10061
|
+
};
|
|
10062
|
+
if (formInputConfig?.label && typeof formInputConfig?.label === 'object') {
|
|
10063
|
+
const dynamicLabelKeys = Object.keys(formInputConfig?.label);
|
|
10067
10064
|
let resolvedLabel = null;
|
|
10068
10065
|
for (const labelKey of dynamicLabelKeys) {
|
|
10069
10066
|
const parts = labelKey.split(' is ');
|
|
@@ -10072,7 +10069,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10072
10069
|
const flattenedItem = Object.assign({}, item.location, {
|
|
10073
10070
|
address: item.address
|
|
10074
10071
|
});
|
|
10075
|
-
if (
|
|
10072
|
+
if (flattenedItem?.[conditionKey] === conditionValue) {
|
|
10076
10073
|
resolvedLabel = formInputConfig.label[labelKey];
|
|
10077
10074
|
break;
|
|
10078
10075
|
}
|
|
@@ -10080,7 +10077,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10080
10077
|
}
|
|
10081
10078
|
inputs[fieldKey].label = resolvedLabel || Object.values(formInputConfig.label)[0] || (uploadTypeFields.includes(fieldKey) ? uploadTypeLabels[fieldKey] : fieldKey);
|
|
10082
10079
|
}
|
|
10083
|
-
values[fieldKey] =
|
|
10080
|
+
values[fieldKey] = item?.linking?.SCL?.[item?.[fieldKey]]?.name || item?.[fieldKey];
|
|
10084
10081
|
});
|
|
10085
10082
|
}
|
|
10086
10083
|
return {
|
|
@@ -10090,17 +10087,16 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10090
10087
|
};
|
|
10091
10088
|
if (Array.isArray(value)) {
|
|
10092
10089
|
return value.map((item, itemIndex) => {
|
|
10093
|
-
var _merged$inputKey;
|
|
10094
10090
|
const merged = mergeObject(item);
|
|
10095
|
-
const datastakeIdValue =
|
|
10091
|
+
const datastakeIdValue = merged?.[inputKey]?.datastakeId || merged?.datastakeId;
|
|
10096
10092
|
const {
|
|
10097
10093
|
inputs,
|
|
10098
10094
|
values
|
|
10099
10095
|
} = createInputsAndValues(merged);
|
|
10100
10096
|
return /*#__PURE__*/jsxRuntime.jsx(TreeNodeComponent, {
|
|
10101
|
-
nodeKey: datastakeIdValue || t(
|
|
10097
|
+
nodeKey: datastakeIdValue || t(`No ID ${itemIndex + 1}`),
|
|
10102
10098
|
config: {
|
|
10103
|
-
label: datastakeIdValue || t(
|
|
10099
|
+
label: datastakeIdValue || t(`No ID ${itemIndex + 1}`),
|
|
10104
10100
|
type: 'custom-datalink-group',
|
|
10105
10101
|
inputs: inputs
|
|
10106
10102
|
},
|
|
@@ -10114,12 +10110,11 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10114
10110
|
getApiBaseUrl: getApiBaseUrl,
|
|
10115
10111
|
getAppHeader: getAppHeader,
|
|
10116
10112
|
app: app
|
|
10117
|
-
},
|
|
10113
|
+
}, `${inputKey}-${itemIndex}`);
|
|
10118
10114
|
});
|
|
10119
10115
|
} else {
|
|
10120
|
-
var _merged$inputKey2;
|
|
10121
10116
|
const merged = mergeObject(value);
|
|
10122
|
-
const datastakeIdValue =
|
|
10117
|
+
const datastakeIdValue = merged?.[inputKey]?.datastakeId || merged?.datastakeId;
|
|
10123
10118
|
const {
|
|
10124
10119
|
inputs,
|
|
10125
10120
|
values
|
|
@@ -10141,7 +10136,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10141
10136
|
getApiBaseUrl: getApiBaseUrl,
|
|
10142
10137
|
getAppHeader: getAppHeader,
|
|
10143
10138
|
app: app
|
|
10144
|
-
},
|
|
10139
|
+
}, `${inputKey}-group`);
|
|
10145
10140
|
}
|
|
10146
10141
|
};
|
|
10147
10142
|
|
|
@@ -10322,20 +10317,21 @@ const handleDataLinkWithTableKeys = ({
|
|
|
10322
10317
|
}
|
|
10323
10318
|
};
|
|
10324
10319
|
|
|
10325
|
-
const handleGroupChildren =
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10320
|
+
const handleGroupChildren = _ref => {
|
|
10321
|
+
let {
|
|
10322
|
+
config,
|
|
10323
|
+
value,
|
|
10324
|
+
allData,
|
|
10325
|
+
level,
|
|
10326
|
+
t,
|
|
10327
|
+
rootForm,
|
|
10328
|
+
user,
|
|
10329
|
+
getApiBaseUrl = () => {},
|
|
10330
|
+
getAppHeader = () => {},
|
|
10331
|
+
app,
|
|
10332
|
+
TreeNodeComponent
|
|
10333
|
+
} = _ref;
|
|
10334
|
+
if (!(config !== null && config !== void 0 && config.inputs)) {
|
|
10339
10335
|
return null;
|
|
10340
10336
|
}
|
|
10341
10337
|
const inputKeys = Object.keys(config.inputs);
|
|
@@ -10348,7 +10344,7 @@ const handleGroupChildren = ({
|
|
|
10348
10344
|
if (value && typeof value === 'object' && value[inputKey]) {
|
|
10349
10345
|
inputValue = value[inputKey];
|
|
10350
10346
|
} else {
|
|
10351
|
-
inputValue = allData
|
|
10347
|
+
inputValue = allData === null || allData === void 0 ? void 0 : allData[inputKey];
|
|
10352
10348
|
}
|
|
10353
10349
|
return /*#__PURE__*/jsxRuntime.jsx(TreeNodeComponent, {
|
|
10354
10350
|
nodeKey: inputKey,
|
|
@@ -44114,10 +44110,6 @@ const useFilters = ({
|
|
|
44114
44110
|
}, [pagination]);
|
|
44115
44111
|
const canGoPrev = React.useMemo(() => pagination.current !== 1, [pagination]);
|
|
44116
44112
|
const canGoNext = React.useMemo(() => pagination.current !== totalPages && totalPages, [pagination, totalPages]);
|
|
44117
|
-
console.log({
|
|
44118
|
-
totalPages,
|
|
44119
|
-
pagination
|
|
44120
|
-
});
|
|
44121
44113
|
const goPrev = () => {
|
|
44122
44114
|
if (!canGoPrev) {
|
|
44123
44115
|
return;
|
|
@@ -49157,6 +49149,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
49157
49149
|
withDuration = true,
|
|
49158
49150
|
onFilterChange,
|
|
49159
49151
|
isPdf,
|
|
49152
|
+
zoomOutTransition = false,
|
|
49160
49153
|
...props
|
|
49161
49154
|
}, ref) {
|
|
49162
49155
|
const {
|
|
@@ -49212,8 +49205,11 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
49212
49205
|
fitView: true // zoom out on default
|
|
49213
49206
|
,
|
|
49214
49207
|
fitViewOptions: {
|
|
49215
|
-
padding: 0.2
|
|
49216
|
-
//
|
|
49208
|
+
padding: 0.2,
|
|
49209
|
+
//zoom out on default
|
|
49210
|
+
...(zoomOutTransition ? {
|
|
49211
|
+
duration: withDuration ? 300 : undefined
|
|
49212
|
+
} : {})
|
|
49217
49213
|
},
|
|
49218
49214
|
...props,
|
|
49219
49215
|
children: !isPdf && /*#__PURE__*/jsxRuntime.jsxs(react.Controls, {
|
|
@@ -49810,7 +49806,8 @@ function StakeholderMappings(_ref3) {
|
|
|
49810
49806
|
iconOffsetY = 250,
|
|
49811
49807
|
t = s => s,
|
|
49812
49808
|
emptyString = undefined,
|
|
49813
|
-
isPdf = false
|
|
49809
|
+
isPdf = false,
|
|
49810
|
+
zoomOutTransition = false
|
|
49814
49811
|
} = _ref3;
|
|
49815
49812
|
const reactFlowWrapper = React.useRef(null);
|
|
49816
49813
|
const [nodes, setNodes] = react.useNodesState([]);
|
|
@@ -50075,6 +50072,7 @@ function StakeholderMappings(_ref3) {
|
|
|
50075
50072
|
});
|
|
50076
50073
|
}, [reactFlowWrapper.current, JSON.stringify(data), JSON.stringify(selectedIconNodes), isAllOpenDefault, isSelectable, isChanged, emptyString]);
|
|
50077
50074
|
return /*#__PURE__*/jsxRuntime.jsx(BaseGraph, {
|
|
50075
|
+
zoomOutTransition: zoomOutTransition,
|
|
50078
50076
|
nodes: nodes,
|
|
50079
50077
|
mandatoryNodesToFit: mandatoryNodesToFit,
|
|
50080
50078
|
edges: edges,
|
package/dist/hooks/index.js
CHANGED
|
@@ -419,10 +419,6 @@ const useFilters = ({
|
|
|
419
419
|
}, [pagination]);
|
|
420
420
|
const canGoPrev = React.useMemo(() => pagination.current !== 1, [pagination]);
|
|
421
421
|
const canGoNext = React.useMemo(() => pagination.current !== totalPages && totalPages, [pagination, totalPages]);
|
|
422
|
-
console.log({
|
|
423
|
-
totalPages,
|
|
424
|
-
pagination
|
|
425
|
-
});
|
|
426
422
|
const goPrev = () => {
|
|
427
423
|
if (!canGoPrev) {
|
|
428
424
|
return;
|
package/dist/pages/index.js
CHANGED
|
@@ -6966,7 +6966,7 @@ const getRowConfig$1 = ({
|
|
|
6966
6966
|
children: t("Identified Mine Sites")
|
|
6967
6967
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6968
6968
|
className: "cursor-pointer",
|
|
6969
|
-
onClick: () => goTo(getRedirectLink("/app/
|
|
6969
|
+
onClick: () => goTo(getRedirectLink("/app/production-sites")),
|
|
6970
6970
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
6971
6971
|
name: "LinkNewTab",
|
|
6972
6972
|
width: 16,
|
|
@@ -11637,6 +11637,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
11637
11637
|
withDuration = true,
|
|
11638
11638
|
onFilterChange,
|
|
11639
11639
|
isPdf,
|
|
11640
|
+
zoomOutTransition = false,
|
|
11640
11641
|
...props
|
|
11641
11642
|
}, ref) {
|
|
11642
11643
|
const {
|
|
@@ -11692,8 +11693,11 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
11692
11693
|
fitView: true // zoom out on default
|
|
11693
11694
|
,
|
|
11694
11695
|
fitViewOptions: {
|
|
11695
|
-
padding: 0.2
|
|
11696
|
-
//
|
|
11696
|
+
padding: 0.2,
|
|
11697
|
+
//zoom out on default
|
|
11698
|
+
...(zoomOutTransition ? {
|
|
11699
|
+
duration: withDuration ? 300 : undefined
|
|
11700
|
+
} : {})
|
|
11697
11701
|
},
|
|
11698
11702
|
...props,
|
|
11699
11703
|
children: !isPdf && /*#__PURE__*/jsxRuntime.jsxs(react.Controls, {
|
|
@@ -13244,7 +13248,7 @@ const getActionWidgetsConfig = ({
|
|
|
13244
13248
|
t
|
|
13245
13249
|
}) => [{
|
|
13246
13250
|
icon: "MineSite",
|
|
13247
|
-
title: t("
|
|
13251
|
+
title: t("Create Mine Site"),
|
|
13248
13252
|
onClick: () => goTo(getRedirectLink("/app/production-sites?create=true"))
|
|
13249
13253
|
}, {
|
|
13250
13254
|
icon: "FileEdit",
|
|
@@ -14607,6 +14611,7 @@ function DataCompilation({
|
|
|
14607
14611
|
title: t("Data Compilation"),
|
|
14608
14612
|
className: "with-border-header",
|
|
14609
14613
|
expandable: true,
|
|
14614
|
+
defaultExpanded: true,
|
|
14610
14615
|
addedHeaderFirst: true,
|
|
14611
14616
|
addedHeader: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
14612
14617
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -14658,7 +14663,6 @@ function DataConsilidation({
|
|
|
14658
14663
|
title: t("Data Consolidation"),
|
|
14659
14664
|
className: "with-border-header",
|
|
14660
14665
|
expandable: true,
|
|
14661
|
-
defaultExpanded: true,
|
|
14662
14666
|
addedHeaderFirst: true,
|
|
14663
14667
|
addedHeader: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
14664
14668
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -15521,10 +15525,6 @@ const useFilters = ({
|
|
|
15521
15525
|
}, [pagination]);
|
|
15522
15526
|
const canGoPrev = React.useMemo(() => pagination.current !== 1, [pagination]);
|
|
15523
15527
|
const canGoNext = React.useMemo(() => pagination.current !== totalPages && totalPages, [pagination, totalPages]);
|
|
15524
|
-
console.log({
|
|
15525
|
-
totalPages,
|
|
15526
|
-
pagination
|
|
15527
|
-
});
|
|
15528
15528
|
const goPrev = () => {
|
|
15529
15529
|
if (!canGoPrev) {
|
|
15530
15530
|
return;
|
|
@@ -31827,9 +31827,6 @@ const getFilterOptions$6 = (options, t) => {
|
|
|
31827
31827
|
countries = [],
|
|
31828
31828
|
category = []
|
|
31829
31829
|
} = options || {};
|
|
31830
|
-
console.log({
|
|
31831
|
-
options
|
|
31832
|
-
});
|
|
31833
31830
|
const _default = {
|
|
31834
31831
|
timeframe: timeframe,
|
|
31835
31832
|
country: countries,
|
|
@@ -34467,6 +34464,42 @@ const IncidentsTable = ({
|
|
|
34467
34464
|
});
|
|
34468
34465
|
};
|
|
34469
34466
|
|
|
34467
|
+
const MoreOptions = ({
|
|
34468
|
+
data,
|
|
34469
|
+
limit = 2,
|
|
34470
|
+
toolTipPlacement = 'top'
|
|
34471
|
+
}) => {
|
|
34472
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
34473
|
+
style: {
|
|
34474
|
+
overflow: 'hidden',
|
|
34475
|
+
textOverflow: 'ellipsis',
|
|
34476
|
+
whiteSpace: 'nowrap',
|
|
34477
|
+
display: 'inline-block'
|
|
34478
|
+
},
|
|
34479
|
+
placement: toolTipPlacement,
|
|
34480
|
+
title: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
34481
|
+
children: [data?.slice(0, 10).map((value, index) => /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
34482
|
+
children: [typeof value === 'string' ? value : value?.name, /*#__PURE__*/jsxRuntime.jsx("br", {})]
|
|
34483
|
+
}, index)), data?.length > 10 && /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
34484
|
+
children: ["+", data?.length - 10]
|
|
34485
|
+
})]
|
|
34486
|
+
}),
|
|
34487
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
34488
|
+
style: {
|
|
34489
|
+
overflow: 'hidden',
|
|
34490
|
+
textOverflow: 'ellipsis',
|
|
34491
|
+
whiteSpace: 'nowrap',
|
|
34492
|
+
maxWidth: '95%'
|
|
34493
|
+
},
|
|
34494
|
+
children: data?.length > limit ? `${data.slice(0, limit).map(value => typeof value === 'string' ? value : value?.name).join(', ')}, +${data?.length - limit}` : data.map(value => typeof value === 'string' ? value : value?.name).join(', ')
|
|
34495
|
+
})
|
|
34496
|
+
});
|
|
34497
|
+
};
|
|
34498
|
+
MoreOptions.propTypes = {
|
|
34499
|
+
data: PropTypes__default["default"].array.isRequired,
|
|
34500
|
+
limit: PropTypes__default["default"].number
|
|
34501
|
+
};
|
|
34502
|
+
|
|
34470
34503
|
const getColumns$1 = ({
|
|
34471
34504
|
t,
|
|
34472
34505
|
goTo,
|
|
@@ -34572,10 +34605,10 @@ const getColumns$1 = ({
|
|
|
34572
34605
|
className: "daf-default-cell"
|
|
34573
34606
|
});
|
|
34574
34607
|
}
|
|
34575
|
-
const
|
|
34576
|
-
return
|
|
34577
|
-
|
|
34578
|
-
|
|
34608
|
+
const operators = all?.operatorOfLocation?.map(operator => operator?.clientLocation?.name);
|
|
34609
|
+
return operators && operators.length > 0 ? /*#__PURE__*/jsxRuntime.jsx(MoreOptions, {
|
|
34610
|
+
data: operators || [],
|
|
34611
|
+
tooltipPlacement: "topLeft"
|
|
34579
34612
|
}) : '-';
|
|
34580
34613
|
}
|
|
34581
34614
|
}, {
|
|
@@ -34859,9 +34892,6 @@ const getFilterOptions$1 = (options, t) => {
|
|
|
34859
34892
|
administrativeLevel1,
|
|
34860
34893
|
administrativeLevel2
|
|
34861
34894
|
} = options || {};
|
|
34862
|
-
console.log({
|
|
34863
|
-
options
|
|
34864
|
-
});
|
|
34865
34895
|
const _default = {
|
|
34866
34896
|
category: stakeholderCategoryOptions || categoryOptions,
|
|
34867
34897
|
country: countries,
|
|
@@ -35409,9 +35439,6 @@ const getFilterOptions = (options, t) => {
|
|
|
35409
35439
|
timeframeOptions = [],
|
|
35410
35440
|
userRoleOptions = []
|
|
35411
35441
|
} = options || {};
|
|
35412
|
-
console.log({
|
|
35413
|
-
options
|
|
35414
|
-
});
|
|
35415
35442
|
const _default = {
|
|
35416
35443
|
timeframe: timeframeOptions,
|
|
35417
35444
|
email: emailOptions,
|
|
@@ -37224,7 +37251,8 @@ function StakeholderMappings({
|
|
|
37224
37251
|
iconOffsetY = 250,
|
|
37225
37252
|
t = s => s,
|
|
37226
37253
|
emptyString = undefined,
|
|
37227
|
-
isPdf = false
|
|
37254
|
+
isPdf = false,
|
|
37255
|
+
zoomOutTransition = false
|
|
37228
37256
|
}) {
|
|
37229
37257
|
const reactFlowWrapper = React.useRef(null);
|
|
37230
37258
|
const [nodes, setNodes] = react.useNodesState([]);
|
|
@@ -37485,6 +37513,7 @@ function StakeholderMappings({
|
|
|
37485
37513
|
});
|
|
37486
37514
|
}, [reactFlowWrapper.current, JSON.stringify(data), JSON.stringify(selectedIconNodes), isAllOpenDefault, isSelectable, isChanged, emptyString]);
|
|
37487
37515
|
return /*#__PURE__*/jsxRuntime.jsx(BaseGraph, {
|
|
37516
|
+
zoomOutTransition: zoomOutTransition,
|
|
37488
37517
|
nodes: nodes,
|
|
37489
37518
|
mandatoryNodesToFit: mandatoryNodesToFit,
|
|
37490
37519
|
edges: edges,
|
|
@@ -37755,11 +37784,6 @@ styled__default["default"].div`
|
|
|
37755
37784
|
pagination: PropTypes__default["default"].any
|
|
37756
37785
|
});
|
|
37757
37786
|
|
|
37758
|
-
({
|
|
37759
|
-
data: PropTypes__default["default"].array.isRequired,
|
|
37760
|
-
limit: PropTypes__default["default"].number
|
|
37761
|
-
});
|
|
37762
|
-
|
|
37763
37787
|
({
|
|
37764
37788
|
content: PropTypes__default["default"].string,
|
|
37765
37789
|
size: PropTypes__default["default"].oneOf(['large', 'middle', 'small']),
|
package/dist/utils/index.js
CHANGED
|
@@ -14257,12 +14257,6 @@ const renderBreadCrumbs = ({
|
|
|
14257
14257
|
return Boolean(cond); // Boolean condition
|
|
14258
14258
|
};
|
|
14259
14259
|
const config = breadCrumbConfig[view];
|
|
14260
|
-
console.log({
|
|
14261
|
-
config,
|
|
14262
|
-
breadCrumbConfig,
|
|
14263
|
-
breadCrumbsLabels,
|
|
14264
|
-
condition
|
|
14265
|
-
});
|
|
14266
14260
|
if (config) {
|
|
14267
14261
|
const conditionContext = {
|
|
14268
14262
|
isDataStore,
|
package/package.json
CHANGED
|
@@ -163,6 +163,7 @@ function StakeholderMappings({
|
|
|
163
163
|
t = (s) => s,
|
|
164
164
|
emptyString = undefined,
|
|
165
165
|
isPdf = false,
|
|
166
|
+
zoomOutTransition = false,
|
|
166
167
|
}) {
|
|
167
168
|
const reactFlowWrapper = useRef(null);
|
|
168
169
|
const [nodes, setNodes] = useNodesState([]);
|
|
@@ -472,6 +473,7 @@ function StakeholderMappings({
|
|
|
472
473
|
|
|
473
474
|
return (
|
|
474
475
|
<BaseGraph
|
|
476
|
+
zoomOutTransition={zoomOutTransition}
|
|
475
477
|
nodes={nodes}
|
|
476
478
|
mandatoryNodesToFit={mandatoryNodesToFit}
|
|
477
479
|
edges={edges}
|
|
@@ -33,6 +33,7 @@ const BaseGraph = forwardRef(function BaseGraph(
|
|
|
33
33
|
withDuration = true,
|
|
34
34
|
onFilterChange,
|
|
35
35
|
isPdf,
|
|
36
|
+
zoomOutTransition = false,
|
|
36
37
|
...props
|
|
37
38
|
},
|
|
38
39
|
ref,
|
|
@@ -86,7 +87,7 @@ const BaseGraph = forwardRef(function BaseGraph(
|
|
|
86
87
|
fitView={true} // zoom out on default
|
|
87
88
|
fitViewOptions={{
|
|
88
89
|
padding: 0.2, //zoom out on default
|
|
89
|
-
|
|
90
|
+
...(zoomOutTransition ? { duration: withDuration ? 300 : undefined } : {}),
|
|
90
91
|
}}
|
|
91
92
|
{...props}
|
|
92
93
|
>
|
|
@@ -234,8 +234,6 @@ export const useFilters = ({
|
|
|
234
234
|
const canGoPrev = useMemo(() => pagination.current !== 1, [pagination]);
|
|
235
235
|
const canGoNext = useMemo(() => pagination.current !== totalPages && totalPages, [pagination, totalPages]);
|
|
236
236
|
|
|
237
|
-
console.log({totalPages, pagination})
|
|
238
|
-
|
|
239
237
|
const goPrev = () => {
|
|
240
238
|
if (!canGoPrev) {
|
|
241
239
|
return;
|
|
@@ -6,7 +6,7 @@ export const getRowConfig = ({ t, data = {}, goTo, getRedirectLink, theme = {} }
|
|
|
6
6
|
label: (
|
|
7
7
|
<div className="flex">
|
|
8
8
|
<div className="flex-1">{t("Identified Mine Sites")}</div>
|
|
9
|
-
<div className="cursor-pointer" onClick={() => goTo(getRedirectLink("/app/
|
|
9
|
+
<div className="cursor-pointer" onClick={() => goTo(getRedirectLink("/app/production-sites"))}>
|
|
10
10
|
<CustomIcon
|
|
11
11
|
name="LinkNewTab"
|
|
12
12
|
width={16}
|
|
@@ -6,6 +6,7 @@ import CustomIcon from '../../../core/components/Icon/CustomIcon.jsx';
|
|
|
6
6
|
import AvatarGroup from '../../../core/components/AvatarGroup/index.jsx';
|
|
7
7
|
import sourceAvatarConfig from '../../../../helpers/sourceAvatarConfig.js';
|
|
8
8
|
import MoreMenu from '../../../core/components/Table/MoreMenu/index.jsx';
|
|
9
|
+
import MoreOptions from '../../../core/components/Table/MoreOptions/index.jsx';
|
|
9
10
|
|
|
10
11
|
export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
|
|
11
12
|
{
|
|
@@ -88,9 +89,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
88
89
|
return <div className="daf-default-cell" />
|
|
89
90
|
}
|
|
90
91
|
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
return operator ? <Tooltip title={operator}>{operator}</Tooltip> : '-';
|
|
92
|
+
const operators = all?.operatorOfLocation?.map((operator) => operator?.clientLocation?.name);
|
|
93
|
+
return (operators && operators.length > 0) ? <MoreOptions data={operators || []} tooltipPlacement="topLeft" /> : '-';
|
|
94
94
|
},
|
|
95
95
|
},
|
|
96
96
|
{
|