datastake-daf 0.6.762 → 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 +112 -105
- package/dist/hooks/index.js +0 -4
- package/dist/pages/index.js +51 -27
- 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/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
|
@@ -9511,24 +9511,29 @@ const processConditionalTableKeys = (tableKeys, item) => {
|
|
|
9511
9511
|
});
|
|
9512
9512
|
return processedKeys;
|
|
9513
9513
|
};
|
|
9514
|
-
const renderFieldData = (type, value, user, config
|
|
9514
|
+
const renderFieldData = function (type, value, user, config) {
|
|
9515
|
+
let getApiBaseUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : () => {};
|
|
9516
|
+
let getAppHeader = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : () => {};
|
|
9517
|
+
let app = arguments.length > 6 ? arguments[6] : undefined;
|
|
9518
|
+
let allValues = arguments.length > 7 ? arguments[7] : undefined;
|
|
9519
|
+
let formValues = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : {};
|
|
9515
9520
|
switch (type) {
|
|
9516
9521
|
case 'year':
|
|
9517
9522
|
return value !== '-' ? renderDateFormatted(value, 'YYYY', 'en') : '-';
|
|
9518
9523
|
case 'date':
|
|
9519
9524
|
{
|
|
9520
|
-
const language = user
|
|
9525
|
+
const language = user !== null && user !== void 0 && user.language && (user === null || user === void 0 ? void 0 : user.language) === 'sp' ? 'es' : user === null || user === void 0 ? void 0 : user.language;
|
|
9521
9526
|
return value !== '-' ? renderDateFormatted(value, 'DD MMM YYYY', language || 'en') : '-';
|
|
9522
9527
|
}
|
|
9523
9528
|
case 'select':
|
|
9524
9529
|
{
|
|
9525
|
-
const options = config
|
|
9530
|
+
const options = (config === null || config === void 0 ? void 0 : config.options) || [];
|
|
9526
9531
|
const option = findOptions(value, options);
|
|
9527
9532
|
return option;
|
|
9528
9533
|
}
|
|
9529
9534
|
case 'multiselect':
|
|
9530
9535
|
{
|
|
9531
|
-
const options = config
|
|
9536
|
+
const options = (config === null || config === void 0 ? void 0 : config.options) || [];
|
|
9532
9537
|
const _val = typeof value === 'string' ? value.split(',').map(v => v.trim()) : value;
|
|
9533
9538
|
const option = findOptions(_val, options);
|
|
9534
9539
|
return option.join(', ');
|
|
@@ -9543,7 +9548,7 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
|
|
|
9543
9548
|
formValues: formValues
|
|
9544
9549
|
});
|
|
9545
9550
|
case 'percentage':
|
|
9546
|
-
return value === '-' || value === null || value === undefined ? '-' :
|
|
9551
|
+
return value === '-' || value === null || value === undefined ? '-' : "".concat(value, " %");
|
|
9547
9552
|
case 'geolocation':
|
|
9548
9553
|
{
|
|
9549
9554
|
const val = JSON.parse(value) || {};
|
|
@@ -9557,7 +9562,7 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
|
|
|
9557
9562
|
case 'upload':
|
|
9558
9563
|
case 'videoUpload':
|
|
9559
9564
|
{
|
|
9560
|
-
const documentName = allValues
|
|
9565
|
+
const documentName = allValues === null || allValues === void 0 ? void 0 : allValues.map(item => item === null || item === void 0 ? void 0 : item.name).join(', ');
|
|
9561
9566
|
return documentName;
|
|
9562
9567
|
}
|
|
9563
9568
|
default:
|
|
@@ -9565,25 +9570,27 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
|
|
|
9565
9570
|
}
|
|
9566
9571
|
};
|
|
9567
9572
|
|
|
9568
|
-
const renderValue =
|
|
9569
|
-
|
|
9570
|
-
|
|
9571
|
-
|
|
9572
|
-
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9573
|
+
const renderValue = _ref => {
|
|
9574
|
+
let {
|
|
9575
|
+
value,
|
|
9576
|
+
hasChildren,
|
|
9577
|
+
config,
|
|
9578
|
+
user,
|
|
9579
|
+
getApiBaseUrl = () => {},
|
|
9580
|
+
getAppHeader = () => {},
|
|
9581
|
+
app,
|
|
9582
|
+
allData = {}
|
|
9583
|
+
} = _ref;
|
|
9584
|
+
if ((config === null || config === void 0 ? void 0 : config.type) === 'groupInputs') {
|
|
9585
|
+
if (!(config !== null && config !== void 0 && config.inputs)) return null;
|
|
9580
9586
|
const inputKeys = Object.keys(config.inputs).sort((a, b) => {
|
|
9581
|
-
|
|
9582
|
-
const
|
|
9587
|
+
var _config$inputs$a, _config$inputs$b;
|
|
9588
|
+
const positionA = ((_config$inputs$a = config.inputs[a]) === null || _config$inputs$a === void 0 ? void 0 : _config$inputs$a.position) || 0;
|
|
9589
|
+
const positionB = ((_config$inputs$b = config.inputs[b]) === null || _config$inputs$b === void 0 ? void 0 : _config$inputs$b.position) || 0;
|
|
9583
9590
|
return positionA - positionB;
|
|
9584
9591
|
});
|
|
9585
9592
|
const values = inputKeys.map(inputKey => {
|
|
9586
|
-
let inputValue = value
|
|
9593
|
+
let inputValue = value === null || value === void 0 ? void 0 : value[inputKey];
|
|
9587
9594
|
if (inputValue === null || inputValue === undefined || inputValue === '') {
|
|
9588
9595
|
return '';
|
|
9589
9596
|
} else if (typeof inputValue === 'object' && inputValue !== null) {
|
|
@@ -9624,8 +9631,8 @@ const renderValue = ({
|
|
|
9624
9631
|
} else {
|
|
9625
9632
|
displayValue = String(value);
|
|
9626
9633
|
}
|
|
9627
|
-
const fieldType = config
|
|
9628
|
-
let cssClass =
|
|
9634
|
+
const fieldType = (config === null || config === void 0 ? void 0 : config.type) || 'text';
|
|
9635
|
+
let cssClass = "tree-value ".concat(fieldType, "-type");
|
|
9629
9636
|
if (displayValue === '-') {
|
|
9630
9637
|
cssClass += ' empty';
|
|
9631
9638
|
}
|
|
@@ -9635,19 +9642,21 @@ const renderValue = ({
|
|
|
9635
9642
|
children: displayValue
|
|
9636
9643
|
});
|
|
9637
9644
|
};
|
|
9638
|
-
const determineHasChildren =
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9645
|
+
const determineHasChildren = _ref2 => {
|
|
9646
|
+
var _config$meta;
|
|
9647
|
+
let {
|
|
9648
|
+
config,
|
|
9649
|
+
level
|
|
9650
|
+
} = _ref2;
|
|
9651
|
+
if ((config === null || config === void 0 ? void 0 : config.type) === 'groupInputs') {
|
|
9643
9652
|
return false;
|
|
9644
9653
|
}
|
|
9645
|
-
if (config
|
|
9654
|
+
if ((config === null || config === void 0 ? void 0 : config.type) === 'header' && config !== null && config !== void 0 && config.inputs && Object.keys(config.inputs).length > 0) {
|
|
9646
9655
|
return true;
|
|
9647
9656
|
}
|
|
9648
|
-
return config
|
|
9657
|
+
return (config === null || config === void 0 ? void 0 : config.inputs) || (config === null || config === void 0 ? void 0 : config.type) === 'group' || (config === null || config === void 0 ? void 0 : config.type) === 'dataLinkGroup' || (config === null || config === void 0 ? void 0 : config.type) === 'section' || (config === null || config === void 0 ? void 0 : config.type) === 'ajaxSubGroup' ||
|
|
9649
9658
|
// Add this line
|
|
9650
|
-
config
|
|
9659
|
+
(config === null || config === void 0 ? void 0 : config.type) === 'dataLink' && (config === null || config === void 0 || (_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.tableKeys) || level === 0 && config && typeof config === 'object' && Object.keys(config).some(key => key !== 'id' && key !== 'label' && key !== 'position' && key !== 'subTitle' && typeof config[key] === 'object' && config[key] !== null);
|
|
9651
9660
|
};
|
|
9652
9661
|
|
|
9653
9662
|
const sortByPosition = (items, getConfig) => {
|
|
@@ -9921,44 +9930,44 @@ function useAjaxModal$2({
|
|
|
9921
9930
|
}
|
|
9922
9931
|
|
|
9923
9932
|
const mergeObject = obj => {
|
|
9924
|
-
return Object.entries(obj || {}).reduce((acc,
|
|
9925
|
-
let [key, value] = _ref;
|
|
9933
|
+
return Object.entries(obj || {}).reduce((acc, [key, value]) => {
|
|
9926
9934
|
if (typeof value === "object" && !Array.isArray(value) && value !== null) {
|
|
9927
|
-
return
|
|
9935
|
+
return {
|
|
9936
|
+
...acc,
|
|
9937
|
+
...value
|
|
9938
|
+
};
|
|
9928
9939
|
}
|
|
9929
|
-
return
|
|
9940
|
+
return {
|
|
9941
|
+
...acc,
|
|
9930
9942
|
[key]: value
|
|
9931
|
-
}
|
|
9943
|
+
};
|
|
9932
9944
|
}, {});
|
|
9933
9945
|
};
|
|
9934
|
-
const handleDataLinkGroupWithTableKeys =
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
TreeNodeComponent
|
|
9950
|
-
} = _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
|
+
}) => {
|
|
9951
9961
|
if (!(config.type === 'dataLinkGroup' || config.type === 'dataLink')) {
|
|
9952
9962
|
return null;
|
|
9953
9963
|
}
|
|
9954
|
-
if (
|
|
9964
|
+
if (inputConfig?.type !== 'dataLink' || !inputConfig?.meta?.tableKeys) {
|
|
9955
9965
|
const parentInputKeys = Object.keys(config.inputs || {});
|
|
9956
9966
|
const isHandledBySiblingDataLink = parentInputKeys.some(otherInputKey => {
|
|
9957
9967
|
const otherConfig = config.inputs[otherInputKey];
|
|
9958
|
-
if (
|
|
9959
|
-
|
|
9960
|
-
const
|
|
9961
|
-
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 || [];
|
|
9962
9971
|
const allSiblingKeys = [...siblingTableKeys, ...additionalTableKeys];
|
|
9963
9972
|
return allSiblingKeys.includes(inputKey) && otherInputKey !== inputKey;
|
|
9964
9973
|
}
|
|
@@ -9972,26 +9981,23 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
9972
9981
|
return null;
|
|
9973
9982
|
}
|
|
9974
9983
|
const tableKeys = inputConfig.meta.tableKeys;
|
|
9975
|
-
const additionalTableKeys =
|
|
9984
|
+
const additionalTableKeys = config.meta?.additionalTableKeys || [];
|
|
9976
9985
|
const parentInputKeys = Object.keys(config.inputs || {});
|
|
9977
9986
|
const siblingInputsMatchingTableKeys = parentInputKeys.filter(siblingKey => siblingKey !== inputKey).filter(siblingKey => tableKeys.includes(siblingKey) || additionalTableKeys.includes(siblingKey));
|
|
9978
9987
|
[...new Set([...tableKeys, ...siblingInputsMatchingTableKeys])];
|
|
9979
|
-
const isAjaxModal = React.useMemo(() =>
|
|
9980
|
-
var _inputConfig$meta2;
|
|
9981
|
-
return !!(inputConfig !== null && inputConfig !== void 0 && (_inputConfig$meta2 = inputConfig.meta) !== null && _inputConfig$meta2 !== void 0 && _inputConfig$meta2.namespace);
|
|
9982
|
-
}, [inputConfig]);
|
|
9988
|
+
const isAjaxModal = React.useMemo(() => !!inputConfig?.meta?.namespace, [inputConfig]);
|
|
9983
9989
|
const ajaxModalValues = useAjaxModal$2({
|
|
9984
9990
|
name: inputKey,
|
|
9985
9991
|
user,
|
|
9986
|
-
namespace: inputConfig
|
|
9987
|
-
skipFetch: inputConfig
|
|
9992
|
+
namespace: inputConfig?.meta?.namespace,
|
|
9993
|
+
skipFetch: inputConfig?.meta?.skipFetch,
|
|
9988
9994
|
isAjaxModal,
|
|
9989
|
-
formScope: inputConfig
|
|
9995
|
+
formScope: inputConfig?.meta?.formScope,
|
|
9990
9996
|
APP: app,
|
|
9991
9997
|
apiBaseUrl: getApiBaseUrl(),
|
|
9992
9998
|
_getAppHeader: getAppHeader
|
|
9993
9999
|
});
|
|
9994
|
-
const dataLinkForm = ajaxModalValues
|
|
10000
|
+
const dataLinkForm = ajaxModalValues?.form;
|
|
9995
10001
|
const createInputsAndValues = item => {
|
|
9996
10002
|
const inputs = {};
|
|
9997
10003
|
const values = {};
|
|
@@ -10003,12 +10009,12 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10003
10009
|
'videos': 'Video'
|
|
10004
10010
|
};
|
|
10005
10011
|
tableKeys.filter(tableKey => tableKey !== 'datastakeId').forEach(tableKey => {
|
|
10006
|
-
|
|
10007
|
-
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];
|
|
10008
10013
|
if (formInputConfig) {
|
|
10009
|
-
inputs[tableKey] =
|
|
10014
|
+
inputs[tableKey] = {
|
|
10015
|
+
...formInputConfig,
|
|
10010
10016
|
label: uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : formInputConfig.label || formInputConfig.tableLabel || tableKey
|
|
10011
|
-
}
|
|
10017
|
+
};
|
|
10012
10018
|
if (formInputConfig.label && typeof formInputConfig.label === 'object') {
|
|
10013
10019
|
const dynamicLabelKeys = Object.keys(formInputConfig.label);
|
|
10014
10020
|
let resolvedLabel = null;
|
|
@@ -10016,7 +10022,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10016
10022
|
const parts = labelKey.split(' is ');
|
|
10017
10023
|
if (parts.length === 2) {
|
|
10018
10024
|
const [conditionKey, conditionValue] = parts;
|
|
10019
|
-
if (
|
|
10025
|
+
if (item?.[conditionKey] === conditionValue) {
|
|
10020
10026
|
resolvedLabel = formInputConfig.label[labelKey];
|
|
10021
10027
|
break;
|
|
10022
10028
|
}
|
|
@@ -10024,37 +10030,37 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10024
10030
|
}
|
|
10025
10031
|
inputs[tableKey].label = resolvedLabel || Object.values(formInputConfig.label)[0] || (uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : tableKey);
|
|
10026
10032
|
}
|
|
10027
|
-
values[tableKey] = item
|
|
10033
|
+
values[tableKey] = item?.[tableKey];
|
|
10028
10034
|
} else {
|
|
10029
|
-
var _item$linking;
|
|
10030
10035
|
inputs[tableKey] = {
|
|
10031
10036
|
label: uploadTypeFields.includes(tableKey) ? uploadTypeLabels[tableKey] : tableKey,
|
|
10032
|
-
type: inputConfig
|
|
10037
|
+
type: inputConfig?.type
|
|
10033
10038
|
};
|
|
10034
|
-
values[tableKey] =
|
|
10039
|
+
values[tableKey] = item?.linking?.SCL?.[item?.[tableKey]]?.name || item?.[tableKey];
|
|
10035
10040
|
}
|
|
10036
10041
|
});
|
|
10037
10042
|
siblingInputsMatchingTableKeys.forEach(siblingKey => {
|
|
10038
10043
|
const siblingConfig = config.inputs[siblingKey];
|
|
10039
10044
|
if (siblingConfig) {
|
|
10040
|
-
inputs[siblingKey] =
|
|
10045
|
+
inputs[siblingKey] = {
|
|
10046
|
+
...siblingConfig,
|
|
10041
10047
|
label: siblingConfig.label || siblingKey
|
|
10042
|
-
}
|
|
10043
|
-
values[siblingKey] = item
|
|
10048
|
+
};
|
|
10049
|
+
values[siblingKey] = item?.[siblingKey];
|
|
10044
10050
|
}
|
|
10045
10051
|
});
|
|
10046
|
-
if (dataLinkForm
|
|
10052
|
+
if (dataLinkForm?.identification && typeof dataLinkForm.identification === 'object') {
|
|
10047
10053
|
Object.keys(dataLinkForm.identification).filter(fieldKey => fieldKey !== 'datastakeId' && !tableKeys.includes(fieldKey)).filter(fieldKey => {
|
|
10048
10054
|
const formInputConfig = dataLinkForm.identification[fieldKey];
|
|
10049
10055
|
return formInputConfig && typeof formInputConfig === 'object' && !Array.isArray(formInputConfig);
|
|
10050
10056
|
}).forEach(fieldKey => {
|
|
10051
|
-
var _item$linking2;
|
|
10052
10057
|
const formInputConfig = dataLinkForm.identification[fieldKey];
|
|
10053
|
-
inputs[fieldKey] =
|
|
10058
|
+
inputs[fieldKey] = {
|
|
10059
|
+
...formInputConfig,
|
|
10054
10060
|
label: uploadTypeFields.includes(fieldKey) ? uploadTypeLabels[fieldKey] : formInputConfig.label || formInputConfig.tableLabel || fieldKey
|
|
10055
|
-
}
|
|
10056
|
-
if (formInputConfig
|
|
10057
|
-
const dynamicLabelKeys = Object.keys(formInputConfig
|
|
10061
|
+
};
|
|
10062
|
+
if (formInputConfig?.label && typeof formInputConfig?.label === 'object') {
|
|
10063
|
+
const dynamicLabelKeys = Object.keys(formInputConfig?.label);
|
|
10058
10064
|
let resolvedLabel = null;
|
|
10059
10065
|
for (const labelKey of dynamicLabelKeys) {
|
|
10060
10066
|
const parts = labelKey.split(' is ');
|
|
@@ -10063,7 +10069,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10063
10069
|
const flattenedItem = Object.assign({}, item.location, {
|
|
10064
10070
|
address: item.address
|
|
10065
10071
|
});
|
|
10066
|
-
if (
|
|
10072
|
+
if (flattenedItem?.[conditionKey] === conditionValue) {
|
|
10067
10073
|
resolvedLabel = formInputConfig.label[labelKey];
|
|
10068
10074
|
break;
|
|
10069
10075
|
}
|
|
@@ -10071,7 +10077,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10071
10077
|
}
|
|
10072
10078
|
inputs[fieldKey].label = resolvedLabel || Object.values(formInputConfig.label)[0] || (uploadTypeFields.includes(fieldKey) ? uploadTypeLabels[fieldKey] : fieldKey);
|
|
10073
10079
|
}
|
|
10074
|
-
values[fieldKey] =
|
|
10080
|
+
values[fieldKey] = item?.linking?.SCL?.[item?.[fieldKey]]?.name || item?.[fieldKey];
|
|
10075
10081
|
});
|
|
10076
10082
|
}
|
|
10077
10083
|
return {
|
|
@@ -10081,17 +10087,16 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10081
10087
|
};
|
|
10082
10088
|
if (Array.isArray(value)) {
|
|
10083
10089
|
return value.map((item, itemIndex) => {
|
|
10084
|
-
var _merged$inputKey;
|
|
10085
10090
|
const merged = mergeObject(item);
|
|
10086
|
-
const datastakeIdValue =
|
|
10091
|
+
const datastakeIdValue = merged?.[inputKey]?.datastakeId || merged?.datastakeId;
|
|
10087
10092
|
const {
|
|
10088
10093
|
inputs,
|
|
10089
10094
|
values
|
|
10090
10095
|
} = createInputsAndValues(merged);
|
|
10091
10096
|
return /*#__PURE__*/jsxRuntime.jsx(TreeNodeComponent, {
|
|
10092
|
-
nodeKey: datastakeIdValue || t(
|
|
10097
|
+
nodeKey: datastakeIdValue || t(`No ID ${itemIndex + 1}`),
|
|
10093
10098
|
config: {
|
|
10094
|
-
label: datastakeIdValue || t(
|
|
10099
|
+
label: datastakeIdValue || t(`No ID ${itemIndex + 1}`),
|
|
10095
10100
|
type: 'custom-datalink-group',
|
|
10096
10101
|
inputs: inputs
|
|
10097
10102
|
},
|
|
@@ -10105,12 +10110,11 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10105
10110
|
getApiBaseUrl: getApiBaseUrl,
|
|
10106
10111
|
getAppHeader: getAppHeader,
|
|
10107
10112
|
app: app
|
|
10108
|
-
},
|
|
10113
|
+
}, `${inputKey}-${itemIndex}`);
|
|
10109
10114
|
});
|
|
10110
10115
|
} else {
|
|
10111
|
-
var _merged$inputKey2;
|
|
10112
10116
|
const merged = mergeObject(value);
|
|
10113
|
-
const datastakeIdValue =
|
|
10117
|
+
const datastakeIdValue = merged?.[inputKey]?.datastakeId || merged?.datastakeId;
|
|
10114
10118
|
const {
|
|
10115
10119
|
inputs,
|
|
10116
10120
|
values
|
|
@@ -10132,7 +10136,7 @@ const handleDataLinkGroupWithTableKeys = _ref2 => {
|
|
|
10132
10136
|
getApiBaseUrl: getApiBaseUrl,
|
|
10133
10137
|
getAppHeader: getAppHeader,
|
|
10134
10138
|
app: app
|
|
10135
|
-
},
|
|
10139
|
+
}, `${inputKey}-group`);
|
|
10136
10140
|
}
|
|
10137
10141
|
};
|
|
10138
10142
|
|
|
@@ -10490,11 +10494,12 @@ const AjaxSubGroup$2 = ({
|
|
|
10490
10494
|
};
|
|
10491
10495
|
|
|
10492
10496
|
const handleAjaxSubGroupChildren = props => {
|
|
10493
|
-
|
|
10494
|
-
if (((_props$config = props.config) === null || _props$config === void 0 ? void 0 : _props$config.type) !== 'ajaxSubGroup' || !Array.isArray(props.value)) {
|
|
10497
|
+
if (props.config?.type !== 'ajaxSubGroup' || !Array.isArray(props.value)) {
|
|
10495
10498
|
return null;
|
|
10496
10499
|
}
|
|
10497
|
-
return [/*#__PURE__*/jsxRuntime.jsx(AjaxSubGroup$2,
|
|
10500
|
+
return [/*#__PURE__*/jsxRuntime.jsx(AjaxSubGroup$2, {
|
|
10501
|
+
...props
|
|
10502
|
+
}, "ajax-subgroup")];
|
|
10498
10503
|
};
|
|
10499
10504
|
|
|
10500
10505
|
const TreeNode = _ref => {
|
|
@@ -44105,10 +44110,6 @@ const useFilters = ({
|
|
|
44105
44110
|
}, [pagination]);
|
|
44106
44111
|
const canGoPrev = React.useMemo(() => pagination.current !== 1, [pagination]);
|
|
44107
44112
|
const canGoNext = React.useMemo(() => pagination.current !== totalPages && totalPages, [pagination, totalPages]);
|
|
44108
|
-
console.log({
|
|
44109
|
-
totalPages,
|
|
44110
|
-
pagination
|
|
44111
|
-
});
|
|
44112
44113
|
const goPrev = () => {
|
|
44113
44114
|
if (!canGoPrev) {
|
|
44114
44115
|
return;
|
|
@@ -49148,6 +49149,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
49148
49149
|
withDuration = true,
|
|
49149
49150
|
onFilterChange,
|
|
49150
49151
|
isPdf,
|
|
49152
|
+
zoomOutTransition = false,
|
|
49151
49153
|
...props
|
|
49152
49154
|
}, ref) {
|
|
49153
49155
|
const {
|
|
@@ -49203,8 +49205,11 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
49203
49205
|
fitView: true // zoom out on default
|
|
49204
49206
|
,
|
|
49205
49207
|
fitViewOptions: {
|
|
49206
|
-
padding: 0.2
|
|
49207
|
-
//
|
|
49208
|
+
padding: 0.2,
|
|
49209
|
+
//zoom out on default
|
|
49210
|
+
...(zoomOutTransition ? {
|
|
49211
|
+
duration: withDuration ? 300 : undefined
|
|
49212
|
+
} : {})
|
|
49208
49213
|
},
|
|
49209
49214
|
...props,
|
|
49210
49215
|
children: !isPdf && /*#__PURE__*/jsxRuntime.jsxs(react.Controls, {
|
|
@@ -49801,7 +49806,8 @@ function StakeholderMappings(_ref3) {
|
|
|
49801
49806
|
iconOffsetY = 250,
|
|
49802
49807
|
t = s => s,
|
|
49803
49808
|
emptyString = undefined,
|
|
49804
|
-
isPdf = false
|
|
49809
|
+
isPdf = false,
|
|
49810
|
+
zoomOutTransition = false
|
|
49805
49811
|
} = _ref3;
|
|
49806
49812
|
const reactFlowWrapper = React.useRef(null);
|
|
49807
49813
|
const [nodes, setNodes] = react.useNodesState([]);
|
|
@@ -50066,6 +50072,7 @@ function StakeholderMappings(_ref3) {
|
|
|
50066
50072
|
});
|
|
50067
50073
|
}, [reactFlowWrapper.current, JSON.stringify(data), JSON.stringify(selectedIconNodes), isAllOpenDefault, isSelectable, isChanged, emptyString]);
|
|
50068
50074
|
return /*#__PURE__*/jsxRuntime.jsx(BaseGraph, {
|
|
50075
|
+
zoomOutTransition: zoomOutTransition,
|
|
50069
50076
|
nodes: nodes,
|
|
50070
50077
|
mandatoryNodesToFit: mandatoryNodesToFit,
|
|
50071
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, {
|
|
@@ -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
|
{
|