datastake-daf 0.6.798 → 0.6.800
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 +1206 -311
- package/dist/context/index.js +6 -6
- package/dist/pages/index.js +250 -14
- package/dist/services/index.js +187 -84
- package/dist/utils/index.js +14 -17
- package/package.json +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/hook.js +0 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/hook.js +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/AddUser/index.jsx +0 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/columns.js +79 -0
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/helper.js +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +18 -8
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +6 -6
- package/src/@daf/core/components/Screens/Admin/AdminModals/NewAccount/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/NewUser/index.jsx +61 -38
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Accounts.jsx +1 -4
- package/src/@daf/core/components/Screens/Admin/AdminScreens/AccountsView.jsx +2 -0
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Dashboard.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Location.jsx +10 -8
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Subjects.jsx +5 -3
- package/src/@daf/core/components/Screens/Admin/AdminScreens/SubjectsView.jsx +395 -0
- package/src/@daf/core/components/Screens/Admin/AdminScreens/index.js +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/index.jsx +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/column.js +225 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/helper.js +65 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +78 -46
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/columns.js +41 -39
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +53 -24
- package/src/@daf/core/components/Screens/Admin/AdminTables/UserTable/index.jsx +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditLocation/configTransformer.js +137 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditLocation/index.js +9 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditLocation/index.jsx +196 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditStakeholder/configTransformer.js +216 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditStakeholder/index.js +7 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditStakeholder/index.jsx +184 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/config.js +64 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/helpers.js +13 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/index.jsx +77 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/config.js +51 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/helpers.js +0 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/index.jsx +75 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Edit/index.jsx +7 -1
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/SidebarMenu/index.jsx +5 -3
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/helper.js +13 -8
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/index.jsx +16 -10
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/View/index.jsx +2 -1
- package/src/@daf/core/components/Screens/Admin/AdminViews/index.jsx +66 -26
- package/src/@daf/core/components/Screens/Admin/AppInvitation/index.jsx +193 -0
- package/src/@daf/core/components/Screens/Admin/adminRoutes.js +37 -2
- package/src/@daf/layouts/AppLayout/index.jsx +0 -1
- package/src/@daf/pages/Edit/hooks/usePrepareForm.js +1 -1
- package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/columns.js +180 -0
- package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/config.js +0 -0
- package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/index.jsx +27 -0
- package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/columns.js +157 -0
- package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/config.js +31 -0
- package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/index.js +77 -0
- package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/columns.js +117 -0
- package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/index.jsx +54 -0
- package/src/@daf/pages/SelfAssesment/index.jsx +0 -0
- package/src/@daf/pages/View/hooks/usePrepareForm.js +11 -1
- package/src/@daf/pages/View/index.jsx +9 -2
- package/src/@daf/services/AdminService.js +112 -7
- package/src/@daf/services/AuthenticationService.js +1 -0
- package/src/@daf/services/DashboardService.js +2 -1
- package/src/@daf/utils/filters.js +15 -13
- package/src/constants/locales/en/translation.js +7 -0
- package/src/constants/locales/fr/translation.js +1 -1
- package/src/constants/locales/sp/translation.js +1 -1
- package/src/index.js +1 -0
package/dist/components/index.js
CHANGED
|
@@ -4778,7 +4778,7 @@ const config$2 = {
|
|
|
4778
4778
|
Down: config$3
|
|
4779
4779
|
};
|
|
4780
4780
|
|
|
4781
|
-
const _excluded$
|
|
4781
|
+
const _excluded$F = ["width", "height", "size", "name", "fill"];
|
|
4782
4782
|
const CustomIcon = _ref => {
|
|
4783
4783
|
let {
|
|
4784
4784
|
width = 14,
|
|
@@ -4787,7 +4787,7 @@ const CustomIcon = _ref => {
|
|
|
4787
4787
|
name = "",
|
|
4788
4788
|
fill = "none"
|
|
4789
4789
|
} = _ref,
|
|
4790
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
4790
|
+
props = _objectWithoutProperties(_ref, _excluded$F);
|
|
4791
4791
|
const conf = config$2[name];
|
|
4792
4792
|
if (conf) {
|
|
4793
4793
|
return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -5076,7 +5076,7 @@ createCommonjsModule(function (module, exports) {
|
|
|
5076
5076
|
!function(e,n){module.exports=n();}(commonjsGlobal,(function(){return {name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var n=["th","st","nd","rd"],t=e%100;return "["+e+(n[(t-20)%10]||n[t]||n[0])+"]"}}}));
|
|
5077
5077
|
});
|
|
5078
5078
|
|
|
5079
|
-
const _excluded$
|
|
5079
|
+
const _excluded$E = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
|
|
5080
5080
|
dayjs__default["default"].extend(customParseFormat);
|
|
5081
5081
|
dayjs__default["default"].extend(utc);
|
|
5082
5082
|
dayjs__default["default"].extend(utc);
|
|
@@ -5452,7 +5452,7 @@ const filterCreateData = data => {
|
|
|
5452
5452
|
createdAt,
|
|
5453
5453
|
updatedAt
|
|
5454
5454
|
} = data,
|
|
5455
|
-
rest = _objectWithoutProperties(data, _excluded$
|
|
5455
|
+
rest = _objectWithoutProperties(data, _excluded$E);
|
|
5456
5456
|
const _meta = isObjectEmpty(meta) ? undefined : meta;
|
|
5457
5457
|
return _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
5458
5458
|
meta: _meta
|
|
@@ -5848,7 +5848,7 @@ SelectFilters.propTypes = {
|
|
|
5848
5848
|
apiUrl: PropTypes__default["default"].string
|
|
5849
5849
|
};
|
|
5850
5850
|
|
|
5851
|
-
const _excluded$
|
|
5851
|
+
const _excluded$D = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
|
|
5852
5852
|
function DAFTable(_ref) {
|
|
5853
5853
|
let {
|
|
5854
5854
|
columns = [],
|
|
@@ -5879,7 +5879,7 @@ function DAFTable(_ref) {
|
|
|
5879
5879
|
app,
|
|
5880
5880
|
doEmptyRows
|
|
5881
5881
|
} = _ref,
|
|
5882
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
5882
|
+
rest = _objectWithoutProperties(_ref, _excluded$D);
|
|
5883
5883
|
const [source, setSource] = React.useState([]);
|
|
5884
5884
|
const projectData = (projects || []).find(p => p.id === selectedProject);
|
|
5885
5885
|
const [filtersInit, setFiltersInit] = React.useState(!loading);
|
|
@@ -6697,7 +6697,7 @@ function ComponentWithFocus(_ref) {
|
|
|
6697
6697
|
}
|
|
6698
6698
|
|
|
6699
6699
|
var _templateObject$g;
|
|
6700
|
-
const _excluded$
|
|
6700
|
+
const _excluded$C = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
|
|
6701
6701
|
function StickyTable(_ref) {
|
|
6702
6702
|
let {
|
|
6703
6703
|
size = "small",
|
|
@@ -6708,7 +6708,7 @@ function StickyTable(_ref) {
|
|
|
6708
6708
|
pagination = false,
|
|
6709
6709
|
doEmptyRows = true
|
|
6710
6710
|
} = _ref,
|
|
6711
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
6711
|
+
props = _objectWithoutProperties(_ref, _excluded$C);
|
|
6712
6712
|
const data = React__default["default"].useMemo(() => {
|
|
6713
6713
|
if (!doEmptyRows) {
|
|
6714
6714
|
return dataSource;
|
|
@@ -7236,7 +7236,7 @@ const BTN_SIZE = {
|
|
|
7236
7236
|
LG: 'large'
|
|
7237
7237
|
};
|
|
7238
7238
|
|
|
7239
|
-
const _excluded$
|
|
7239
|
+
const _excluded$B = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
|
|
7240
7240
|
function DafButton(_ref) {
|
|
7241
7241
|
let {
|
|
7242
7242
|
content = '',
|
|
@@ -7250,7 +7250,7 @@ function DafButton(_ref) {
|
|
|
7250
7250
|
style = {},
|
|
7251
7251
|
className = ''
|
|
7252
7252
|
} = _ref,
|
|
7253
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
7253
|
+
restProps = _objectWithoutProperties(_ref, _excluded$B);
|
|
7254
7254
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
|
|
7255
7255
|
icon: icon,
|
|
7256
7256
|
type: type,
|
|
@@ -7369,12 +7369,12 @@ const Style$R = styled__default["default"].div`
|
|
|
7369
7369
|
}
|
|
7370
7370
|
`;
|
|
7371
7371
|
|
|
7372
|
-
const _excluded$
|
|
7372
|
+
const _excluded$A = ["children"];
|
|
7373
7373
|
const BorderedButton = _ref => {
|
|
7374
7374
|
let {
|
|
7375
7375
|
children
|
|
7376
7376
|
} = _ref,
|
|
7377
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7377
|
+
props = _objectWithoutProperties(_ref, _excluded$A);
|
|
7378
7378
|
return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
|
|
7379
7379
|
className: "d-btn-cont",
|
|
7380
7380
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -7514,12 +7514,12 @@ Badge.propTypes = {
|
|
|
7514
7514
|
props: PropTypes__default["default"].object
|
|
7515
7515
|
};
|
|
7516
7516
|
|
|
7517
|
-
const _excluded$
|
|
7517
|
+
const _excluded$z = ["icon"];
|
|
7518
7518
|
function GetIcon(_ref) {
|
|
7519
7519
|
let {
|
|
7520
7520
|
icon
|
|
7521
7521
|
} = _ref,
|
|
7522
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7522
|
+
props = _objectWithoutProperties(_ref, _excluded$z);
|
|
7523
7523
|
let Icon = Icons__namespace.CloseOutlined;
|
|
7524
7524
|
if (Icons__namespace[icon]) {
|
|
7525
7525
|
Icon = Icons__namespace[icon];
|
|
@@ -7849,7 +7849,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
|
|
|
7849
7849
|
}
|
|
7850
7850
|
`;
|
|
7851
7851
|
|
|
7852
|
-
const _excluded$
|
|
7852
|
+
const _excluded$y = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
|
|
7853
7853
|
const {
|
|
7854
7854
|
useToken: useToken$n
|
|
7855
7855
|
} = antd.theme;
|
|
@@ -7942,7 +7942,7 @@ function Multiselect(_ref) {
|
|
|
7942
7942
|
isSingle = false,
|
|
7943
7943
|
selectionType = SELECTION_TYPES.DEFAULT
|
|
7944
7944
|
} = _ref,
|
|
7945
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
7945
|
+
restProps = _objectWithoutProperties(_ref, _excluded$y);
|
|
7946
7946
|
const {
|
|
7947
7947
|
token
|
|
7948
7948
|
} = useToken$n();
|
|
@@ -8664,7 +8664,7 @@ DAFHeader.propTypes = {
|
|
|
8664
8664
|
filtersConfig: PropTypes__default["default"].any
|
|
8665
8665
|
};
|
|
8666
8666
|
|
|
8667
|
-
const _excluded$
|
|
8667
|
+
const _excluded$x = ["tabs", "onChange", "value", "className"];
|
|
8668
8668
|
function TabsHeader(_ref) {
|
|
8669
8669
|
let {
|
|
8670
8670
|
tabs = [],
|
|
@@ -8672,7 +8672,7 @@ function TabsHeader(_ref) {
|
|
|
8672
8672
|
value = '',
|
|
8673
8673
|
className = 'mt-2'
|
|
8674
8674
|
} = _ref,
|
|
8675
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
8675
|
+
rest = _objectWithoutProperties(_ref, _excluded$x);
|
|
8676
8676
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8677
8677
|
className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
|
|
8678
8678
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
|
|
@@ -8769,7 +8769,7 @@ DrawerHeader.propTypes = {
|
|
|
8769
8769
|
tabsConfig: PropTypes__default["default"].any
|
|
8770
8770
|
};
|
|
8771
8771
|
|
|
8772
|
-
const _excluded$
|
|
8772
|
+
const _excluded$w = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
|
|
8773
8773
|
const useFooter = _ref => {
|
|
8774
8774
|
let {
|
|
8775
8775
|
leftContent,
|
|
@@ -8804,7 +8804,7 @@ const useFooter = _ref => {
|
|
|
8804
8804
|
style = {},
|
|
8805
8805
|
className = ""
|
|
8806
8806
|
} = button,
|
|
8807
|
-
restProps = _objectWithoutProperties(button, _excluded$
|
|
8807
|
+
restProps = _objectWithoutProperties(button, _excluded$w);
|
|
8808
8808
|
return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
|
|
8809
8809
|
content: label,
|
|
8810
8810
|
type: type,
|
|
@@ -9615,27 +9615,25 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
|
|
|
9615
9615
|
}
|
|
9616
9616
|
};
|
|
9617
9617
|
|
|
9618
|
-
const renderValue =
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9628
|
-
|
|
9629
|
-
|
|
9630
|
-
if (!(config !== null && config !== void 0 && config.inputs)) return null;
|
|
9618
|
+
const renderValue = ({
|
|
9619
|
+
value,
|
|
9620
|
+
hasChildren,
|
|
9621
|
+
config,
|
|
9622
|
+
user,
|
|
9623
|
+
getApiBaseUrl = () => {},
|
|
9624
|
+
getAppHeader = () => {},
|
|
9625
|
+
app,
|
|
9626
|
+
allData = {}
|
|
9627
|
+
}) => {
|
|
9628
|
+
if (config?.type === 'groupInputs') {
|
|
9629
|
+
if (!config?.inputs) return null;
|
|
9631
9630
|
const inputKeys = Object.keys(config.inputs).sort((a, b) => {
|
|
9632
|
-
|
|
9633
|
-
const
|
|
9634
|
-
const positionB = ((_config$inputs$b = config.inputs[b]) === null || _config$inputs$b === void 0 ? void 0 : _config$inputs$b.position) || 0;
|
|
9631
|
+
const positionA = config.inputs[a]?.position || 0;
|
|
9632
|
+
const positionB = config.inputs[b]?.position || 0;
|
|
9635
9633
|
return positionA - positionB;
|
|
9636
9634
|
});
|
|
9637
9635
|
const values = inputKeys.map(inputKey => {
|
|
9638
|
-
let inputValue = value
|
|
9636
|
+
let inputValue = value?.[inputKey];
|
|
9639
9637
|
if (inputValue === null || inputValue === undefined || inputValue === '') {
|
|
9640
9638
|
return '';
|
|
9641
9639
|
} else if (typeof inputValue === 'object' && inputValue !== null) {
|
|
@@ -9676,8 +9674,8 @@ const renderValue = _ref => {
|
|
|
9676
9674
|
} else {
|
|
9677
9675
|
displayValue = String(value);
|
|
9678
9676
|
}
|
|
9679
|
-
const fieldType =
|
|
9680
|
-
let cssClass =
|
|
9677
|
+
const fieldType = config?.type || 'text';
|
|
9678
|
+
let cssClass = `tree-value ${fieldType}-type`;
|
|
9681
9679
|
if (displayValue === '-') {
|
|
9682
9680
|
cssClass += ' empty';
|
|
9683
9681
|
}
|
|
@@ -9687,21 +9685,19 @@ const renderValue = _ref => {
|
|
|
9687
9685
|
children: displayValue
|
|
9688
9686
|
});
|
|
9689
9687
|
};
|
|
9690
|
-
const determineHasChildren =
|
|
9691
|
-
|
|
9692
|
-
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
} = _ref2;
|
|
9696
|
-
if ((config === null || config === void 0 ? void 0 : config.type) === 'groupInputs') {
|
|
9688
|
+
const determineHasChildren = ({
|
|
9689
|
+
config,
|
|
9690
|
+
level
|
|
9691
|
+
}) => {
|
|
9692
|
+
if (config?.type === 'groupInputs') {
|
|
9697
9693
|
return false;
|
|
9698
9694
|
}
|
|
9699
|
-
if (
|
|
9695
|
+
if (config?.type === 'header' && config?.inputs && Object.keys(config.inputs).length > 0) {
|
|
9700
9696
|
return true;
|
|
9701
9697
|
}
|
|
9702
|
-
return
|
|
9698
|
+
return config?.inputs || config?.type === 'group' || config?.type === 'dataLinkGroup' || config?.type === 'section' || config?.type === 'ajaxSubGroup' ||
|
|
9703
9699
|
// Add this line
|
|
9704
|
-
|
|
9700
|
+
config?.type === 'dataLink' && 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);
|
|
9705
9701
|
};
|
|
9706
9702
|
|
|
9707
9703
|
const sortByPosition = (items, getConfig) => {
|
|
@@ -11689,7 +11685,7 @@ Widget.propTypes = {
|
|
|
11689
11685
|
};
|
|
11690
11686
|
Widget.displayName = 'Widget';
|
|
11691
11687
|
|
|
11692
|
-
const _excluded$
|
|
11688
|
+
const _excluded$v = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
|
|
11693
11689
|
function ImageWidget(_ref) {
|
|
11694
11690
|
let {
|
|
11695
11691
|
loading = false,
|
|
@@ -11700,7 +11696,7 @@ function ImageWidget(_ref) {
|
|
|
11700
11696
|
noDescriptionText,
|
|
11701
11697
|
isPdf = false
|
|
11702
11698
|
} = _ref,
|
|
11703
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
11699
|
+
props = _objectWithoutProperties(_ref, _excluded$v);
|
|
11704
11700
|
const expandable = isPdf ? false : props.expandable;
|
|
11705
11701
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
11706
11702
|
loading: loading,
|
|
@@ -11760,7 +11756,7 @@ function ImageWidget(_ref) {
|
|
|
11760
11756
|
ImageWidget.displayName = 'ImageWidget';
|
|
11761
11757
|
|
|
11762
11758
|
var _templateObject$d;
|
|
11763
|
-
const _excluded$
|
|
11759
|
+
const _excluded$u = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
|
|
11764
11760
|
function FlowWidget(_ref) {
|
|
11765
11761
|
let {
|
|
11766
11762
|
title,
|
|
@@ -11772,7 +11768,7 @@ function FlowWidget(_ref) {
|
|
|
11772
11768
|
className,
|
|
11773
11769
|
direction = "horizontal"
|
|
11774
11770
|
} = _ref,
|
|
11775
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11771
|
+
rest = _objectWithoutProperties(_ref, _excluded$u);
|
|
11776
11772
|
const [activeTab, setActiveTab] = React.useState();
|
|
11777
11773
|
React.useEffect(() => {
|
|
11778
11774
|
if (defaultActiveTab) {
|
|
@@ -15488,7 +15484,7 @@ Map$3.propTypes = {
|
|
|
15488
15484
|
link: PropTypes__default["default"].any
|
|
15489
15485
|
};
|
|
15490
15486
|
|
|
15491
|
-
const _excluded$
|
|
15487
|
+
const _excluded$t = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
|
|
15492
15488
|
function InExpandableWidgetMap(_ref) {
|
|
15493
15489
|
let {
|
|
15494
15490
|
isExpanded,
|
|
@@ -15502,7 +15498,7 @@ function InExpandableWidgetMap(_ref) {
|
|
|
15502
15498
|
height,
|
|
15503
15499
|
widgetConfig
|
|
15504
15500
|
} = _ref,
|
|
15505
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
15501
|
+
rest = _objectWithoutProperties(_ref, _excluded$t);
|
|
15506
15502
|
const [mapKey, setMapKey] = React.useState(0);
|
|
15507
15503
|
const [isMapReady, setIsMapReady] = React.useState(false);
|
|
15508
15504
|
React.useEffect(() => {
|
|
@@ -17702,14 +17698,14 @@ const MapConfig = ({
|
|
|
17702
17698
|
});
|
|
17703
17699
|
};
|
|
17704
17700
|
|
|
17705
|
-
const _excluded$
|
|
17701
|
+
const _excluded$s = ["config", "title", "loading"];
|
|
17706
17702
|
const Details = _ref => {
|
|
17707
17703
|
let {
|
|
17708
17704
|
config = [],
|
|
17709
17705
|
title,
|
|
17710
17706
|
loading = false
|
|
17711
17707
|
} = _ref,
|
|
17712
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17708
|
+
rest = _objectWithoutProperties(_ref, _excluded$s);
|
|
17713
17709
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17714
17710
|
className: "with-border-header h-w-btn-header card",
|
|
17715
17711
|
loading: loading,
|
|
@@ -17725,14 +17721,14 @@ const Details = _ref => {
|
|
|
17725
17721
|
}));
|
|
17726
17722
|
};
|
|
17727
17723
|
|
|
17728
|
-
const _excluded$
|
|
17724
|
+
const _excluded$r = ["config", "title", "loading"];
|
|
17729
17725
|
const KeyIndicatorsDetails = _ref => {
|
|
17730
17726
|
let {
|
|
17731
17727
|
config,
|
|
17732
17728
|
title,
|
|
17733
17729
|
loading = false
|
|
17734
17730
|
} = _ref,
|
|
17735
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17731
|
+
rest = _objectWithoutProperties(_ref, _excluded$r);
|
|
17736
17732
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17737
17733
|
className: "with-border-header h-w-btn-header",
|
|
17738
17734
|
title: title,
|
|
@@ -17762,7 +17758,7 @@ const Style$G = styled__default["default"].div`
|
|
|
17762
17758
|
}
|
|
17763
17759
|
`;
|
|
17764
17760
|
|
|
17765
|
-
const _excluded$
|
|
17761
|
+
const _excluded$q = ["children", "config", "detailsTitle", "firstColumnWidth"];
|
|
17766
17762
|
const DetailsSection = _ref => {
|
|
17767
17763
|
let {
|
|
17768
17764
|
children,
|
|
@@ -17770,7 +17766,7 @@ const DetailsSection = _ref => {
|
|
|
17770
17766
|
detailsTitle,
|
|
17771
17767
|
firstColumnWidth = "250px"
|
|
17772
17768
|
} = _ref,
|
|
17773
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17769
|
+
rest = _objectWithoutProperties(_ref, _excluded$q);
|
|
17774
17770
|
return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
|
|
17775
17771
|
firstColumnWidth: firstColumnWidth,
|
|
17776
17772
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -17946,14 +17942,14 @@ const getGoalConfig = () => {
|
|
|
17946
17942
|
};
|
|
17947
17943
|
|
|
17948
17944
|
var _templateObject$b;
|
|
17949
|
-
const _excluded$
|
|
17945
|
+
const _excluded$p = ["title", "activeSdgGoals", "t"];
|
|
17950
17946
|
function SDGWidget(_ref) {
|
|
17951
17947
|
let {
|
|
17952
17948
|
title = "Sustainable Development Goals",
|
|
17953
17949
|
activeSdgGoals = [],
|
|
17954
17950
|
t = key => key
|
|
17955
17951
|
} = _ref,
|
|
17956
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
17952
|
+
props = _objectWithoutProperties(_ref, _excluded$p);
|
|
17957
17953
|
const sdgConfig = getGoalConfig();
|
|
17958
17954
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17959
17955
|
title: title,
|
|
@@ -18251,7 +18247,7 @@ function SdgList({
|
|
|
18251
18247
|
});
|
|
18252
18248
|
}
|
|
18253
18249
|
|
|
18254
|
-
const _excluded$
|
|
18250
|
+
const _excluded$o = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
|
|
18255
18251
|
const {
|
|
18256
18252
|
Meta
|
|
18257
18253
|
} = antd.Card;
|
|
@@ -18271,7 +18267,7 @@ function ProjectWidget(_ref) {
|
|
|
18271
18267
|
hideSDGList = false,
|
|
18272
18268
|
t = x => x
|
|
18273
18269
|
} = _ref,
|
|
18274
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18270
|
+
props = _objectWithoutProperties(_ref, _excluded$o);
|
|
18275
18271
|
const [isHovered, setIsHovered] = React__default["default"].useState(false);
|
|
18276
18272
|
const {
|
|
18277
18273
|
token
|
|
@@ -18543,13 +18539,13 @@ const WidgetCard = _ref => {
|
|
|
18543
18539
|
});
|
|
18544
18540
|
};
|
|
18545
18541
|
|
|
18546
|
-
const _excluded$
|
|
18542
|
+
const _excluded$n = ["title", "children"];
|
|
18547
18543
|
const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
18548
18544
|
let {
|
|
18549
18545
|
title,
|
|
18550
18546
|
children
|
|
18551
18547
|
} = _ref,
|
|
18552
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18548
|
+
rest = _objectWithoutProperties(_ref, _excluded$n);
|
|
18553
18549
|
/**
|
|
18554
18550
|
* Handles carousel slide change events
|
|
18555
18551
|
* @param {number} currentSlide - The index of the current slide after change
|
|
@@ -18713,7 +18709,7 @@ const EmptyStateContainer = styled__default["default"].div`
|
|
|
18713
18709
|
}
|
|
18714
18710
|
`;
|
|
18715
18711
|
|
|
18716
|
-
const _excluded$
|
|
18712
|
+
const _excluded$m = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
|
|
18717
18713
|
function ImageCarousel(_ref) {
|
|
18718
18714
|
let {
|
|
18719
18715
|
title,
|
|
@@ -18728,7 +18724,7 @@ function ImageCarousel(_ref) {
|
|
|
18728
18724
|
emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
|
|
18729
18725
|
emptyText = "No Image"
|
|
18730
18726
|
} = _ref,
|
|
18731
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18727
|
+
rest = _objectWithoutProperties(_ref, _excluded$m);
|
|
18732
18728
|
const [previewVisible, setPreviewVisible] = React.useState(false);
|
|
18733
18729
|
const [current, setCurrent] = React.useState(0);
|
|
18734
18730
|
const carouselRef = React.useRef(null);
|
|
@@ -19097,7 +19093,7 @@ const getVegetationConfig = () => {
|
|
|
19097
19093
|
};
|
|
19098
19094
|
|
|
19099
19095
|
var _templateObject$9, _templateObject2$1;
|
|
19100
|
-
const _excluded$
|
|
19096
|
+
const _excluded$l = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
|
|
19101
19097
|
function VegetationWidget(_ref) {
|
|
19102
19098
|
let {
|
|
19103
19099
|
title = "Vegetation Health",
|
|
@@ -19109,7 +19105,7 @@ function VegetationWidget(_ref) {
|
|
|
19109
19105
|
growthObservations = [],
|
|
19110
19106
|
t = key => key
|
|
19111
19107
|
} = _ref,
|
|
19112
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19108
|
+
props = _objectWithoutProperties(_ref, _excluded$l);
|
|
19113
19109
|
let vegetationConfig = getVegetationConfig();
|
|
19114
19110
|
|
|
19115
19111
|
// Get all VEGETATION_KEYS values before filtering (needed for mapping check)
|
|
@@ -24445,8 +24441,8 @@ const RepeatableModals = ({
|
|
|
24445
24441
|
}) : null;
|
|
24446
24442
|
};
|
|
24447
24443
|
|
|
24448
|
-
const _excluded$
|
|
24449
|
-
_excluded2$
|
|
24444
|
+
const _excluded$k = ["viewGroup"],
|
|
24445
|
+
_excluded2$2 = ["label", "icon", "position"];
|
|
24450
24446
|
const Content$1 = _ref => {
|
|
24451
24447
|
let {
|
|
24452
24448
|
style = {},
|
|
@@ -24514,7 +24510,7 @@ const Content$1 = _ref => {
|
|
|
24514
24510
|
if (groups[gKey].viewGroup === key) {
|
|
24515
24511
|
// eslint-disable-next-line no-unused-vars
|
|
24516
24512
|
const _groups$gKey = groups[gKey],
|
|
24517
|
-
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$
|
|
24513
|
+
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$k);
|
|
24518
24514
|
items[gKey] = gCfg;
|
|
24519
24515
|
}
|
|
24520
24516
|
return items;
|
|
@@ -24736,7 +24732,7 @@ const Content$1 = _ref => {
|
|
|
24736
24732
|
showIcon: true
|
|
24737
24733
|
});
|
|
24738
24734
|
}
|
|
24739
|
-
let groups = _objectWithoutProperties(f, _excluded2$
|
|
24735
|
+
let groups = _objectWithoutProperties(f, _excluded2$2);
|
|
24740
24736
|
groups = Object.keys(groups).reduce((items, key) => {
|
|
24741
24737
|
var _groups$key2;
|
|
24742
24738
|
if (!((_groups$key2 = groups[key]) !== null && _groups$key2 !== void 0 && (_groups$key2 = _groups$key2.meta) !== null && _groups$key2 !== void 0 && _groups$key2.excludeFromView)) {
|
|
@@ -24772,7 +24768,7 @@ const Content$1 = _ref => {
|
|
|
24772
24768
|
});
|
|
24773
24769
|
};
|
|
24774
24770
|
|
|
24775
|
-
const _excluded$
|
|
24771
|
+
const _excluded$j = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
|
|
24776
24772
|
function Modal(_ref) {
|
|
24777
24773
|
let {
|
|
24778
24774
|
t = text => text,
|
|
@@ -24788,7 +24784,7 @@ function Modal(_ref) {
|
|
|
24788
24784
|
disabled = false,
|
|
24789
24785
|
withModalFormWrapper = true
|
|
24790
24786
|
} = _ref,
|
|
24791
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
24787
|
+
props = _objectWithoutProperties(_ref, _excluded$j);
|
|
24792
24788
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
|
|
24793
24789
|
width: 650,
|
|
24794
24790
|
footer: null,
|
|
@@ -35341,8 +35337,8 @@ const beforeUpload = allowedExtensions => file => {
|
|
|
35341
35337
|
};
|
|
35342
35338
|
const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
|
|
35343
35339
|
|
|
35344
|
-
const _excluded$
|
|
35345
|
-
_excluded2 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
|
|
35340
|
+
const _excluded$i = ["placeholder"],
|
|
35341
|
+
_excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
|
|
35346
35342
|
dayjs__default["default"].extend(utc);
|
|
35347
35343
|
dayjs__default["default"].extend(timezone);
|
|
35348
35344
|
dayjs__default["default"].tz.setDefault("UTC");
|
|
@@ -36290,7 +36286,7 @@ const inputTypeComponent$1 = {
|
|
|
36290
36286
|
},
|
|
36291
36287
|
commentHint
|
|
36292
36288
|
} = _ref19,
|
|
36293
|
-
props = _objectWithoutProperties(_ref19.props, _excluded$
|
|
36289
|
+
props = _objectWithoutProperties(_ref19.props, _excluded$i);
|
|
36294
36290
|
let {
|
|
36295
36291
|
onChange,
|
|
36296
36292
|
value,
|
|
@@ -37657,7 +37653,7 @@ const mapFormGroup = (f, d) => Object.keys(f).map(key => {
|
|
|
37657
37653
|
template,
|
|
37658
37654
|
formClass
|
|
37659
37655
|
} = _ref72,
|
|
37660
|
-
fc = _objectWithoutProperties(_ref72, _excluded2);
|
|
37656
|
+
fc = _objectWithoutProperties(_ref72, _excluded2$1);
|
|
37661
37657
|
const fConf = {
|
|
37662
37658
|
id: key,
|
|
37663
37659
|
label,
|
|
@@ -38972,7 +38968,7 @@ function AjaxSelect(props) {
|
|
|
38972
38968
|
}, props));
|
|
38973
38969
|
}
|
|
38974
38970
|
|
|
38975
|
-
const _excluded$
|
|
38971
|
+
const _excluded$h = ["placeholder"];
|
|
38976
38972
|
const propHasValue = val => {
|
|
38977
38973
|
if (Array.isArray(val)) {
|
|
38978
38974
|
return val.length > 0 ? true : false;
|
|
@@ -39727,7 +39723,7 @@ const inputTypeComponent = {
|
|
|
39727
39723
|
},
|
|
39728
39724
|
commentHint
|
|
39729
39725
|
} = _ref15,
|
|
39730
|
-
props = _objectWithoutProperties(_ref15.props, _excluded$
|
|
39726
|
+
props = _objectWithoutProperties(_ref15.props, _excluded$h);
|
|
39731
39727
|
let {
|
|
39732
39728
|
onChange,
|
|
39733
39729
|
value
|
|
@@ -41365,7 +41361,7 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
|
|
|
41365
41361
|
});
|
|
41366
41362
|
};
|
|
41367
41363
|
|
|
41368
|
-
const _excluded$
|
|
41364
|
+
const _excluded$g = ["icon"];
|
|
41369
41365
|
function DynamicForm(_ref) {
|
|
41370
41366
|
var _data$meta;
|
|
41371
41367
|
let {
|
|
@@ -41980,7 +41976,7 @@ function DynamicForm(_ref) {
|
|
|
41980
41976
|
let {
|
|
41981
41977
|
icon: Icon
|
|
41982
41978
|
} = _ref3,
|
|
41983
|
-
form = _objectWithoutProperties(_ref3, _excluded$
|
|
41979
|
+
form = _objectWithoutProperties(_ref3, _excluded$g);
|
|
41984
41980
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
41985
41981
|
type: "link",
|
|
41986
41982
|
size: "large",
|
|
@@ -42198,7 +42194,7 @@ const Navigation = _ref => {
|
|
|
42198
42194
|
var _templateObject$7;
|
|
42199
42195
|
const StyledSelect = styled__default["default"](antd.Select)(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n width: 100%;\n \n .ant-select-arrow {\n margin-top: 1px !important;\n }\n"])));
|
|
42200
42196
|
|
|
42201
|
-
const _excluded$
|
|
42197
|
+
const _excluded$f = ["onChange", "value"];
|
|
42202
42198
|
function AuthForm(_ref) {
|
|
42203
42199
|
var _steps$currentStep;
|
|
42204
42200
|
let {
|
|
@@ -42331,7 +42327,7 @@ function AuthForm(_ref) {
|
|
|
42331
42327
|
{
|
|
42332
42328
|
var _field$options;
|
|
42333
42329
|
const _ref3 = field.props || {},
|
|
42334
|
-
restSelectProps = _objectWithoutProperties(_ref3, _excluded$
|
|
42330
|
+
restSelectProps = _objectWithoutProperties(_ref3, _excluded$f);
|
|
42335
42331
|
inputNode = /*#__PURE__*/jsxRuntime.jsx(StyledSelect, _objectSpread2(_objectSpread2({
|
|
42336
42332
|
placeholder: field.placeholder,
|
|
42337
42333
|
disabled: field.disabled
|
|
@@ -42497,7 +42493,7 @@ function MultiBarProgress(_ref) {
|
|
|
42497
42493
|
}
|
|
42498
42494
|
const Style$x = styled__default["default"].div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n\theight: 6px;\n\twidth: 100%;\n\tbackground: var(--base-gray-40);\n\tborder-radius: 8px;\n\tdisplay: flex;\n\toverflow: hidden;\n\tdiv {\n\t\theight: 100%;\n\t}\n"])));
|
|
42499
42495
|
|
|
42500
|
-
const _excluded$
|
|
42496
|
+
const _excluded$e = ["tooltipTitle", "percentage", "strokeColor", "showInfo"];
|
|
42501
42497
|
function MultiColorProgressBar(_ref) {
|
|
42502
42498
|
let {
|
|
42503
42499
|
tooltipTitle,
|
|
@@ -42509,7 +42505,7 @@ function MultiColorProgressBar(_ref) {
|
|
|
42509
42505
|
},
|
|
42510
42506
|
showInfo = false
|
|
42511
42507
|
} = _ref,
|
|
42512
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
42508
|
+
rest = _objectWithoutProperties(_ref, _excluded$e);
|
|
42513
42509
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
42514
42510
|
title: tooltipTitle,
|
|
42515
42511
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Progress, _objectSpread2({
|
|
@@ -42584,7 +42580,7 @@ function ProgressBarWithIcon(_ref) {
|
|
|
42584
42580
|
});
|
|
42585
42581
|
}
|
|
42586
42582
|
|
|
42587
|
-
const _excluded$
|
|
42583
|
+
const _excluded$d = ["value", "options", "onChange", "className", "width"];
|
|
42588
42584
|
const ProgressTabs = _ref => {
|
|
42589
42585
|
let {
|
|
42590
42586
|
value = 'setup',
|
|
@@ -42605,7 +42601,7 @@ const ProgressTabs = _ref => {
|
|
|
42605
42601
|
className = '',
|
|
42606
42602
|
width = '100%'
|
|
42607
42603
|
} = _ref,
|
|
42608
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
42604
|
+
rest = _objectWithoutProperties(_ref, _excluded$d);
|
|
42609
42605
|
// Transform options to include icons and handle disabled state
|
|
42610
42606
|
const transformedOptions = options.map(option => _objectSpread2(_objectSpread2({}, option), {}, {
|
|
42611
42607
|
label: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -44458,11 +44454,11 @@ function DataStore(_ref) {
|
|
|
44458
44454
|
});
|
|
44459
44455
|
}
|
|
44460
44456
|
|
|
44461
|
-
const filtersConfig$
|
|
44457
|
+
const filtersConfig$c = {
|
|
44462
44458
|
datastakeId: '',
|
|
44463
44459
|
name: ''
|
|
44464
44460
|
};
|
|
44465
|
-
const selectFiltersConfig$
|
|
44461
|
+
const selectFiltersConfig$c = {
|
|
44466
44462
|
country: {
|
|
44467
44463
|
type: 'select',
|
|
44468
44464
|
label: 'Country',
|
|
@@ -44503,7 +44499,7 @@ const selectFiltersConfig$b = {
|
|
|
44503
44499
|
getValue: option => option.value
|
|
44504
44500
|
}
|
|
44505
44501
|
};
|
|
44506
|
-
const checkboxConfig$
|
|
44502
|
+
const checkboxConfig$c = {
|
|
44507
44503
|
datastakeId: 'ID',
|
|
44508
44504
|
name: 'Name'
|
|
44509
44505
|
};
|
|
@@ -44820,15 +44816,14 @@ const getDefaultActiveFilters = (params, selectFiltersConfig, defaultPageSize, d
|
|
|
44820
44816
|
});
|
|
44821
44817
|
return o;
|
|
44822
44818
|
};
|
|
44823
|
-
const NEW_PAGINATION_APPS = ["nashiriki"];
|
|
44824
44819
|
const filterParams = (value, module) => {
|
|
44825
44820
|
const {
|
|
44826
44821
|
activeFilters,
|
|
44827
44822
|
...rest
|
|
44828
44823
|
} = value;
|
|
44829
44824
|
const {
|
|
44830
|
-
page,
|
|
44831
|
-
pageSize,
|
|
44825
|
+
page = 1,
|
|
44826
|
+
pageSize = 20,
|
|
44832
44827
|
sortDir,
|
|
44833
44828
|
sortBy,
|
|
44834
44829
|
search,
|
|
@@ -44837,9 +44832,10 @@ const filterParams = (value, module) => {
|
|
|
44837
44832
|
} = activeFilters || {};
|
|
44838
44833
|
const params = {};
|
|
44839
44834
|
params.pagination = JSON.stringify({
|
|
44840
|
-
|
|
44841
|
-
|
|
44835
|
+
page,
|
|
44836
|
+
pageSize
|
|
44842
44837
|
});
|
|
44838
|
+
params.filters = JSON.stringify(filters);
|
|
44843
44839
|
if (search && searchParams) {
|
|
44844
44840
|
params.search = JSON.stringify({
|
|
44845
44841
|
qs: search,
|
|
@@ -44852,16 +44848,6 @@ const filterParams = (value, module) => {
|
|
|
44852
44848
|
by: sortBy
|
|
44853
44849
|
});
|
|
44854
44850
|
}
|
|
44855
|
-
if (Object.keys(filters).length) {
|
|
44856
|
-
if (value.sourceId && value.sourceId === "overview") {
|
|
44857
|
-
params.filters = JSON.stringify(filters);
|
|
44858
|
-
} else {
|
|
44859
|
-
params.filters = JSON.stringify({
|
|
44860
|
-
...filters,
|
|
44861
|
-
authorId: undefined
|
|
44862
|
-
});
|
|
44863
|
-
}
|
|
44864
|
-
}
|
|
44865
44851
|
return {
|
|
44866
44852
|
...rest,
|
|
44867
44853
|
...params
|
|
@@ -45157,7 +45143,7 @@ const renderRows = ({
|
|
|
45157
45143
|
});
|
|
45158
45144
|
};
|
|
45159
45145
|
|
|
45160
|
-
const _excluded$
|
|
45146
|
+
const _excluded$c = ["page", "pageSize"];
|
|
45161
45147
|
function DataStoreTable$1(_ref) {
|
|
45162
45148
|
let {
|
|
45163
45149
|
mod,
|
|
@@ -45239,12 +45225,12 @@ function DataStoreTable$1(_ref) {
|
|
|
45239
45225
|
goNext,
|
|
45240
45226
|
setPagination
|
|
45241
45227
|
} = useFilters({
|
|
45242
|
-
selectFiltersConfig: selectFiltersConfig$
|
|
45228
|
+
selectFiltersConfig: selectFiltersConfig$c,
|
|
45243
45229
|
view,
|
|
45244
45230
|
goTo,
|
|
45245
45231
|
location,
|
|
45246
45232
|
module: mod,
|
|
45247
|
-
filtersConfig: filtersConfig$
|
|
45233
|
+
filtersConfig: filtersConfig$c,
|
|
45248
45234
|
getRedirectLink,
|
|
45249
45235
|
defaultPageSize
|
|
45250
45236
|
});
|
|
@@ -45255,7 +45241,7 @@ function DataStoreTable$1(_ref) {
|
|
|
45255
45241
|
page,
|
|
45256
45242
|
pageSize
|
|
45257
45243
|
} = activeFilters,
|
|
45258
|
-
rest = _objectWithoutProperties(activeFilters, _excluded$
|
|
45244
|
+
rest = _objectWithoutProperties(activeFilters, _excluded$c);
|
|
45259
45245
|
const params = _objectSpread2({
|
|
45260
45246
|
pagination: {
|
|
45261
45247
|
page,
|
|
@@ -45317,7 +45303,7 @@ function DataStoreTable$1(_ref) {
|
|
|
45317
45303
|
hasError: hasError,
|
|
45318
45304
|
setHasError: setHasError,
|
|
45319
45305
|
filtersConfig: newFiltersConfig,
|
|
45320
|
-
checkboxConfig: checkboxConfig$
|
|
45306
|
+
checkboxConfig: checkboxConfig$c,
|
|
45321
45307
|
onSearch: onSearch,
|
|
45322
45308
|
activeFilters: activeFilters,
|
|
45323
45309
|
canClear: canClearSearch,
|
|
@@ -45333,7 +45319,7 @@ function DataStoreTable$1(_ref) {
|
|
|
45333
45319
|
rowKey: "key",
|
|
45334
45320
|
doEmptyRows: true,
|
|
45335
45321
|
selectOptions,
|
|
45336
|
-
filtersConfig: selectFiltersConfig$
|
|
45322
|
+
filtersConfig: selectFiltersConfig$c,
|
|
45337
45323
|
onFilterChange: onFiltersChange,
|
|
45338
45324
|
showFilters,
|
|
45339
45325
|
defaultFilters,
|
|
@@ -45575,7 +45561,7 @@ const getLinkedColumns = ({
|
|
|
45575
45561
|
ellipsis: true
|
|
45576
45562
|
}];
|
|
45577
45563
|
|
|
45578
|
-
const _excluded$
|
|
45564
|
+
const _excluded$b = ["administrativeLevel1", "administrativeLevel2"];
|
|
45579
45565
|
function DataStoreView(_ref) {
|
|
45580
45566
|
let {
|
|
45581
45567
|
mod,
|
|
@@ -45638,7 +45624,7 @@ function DataStoreView(_ref) {
|
|
|
45638
45624
|
administrativeLevel1,
|
|
45639
45625
|
administrativeLevel2
|
|
45640
45626
|
} = _ref2,
|
|
45641
|
-
rest = _objectWithoutProperties(_ref2, _excluded$
|
|
45627
|
+
rest = _objectWithoutProperties(_ref2, _excluded$b);
|
|
45642
45628
|
const levels = [administrativeLevel1, administrativeLevel2].filter(p => !!p);
|
|
45643
45629
|
let levelsRes = {
|
|
45644
45630
|
data: []
|
|
@@ -47136,14 +47122,14 @@ const TabsStyled = styled__default["default"](antd.Tabs)`
|
|
|
47136
47122
|
|
|
47137
47123
|
`;
|
|
47138
47124
|
|
|
47139
|
-
const _excluded$
|
|
47125
|
+
const _excluded$a = ["defaultActiveKey", "items", "onChange"];
|
|
47140
47126
|
const StyledTabs = _ref => {
|
|
47141
47127
|
let {
|
|
47142
47128
|
defaultActiveKey,
|
|
47143
47129
|
items,
|
|
47144
47130
|
onChange
|
|
47145
47131
|
} = _ref,
|
|
47146
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
47132
|
+
rest = _objectWithoutProperties(_ref, _excluded$a);
|
|
47147
47133
|
return /*#__PURE__*/jsxRuntime.jsx(TabsStyled, _objectSpread2({
|
|
47148
47134
|
defaultActiveKey: defaultActiveKey,
|
|
47149
47135
|
items: items,
|
|
@@ -47214,7 +47200,7 @@ const Container$1 = styled__default["default"].div`
|
|
|
47214
47200
|
width: ${props => props.isPdf ? props.width ? props.width : '1000px' : 'calc(100% - 48px)'};
|
|
47215
47201
|
`;
|
|
47216
47202
|
|
|
47217
|
-
const _excluded$
|
|
47203
|
+
const _excluded$9 = ["data", "xFieldKey", "yFieldKey", "renderTooltipContent", "tooltipConfig", "animated", "isStack", "isGroup", "isPercentage", "seriesField", "formattedYAxis", "formattedXAxis", "color", "height", "t", "isPdf", "legendConfig", "width", "xAxisConfig"];
|
|
47218
47204
|
const {
|
|
47219
47205
|
useToken: useToken$g
|
|
47220
47206
|
} = antd.theme;
|
|
@@ -47304,7 +47290,7 @@ function BarChart(_ref) {
|
|
|
47304
47290
|
width,
|
|
47305
47291
|
xAxisConfig = {}
|
|
47306
47292
|
} = _ref;
|
|
47307
|
-
_objectWithoutProperties(_ref, _excluded$
|
|
47293
|
+
_objectWithoutProperties(_ref, _excluded$9);
|
|
47308
47294
|
const containerRef = React__default["default"].useRef(null);
|
|
47309
47295
|
const chartRef = React__default["default"].useRef(null);
|
|
47310
47296
|
const {
|
|
@@ -47388,7 +47374,7 @@ function BarChart(_ref) {
|
|
|
47388
47374
|
});
|
|
47389
47375
|
}
|
|
47390
47376
|
|
|
47391
|
-
const _excluded$
|
|
47377
|
+
const _excluded$8 = ["data", "xFieldKey", "yFieldKey", "renderTooltipContent", "tooltipConfig", "animated", "isSmooth", "seriesField", "isArea", "formattedYAxis", "formattedXAxis", "color", "isPercentage", "height", "autoHideXLabel", "t", "isPdf", "legendConfig", "width", "yAxis", "xAxis"];
|
|
47392
47378
|
const {
|
|
47393
47379
|
useToken: useToken$f
|
|
47394
47380
|
} = antd.theme;
|
|
@@ -47477,7 +47463,7 @@ function LineChart(_ref) {
|
|
|
47477
47463
|
yAxis: customYAxis,
|
|
47478
47464
|
xAxis: customXAxis
|
|
47479
47465
|
} = _ref;
|
|
47480
|
-
_objectWithoutProperties(_ref, _excluded$
|
|
47466
|
+
_objectWithoutProperties(_ref, _excluded$8);
|
|
47481
47467
|
const containerRef = React__default["default"].useRef(null);
|
|
47482
47468
|
const chartRef = React__default["default"].useRef(null);
|
|
47483
47469
|
const {
|
|
@@ -47579,7 +47565,7 @@ function LineChart(_ref) {
|
|
|
47579
47565
|
});
|
|
47580
47566
|
}
|
|
47581
47567
|
|
|
47582
|
-
const _excluded$
|
|
47568
|
+
const _excluded$7 = ["data", "xFieldKey", "yFieldKey", "renderTooltipContent", "tooltipConfig", "animated", "isStack", "isGroup", "seriesField", "isPercentage", "showBackground", "formattedYAxis", "formattedXAxis", "color", "height", "groupField", "width", "legendConfig", "isPdf", "yAxis", "xAxis"];
|
|
47583
47569
|
const {
|
|
47584
47570
|
useToken: useToken$e
|
|
47585
47571
|
} = antd.theme;
|
|
@@ -47684,7 +47670,7 @@ function ColumnChart(_ref) {
|
|
|
47684
47670
|
yAxis: customYAxis,
|
|
47685
47671
|
xAxis: customXAxis
|
|
47686
47672
|
} = _ref;
|
|
47687
|
-
_objectWithoutProperties(_ref, _excluded$
|
|
47673
|
+
_objectWithoutProperties(_ref, _excluded$7);
|
|
47688
47674
|
const containerRef = React__default["default"].useRef(null);
|
|
47689
47675
|
const chartRef = React__default["default"].useRef(null);
|
|
47690
47676
|
const {
|
|
@@ -47952,7 +47938,7 @@ function RadialBarChart(_ref) {
|
|
|
47952
47938
|
});
|
|
47953
47939
|
}
|
|
47954
47940
|
|
|
47955
|
-
const _excluded$
|
|
47941
|
+
const _excluded$6 = ["data", "angleField", "colorField", "color", "height", "innerRadius", "radius", "legend", "label", "statistic", "tooltip", "renderTooltipContent", "tooltipConfig", "meta", "animation", "t", "isPdf", "legendConfig"];
|
|
47956
47942
|
const {
|
|
47957
47943
|
useToken: useToken$c
|
|
47958
47944
|
} = antd.theme;
|
|
@@ -48027,7 +48013,7 @@ function DonutPie(_ref) {
|
|
|
48027
48013
|
isPdf = false,
|
|
48028
48014
|
legendConfig = {}
|
|
48029
48015
|
} = _ref,
|
|
48030
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
48016
|
+
rest = _objectWithoutProperties(_ref, _excluded$6);
|
|
48031
48017
|
const containerRef = React.useRef(null);
|
|
48032
48018
|
const chartRef = React.useRef(null);
|
|
48033
48019
|
const {
|
|
@@ -48547,7 +48533,7 @@ function StackChart(_ref) {
|
|
|
48547
48533
|
});
|
|
48548
48534
|
}
|
|
48549
48535
|
|
|
48550
|
-
const _excluded$
|
|
48536
|
+
const _excluded$5 = ["data", "xFieldKey", "yFieldKey", "seriesField", "renderTooltipContent", "tooltipConfig", "animated", "color", "formattedYAxis", "formattedXAxis", "fillOpacity", "height", "t", "isPdf", "legendConfig", "width"];
|
|
48551
48537
|
const {
|
|
48552
48538
|
useToken: useToken$a
|
|
48553
48539
|
} = antd.theme;
|
|
@@ -48624,7 +48610,7 @@ const AreaChart = _ref => {
|
|
|
48624
48610
|
legendConfig = {},
|
|
48625
48611
|
width
|
|
48626
48612
|
} = _ref,
|
|
48627
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
48613
|
+
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
48628
48614
|
const containerRef = React.useRef(null);
|
|
48629
48615
|
const chartRef = React.useRef(null);
|
|
48630
48616
|
const {
|
|
@@ -48712,7 +48698,7 @@ const AreaChart = _ref => {
|
|
|
48712
48698
|
});
|
|
48713
48699
|
};
|
|
48714
48700
|
|
|
48715
|
-
const _excluded$
|
|
48701
|
+
const _excluded$4 = ["data", "xFieldKey", "yFieldKey", "seriesField", "renderTooltipContent", "tooltipConfig", "animated", "color", "formattedYAxis", "formattedXAxis", "score", "height", "isPdf", "legendConfig"];
|
|
48716
48702
|
const {
|
|
48717
48703
|
useToken: useToken$9
|
|
48718
48704
|
} = antd.theme;
|
|
@@ -48737,7 +48723,7 @@ const RadarChart = _ref => {
|
|
|
48737
48723
|
isPdf = false,
|
|
48738
48724
|
legendConfig = {}
|
|
48739
48725
|
} = _ref,
|
|
48740
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
48726
|
+
rest = _objectWithoutProperties(_ref, _excluded$4);
|
|
48741
48727
|
const containerRef = React.useRef(null);
|
|
48742
48728
|
const chartRef = React.useRef(null);
|
|
48743
48729
|
const {
|
|
@@ -51069,7 +51055,7 @@ function StakeholderMappings(_ref3) {
|
|
|
51069
51055
|
}
|
|
51070
51056
|
var index = withProvider(StakeholderMappings);
|
|
51071
51057
|
|
|
51072
|
-
const _excluded$
|
|
51058
|
+
const _excluded$3 = ["t", "checkboxConfig", "defaultTableFilters", "columns", "children", "data", "loading", "APP", "getApiBaseUrl", "selectOptions", "selectFilters", "showCreate", "location", "goTo", "getRedirectLink", "defaultUrlParams", "view", "module", "filtersConfig", "isMobile"];
|
|
51073
51059
|
const BaseScreen = _ref => {
|
|
51074
51060
|
var _data$data;
|
|
51075
51061
|
let {
|
|
@@ -51107,7 +51093,7 @@ const BaseScreen = _ref => {
|
|
|
51107
51093
|
filtersConfig,
|
|
51108
51094
|
isMobile
|
|
51109
51095
|
} = _ref,
|
|
51110
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
51096
|
+
rest = _objectWithoutProperties(_ref, _excluded$3);
|
|
51111
51097
|
const [showFilters, setShowFilters] = React.useState(false);
|
|
51112
51098
|
const [hasError, setHasError] = React.useState(false);
|
|
51113
51099
|
const {
|
|
@@ -51217,6 +51203,217 @@ const BaseScreen = _ref => {
|
|
|
51217
51203
|
});
|
|
51218
51204
|
};
|
|
51219
51205
|
|
|
51206
|
+
function AppInvitation(_ref) {
|
|
51207
|
+
let {
|
|
51208
|
+
// Redux State
|
|
51209
|
+
errors,
|
|
51210
|
+
user,
|
|
51211
|
+
invitationSuccess,
|
|
51212
|
+
// Actions
|
|
51213
|
+
confirmInvitation,
|
|
51214
|
+
getUserFromInvitation,
|
|
51215
|
+
// Configuration
|
|
51216
|
+
Layout,
|
|
51217
|
+
redirectPath = "/",
|
|
51218
|
+
loginPath = "/login",
|
|
51219
|
+
appRedirectPath = "/app",
|
|
51220
|
+
params: propParams = {}
|
|
51221
|
+
} = _ref;
|
|
51222
|
+
const {
|
|
51223
|
+
t
|
|
51224
|
+
} = useTranslation();
|
|
51225
|
+
const routeParams = useParams();
|
|
51226
|
+
const {
|
|
51227
|
+
app,
|
|
51228
|
+
companyCode,
|
|
51229
|
+
userCode
|
|
51230
|
+
} = _objectSpread2(_objectSpread2({}, routeParams), propParams);
|
|
51231
|
+
const [passwords] = antd.Form.useForm();
|
|
51232
|
+
const [checking, setChecking] = React.useState(true);
|
|
51233
|
+
const goTo = useNavigate();
|
|
51234
|
+
const [termsAgreed, setTermsAgreed] = React.useState(false);
|
|
51235
|
+
const [passwordReseted, setPasswordReseted] = React.useState(false);
|
|
51236
|
+
React.useEffect(() => {
|
|
51237
|
+
if (companyCode && userCode) {
|
|
51238
|
+
getUserFromInvitation({
|
|
51239
|
+
companyCode,
|
|
51240
|
+
userCode
|
|
51241
|
+
}, () => {
|
|
51242
|
+
setChecking(false);
|
|
51243
|
+
});
|
|
51244
|
+
} else {
|
|
51245
|
+
setChecking(false);
|
|
51246
|
+
}
|
|
51247
|
+
}, [companyCode, userCode, getUserFromInvitation]);
|
|
51248
|
+
React.useEffect(() => {
|
|
51249
|
+
if (invitationSuccess && user && user.inviteToken) {
|
|
51250
|
+
confirmInvitation({}, data => {
|
|
51251
|
+
if (data.token) {
|
|
51252
|
+
localStorage.setItem('token', data.token);
|
|
51253
|
+
}
|
|
51254
|
+
antd.message.success(t('Invitation accepted'));
|
|
51255
|
+
// Fix: ensure we don't rely on a variable from useParams that might not exist
|
|
51256
|
+
// Just use the configured redirectPath
|
|
51257
|
+
goTo(redirectPath);
|
|
51258
|
+
}, {
|
|
51259
|
+
companyCode,
|
|
51260
|
+
userCode
|
|
51261
|
+
});
|
|
51262
|
+
}
|
|
51263
|
+
}, [invitationSuccess, user, confirmInvitation, goTo, redirectPath, companyCode, userCode, t]);
|
|
51264
|
+
const displayError = name => {
|
|
51265
|
+
return errors && errors[name] && errors[name].length > 0 && {
|
|
51266
|
+
help: errors[name][0],
|
|
51267
|
+
validateStatus: 'error'
|
|
51268
|
+
};
|
|
51269
|
+
};
|
|
51270
|
+
const subTitle = !passwordReseted ? 'Set up your password and agree with out terms and conditions.' : isMobile ? 'Your account has been successfully set up. To log in use a desktop device.' : 'Your account has been successfully set up. Please click the button below to log in.';
|
|
51271
|
+
const title = passwordReseted ? 'Thank You!' : undefined;
|
|
51272
|
+
if (checking && !invitationSuccess) {
|
|
51273
|
+
return /*#__PURE__*/jsxRuntime.jsx(Loading, {});
|
|
51274
|
+
}
|
|
51275
|
+
|
|
51276
|
+
// If auto-confirming (inviteToken present), we might want to show loading or nothing until redirect
|
|
51277
|
+
if (invitationSuccess && user && user.inviteToken) {
|
|
51278
|
+
// The useEffect will handle the redirect/confirm.
|
|
51279
|
+
// We can show loading here too or just return null.
|
|
51280
|
+
// Original code: checks invitationSuccess && !user.inviteToken for form, else redirect.
|
|
51281
|
+
return /*#__PURE__*/jsxRuntime.jsx(Loading, {});
|
|
51282
|
+
}
|
|
51283
|
+
if (invitationSuccess && !user.inviteToken) {
|
|
51284
|
+
const Content = /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
51285
|
+
children: passwordReseted ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51286
|
+
children: isMobile ? null : /*#__PURE__*/jsxRuntime.jsx(DafButton, {
|
|
51287
|
+
type: "primary",
|
|
51288
|
+
className: "normal-br",
|
|
51289
|
+
onClick: () => {
|
|
51290
|
+
window.location.href = loginPath;
|
|
51291
|
+
},
|
|
51292
|
+
children: t('Log In')
|
|
51293
|
+
})
|
|
51294
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
51295
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(antd.Form, {
|
|
51296
|
+
name: "password",
|
|
51297
|
+
layout: "vertical",
|
|
51298
|
+
form: passwords,
|
|
51299
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
|
|
51300
|
+
required: true,
|
|
51301
|
+
name: "password"
|
|
51302
|
+
}, displayError('password')), {}, {
|
|
51303
|
+
label: t("Password"),
|
|
51304
|
+
rules: [{
|
|
51305
|
+
required: true,
|
|
51306
|
+
message: t("errors::password should not be empty")
|
|
51307
|
+
}],
|
|
51308
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Input.Password, {
|
|
51309
|
+
size: "large",
|
|
51310
|
+
placeholder: t("Password")
|
|
51311
|
+
})
|
|
51312
|
+
})), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
|
|
51313
|
+
required: true,
|
|
51314
|
+
name: "confirmPassword"
|
|
51315
|
+
}, displayError('confirmPassword')), {}, {
|
|
51316
|
+
label: t("Confirm Password"),
|
|
51317
|
+
dependencies: ['password'],
|
|
51318
|
+
rules: [{
|
|
51319
|
+
required: true,
|
|
51320
|
+
message: t("errors::password should not be empty")
|
|
51321
|
+
}, _ref2 => {
|
|
51322
|
+
let {
|
|
51323
|
+
getFieldValue
|
|
51324
|
+
} = _ref2;
|
|
51325
|
+
return {
|
|
51326
|
+
validator(rule, value) {
|
|
51327
|
+
if (!value || getFieldValue('password') === value) {
|
|
51328
|
+
return Promise.resolve();
|
|
51329
|
+
}
|
|
51330
|
+
return Promise.reject(t('errors::passwordNotMatch'));
|
|
51331
|
+
}
|
|
51332
|
+
};
|
|
51333
|
+
}],
|
|
51334
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Input.Password, {
|
|
51335
|
+
size: "large",
|
|
51336
|
+
placeholder: t("Confirm Password")
|
|
51337
|
+
})
|
|
51338
|
+
})), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
51339
|
+
name: "mailUpdates",
|
|
51340
|
+
valuePropName: "checked",
|
|
51341
|
+
noStyle: true,
|
|
51342
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox, {
|
|
51343
|
+
children: t("Sign up to receive updates")
|
|
51344
|
+
})
|
|
51345
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
51346
|
+
name: "agreeTerms",
|
|
51347
|
+
valuePropName: "checked",
|
|
51348
|
+
noStyle: true,
|
|
51349
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox, {
|
|
51350
|
+
checked: termsAgreed,
|
|
51351
|
+
onChange: e => setTermsAgreed(e.target.checked),
|
|
51352
|
+
children: /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
51353
|
+
className: "mb-0",
|
|
51354
|
+
children: t('Agree to the Terms of Use of this application and the Privacy Policy')
|
|
51355
|
+
})
|
|
51356
|
+
})
|
|
51357
|
+
})]
|
|
51358
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51359
|
+
className: "buttons",
|
|
51360
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DafButton, {
|
|
51361
|
+
className: "normal-br",
|
|
51362
|
+
type: "primary",
|
|
51363
|
+
block: true,
|
|
51364
|
+
size: "large",
|
|
51365
|
+
disabled: !termsAgreed,
|
|
51366
|
+
onClick: () => {
|
|
51367
|
+
passwords.validateFields().then(data => {
|
|
51368
|
+
const {
|
|
51369
|
+
password,
|
|
51370
|
+
mailUpdates
|
|
51371
|
+
} = data;
|
|
51372
|
+
confirmInvitation({
|
|
51373
|
+
password,
|
|
51374
|
+
mailUpdates
|
|
51375
|
+
}, () => {}, {
|
|
51376
|
+
companyCode,
|
|
51377
|
+
userCode
|
|
51378
|
+
});
|
|
51379
|
+
setPasswordReseted(true);
|
|
51380
|
+
});
|
|
51381
|
+
},
|
|
51382
|
+
children: t("Confirm")
|
|
51383
|
+
})
|
|
51384
|
+
})]
|
|
51385
|
+
})
|
|
51386
|
+
});
|
|
51387
|
+
if (Layout) {
|
|
51388
|
+
// Assuming Layout accepts these props as per Nashiriki AuthLayout
|
|
51389
|
+
return /*#__PURE__*/jsxRuntime.jsx(Layout, {
|
|
51390
|
+
app: app,
|
|
51391
|
+
step: 1,
|
|
51392
|
+
subTitle: subTitle,
|
|
51393
|
+
title: title,
|
|
51394
|
+
children: Content
|
|
51395
|
+
});
|
|
51396
|
+
}
|
|
51397
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
51398
|
+
style: {
|
|
51399
|
+
padding: 20,
|
|
51400
|
+
maxWidth: 400,
|
|
51401
|
+
margin: '0 auto'
|
|
51402
|
+
},
|
|
51403
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("h2", {
|
|
51404
|
+
children: title
|
|
51405
|
+
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
51406
|
+
children: subTitle
|
|
51407
|
+
}), Content]
|
|
51408
|
+
});
|
|
51409
|
+
}
|
|
51410
|
+
return user ? /*#__PURE__*/jsxRuntime.jsx(Navigate, {
|
|
51411
|
+
to: appRedirectPath
|
|
51412
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(Navigate, {
|
|
51413
|
+
to: redirectPath
|
|
51414
|
+
});
|
|
51415
|
+
}
|
|
51416
|
+
|
|
51220
51417
|
/**
|
|
51221
51418
|
* Formats a number for display with locale-specific formatting
|
|
51222
51419
|
* @param {any} val - The value to format
|
|
@@ -51540,6 +51737,7 @@ function useUserGrowth({
|
|
|
51540
51737
|
const {
|
|
51541
51738
|
token
|
|
51542
51739
|
} = useToken$6();
|
|
51740
|
+
console.log("mainData", mainData);
|
|
51543
51741
|
const fetchData = () => {
|
|
51544
51742
|
const {
|
|
51545
51743
|
dates = []
|
|
@@ -51675,6 +51873,7 @@ function UserGrowth({
|
|
|
51675
51873
|
t,
|
|
51676
51874
|
translationKeys
|
|
51677
51875
|
});
|
|
51876
|
+
console.log("usergrowthhhhh", data);
|
|
51678
51877
|
React.useEffect(() => {
|
|
51679
51878
|
if (typeof fetchUserGrowth === "function") {
|
|
51680
51879
|
fetchUserGrowth(selectValue);
|
|
@@ -51802,6 +52001,7 @@ function TopContributors({
|
|
|
51802
52001
|
data,
|
|
51803
52002
|
t
|
|
51804
52003
|
});
|
|
52004
|
+
console.log("topcontributorshhhh", data);
|
|
51805
52005
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, {
|
|
51806
52006
|
title: t(`admin::top-contributors`),
|
|
51807
52007
|
className: "with-border-header overflow-hidden h-w-btn-header",
|
|
@@ -52072,7 +52272,6 @@ function AddUserModal({
|
|
|
52072
52272
|
setAccountUsed(true);
|
|
52073
52273
|
}).catch(() => {});
|
|
52074
52274
|
};
|
|
52075
|
-
console.log("hellooooooooooooooooooooooooo");
|
|
52076
52275
|
return /*#__PURE__*/jsxRuntime.jsx(Modal, {
|
|
52077
52276
|
open: isOpen,
|
|
52078
52277
|
title: "admin::edit-user",
|
|
@@ -52198,7 +52397,7 @@ const renderTypeTag = ({
|
|
|
52198
52397
|
});
|
|
52199
52398
|
};
|
|
52200
52399
|
|
|
52201
|
-
const getColumns$
|
|
52400
|
+
const getColumns$7 = ({
|
|
52202
52401
|
t,
|
|
52203
52402
|
show = "show",
|
|
52204
52403
|
selectOptions,
|
|
@@ -52472,11 +52671,11 @@ const getColumns$6 = ({
|
|
|
52472
52671
|
}];
|
|
52473
52672
|
return cols.filter(c => c[show]);
|
|
52474
52673
|
};
|
|
52475
|
-
const checkboxConfig$
|
|
52674
|
+
const checkboxConfig$b = {
|
|
52476
52675
|
name: "Name",
|
|
52477
52676
|
datastakeId: "ID"
|
|
52478
52677
|
};
|
|
52479
|
-
const selectFiltersConfig$
|
|
52678
|
+
const selectFiltersConfig$b = {
|
|
52480
52679
|
account: {
|
|
52481
52680
|
type: "select",
|
|
52482
52681
|
label: "Account",
|
|
@@ -52517,16 +52716,16 @@ const selectFiltersConfig$a = {
|
|
|
52517
52716
|
getValue: option => option.value
|
|
52518
52717
|
}
|
|
52519
52718
|
};
|
|
52520
|
-
const filtersConfig$
|
|
52719
|
+
const filtersConfig$b = {
|
|
52521
52720
|
name: "",
|
|
52522
52721
|
datastakeId: ""
|
|
52523
52722
|
};
|
|
52524
52723
|
const view$2 = "admin-users";
|
|
52525
|
-
const defaultUrlParams$
|
|
52724
|
+
const defaultUrlParams$4 = {
|
|
52526
52725
|
activeTab: "active"
|
|
52527
52726
|
};
|
|
52528
52727
|
const defaultTableFilters$2 = {};
|
|
52529
|
-
const getTabs$
|
|
52728
|
+
const getTabs$3 = ({
|
|
52530
52729
|
totalPending = 0,
|
|
52531
52730
|
t
|
|
52532
52731
|
}) => [{
|
|
@@ -52666,14 +52865,15 @@ function UserTable(_ref) {
|
|
|
52666
52865
|
} = useAdminTable({
|
|
52667
52866
|
goTo,
|
|
52668
52867
|
location,
|
|
52669
|
-
selectFiltersConfig: selectFiltersConfig$
|
|
52868
|
+
selectFiltersConfig: selectFiltersConfig$b,
|
|
52670
52869
|
view: view$2,
|
|
52671
|
-
defaultUrlParams: defaultUrlParams$
|
|
52870
|
+
defaultUrlParams: defaultUrlParams$4,
|
|
52672
52871
|
module,
|
|
52673
|
-
filtersConfig: filtersConfig$
|
|
52872
|
+
filtersConfig: filtersConfig$b,
|
|
52674
52873
|
getRedirectLink,
|
|
52675
52874
|
getData,
|
|
52676
|
-
defaultPageSize
|
|
52875
|
+
defaultPageSize,
|
|
52876
|
+
fetchPendingOnMount: true // Users table needs pending count
|
|
52677
52877
|
});
|
|
52678
52878
|
const selectOptions = React.useMemo(() => {
|
|
52679
52879
|
return {
|
|
@@ -52682,7 +52882,7 @@ function UserTable(_ref) {
|
|
|
52682
52882
|
role: config.userRoles.filter(c => !c.isForAppAdmin)
|
|
52683
52883
|
};
|
|
52684
52884
|
}, [config.userRoles, config.accountTypes, accounts]);
|
|
52685
|
-
const columns = React.useMemo(() => getColumns$
|
|
52885
|
+
const columns = React.useMemo(() => getColumns$7({
|
|
52686
52886
|
t,
|
|
52687
52887
|
show: activeTab,
|
|
52688
52888
|
selectOptions,
|
|
@@ -52727,7 +52927,7 @@ function UserTable(_ref) {
|
|
|
52727
52927
|
t: t,
|
|
52728
52928
|
headerTitle: headerTitle,
|
|
52729
52929
|
actionButton: actionButton,
|
|
52730
|
-
tabs: getTabs$
|
|
52930
|
+
tabs: getTabs$3({
|
|
52731
52931
|
totalPending: totalPending,
|
|
52732
52932
|
t
|
|
52733
52933
|
}),
|
|
@@ -52738,7 +52938,7 @@ function UserTable(_ref) {
|
|
|
52738
52938
|
hasError: hasError,
|
|
52739
52939
|
setHasError: setHasError,
|
|
52740
52940
|
canClearSearch: canClearSearch,
|
|
52741
|
-
checkboxConfig: checkboxConfig$
|
|
52941
|
+
checkboxConfig: checkboxConfig$b,
|
|
52742
52942
|
defaultTableFilters: defaultTableFilters$2,
|
|
52743
52943
|
children: /*#__PURE__*/jsxRuntime.jsx(DAFTable, {
|
|
52744
52944
|
columns: columns,
|
|
@@ -52747,7 +52947,7 @@ function UserTable(_ref) {
|
|
|
52747
52947
|
pagination: filter.pagination,
|
|
52748
52948
|
selectOptions: selectOptions,
|
|
52749
52949
|
setShowFilters: setShowFilters,
|
|
52750
|
-
filtersConfig: selectFiltersConfig$
|
|
52950
|
+
filtersConfig: selectFiltersConfig$b,
|
|
52751
52951
|
onFilterChange: filter.onFiltersChange,
|
|
52752
52952
|
showFilters: showFilters,
|
|
52753
52953
|
defaultFilters: filter.defaultFilters,
|
|
@@ -52778,7 +52978,7 @@ function UserTable(_ref) {
|
|
|
52778
52978
|
});
|
|
52779
52979
|
}
|
|
52780
52980
|
|
|
52781
|
-
const getColumns$
|
|
52981
|
+
const getColumns$6 = ({
|
|
52782
52982
|
t,
|
|
52783
52983
|
goTo,
|
|
52784
52984
|
show = "show",
|
|
@@ -53075,11 +53275,11 @@ const getColumns$5 = ({
|
|
|
53075
53275
|
}];
|
|
53076
53276
|
return cols.filter(c => c[show]);
|
|
53077
53277
|
};
|
|
53078
|
-
const checkboxConfig$
|
|
53278
|
+
const checkboxConfig$a = {
|
|
53079
53279
|
name: "Name",
|
|
53080
53280
|
datastakeId: "ID"
|
|
53081
53281
|
};
|
|
53082
|
-
const selectFiltersConfig$
|
|
53282
|
+
const selectFiltersConfig$a = {
|
|
53083
53283
|
type: {
|
|
53084
53284
|
type: "select",
|
|
53085
53285
|
label: "Type",
|
|
@@ -53107,16 +53307,16 @@ const selectFiltersConfig$9 = {
|
|
|
53107
53307
|
getValue: option => option.value
|
|
53108
53308
|
}
|
|
53109
53309
|
};
|
|
53110
|
-
const filtersConfig$
|
|
53310
|
+
const filtersConfig$a = {
|
|
53111
53311
|
name: "",
|
|
53112
53312
|
datastakeId: ""
|
|
53113
53313
|
};
|
|
53114
53314
|
const view$1 = "accounts";
|
|
53115
|
-
const defaultUrlParams$
|
|
53315
|
+
const defaultUrlParams$3 = {
|
|
53116
53316
|
activeTab: "active"
|
|
53117
53317
|
};
|
|
53118
53318
|
const defaultTableFilters$1 = {};
|
|
53119
|
-
const getTabs$
|
|
53319
|
+
const getTabs$2 = ({
|
|
53120
53320
|
totalPending = 0,
|
|
53121
53321
|
t
|
|
53122
53322
|
}) => [{
|
|
@@ -53131,7 +53331,7 @@ const getTabs$1 = ({
|
|
|
53131
53331
|
label: t("Suspended")
|
|
53132
53332
|
}];
|
|
53133
53333
|
|
|
53134
|
-
const getColumns$
|
|
53334
|
+
const getColumns$5 = ({
|
|
53135
53335
|
t,
|
|
53136
53336
|
selectOptions,
|
|
53137
53337
|
module
|
|
@@ -53254,7 +53454,7 @@ function CombineAccountModal({
|
|
|
53254
53454
|
} = useToken$4();
|
|
53255
53455
|
const [MainForm] = antd.Form.useForm();
|
|
53256
53456
|
const columns = React.useMemo(() => {
|
|
53257
|
-
return getColumns$
|
|
53457
|
+
return getColumns$5({
|
|
53258
53458
|
t,
|
|
53259
53459
|
selectOptions,
|
|
53260
53460
|
module
|
|
@@ -53423,7 +53623,7 @@ function NewAccount({
|
|
|
53423
53623
|
};
|
|
53424
53624
|
return /*#__PURE__*/jsxRuntime.jsx(Modal, {
|
|
53425
53625
|
t: t,
|
|
53426
|
-
title: t(isEdit ? "
|
|
53626
|
+
title: t(isEdit ? "edit-account" : "add-account"),
|
|
53427
53627
|
open: isOpen,
|
|
53428
53628
|
onClose: onClose,
|
|
53429
53629
|
onSuccess: onSubmit,
|
|
@@ -53510,14 +53710,15 @@ function AccountTable(_ref) {
|
|
|
53510
53710
|
} = useAdminTable({
|
|
53511
53711
|
goTo,
|
|
53512
53712
|
location,
|
|
53513
|
-
selectFiltersConfig: selectFiltersConfig$
|
|
53713
|
+
selectFiltersConfig: selectFiltersConfig$a,
|
|
53514
53714
|
view: view$1,
|
|
53515
|
-
defaultUrlParams: defaultUrlParams$
|
|
53715
|
+
defaultUrlParams: defaultUrlParams$3,
|
|
53516
53716
|
module,
|
|
53517
53717
|
defaultPageSize,
|
|
53518
|
-
filtersConfig: filtersConfig$
|
|
53718
|
+
filtersConfig: filtersConfig$a,
|
|
53519
53719
|
getRedirectLink,
|
|
53520
|
-
getData
|
|
53720
|
+
getData,
|
|
53721
|
+
fetchPendingOnMount: true
|
|
53521
53722
|
});
|
|
53522
53723
|
const selectOptions = React.useMemo(() => {
|
|
53523
53724
|
var _config$options;
|
|
@@ -53557,7 +53758,7 @@ function AccountTable(_ref) {
|
|
|
53557
53758
|
onCancel: () => {}
|
|
53558
53759
|
});
|
|
53559
53760
|
}, [t, fetchData, fetchPendingAccounts]);
|
|
53560
|
-
const columns = React.useMemo(() => getColumns$
|
|
53761
|
+
const columns = React.useMemo(() => getColumns$6({
|
|
53561
53762
|
t,
|
|
53562
53763
|
show: activeTab,
|
|
53563
53764
|
selectOptions,
|
|
@@ -53583,7 +53784,7 @@ function AccountTable(_ref) {
|
|
|
53583
53784
|
tooltip: "Combine",
|
|
53584
53785
|
disabled: selectedAccounts.length < 2
|
|
53585
53786
|
}],
|
|
53586
|
-
tabs: getTabs$
|
|
53787
|
+
tabs: getTabs$2({
|
|
53587
53788
|
totalPending: totalPending,
|
|
53588
53789
|
t
|
|
53589
53790
|
}),
|
|
@@ -53595,7 +53796,7 @@ function AccountTable(_ref) {
|
|
|
53595
53796
|
setHasError: setHasError,
|
|
53596
53797
|
canClearSearch: canClearSearch,
|
|
53597
53798
|
selectOptions: selectOptions,
|
|
53598
|
-
checkboxConfig: checkboxConfig$
|
|
53799
|
+
checkboxConfig: checkboxConfig$a,
|
|
53599
53800
|
defaultTableFilters: defaultTableFilters$1,
|
|
53600
53801
|
children: [selectedAccounts.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
53601
53802
|
className: "flex flex-row ml-6 mt-5",
|
|
@@ -53626,7 +53827,7 @@ function AccountTable(_ref) {
|
|
|
53626
53827
|
doEmptyRows: true,
|
|
53627
53828
|
selectOptions: selectOptions,
|
|
53628
53829
|
setShowFilters: setShowFilters,
|
|
53629
|
-
filtersConfig: selectFiltersConfig$
|
|
53830
|
+
filtersConfig: selectFiltersConfig$a,
|
|
53630
53831
|
onFilterChange: filter.onFiltersChange,
|
|
53631
53832
|
showFilters: showFilters,
|
|
53632
53833
|
defaultFilters: filter.defaultFilters,
|
|
@@ -53662,7 +53863,7 @@ function AccountTable(_ref) {
|
|
|
53662
53863
|
});
|
|
53663
53864
|
}
|
|
53664
53865
|
|
|
53665
|
-
const getTabs = ({
|
|
53866
|
+
const getTabs$1 = ({
|
|
53666
53867
|
t
|
|
53667
53868
|
}) => {
|
|
53668
53869
|
return [{
|
|
@@ -53676,7 +53877,7 @@ const getTabs = ({
|
|
|
53676
53877
|
label: t("Suspended")
|
|
53677
53878
|
}];
|
|
53678
53879
|
};
|
|
53679
|
-
const selectFiltersConfig$
|
|
53880
|
+
const selectFiltersConfig$9 = {
|
|
53680
53881
|
category: {
|
|
53681
53882
|
type: "select",
|
|
53682
53883
|
label: "Category",
|
|
@@ -53717,32 +53918,35 @@ const selectFiltersConfig$8 = {
|
|
|
53717
53918
|
getValue: option => option.value
|
|
53718
53919
|
}
|
|
53719
53920
|
};
|
|
53720
|
-
const filtersConfig$
|
|
53921
|
+
const filtersConfig$9 = {
|
|
53721
53922
|
name: "",
|
|
53722
53923
|
datastakeId: ""
|
|
53723
53924
|
};
|
|
53724
|
-
const defaultUrlParams$
|
|
53925
|
+
const defaultUrlParams$2 = {
|
|
53725
53926
|
activeTab: "active"
|
|
53726
53927
|
};
|
|
53727
|
-
const checkboxConfig$
|
|
53928
|
+
const checkboxConfig$9 = {
|
|
53728
53929
|
name: "Name",
|
|
53729
53930
|
datastakeId: "ID"
|
|
53730
53931
|
};
|
|
53731
|
-
|
|
53932
|
+
|
|
53933
|
+
const getNameByLevel$1 = (data, level) => {
|
|
53732
53934
|
const entry = Object.values(data || {}).find(item => item.level === level);
|
|
53733
|
-
return entry;
|
|
53935
|
+
return entry?.name || "-";
|
|
53734
53936
|
};
|
|
53735
53937
|
|
|
53736
|
-
const getColumns$
|
|
53938
|
+
const getColumns$4 = ({
|
|
53737
53939
|
t,
|
|
53738
53940
|
goTo = () => {},
|
|
53739
53941
|
show = "show",
|
|
53740
53942
|
getRedirectLink = () => {},
|
|
53741
53943
|
token,
|
|
53742
|
-
|
|
53743
|
-
|
|
53944
|
+
selectedLocations,
|
|
53945
|
+
setSelectedLocations,
|
|
53744
53946
|
selectOptions,
|
|
53745
|
-
entity
|
|
53947
|
+
entity,
|
|
53948
|
+
user,
|
|
53949
|
+
options
|
|
53746
53950
|
}) => {
|
|
53747
53951
|
const cols = [{
|
|
53748
53952
|
title: "",
|
|
@@ -53757,15 +53961,15 @@ const getColumns$3 = ({
|
|
|
53757
53961
|
});
|
|
53758
53962
|
}
|
|
53759
53963
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox, {
|
|
53760
|
-
onChange: () =>
|
|
53964
|
+
onChange: () => setSelectedLocations(prev => {
|
|
53761
53965
|
const isSelected = prev.some(p => p.id === all.id);
|
|
53762
53966
|
if (isSelected) {
|
|
53763
53967
|
return prev.filter(p => p.id !== all.id);
|
|
53764
53968
|
}
|
|
53765
53969
|
return [...prev, all];
|
|
53766
53970
|
}),
|
|
53767
|
-
checked:
|
|
53768
|
-
disabled:
|
|
53971
|
+
checked: selectedLocations.some(p => p.id === all.id),
|
|
53972
|
+
disabled: selectedLocations?.length >= 3 && !selectedLocations.some(p => p.id === all.id)
|
|
53769
53973
|
});
|
|
53770
53974
|
}
|
|
53771
53975
|
}, {
|
|
@@ -53839,11 +54043,11 @@ const getColumns$3 = ({
|
|
|
53839
54043
|
});
|
|
53840
54044
|
}
|
|
53841
54045
|
}, {
|
|
53842
|
-
title: t("Province"),
|
|
54046
|
+
title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
|
|
53843
54047
|
dataIndex: "administrativeLevel1",
|
|
53844
54048
|
key: "administrativeLevel1",
|
|
53845
54049
|
ellipsis: true,
|
|
53846
|
-
show: entity.includes("
|
|
54050
|
+
show: entity.includes("location"),
|
|
53847
54051
|
render: (value, all) => {
|
|
53848
54052
|
if (all.empty) {
|
|
53849
54053
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -53854,7 +54058,7 @@ const getColumns$3 = ({
|
|
|
53854
54058
|
if (all?.administrativeLevel1 && value === all?.administrativeLevel1) {
|
|
53855
54059
|
label = all?.linking?.SCL?.[value]?.name;
|
|
53856
54060
|
} else {
|
|
53857
|
-
label = getNameByLevel(all?.linking?.SCL, "level_1")?.name;
|
|
54061
|
+
label = getNameByLevel$1(all?.linking?.SCL, "level_1")?.name;
|
|
53858
54062
|
}
|
|
53859
54063
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
53860
54064
|
title: label || '-',
|
|
@@ -53862,10 +54066,10 @@ const getColumns$3 = ({
|
|
|
53862
54066
|
});
|
|
53863
54067
|
}
|
|
53864
54068
|
}, {
|
|
53865
|
-
title: t("Territory"),
|
|
54069
|
+
title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
|
|
53866
54070
|
dataIndex: "administrativeLevel2",
|
|
53867
54071
|
key: "administrativeLevel2",
|
|
53868
|
-
show: entity.includes("
|
|
54072
|
+
show: entity.includes("location"),
|
|
53869
54073
|
ellipsis: true,
|
|
53870
54074
|
render: (value, all) => {
|
|
53871
54075
|
if (all.empty) {
|
|
@@ -53877,7 +54081,7 @@ const getColumns$3 = ({
|
|
|
53877
54081
|
if (all?.administrativeLevel2 && value === all?.administrativeLevel2) {
|
|
53878
54082
|
label = all?.linking?.SCL?.[value]?.name;
|
|
53879
54083
|
} else {
|
|
53880
|
-
label = getNameByLevel(all?.linking?.SCL, "level_2")?.name;
|
|
54084
|
+
label = getNameByLevel$1(all?.linking?.SCL, "level_2")?.name;
|
|
53881
54085
|
}
|
|
53882
54086
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
53883
54087
|
title: label || '-',
|
|
@@ -53941,7 +54145,7 @@ const getColumns$3 = ({
|
|
|
53941
54145
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
53942
54146
|
className: "cursor-pointer",
|
|
53943
54147
|
onClick: () => {
|
|
53944
|
-
goTo(getRedirectLink(`/app/
|
|
54148
|
+
goTo(getRedirectLink(`/app/view/management-location/${all.id}`));
|
|
53945
54149
|
},
|
|
53946
54150
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
53947
54151
|
name: "Link",
|
|
@@ -53954,7 +54158,78 @@ const getColumns$3 = ({
|
|
|
53954
54158
|
return cols.filter(c => c[show]);
|
|
53955
54159
|
};
|
|
53956
54160
|
|
|
53957
|
-
const
|
|
54161
|
+
const getTabs = ({
|
|
54162
|
+
t
|
|
54163
|
+
}) => {
|
|
54164
|
+
return [{
|
|
54165
|
+
key: "active",
|
|
54166
|
+
label: t("Active")
|
|
54167
|
+
}, {
|
|
54168
|
+
key: "pending",
|
|
54169
|
+
label: t("Pending")
|
|
54170
|
+
}, {
|
|
54171
|
+
key: 'suspended',
|
|
54172
|
+
label: t("Suspended")
|
|
54173
|
+
}];
|
|
54174
|
+
};
|
|
54175
|
+
const selectFiltersConfig$8 = {
|
|
54176
|
+
category: {
|
|
54177
|
+
type: "select",
|
|
54178
|
+
label: "Category",
|
|
54179
|
+
placeholder: t => t("Category"),
|
|
54180
|
+
style: {
|
|
54181
|
+
flex: 1
|
|
54182
|
+
},
|
|
54183
|
+
labelStyle: {
|
|
54184
|
+
flex: 1
|
|
54185
|
+
},
|
|
54186
|
+
getLabel: option => option.label,
|
|
54187
|
+
getValue: option => option.value
|
|
54188
|
+
},
|
|
54189
|
+
country: {
|
|
54190
|
+
type: "select",
|
|
54191
|
+
label: "Country",
|
|
54192
|
+
placeholder: t => t("Country"),
|
|
54193
|
+
style: {
|
|
54194
|
+
flex: 1
|
|
54195
|
+
},
|
|
54196
|
+
labelStyle: {
|
|
54197
|
+
flex: 1
|
|
54198
|
+
},
|
|
54199
|
+
getLabel: option => option.label,
|
|
54200
|
+
getValue: option => option.value
|
|
54201
|
+
},
|
|
54202
|
+
sources: {
|
|
54203
|
+
type: "select",
|
|
54204
|
+
label: "Sources",
|
|
54205
|
+
placeholder: t => t("Sources"),
|
|
54206
|
+
style: {
|
|
54207
|
+
flex: 1
|
|
54208
|
+
},
|
|
54209
|
+
labelStyle: {
|
|
54210
|
+
flex: 1
|
|
54211
|
+
},
|
|
54212
|
+
getLabel: option => option.label,
|
|
54213
|
+
getValue: option => option.value
|
|
54214
|
+
}
|
|
54215
|
+
};
|
|
54216
|
+
const filtersConfig$8 = {
|
|
54217
|
+
name: "",
|
|
54218
|
+
datastakeId: ""
|
|
54219
|
+
};
|
|
54220
|
+
const defaultUrlParams$1 = {
|
|
54221
|
+
activeTab: "active"
|
|
54222
|
+
};
|
|
54223
|
+
const checkboxConfig$8 = {
|
|
54224
|
+
name: "Name",
|
|
54225
|
+
datastakeId: "ID"
|
|
54226
|
+
};
|
|
54227
|
+
const getNameByLevel = (data, level) => {
|
|
54228
|
+
const entry = Object.values(data || {}).find(item => item.level === level);
|
|
54229
|
+
return entry;
|
|
54230
|
+
};
|
|
54231
|
+
|
|
54232
|
+
const getColumns$3 = ({
|
|
53958
54233
|
t,
|
|
53959
54234
|
selectOptions,
|
|
53960
54235
|
module,
|
|
@@ -54011,7 +54286,7 @@ const getColumns$2 = ({
|
|
|
54011
54286
|
dataIndex: "administrativeLevel1",
|
|
54012
54287
|
key: "administrativeLevel1",
|
|
54013
54288
|
ellipsis: true,
|
|
54014
|
-
show: entity
|
|
54289
|
+
show: entity?.includes("location"),
|
|
54015
54290
|
render: (value, all) => {
|
|
54016
54291
|
let label;
|
|
54017
54292
|
if (all?.administrativeLevel1 && value === all?.administrativeLevel1) {
|
|
@@ -54028,7 +54303,7 @@ const getColumns$2 = ({
|
|
|
54028
54303
|
title: t("Territory"),
|
|
54029
54304
|
dataIndex: "administrativeLevel2",
|
|
54030
54305
|
key: "administrativeLevel2",
|
|
54031
|
-
show: entity
|
|
54306
|
+
show: entity?.includes("location"),
|
|
54032
54307
|
render: (value, all) => {
|
|
54033
54308
|
let label;
|
|
54034
54309
|
if (all?.administrativeLevel2 && value === all?.administrativeLevel2) {
|
|
@@ -54063,7 +54338,7 @@ function CombineLocationModal({
|
|
|
54063
54338
|
const [MainForm] = antd.Form.useForm();
|
|
54064
54339
|
const [isDisabled, setIsDisabled] = React.useState(true);
|
|
54065
54340
|
const columns = React.useMemo(() => {
|
|
54066
|
-
return getColumns$
|
|
54341
|
+
return getColumns$3({
|
|
54067
54342
|
t,
|
|
54068
54343
|
selectOptions,
|
|
54069
54344
|
module,
|
|
@@ -54073,10 +54348,12 @@ function CombineLocationModal({
|
|
|
54073
54348
|
}, [selectedLocations, t, selectOptions, module, entity]);
|
|
54074
54349
|
const onSubmit = () => {
|
|
54075
54350
|
MainForm.validateFields().then(data => {
|
|
54076
|
-
const ids = selectedLocations.map(location => location.
|
|
54351
|
+
const ids = selectedLocations.map(location => location.id);
|
|
54352
|
+
const allowedKeys = ["id", "name", "country", "category", "administrativeLevel1", "administrativeLevel2"];
|
|
54353
|
+
const filteredData = Object.fromEntries(Object.entries(data).filter(([key]) => allowedKeys.includes(key)));
|
|
54077
54354
|
onSuccess({
|
|
54078
54355
|
ids,
|
|
54079
|
-
data
|
|
54356
|
+
data: filteredData
|
|
54080
54357
|
});
|
|
54081
54358
|
});
|
|
54082
54359
|
};
|
|
@@ -54092,7 +54369,7 @@ function CombineLocationModal({
|
|
|
54092
54369
|
onValuesChange: () => {
|
|
54093
54370
|
setIsDisabled(() => {
|
|
54094
54371
|
const values = MainForm.getFieldsValue();
|
|
54095
|
-
const requiredFields = entity
|
|
54372
|
+
const requiredFields = entity?.includes("location") ? ["id", "name", "category", "country", "administrativeLevel1", "administrativeLevel2"] : ["id", "name", "category", "country"];
|
|
54096
54373
|
return requiredFields.some(field => values[field] === undefined);
|
|
54097
54374
|
});
|
|
54098
54375
|
},
|
|
@@ -54139,7 +54416,7 @@ function CombineLocationModal({
|
|
|
54139
54416
|
options: selectedLocations.map(location => {
|
|
54140
54417
|
return {
|
|
54141
54418
|
label: location?.datastakeId || "-",
|
|
54142
|
-
value: location?.
|
|
54419
|
+
value: location?.id || "-"
|
|
54143
54420
|
};
|
|
54144
54421
|
}),
|
|
54145
54422
|
placeholder: t("ID")
|
|
@@ -54174,7 +54451,7 @@ function CombineLocationModal({
|
|
|
54174
54451
|
}).filter((option, index, self) => index === self.findIndex(o => o.value === option.value)),
|
|
54175
54452
|
placeholder: t("admin::country")
|
|
54176
54453
|
})
|
|
54177
|
-
}), entity
|
|
54454
|
+
}), entity?.includes("location") && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
54178
54455
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
54179
54456
|
className: "flex-1",
|
|
54180
54457
|
name: "administrativeLevel1",
|
|
@@ -54212,6 +54489,7 @@ function CombineLocationModal({
|
|
|
54212
54489
|
});
|
|
54213
54490
|
}
|
|
54214
54491
|
|
|
54492
|
+
const _excluded$2 = ["pagination", "tab", "filters", "search", "sort"];
|
|
54215
54493
|
const {
|
|
54216
54494
|
useToken: useToken$2
|
|
54217
54495
|
} = antd.theme;
|
|
@@ -54229,8 +54507,10 @@ function LocationTable(_ref) {
|
|
|
54229
54507
|
view,
|
|
54230
54508
|
headerTitle,
|
|
54231
54509
|
breadcrumbs,
|
|
54232
|
-
|
|
54233
|
-
refetchTrigger
|
|
54510
|
+
mergeLocationsFunction,
|
|
54511
|
+
refetchTrigger,
|
|
54512
|
+
user,
|
|
54513
|
+
options
|
|
54234
54514
|
} = _ref;
|
|
54235
54515
|
const [showFilters, setShowFilters] = React.useState(false);
|
|
54236
54516
|
const [hasError, setHasError] = React.useState(false);
|
|
@@ -54238,7 +54518,50 @@ function LocationTable(_ref) {
|
|
|
54238
54518
|
const {
|
|
54239
54519
|
token
|
|
54240
54520
|
} = useToken$2();
|
|
54241
|
-
const [
|
|
54521
|
+
const [isCombineModalOpen, setIsModalOpen] = React.useState(false);
|
|
54522
|
+
const getDataWithStringPagination = async _ref2 => {
|
|
54523
|
+
let {
|
|
54524
|
+
params
|
|
54525
|
+
} = _ref2;
|
|
54526
|
+
const {
|
|
54527
|
+
pagination,
|
|
54528
|
+
tab,
|
|
54529
|
+
filters,
|
|
54530
|
+
search,
|
|
54531
|
+
sort
|
|
54532
|
+
} = params;
|
|
54533
|
+
_objectWithoutProperties(params, _excluded$2);
|
|
54534
|
+
let paginationObj = {
|
|
54535
|
+
page: 1,
|
|
54536
|
+
pageSize: 20
|
|
54537
|
+
};
|
|
54538
|
+
if (pagination) {
|
|
54539
|
+
try {
|
|
54540
|
+
paginationObj = typeof pagination === 'string' ? JSON.parse(pagination) : pagination;
|
|
54541
|
+
} catch (e) {
|
|
54542
|
+
console.error('Failed to parse pagination', e);
|
|
54543
|
+
}
|
|
54544
|
+
}
|
|
54545
|
+
let activeTab = tab || "active";
|
|
54546
|
+
if (!tab && filters) {
|
|
54547
|
+
try {
|
|
54548
|
+
const parsedFilters = typeof filters === 'string' ? JSON.parse(filters) : filters;
|
|
54549
|
+
activeTab = parsedFilters.activeTab || "active";
|
|
54550
|
+
} catch (e) {
|
|
54551
|
+
activeTab = "active";
|
|
54552
|
+
}
|
|
54553
|
+
}
|
|
54554
|
+
const transformedParams = {
|
|
54555
|
+
pagination: {
|
|
54556
|
+
skip: String(paginationObj.page || 1),
|
|
54557
|
+
take: String(paginationObj.pageSize || 20)
|
|
54558
|
+
},
|
|
54559
|
+
tab: activeTab
|
|
54560
|
+
};
|
|
54561
|
+
return getData({
|
|
54562
|
+
params: transformedParams
|
|
54563
|
+
});
|
|
54564
|
+
};
|
|
54242
54565
|
const {
|
|
54243
54566
|
filter,
|
|
54244
54567
|
activeTab,
|
|
@@ -54253,14 +54576,14 @@ function LocationTable(_ref) {
|
|
|
54253
54576
|
} = useAdminTable({
|
|
54254
54577
|
goTo,
|
|
54255
54578
|
location,
|
|
54256
|
-
selectFiltersConfig: selectFiltersConfig$
|
|
54579
|
+
selectFiltersConfig: selectFiltersConfig$9,
|
|
54257
54580
|
view,
|
|
54258
|
-
defaultUrlParams: defaultUrlParams$
|
|
54581
|
+
defaultUrlParams: defaultUrlParams$2,
|
|
54259
54582
|
module,
|
|
54260
54583
|
defaultPageSize,
|
|
54261
|
-
filtersConfig: filtersConfig$
|
|
54584
|
+
filtersConfig: filtersConfig$9,
|
|
54262
54585
|
getRedirectLink,
|
|
54263
|
-
getData,
|
|
54586
|
+
getData: getDataWithStringPagination,
|
|
54264
54587
|
refetchTrigger
|
|
54265
54588
|
});
|
|
54266
54589
|
const selectOptions = React.useMemo(() => {
|
|
@@ -54268,11 +54591,11 @@ function LocationTable(_ref) {
|
|
|
54268
54591
|
return {
|
|
54269
54592
|
category: (_config$options = config.options) === null || _config$options === void 0 ? void 0 : _config$options.category,
|
|
54270
54593
|
country: (_config$options2 = config.options) === null || _config$options2 === void 0 ? void 0 : _config$options2.countries,
|
|
54271
|
-
sources: []
|
|
54594
|
+
sources: []
|
|
54272
54595
|
};
|
|
54273
54596
|
}, [config.options]);
|
|
54274
54597
|
const columns = React.useMemo(() => {
|
|
54275
|
-
return getColumns$
|
|
54598
|
+
return getColumns$4({
|
|
54276
54599
|
t,
|
|
54277
54600
|
goTo,
|
|
54278
54601
|
token,
|
|
@@ -54281,7 +54604,9 @@ function LocationTable(_ref) {
|
|
|
54281
54604
|
setSelectedLocations,
|
|
54282
54605
|
getRedirectLink,
|
|
54283
54606
|
selectOptions,
|
|
54284
|
-
entity: headerTitle
|
|
54607
|
+
entity: headerTitle,
|
|
54608
|
+
user,
|
|
54609
|
+
options
|
|
54285
54610
|
});
|
|
54286
54611
|
}, [t, goTo, module, token, selectedLocations, getRedirectLink, selectOptions, headerTitle]);
|
|
54287
54612
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -54291,11 +54616,11 @@ function LocationTable(_ref) {
|
|
|
54291
54616
|
headerTitle: headerTitle,
|
|
54292
54617
|
actionButton: [{
|
|
54293
54618
|
icon: "Merge",
|
|
54294
|
-
onClick: () =>
|
|
54295
|
-
tooltip: "
|
|
54619
|
+
onClick: () => setIsModalOpen(true),
|
|
54620
|
+
tooltip: t("admin::merge-locations"),
|
|
54296
54621
|
disabled: selectedLocations.length < 2
|
|
54297
54622
|
}],
|
|
54298
|
-
tabs: getTabs({
|
|
54623
|
+
tabs: getTabs$1({
|
|
54299
54624
|
t
|
|
54300
54625
|
}),
|
|
54301
54626
|
isMobile: isMobile,
|
|
@@ -54306,7 +54631,7 @@ function LocationTable(_ref) {
|
|
|
54306
54631
|
setHasError: setHasError,
|
|
54307
54632
|
canClearSearch: canClearSearch,
|
|
54308
54633
|
selectOptions: selectOptions,
|
|
54309
|
-
checkboxConfig: checkboxConfig$
|
|
54634
|
+
checkboxConfig: checkboxConfig$9,
|
|
54310
54635
|
defaultTableFilters: {},
|
|
54311
54636
|
breadcrumbs: breadcrumbs,
|
|
54312
54637
|
children: [selectedLocations.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -54338,34 +54663,262 @@ function LocationTable(_ref) {
|
|
|
54338
54663
|
selectOptions: selectOptions,
|
|
54339
54664
|
doEmptyRows: true,
|
|
54340
54665
|
setShowFilters: setShowFilters,
|
|
54341
|
-
filtersConfig: selectFiltersConfig$
|
|
54666
|
+
filtersConfig: selectFiltersConfig$9,
|
|
54342
54667
|
onFilterChange: filter.onFiltersChange,
|
|
54343
54668
|
showFilters: showFilters,
|
|
54344
54669
|
defaultFilters: filter.defaultFilters,
|
|
54345
54670
|
onChange: filter.onTableChange
|
|
54346
54671
|
})]
|
|
54347
54672
|
}), /*#__PURE__*/jsxRuntime.jsx(CombineLocationModal, {
|
|
54348
|
-
isOpen:
|
|
54673
|
+
isOpen: isCombineModalOpen,
|
|
54349
54674
|
t: t,
|
|
54350
|
-
onClose: () =>
|
|
54351
|
-
setCombineLocationVisible(false);
|
|
54352
|
-
},
|
|
54675
|
+
onClose: () => setIsModalOpen(false),
|
|
54353
54676
|
onSuccess: data => {
|
|
54354
|
-
|
|
54677
|
+
console.log("Modal Success triggered", data); // 1. Check if this logs
|
|
54678
|
+
console.log("Is function?", typeof mergeLocationsFunction);
|
|
54679
|
+
setIsModalOpen(false);
|
|
54355
54680
|
setLoading(true);
|
|
54356
|
-
if (typeof
|
|
54357
|
-
|
|
54358
|
-
|
|
54681
|
+
if (typeof mergeLocationsFunction === 'function') {
|
|
54682
|
+
mergeLocationsFunction(data).finally(() => {
|
|
54683
|
+
setSelectedLocations([]);
|
|
54684
|
+
fetchData();
|
|
54685
|
+
});
|
|
54359
54686
|
}
|
|
54360
54687
|
},
|
|
54361
54688
|
selectedLocations: selectedLocations,
|
|
54362
|
-
selectOptions: selectOptions
|
|
54689
|
+
selectOptions: selectOptions,
|
|
54363
54690
|
module: module,
|
|
54364
54691
|
entity: headerTitle
|
|
54365
54692
|
})]
|
|
54366
54693
|
});
|
|
54367
54694
|
}
|
|
54368
54695
|
|
|
54696
|
+
const getColumns$2 = ({
|
|
54697
|
+
t,
|
|
54698
|
+
goTo = () => {},
|
|
54699
|
+
show = "show",
|
|
54700
|
+
getRedirectLink = () => {},
|
|
54701
|
+
token,
|
|
54702
|
+
selectedSubjects,
|
|
54703
|
+
setSelectedSubjects,
|
|
54704
|
+
selectOptions,
|
|
54705
|
+
entity,
|
|
54706
|
+
options
|
|
54707
|
+
}) => {
|
|
54708
|
+
const cols = [{
|
|
54709
|
+
title: "",
|
|
54710
|
+
dataIndex: "select",
|
|
54711
|
+
key: "select",
|
|
54712
|
+
width: 50,
|
|
54713
|
+
show: true,
|
|
54714
|
+
render: (v, all) => {
|
|
54715
|
+
if (all.empty) {
|
|
54716
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
54717
|
+
className: "daf-default-cell"
|
|
54718
|
+
});
|
|
54719
|
+
}
|
|
54720
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox, {
|
|
54721
|
+
onChange: () => setSelectedSubjects(prev => {
|
|
54722
|
+
const isSelected = prev.some(p => p.id === all.id);
|
|
54723
|
+
if (isSelected) {
|
|
54724
|
+
return prev.filter(p => p.id !== all.id);
|
|
54725
|
+
}
|
|
54726
|
+
return [...prev, all];
|
|
54727
|
+
}),
|
|
54728
|
+
checked: selectedSubjects.some(p => p.id === all.id),
|
|
54729
|
+
disabled: selectedSubjects?.length >= 3 && !selectedSubjects.some(p => p.id === all.id)
|
|
54730
|
+
});
|
|
54731
|
+
}
|
|
54732
|
+
}, {
|
|
54733
|
+
title: t("ID"),
|
|
54734
|
+
dataIndex: "datastakeId",
|
|
54735
|
+
key: "datastakeId",
|
|
54736
|
+
ellipsis: true,
|
|
54737
|
+
show: true,
|
|
54738
|
+
render: (value, all) => {
|
|
54739
|
+
if (all.empty) {
|
|
54740
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
54741
|
+
className: "daf-default-cell"
|
|
54742
|
+
});
|
|
54743
|
+
}
|
|
54744
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
54745
|
+
title: value,
|
|
54746
|
+
children: value
|
|
54747
|
+
});
|
|
54748
|
+
}
|
|
54749
|
+
}, {
|
|
54750
|
+
title: t("Name"),
|
|
54751
|
+
dataIndex: "name",
|
|
54752
|
+
key: "name",
|
|
54753
|
+
ellipsis: true,
|
|
54754
|
+
show: true,
|
|
54755
|
+
render: (value, all) => {
|
|
54756
|
+
if (all.empty) {
|
|
54757
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
54758
|
+
className: "daf-default-cell"
|
|
54759
|
+
});
|
|
54760
|
+
}
|
|
54761
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
54762
|
+
title: value,
|
|
54763
|
+
children: value
|
|
54764
|
+
});
|
|
54765
|
+
}
|
|
54766
|
+
}, {
|
|
54767
|
+
title: t("Category"),
|
|
54768
|
+
dataIndex: "category",
|
|
54769
|
+
key: "category",
|
|
54770
|
+
ellipsis: true,
|
|
54771
|
+
show: true,
|
|
54772
|
+
render: (value, all) => {
|
|
54773
|
+
if (all.empty) {
|
|
54774
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
54775
|
+
className: "daf-default-cell"
|
|
54776
|
+
});
|
|
54777
|
+
}
|
|
54778
|
+
console.log({
|
|
54779
|
+
value,
|
|
54780
|
+
options
|
|
54781
|
+
});
|
|
54782
|
+
const category = findOptions(value, options?.categoriesOptions || []) || "-";
|
|
54783
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
54784
|
+
title: category,
|
|
54785
|
+
children: category
|
|
54786
|
+
});
|
|
54787
|
+
}
|
|
54788
|
+
}, {
|
|
54789
|
+
title: t("Country"),
|
|
54790
|
+
dataIndex: "country",
|
|
54791
|
+
key: "country",
|
|
54792
|
+
ellipsis: true,
|
|
54793
|
+
show: true,
|
|
54794
|
+
render: (value, all) => {
|
|
54795
|
+
if (all.empty) {
|
|
54796
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
54797
|
+
className: "daf-default-cell"
|
|
54798
|
+
});
|
|
54799
|
+
}
|
|
54800
|
+
const country = findOptions(value, options?.countries || []) || "-";
|
|
54801
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
54802
|
+
title: country,
|
|
54803
|
+
children: country
|
|
54804
|
+
});
|
|
54805
|
+
}
|
|
54806
|
+
}, {
|
|
54807
|
+
title: t("Admin Level 1"),
|
|
54808
|
+
dataIndex: "administrativeLevel1",
|
|
54809
|
+
key: "administrativeLevel1",
|
|
54810
|
+
ellipsis: true,
|
|
54811
|
+
show: entity.includes("location"),
|
|
54812
|
+
render: (value, all) => {
|
|
54813
|
+
if (all.empty) {
|
|
54814
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
54815
|
+
className: "daf-default-cell"
|
|
54816
|
+
});
|
|
54817
|
+
}
|
|
54818
|
+
let label;
|
|
54819
|
+
if (all?.administrativeLevel1 && value === all?.administrativeLevel1) {
|
|
54820
|
+
label = all?.linking?.SCL?.[value]?.name;
|
|
54821
|
+
} else {
|
|
54822
|
+
label = getNameByLevel(all?.linking?.SCL, "level_1")?.name;
|
|
54823
|
+
}
|
|
54824
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
54825
|
+
title: label || '-',
|
|
54826
|
+
children: label || '-'
|
|
54827
|
+
});
|
|
54828
|
+
}
|
|
54829
|
+
}, {
|
|
54830
|
+
title: t("Admin Level 2"),
|
|
54831
|
+
dataIndex: "administrativeLevel2",
|
|
54832
|
+
key: "administrativeLevel2",
|
|
54833
|
+
show: entity.includes("location"),
|
|
54834
|
+
ellipsis: true,
|
|
54835
|
+
render: (value, all) => {
|
|
54836
|
+
if (all.empty) {
|
|
54837
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
54838
|
+
className: "daf-default-cell"
|
|
54839
|
+
});
|
|
54840
|
+
}
|
|
54841
|
+
let label;
|
|
54842
|
+
if (all?.administrativeLevel2 && value === all?.administrativeLevel2) {
|
|
54843
|
+
label = all?.linking?.SCL?.[value]?.name;
|
|
54844
|
+
} else {
|
|
54845
|
+
label = getNameByLevel(all?.linking?.SCL, "level_2")?.name;
|
|
54846
|
+
}
|
|
54847
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
54848
|
+
title: label || '-',
|
|
54849
|
+
children: label || '-'
|
|
54850
|
+
});
|
|
54851
|
+
}
|
|
54852
|
+
}, {
|
|
54853
|
+
title: t("Sources"),
|
|
54854
|
+
dataIndex: "sources",
|
|
54855
|
+
key: "sources",
|
|
54856
|
+
show: true,
|
|
54857
|
+
render: (value, all) => {
|
|
54858
|
+
if (all.empty) {
|
|
54859
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
54860
|
+
className: "daf-default-cell"
|
|
54861
|
+
});
|
|
54862
|
+
}
|
|
54863
|
+
const MAX_SOURCES = 3;
|
|
54864
|
+
const count = value?.length === MAX_SOURCES + 1 ? value?.length : MAX_SOURCES;
|
|
54865
|
+
return Array.isArray(value) && value?.length > 0 ? /*#__PURE__*/jsxRuntime.jsx(antd.Avatar.Group, {
|
|
54866
|
+
max: {
|
|
54867
|
+
count: count,
|
|
54868
|
+
style: {
|
|
54869
|
+
color: token.baseGray90,
|
|
54870
|
+
backgroundColor: token.baseGray20,
|
|
54871
|
+
border: `1px solid ${token.baseGray40}`
|
|
54872
|
+
}
|
|
54873
|
+
},
|
|
54874
|
+
size: "small",
|
|
54875
|
+
children: value.map((v, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Avatar, {
|
|
54876
|
+
size: "small",
|
|
54877
|
+
style: {
|
|
54878
|
+
backgroundColor: token.baseGray20,
|
|
54879
|
+
color: token.baseGray90,
|
|
54880
|
+
border: `1px solid ${token.baseGray40}`,
|
|
54881
|
+
display: "flex",
|
|
54882
|
+
alignItems: "center",
|
|
54883
|
+
justifyContent: "center"
|
|
54884
|
+
},
|
|
54885
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
54886
|
+
name: "Organisation02",
|
|
54887
|
+
width: 18,
|
|
54888
|
+
height: 18,
|
|
54889
|
+
color: token.baseGray90
|
|
54890
|
+
})
|
|
54891
|
+
}, i))
|
|
54892
|
+
}) : '-';
|
|
54893
|
+
}
|
|
54894
|
+
}, {
|
|
54895
|
+
title: "",
|
|
54896
|
+
dataIndex: "actions",
|
|
54897
|
+
key: "actions",
|
|
54898
|
+
width: 60,
|
|
54899
|
+
show: true,
|
|
54900
|
+
render: (value, all) => {
|
|
54901
|
+
if (all.empty) {
|
|
54902
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
54903
|
+
className: "daf-default-cell"
|
|
54904
|
+
});
|
|
54905
|
+
}
|
|
54906
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
54907
|
+
className: "cursor-pointer",
|
|
54908
|
+
onClick: () => {
|
|
54909
|
+
goTo(getRedirectLink(`/app/view/management-stakeholder/${all.id}`));
|
|
54910
|
+
},
|
|
54911
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
54912
|
+
name: "Link",
|
|
54913
|
+
width: 18,
|
|
54914
|
+
height: 18
|
|
54915
|
+
})
|
|
54916
|
+
});
|
|
54917
|
+
}
|
|
54918
|
+
}];
|
|
54919
|
+
return cols.filter(c => c[show]);
|
|
54920
|
+
};
|
|
54921
|
+
|
|
54369
54922
|
const mapToSelectOptions = (items, valueKey, selectOptions, optionKey, customMapper = null) => {
|
|
54370
54923
|
return items.map(item => {
|
|
54371
54924
|
if (customMapper) {
|
|
@@ -54500,7 +55053,7 @@ function CombineSubjectsModal({
|
|
|
54500
55053
|
}, [selectedSubjects, t, selectOptions, module, entity]);
|
|
54501
55054
|
const onSubmit = () => {
|
|
54502
55055
|
MainForm.validateFields().then(data => {
|
|
54503
|
-
const ids = selectedSubjects.map(subject => subject.
|
|
55056
|
+
const ids = selectedSubjects.map(subject => subject.id);
|
|
54504
55057
|
onSuccess({
|
|
54505
55058
|
ids,
|
|
54506
55059
|
data
|
|
@@ -54509,7 +55062,7 @@ function CombineSubjectsModal({
|
|
|
54509
55062
|
};
|
|
54510
55063
|
return /*#__PURE__*/jsxRuntime.jsxs(Modal, {
|
|
54511
55064
|
open: isOpen,
|
|
54512
|
-
title: t("
|
|
55065
|
+
title: t("merge"),
|
|
54513
55066
|
onClose: onClose,
|
|
54514
55067
|
onSuccess: onSubmit,
|
|
54515
55068
|
withModalFormWrapper: false,
|
|
@@ -54519,7 +55072,7 @@ function CombineSubjectsModal({
|
|
|
54519
55072
|
onValuesChange: () => {
|
|
54520
55073
|
setIsDisabled(() => {
|
|
54521
55074
|
const values = MainForm.getFieldsValue();
|
|
54522
|
-
const requiredFields = entity
|
|
55075
|
+
const requiredFields = entity.includes("location") ? ["id", "name", "category", "country", "administrativeLevel1", "administrativeLevel2"] : ["id", "name", "category", "country"];
|
|
54523
55076
|
return requiredFields.some(field => values[field] === undefined);
|
|
54524
55077
|
});
|
|
54525
55078
|
},
|
|
@@ -54531,7 +55084,7 @@ function CombineSubjectsModal({
|
|
|
54531
55084
|
style: {
|
|
54532
55085
|
color: token.baseGray90
|
|
54533
55086
|
},
|
|
54534
|
-
children: t("
|
|
55087
|
+
children: t("current_subjects")
|
|
54535
55088
|
}), /*#__PURE__*/jsxRuntime.jsx(DAFTable, {
|
|
54536
55089
|
columns: columns,
|
|
54537
55090
|
data: selectedSubjects,
|
|
@@ -54545,7 +55098,7 @@ function CombineSubjectsModal({
|
|
|
54545
55098
|
color: token.baseGray90,
|
|
54546
55099
|
marginTop: 14
|
|
54547
55100
|
},
|
|
54548
|
-
children: t("
|
|
55101
|
+
children: t("merged_output")
|
|
54549
55102
|
}), /*#__PURE__*/jsxRuntime.jsxs(antd.Form, {
|
|
54550
55103
|
form: MainForm,
|
|
54551
55104
|
clearOnDestroy: true,
|
|
@@ -54586,7 +55139,7 @@ function CombineSubjectsModal({
|
|
|
54586
55139
|
options: mapToSelectOptions(selectedSubjects, "country", selectOptions, "country"),
|
|
54587
55140
|
placeholder: t("admin::country")
|
|
54588
55141
|
})
|
|
54589
|
-
}), entity.includes("
|
|
55142
|
+
}), entity.includes("location") && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
54590
55143
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
54591
55144
|
className: "flex-1",
|
|
54592
55145
|
name: "administrativeLevel1",
|
|
@@ -54624,6 +55177,7 @@ function CombineSubjectsModal({
|
|
|
54624
55177
|
});
|
|
54625
55178
|
}
|
|
54626
55179
|
|
|
55180
|
+
const _excluded$1 = ["pagination", "tab", "filters", "search", "sort"];
|
|
54627
55181
|
const {
|
|
54628
55182
|
useToken
|
|
54629
55183
|
} = antd.theme;
|
|
@@ -54642,7 +55196,9 @@ function SubjectsTable(_ref) {
|
|
|
54642
55196
|
headerTitle,
|
|
54643
55197
|
breadcrumbs,
|
|
54644
55198
|
mergeSubjectsFunction,
|
|
54645
|
-
refetchTrigger
|
|
55199
|
+
refetchTrigger,
|
|
55200
|
+
user,
|
|
55201
|
+
options
|
|
54646
55202
|
} = _ref;
|
|
54647
55203
|
const [showFilters, setShowFilters] = React.useState(false);
|
|
54648
55204
|
const [hasError, setHasError] = React.useState(false);
|
|
@@ -54651,6 +55207,49 @@ function SubjectsTable(_ref) {
|
|
|
54651
55207
|
token
|
|
54652
55208
|
} = useToken();
|
|
54653
55209
|
const [isCombineModalOpen, setIsModalOpen] = React.useState(false);
|
|
55210
|
+
const getDataWithStringPagination = async _ref2 => {
|
|
55211
|
+
let {
|
|
55212
|
+
params
|
|
55213
|
+
} = _ref2;
|
|
55214
|
+
const {
|
|
55215
|
+
pagination,
|
|
55216
|
+
tab,
|
|
55217
|
+
filters,
|
|
55218
|
+
search,
|
|
55219
|
+
sort
|
|
55220
|
+
} = params;
|
|
55221
|
+
_objectWithoutProperties(params, _excluded$1);
|
|
55222
|
+
let paginationObj = {
|
|
55223
|
+
page: 1,
|
|
55224
|
+
pageSize: 20
|
|
55225
|
+
};
|
|
55226
|
+
if (pagination) {
|
|
55227
|
+
try {
|
|
55228
|
+
paginationObj = typeof pagination === 'string' ? JSON.parse(pagination) : pagination;
|
|
55229
|
+
} catch (e) {
|
|
55230
|
+
console.error('Failed to parse pagination', e);
|
|
55231
|
+
}
|
|
55232
|
+
}
|
|
55233
|
+
let activeTab = tab || "active";
|
|
55234
|
+
if (!tab && filters) {
|
|
55235
|
+
try {
|
|
55236
|
+
const parsedFilters = typeof filters === 'string' ? JSON.parse(filters) : filters;
|
|
55237
|
+
activeTab = parsedFilters.activeTab || "active";
|
|
55238
|
+
} catch (e) {
|
|
55239
|
+
activeTab = "active";
|
|
55240
|
+
}
|
|
55241
|
+
}
|
|
55242
|
+
const transformedParams = {
|
|
55243
|
+
pagination: {
|
|
55244
|
+
skip: String(paginationObj.page || 1),
|
|
55245
|
+
take: String(paginationObj.pageSize || 20)
|
|
55246
|
+
},
|
|
55247
|
+
tab: activeTab
|
|
55248
|
+
};
|
|
55249
|
+
return getData({
|
|
55250
|
+
params: transformedParams
|
|
55251
|
+
});
|
|
55252
|
+
};
|
|
54654
55253
|
const {
|
|
54655
55254
|
filter,
|
|
54656
55255
|
activeTab,
|
|
@@ -54672,7 +55271,7 @@ function SubjectsTable(_ref) {
|
|
|
54672
55271
|
defaultPageSize,
|
|
54673
55272
|
filtersConfig: filtersConfig$8,
|
|
54674
55273
|
getRedirectLink,
|
|
54675
|
-
getData,
|
|
55274
|
+
getData: getDataWithStringPagination,
|
|
54676
55275
|
refetchTrigger
|
|
54677
55276
|
});
|
|
54678
55277
|
const selectOptions = React.useMemo(() => {
|
|
@@ -54680,11 +55279,11 @@ function SubjectsTable(_ref) {
|
|
|
54680
55279
|
return {
|
|
54681
55280
|
category: (_config$options = config.options) === null || _config$options === void 0 ? void 0 : _config$options.category,
|
|
54682
55281
|
country: (_config$options2 = config.options) === null || _config$options2 === void 0 ? void 0 : _config$options2.countries,
|
|
54683
|
-
sources: []
|
|
55282
|
+
sources: []
|
|
54684
55283
|
};
|
|
54685
55284
|
}, [config.options]);
|
|
54686
55285
|
const columns = React.useMemo(() => {
|
|
54687
|
-
return getColumns$
|
|
55286
|
+
return getColumns$2({
|
|
54688
55287
|
t,
|
|
54689
55288
|
goTo,
|
|
54690
55289
|
token,
|
|
@@ -54693,9 +55292,10 @@ function SubjectsTable(_ref) {
|
|
|
54693
55292
|
setSelectedSubjects,
|
|
54694
55293
|
getRedirectLink,
|
|
54695
55294
|
selectOptions,
|
|
54696
|
-
entity: headerTitle
|
|
55295
|
+
entity: headerTitle,
|
|
55296
|
+
options
|
|
54697
55297
|
});
|
|
54698
|
-
}, [t, goTo, module, token, selectedSubjects, getRedirectLink, selectOptions, headerTitle]);
|
|
55298
|
+
}, [t, goTo, module, token, selectedSubjects, getRedirectLink, selectOptions, headerTitle, options]);
|
|
54699
55299
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
54700
55300
|
children: [/*#__PURE__*/jsxRuntime.jsxs(AdminTable, {
|
|
54701
55301
|
filters: filter,
|
|
@@ -54759,19 +55359,20 @@ function SubjectsTable(_ref) {
|
|
|
54759
55359
|
}), /*#__PURE__*/jsxRuntime.jsx(CombineSubjectsModal, {
|
|
54760
55360
|
isOpen: isCombineModalOpen,
|
|
54761
55361
|
t: t,
|
|
54762
|
-
onClose: () =>
|
|
54763
|
-
setIsModalOpen(false);
|
|
54764
|
-
},
|
|
55362
|
+
onClose: () => setIsModalOpen(false),
|
|
54765
55363
|
onSuccess: data => {
|
|
54766
55364
|
setIsModalOpen(false);
|
|
54767
55365
|
setLoading(true);
|
|
55366
|
+
antd.message.success(t("Subjects successfully merged."));
|
|
54768
55367
|
if (typeof mergeSubjectsFunction === 'function') {
|
|
54769
|
-
mergeSubjectsFunction(data)
|
|
54770
|
-
|
|
55368
|
+
mergeSubjectsFunction(data).finally(() => {
|
|
55369
|
+
setSelectedSubjects([]);
|
|
55370
|
+
fetchData();
|
|
55371
|
+
});
|
|
54771
55372
|
}
|
|
54772
55373
|
},
|
|
54773
55374
|
selectedSubjects: selectedSubjects,
|
|
54774
|
-
selectOptions: selectOptions
|
|
55375
|
+
selectOptions: selectOptions,
|
|
54775
55376
|
module: module,
|
|
54776
55377
|
entity: headerTitle
|
|
54777
55378
|
})]
|
|
@@ -54817,8 +55418,10 @@ const config$1 = [{
|
|
|
54817
55418
|
function SideBarMenu({
|
|
54818
55419
|
selectedGroup,
|
|
54819
55420
|
onChange = () => {},
|
|
54820
|
-
t
|
|
55421
|
+
t,
|
|
55422
|
+
config
|
|
54821
55423
|
}) {
|
|
55424
|
+
const menuConfig = config || config$1;
|
|
54822
55425
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Menu, {
|
|
54823
55426
|
mode: "inline",
|
|
54824
55427
|
defaultSelectedKeys: [selectedGroup],
|
|
@@ -54830,7 +55433,7 @@ function SideBarMenu({
|
|
|
54830
55433
|
onSelect: g => {
|
|
54831
55434
|
onChange(g.key);
|
|
54832
55435
|
},
|
|
54833
|
-
items:
|
|
55436
|
+
items: menuConfig.map(conf => {
|
|
54834
55437
|
return {
|
|
54835
55438
|
key: conf.key,
|
|
54836
55439
|
label: t(conf.label)
|
|
@@ -54928,10 +55531,14 @@ function NewUser({
|
|
|
54928
55531
|
defaultData,
|
|
54929
55532
|
userRoles = [],
|
|
54930
55533
|
addUser = () => {},
|
|
54931
|
-
module = "straatos"
|
|
55534
|
+
module = "straatos",
|
|
55535
|
+
inviteCompanyAccount = () => {},
|
|
55536
|
+
companyId,
|
|
55537
|
+
handleError = () => {}
|
|
54932
55538
|
}) {
|
|
54933
55539
|
const [MainForm] = antd.Form.useForm();
|
|
54934
55540
|
const [accountUsed, setAccountUsed] = React.useState(false);
|
|
55541
|
+
const [loading, setLoading] = React.useState(false);
|
|
54935
55542
|
React.useEffect(() => {
|
|
54936
55543
|
if (defaultData) {
|
|
54937
55544
|
MainForm.setFieldsValue({
|
|
@@ -54940,28 +55547,44 @@ function NewUser({
|
|
|
54940
55547
|
});
|
|
54941
55548
|
}
|
|
54942
55549
|
}, [defaultData]);
|
|
54943
|
-
const onSubmit = () => {
|
|
54944
|
-
|
|
54945
|
-
|
|
54946
|
-
|
|
55550
|
+
const onSubmit = async () => {
|
|
55551
|
+
try {
|
|
55552
|
+
const val = await MainForm.validateFields();
|
|
55553
|
+
setLoading(true);
|
|
55554
|
+
const apiPayload = {
|
|
54947
55555
|
firstName: val.firstName,
|
|
54948
55556
|
lastName: val.lastName,
|
|
54949
55557
|
email: val.email,
|
|
54950
55558
|
role: val.role,
|
|
54951
|
-
|
|
54952
|
-
|
|
54953
|
-
|
|
54954
|
-
}
|
|
54955
|
-
}
|
|
55559
|
+
type: 'user',
|
|
55560
|
+
pendingCompanyId: companyId,
|
|
55561
|
+
name: `${val.firstName} ${val.lastName}`
|
|
54956
55562
|
};
|
|
54957
|
-
|
|
54958
|
-
|
|
54959
|
-
|
|
54960
|
-
|
|
54961
|
-
|
|
55563
|
+
await inviteCompanyAccount({
|
|
55564
|
+
companyId: companyId,
|
|
55565
|
+
data: apiPayload
|
|
55566
|
+
});
|
|
55567
|
+
const localUserData = {
|
|
55568
|
+
...apiPayload,
|
|
55569
|
+
status: 'pending'
|
|
55570
|
+
// apps: {
|
|
55571
|
+
// [module]: {
|
|
55572
|
+
// role: val.role,
|
|
55573
|
+
// }
|
|
55574
|
+
// },
|
|
55575
|
+
};
|
|
55576
|
+
addUser(localUserData);
|
|
55577
|
+
antd.message.success(t("User added successfully"));
|
|
54962
55578
|
onClose();
|
|
54963
55579
|
MainForm.resetFields();
|
|
54964
|
-
}
|
|
55580
|
+
} catch (error) {
|
|
55581
|
+
if (error.errorFields) {
|
|
55582
|
+
return;
|
|
55583
|
+
}
|
|
55584
|
+
handleError(error);
|
|
55585
|
+
} finally {
|
|
55586
|
+
setLoading(false);
|
|
55587
|
+
}
|
|
54965
55588
|
};
|
|
54966
55589
|
return /*#__PURE__*/jsxRuntime.jsx(Modal, {
|
|
54967
55590
|
t: t,
|
|
@@ -54969,6 +55592,7 @@ function NewUser({
|
|
|
54969
55592
|
open: isOpen,
|
|
54970
55593
|
onClose: onClose,
|
|
54971
55594
|
onSuccess: onSubmit,
|
|
55595
|
+
loading: loading,
|
|
54972
55596
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Form, {
|
|
54973
55597
|
form: MainForm,
|
|
54974
55598
|
layout: "vertical",
|
|
@@ -55224,10 +55848,7 @@ const getColumns = ({
|
|
|
55224
55848
|
}];
|
|
55225
55849
|
return cols.filter(v => v.show);
|
|
55226
55850
|
};
|
|
55227
|
-
const checkboxConfig$7 = {
|
|
55228
|
-
name: "Name",
|
|
55229
|
-
datastakeId: "ID"
|
|
55230
|
-
};
|
|
55851
|
+
const checkboxConfig$7 = {};
|
|
55231
55852
|
const selectFiltersConfig$7 = {
|
|
55232
55853
|
userRole: {
|
|
55233
55854
|
type: "select",
|
|
@@ -55257,11 +55878,18 @@ const selectFiltersConfig$7 = {
|
|
|
55257
55878
|
}
|
|
55258
55879
|
};
|
|
55259
55880
|
const filtersConfig$7 = {
|
|
55260
|
-
|
|
55261
|
-
|
|
55881
|
+
search: ""
|
|
55882
|
+
};
|
|
55883
|
+
const defaultUrlParams = {
|
|
55884
|
+
search: "",
|
|
55885
|
+
userRole: null,
|
|
55886
|
+
status: null
|
|
55887
|
+
};
|
|
55888
|
+
const defaultTableFilters = {
|
|
55889
|
+
search: "",
|
|
55890
|
+
userRole: null,
|
|
55891
|
+
status: null
|
|
55262
55892
|
};
|
|
55263
|
-
const defaultUrlParams = {};
|
|
55264
|
-
const defaultTableFilters = {};
|
|
55265
55893
|
|
|
55266
55894
|
function Users({
|
|
55267
55895
|
t,
|
|
@@ -55277,7 +55905,10 @@ function Users({
|
|
|
55277
55905
|
deleteUser = () => {},
|
|
55278
55906
|
updateUser = () => {},
|
|
55279
55907
|
addUser = () => {},
|
|
55280
|
-
transferAdmin = () => {}
|
|
55908
|
+
transferAdmin = () => {},
|
|
55909
|
+
inviteCompanyAccount = () => {},
|
|
55910
|
+
companyId,
|
|
55911
|
+
handleError = () => {}
|
|
55281
55912
|
}) {
|
|
55282
55913
|
const [hasError, setHasError] = React.useState(false);
|
|
55283
55914
|
const [showFilters, setShowFilters] = React.useState(false);
|
|
@@ -55305,9 +55936,9 @@ function Users({
|
|
|
55305
55936
|
userRole: userRoles.filter(u => !u.isForAppAdmin),
|
|
55306
55937
|
status: accountStatuses
|
|
55307
55938
|
};
|
|
55308
|
-
}, [userRoles]);
|
|
55939
|
+
}, [userRoles, accountStatuses]);
|
|
55309
55940
|
const canClearSearch = React.useMemo(() => {
|
|
55310
|
-
return !!activeFilters.search;
|
|
55941
|
+
return !!activeFilters.search || !!activeFilters.userRole || !!activeFilters.status;
|
|
55311
55942
|
}, [activeFilters]);
|
|
55312
55943
|
const onDeleteUserClick = React.useCallback(id => {
|
|
55313
55944
|
antd.Modal.confirm({
|
|
@@ -55401,11 +56032,215 @@ function Users({
|
|
|
55401
56032
|
onClose: () => setNewUserModalVisible(false),
|
|
55402
56033
|
userRoles: userRoles,
|
|
55403
56034
|
addUser: addUser,
|
|
55404
|
-
module: module
|
|
56035
|
+
module: module,
|
|
56036
|
+
inviteCompanyAccount: inviteCompanyAccount,
|
|
56037
|
+
companyId: companyId,
|
|
56038
|
+
handleError: handleError
|
|
55405
56039
|
})]
|
|
55406
56040
|
});
|
|
55407
56041
|
}
|
|
55408
56042
|
|
|
56043
|
+
class AdminService extends BaseService {
|
|
56044
|
+
updateCompany(id, data) {
|
|
56045
|
+
return this.apiPut({
|
|
56046
|
+
url: `/companies/${id}`,
|
|
56047
|
+
data
|
|
56048
|
+
});
|
|
56049
|
+
}
|
|
56050
|
+
getAccount({
|
|
56051
|
+
id
|
|
56052
|
+
}) {
|
|
56053
|
+
return this.apiGet({
|
|
56054
|
+
url: `/accounts/${id}`
|
|
56055
|
+
});
|
|
56056
|
+
}
|
|
56057
|
+
inviteCompanyAccount({
|
|
56058
|
+
companyId,
|
|
56059
|
+
data
|
|
56060
|
+
}) {
|
|
56061
|
+
return this.apiPost({
|
|
56062
|
+
url: `/accounts/${companyId}/invite`,
|
|
56063
|
+
data
|
|
56064
|
+
});
|
|
56065
|
+
}
|
|
56066
|
+
inviteAccount(data) {
|
|
56067
|
+
return this.apiPost({
|
|
56068
|
+
url: `/accounts/inviteAccount`,
|
|
56069
|
+
data
|
|
56070
|
+
});
|
|
56071
|
+
}
|
|
56072
|
+
getAccounts({
|
|
56073
|
+
params
|
|
56074
|
+
}) {
|
|
56075
|
+
return this.apiGet({
|
|
56076
|
+
params,
|
|
56077
|
+
url: `/accounts`
|
|
56078
|
+
});
|
|
56079
|
+
}
|
|
56080
|
+
updateAccount({
|
|
56081
|
+
data,
|
|
56082
|
+
id
|
|
56083
|
+
}) {
|
|
56084
|
+
return this.apiPut({
|
|
56085
|
+
data,
|
|
56086
|
+
url: `/accounts/${id}`
|
|
56087
|
+
});
|
|
56088
|
+
}
|
|
56089
|
+
toggleAccountStatus({
|
|
56090
|
+
id
|
|
56091
|
+
}) {
|
|
56092
|
+
return this.apiPut({
|
|
56093
|
+
url: `/accounts/suspendActivate/${id}`
|
|
56094
|
+
});
|
|
56095
|
+
}
|
|
56096
|
+
transferAdmin({
|
|
56097
|
+
userId,
|
|
56098
|
+
id
|
|
56099
|
+
}) {
|
|
56100
|
+
return this.apiPut({
|
|
56101
|
+
url: `/accounts/transfer-rights/${id}`,
|
|
56102
|
+
data: {
|
|
56103
|
+
userId
|
|
56104
|
+
}
|
|
56105
|
+
});
|
|
56106
|
+
}
|
|
56107
|
+
getUsers({
|
|
56108
|
+
params
|
|
56109
|
+
}) {
|
|
56110
|
+
return this.apiGet({
|
|
56111
|
+
params,
|
|
56112
|
+
url: `/accounts/users`
|
|
56113
|
+
});
|
|
56114
|
+
}
|
|
56115
|
+
impersonate({
|
|
56116
|
+
id
|
|
56117
|
+
}) {
|
|
56118
|
+
return this.apiGet({
|
|
56119
|
+
url: `/accounts/impersonate/${id}`
|
|
56120
|
+
});
|
|
56121
|
+
}
|
|
56122
|
+
cancelInvitation({
|
|
56123
|
+
token
|
|
56124
|
+
}) {
|
|
56125
|
+
return this.apiPut({
|
|
56126
|
+
url: `/accounts/cancelInvitation/${token}`
|
|
56127
|
+
});
|
|
56128
|
+
}
|
|
56129
|
+
getSubjects({
|
|
56130
|
+
subject,
|
|
56131
|
+
params
|
|
56132
|
+
}) {
|
|
56133
|
+
return this.apiGet({
|
|
56134
|
+
url: `/management/subjects/${subject}`,
|
|
56135
|
+
params
|
|
56136
|
+
});
|
|
56137
|
+
}
|
|
56138
|
+
mergeLocations({
|
|
56139
|
+
ids,
|
|
56140
|
+
data
|
|
56141
|
+
}) {
|
|
56142
|
+
const [id1, id2, ...remainingIds] = ids || [];
|
|
56143
|
+
if (!id1 || !id2) {
|
|
56144
|
+
throw new Error('At least two IDs are required for merging');
|
|
56145
|
+
}
|
|
56146
|
+
const url = `/management/merge/location/${id1}/${id2}`;
|
|
56147
|
+
const payload = {
|
|
56148
|
+
...data
|
|
56149
|
+
};
|
|
56150
|
+
if (remainingIds.length > 0) {
|
|
56151
|
+
payload.additionalIds = remainingIds;
|
|
56152
|
+
}
|
|
56153
|
+
return this.apiPost({
|
|
56154
|
+
url,
|
|
56155
|
+
data: payload
|
|
56156
|
+
});
|
|
56157
|
+
}
|
|
56158
|
+
mergeSubjects({
|
|
56159
|
+
subject,
|
|
56160
|
+
ids,
|
|
56161
|
+
data
|
|
56162
|
+
}) {
|
|
56163
|
+
const [id1, id2, ...remainingIds] = ids || [];
|
|
56164
|
+
if (!id1 || !id2) {
|
|
56165
|
+
throw new Error('At least two IDs are required for merging');
|
|
56166
|
+
}
|
|
56167
|
+
const url = `/management/merge/${subject}/${id1}/${id2}`;
|
|
56168
|
+
const payload = {
|
|
56169
|
+
...data
|
|
56170
|
+
};
|
|
56171
|
+
if (remainingIds.length > 0) {
|
|
56172
|
+
payload.additionalIds = remainingIds;
|
|
56173
|
+
}
|
|
56174
|
+
return this.apiPost({
|
|
56175
|
+
url,
|
|
56176
|
+
data: payload
|
|
56177
|
+
});
|
|
56178
|
+
}
|
|
56179
|
+
getSubjectForm({
|
|
56180
|
+
subject,
|
|
56181
|
+
scope = 'global'
|
|
56182
|
+
}) {
|
|
56183
|
+
return this.apiGet({
|
|
56184
|
+
url: `/forms/${subject}`,
|
|
56185
|
+
params: {
|
|
56186
|
+
scope
|
|
56187
|
+
}
|
|
56188
|
+
});
|
|
56189
|
+
}
|
|
56190
|
+
getSubjectData({
|
|
56191
|
+
subject,
|
|
56192
|
+
id
|
|
56193
|
+
}) {
|
|
56194
|
+
return this.apiGet({
|
|
56195
|
+
url: `/management/subject/${subject}/${id}`
|
|
56196
|
+
});
|
|
56197
|
+
}
|
|
56198
|
+
viewLocation({
|
|
56199
|
+
id
|
|
56200
|
+
}) {
|
|
56201
|
+
return this.apiGet({
|
|
56202
|
+
url: `/management/subject/location/${id}`
|
|
56203
|
+
});
|
|
56204
|
+
}
|
|
56205
|
+
viewStakeholder({
|
|
56206
|
+
id
|
|
56207
|
+
}) {
|
|
56208
|
+
return this.apiGet({
|
|
56209
|
+
url: `/management/subject/stakeholder/${id}`
|
|
56210
|
+
});
|
|
56211
|
+
}
|
|
56212
|
+
updateSubject({
|
|
56213
|
+
subject,
|
|
56214
|
+
id,
|
|
56215
|
+
data
|
|
56216
|
+
}) {
|
|
56217
|
+
const type = subject === 'location' ? 'location' : 'stakeholder';
|
|
56218
|
+
return this.apiPut({
|
|
56219
|
+
url: `/management/subject/${type}/${id}`,
|
|
56220
|
+
data: filterCreateData(data)
|
|
56221
|
+
});
|
|
56222
|
+
}
|
|
56223
|
+
deleteSubject({
|
|
56224
|
+
subject,
|
|
56225
|
+
id
|
|
56226
|
+
}) {
|
|
56227
|
+
const type = subject === 'location' ? 'location' : 'stakeholder';
|
|
56228
|
+
return this.apiDelete({
|
|
56229
|
+
url: `/management/subject/${type}/${id}`
|
|
56230
|
+
});
|
|
56231
|
+
}
|
|
56232
|
+
getUserGrowth(activeFilter) {
|
|
56233
|
+
return this.apiGet({
|
|
56234
|
+
url: `/accounts/dashboard/user-growth`,
|
|
56235
|
+
isUserManager: true,
|
|
56236
|
+
params: {
|
|
56237
|
+
activeFilter
|
|
56238
|
+
}
|
|
56239
|
+
});
|
|
56240
|
+
}
|
|
56241
|
+
}
|
|
56242
|
+
var AdminService$1 = createLazyService(AdminService);
|
|
56243
|
+
|
|
55409
56244
|
const isView = true;
|
|
55410
56245
|
function View({
|
|
55411
56246
|
userRoles = [],
|
|
@@ -55430,7 +56265,8 @@ function View({
|
|
|
55430
56265
|
t: t,
|
|
55431
56266
|
location: location,
|
|
55432
56267
|
accountStatuses: accountStatuses,
|
|
55433
|
-
module: module
|
|
56268
|
+
module: module,
|
|
56269
|
+
inviteCompanyAccount: AdminService$1.inviteCompanyAccount
|
|
55434
56270
|
});
|
|
55435
56271
|
}
|
|
55436
56272
|
const getValue = () => {
|
|
@@ -55603,7 +56439,8 @@ function Edit({
|
|
|
55603
56439
|
toggleAccountStatus = () => {},
|
|
55604
56440
|
accountStatuses = [],
|
|
55605
56441
|
module,
|
|
55606
|
-
transferAdmin = () => {}
|
|
56442
|
+
transferAdmin = () => {},
|
|
56443
|
+
inviteCompanyAccount = () => {}
|
|
55607
56444
|
}) {
|
|
55608
56445
|
const {
|
|
55609
56446
|
addCheck,
|
|
@@ -55617,7 +56454,7 @@ function Edit({
|
|
|
55617
56454
|
}
|
|
55618
56455
|
}, [isChanged, addCheck, removeCheck]);
|
|
55619
56456
|
const deleteUser = React.useCallback(id => {
|
|
55620
|
-
// TODO: add call
|
|
56457
|
+
// TODO: add call
|
|
55621
56458
|
console.log("DELETE", id);
|
|
55622
56459
|
fetchData();
|
|
55623
56460
|
}, [fetchData]);
|
|
@@ -55706,7 +56543,10 @@ function Edit({
|
|
|
55706
56543
|
addUser: addUser,
|
|
55707
56544
|
goTo: goTo,
|
|
55708
56545
|
accountStatuses: accountStatuses,
|
|
55709
|
-
transferAdmin: transferAdmin
|
|
56546
|
+
transferAdmin: transferAdmin,
|
|
56547
|
+
inviteCompanyAccount: inviteCompanyAccount,
|
|
56548
|
+
companyId: data.id,
|
|
56549
|
+
handleError: handleError
|
|
55710
56550
|
});
|
|
55711
56551
|
}
|
|
55712
56552
|
const getValue = () => {
|
|
@@ -55745,6 +56585,7 @@ function Edit({
|
|
|
55745
56585
|
})
|
|
55746
56586
|
}, item.key);
|
|
55747
56587
|
};
|
|
56588
|
+
console.log(conf, "data");
|
|
55748
56589
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
55749
56590
|
className: "form-edit flex-row",
|
|
55750
56591
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Form, {
|
|
@@ -55801,7 +56642,8 @@ NotFound.propTypes = {
|
|
|
55801
56642
|
errorCode: PropTypes__default["default"].oneOf([404, 403, 500])
|
|
55802
56643
|
};
|
|
55803
56644
|
|
|
55804
|
-
const _excluded = ["accountType"]
|
|
56645
|
+
const _excluded = ["accountType"],
|
|
56646
|
+
_excluded2 = ["pendingCompanyId", "status"];
|
|
55805
56647
|
function withFormsProvider(Component) {
|
|
55806
56648
|
return function WrappedWithFormsProvider(props) {
|
|
55807
56649
|
return /*#__PURE__*/jsxRuntime.jsx(FormsProvider, {
|
|
@@ -55828,7 +56670,8 @@ function AdminView(_ref) {
|
|
|
55828
56670
|
updateAccount,
|
|
55829
56671
|
handleError,
|
|
55830
56672
|
toggleAccountStatus,
|
|
55831
|
-
transferAdmin
|
|
56673
|
+
transferAdmin,
|
|
56674
|
+
inviteCompanyAccount
|
|
55832
56675
|
} = _ref;
|
|
55833
56676
|
const conf = React.useMemo(() => config$1.find(c => c.key === group), [group]);
|
|
55834
56677
|
const [loading, setLoading] = React.useState(false);
|
|
@@ -55845,7 +56688,6 @@ function AdminView(_ref) {
|
|
|
55845
56688
|
setEditData(data);
|
|
55846
56689
|
}, [data]);
|
|
55847
56690
|
const goToView = React.useCallback(() => {
|
|
55848
|
-
console.log("goToView");
|
|
55849
56691
|
changeNotificationState({
|
|
55850
56692
|
onYes: () => {
|
|
55851
56693
|
setEditData(data);
|
|
@@ -55853,7 +56695,7 @@ function AdminView(_ref) {
|
|
|
55853
56695
|
goTo("/app/accounts/view/".concat(id, "/").concat(group));
|
|
55854
56696
|
}
|
|
55855
56697
|
});
|
|
55856
|
-
}, [goTo, changeNotificationState, data]);
|
|
56698
|
+
}, [goTo, changeNotificationState, data, id, group]);
|
|
55857
56699
|
const breadCrumbs = React.useMemo(() => {
|
|
55858
56700
|
return renderBreadCrumbs({
|
|
55859
56701
|
view: "accounts",
|
|
@@ -55890,9 +56732,9 @@ function AdminView(_ref) {
|
|
|
55890
56732
|
setIsChanged(false);
|
|
55891
56733
|
setLoading(false);
|
|
55892
56734
|
} catch (err) {
|
|
55893
|
-
|
|
56735
|
+
handleError === null || handleError === void 0 || handleError(err);
|
|
55894
56736
|
}
|
|
55895
|
-
}, [id]);
|
|
56737
|
+
}, [id, getAccountData, module, handleError]);
|
|
55896
56738
|
React.useEffect(() => {
|
|
55897
56739
|
fetchData();
|
|
55898
56740
|
}, [fetchData]);
|
|
@@ -55919,9 +56761,18 @@ function AdminView(_ref) {
|
|
|
55919
56761
|
} = _data,
|
|
55920
56762
|
rest = _objectWithoutProperties(_data, _excluded);
|
|
55921
56763
|
const _accountType = accountType || editData.accountType;
|
|
56764
|
+
const allUsers = (editData === null || editData === void 0 ? void 0 : editData.users) || [];
|
|
56765
|
+
const existingUsers = allUsers.filter(u => !u.pendingCompanyId);
|
|
56766
|
+
const pendingUsers = allUsers.filter(u => u.pendingCompanyId);
|
|
56767
|
+
console.log('Save operation:', {
|
|
56768
|
+
totalUsers: allUsers.length,
|
|
56769
|
+
existingUsers: existingUsers.length,
|
|
56770
|
+
pendingUsers: pendingUsers.length,
|
|
56771
|
+
accountId: editData.id
|
|
56772
|
+
});
|
|
55922
56773
|
const newData = _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
55923
|
-
users:
|
|
55924
|
-
status: "active"
|
|
56774
|
+
users: existingUsers.map(v => _objectSpread2(_objectSpread2({}, v), {}, {
|
|
56775
|
+
status: v.status === "unsaved" ? "active" : v.status
|
|
55925
56776
|
})),
|
|
55926
56777
|
apps: editData === null || editData === void 0 || (_editData$apps = editData.apps) === null || _editData$apps === void 0 ? void 0 : _editData$apps.map(a => {
|
|
55927
56778
|
if (a.app === module) {
|
|
@@ -55937,6 +56788,34 @@ function AdminView(_ref) {
|
|
|
55937
56788
|
id: editData.id,
|
|
55938
56789
|
data: newData
|
|
55939
56790
|
});
|
|
56791
|
+
console.log('Checking for pending users...', {
|
|
56792
|
+
hasPendingUsers: pendingUsers.length > 0,
|
|
56793
|
+
hasInviteFunction: !!inviteCompanyAccount,
|
|
56794
|
+
pendingUsers: pendingUsers
|
|
56795
|
+
});
|
|
56796
|
+
if (pendingUsers.length > 0 && inviteCompanyAccount) {
|
|
56797
|
+
console.log('Inviting pending users:', pendingUsers.length);
|
|
56798
|
+
for (const user of pendingUsers) {
|
|
56799
|
+
try {
|
|
56800
|
+
const {
|
|
56801
|
+
pendingCompanyId,
|
|
56802
|
+
status
|
|
56803
|
+
} = user,
|
|
56804
|
+
userDataToInvite = _objectWithoutProperties(user, _excluded2);
|
|
56805
|
+
console.log('Sending invitation for:', user.email, userDataToInvite);
|
|
56806
|
+
await inviteCompanyAccount({
|
|
56807
|
+
companyId: editData.id,
|
|
56808
|
+
data: _objectSpread2(_objectSpread2({}, userDataToInvite), {}, {
|
|
56809
|
+
pendingCompanyId
|
|
56810
|
+
})
|
|
56811
|
+
});
|
|
56812
|
+
console.log('Invitation sent successfully for:', user.email);
|
|
56813
|
+
} catch (inviteError) {
|
|
56814
|
+
console.error('Failed to invite user:', user.email, inviteError);
|
|
56815
|
+
handleError(inviteError);
|
|
56816
|
+
}
|
|
56817
|
+
}
|
|
56818
|
+
}
|
|
55940
56819
|
await fetchData();
|
|
55941
56820
|
antd.message.success(t("Information saved successfully"));
|
|
55942
56821
|
setNotificationMode(NOTIFICATION_MODE.EMPTY);
|
|
@@ -55952,7 +56831,7 @@ function AdminView(_ref) {
|
|
|
55952
56831
|
icon: "Close",
|
|
55953
56832
|
onClick: goToView
|
|
55954
56833
|
}];
|
|
55955
|
-
}, [t, mode, MainForm, goToView, isChanged, editData, fetchData]);
|
|
56834
|
+
}, [t, mode, MainForm, goToView, isChanged, editData, fetchData, updateAccount, handleError, setNotificationMode, module, inviteCompanyAccount]);
|
|
55956
56835
|
if (!conf) {
|
|
55957
56836
|
return /*#__PURE__*/jsxRuntime.jsx(NotFound, {});
|
|
55958
56837
|
}
|
|
@@ -55989,7 +56868,8 @@ function AdminView(_ref) {
|
|
|
55989
56868
|
data: editData,
|
|
55990
56869
|
accountStatuses: accountStatuses,
|
|
55991
56870
|
module: module,
|
|
55992
|
-
transferAdmin: transferAdmin
|
|
56871
|
+
transferAdmin: transferAdmin,
|
|
56872
|
+
inviteCompanyAccount: inviteCompanyAccount
|
|
55993
56873
|
}) : /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
55994
56874
|
userRoles: userRoles,
|
|
55995
56875
|
formOptions: formOptions,
|
|
@@ -56026,9 +56906,9 @@ function AdminDashboardScreen({
|
|
|
56026
56906
|
fetchUserGrowth,
|
|
56027
56907
|
userGrowthDataLoading
|
|
56028
56908
|
} = useWidgetFetch();
|
|
56029
|
-
|
|
56030
|
-
|
|
56031
|
-
|
|
56909
|
+
|
|
56910
|
+
// console.log({userGrowthData});
|
|
56911
|
+
|
|
56032
56912
|
const actionsWidgetsConfig = React.useMemo(() => getActionWidgetsConfig({
|
|
56033
56913
|
getRedirectLink
|
|
56034
56914
|
}), [getRedirectLink, getActionWidgetsConfig]);
|
|
@@ -56039,6 +56919,7 @@ function AdminDashboardScreen({
|
|
|
56039
56919
|
const safeUserActivity = Array.isArray(data?.data?.userActivity) ? data.data.userActivity : [];
|
|
56040
56920
|
const safeTopContributors = Array.isArray(data?.topContributors) ? data.topContributors : [];
|
|
56041
56921
|
const safeUserGrowth = Array.isArray(data?.userGrowthData) ? data.userGrowthData : [];
|
|
56922
|
+
console.log("safeUserGrowth", safeUserGrowth);
|
|
56042
56923
|
return /*#__PURE__*/jsxRuntime.jsx(AdminDashboard, {
|
|
56043
56924
|
t: t,
|
|
56044
56925
|
goTo: goTo,
|
|
@@ -56161,17 +57042,14 @@ function AdminAccountsScreen({
|
|
|
56161
57042
|
AdminService,
|
|
56162
57043
|
options,
|
|
56163
57044
|
useQuery,
|
|
56164
|
-
NewAccountModal
|
|
57045
|
+
NewAccountModal
|
|
56165
57046
|
} = config;
|
|
56166
|
-
|
|
56167
|
-
// Use provided modal or fallback to DAF's default
|
|
56168
57047
|
const AccountModal = NewAccountModal || NewAccount;
|
|
56169
57048
|
const query = useQuery ? useQuery() : {
|
|
56170
57049
|
get: () => null
|
|
56171
57050
|
};
|
|
56172
57051
|
const [addAccountVisible, setAddAccountVisible] = React.useState(!!query.get("create"));
|
|
56173
57052
|
const onResendInvitation = React.useCallback(() => {
|
|
56174
|
-
// TODO: implement in calling app if needed
|
|
56175
57053
|
antd.message.success(t("Invitation email resent"));
|
|
56176
57054
|
}, [t]);
|
|
56177
57055
|
const onCopyInvitation = React.useCallback(() => {
|
|
@@ -56217,9 +57095,7 @@ function AdminAccountsScreen({
|
|
|
56217
57095
|
isOpen: addAccountVisible,
|
|
56218
57096
|
onClose: () => setAddAccountVisible(false),
|
|
56219
57097
|
accountTypes: accountTypes,
|
|
56220
|
-
fetchData: () => {
|
|
56221
|
-
// Refresh table data - handled by AccountTable internally
|
|
56222
|
-
},
|
|
57098
|
+
fetchData: () => {},
|
|
56223
57099
|
inviteAccount: data => AdminService.inviteAccount(data)
|
|
56224
57100
|
})]
|
|
56225
57101
|
});
|
|
@@ -56246,7 +57122,8 @@ function AdminAccountsViewScreen({
|
|
|
56246
57122
|
updateAccount,
|
|
56247
57123
|
handleError,
|
|
56248
57124
|
toggleAccountStatus,
|
|
56249
|
-
transferAdmin
|
|
57125
|
+
transferAdmin,
|
|
57126
|
+
inviteCompanyAccount
|
|
56250
57127
|
} = config;
|
|
56251
57128
|
return /*#__PURE__*/jsxRuntime.jsx(AdminView$1, {
|
|
56252
57129
|
t: t,
|
|
@@ -56266,7 +57143,8 @@ function AdminAccountsViewScreen({
|
|
|
56266
57143
|
updateAccount: updateAccount,
|
|
56267
57144
|
handleError: handleError,
|
|
56268
57145
|
toggleAccountStatus: toggleAccountStatus,
|
|
56269
|
-
transferAdmin: transferAdmin
|
|
57146
|
+
transferAdmin: transferAdmin,
|
|
57147
|
+
inviteCompanyAccount: inviteCompanyAccount
|
|
56270
57148
|
});
|
|
56271
57149
|
}
|
|
56272
57150
|
|
|
@@ -56289,12 +57167,16 @@ function AdminSubjectsScreen({
|
|
|
56289
57167
|
headerTitle = "subjects",
|
|
56290
57168
|
breadcrumbs,
|
|
56291
57169
|
refetchTrigger,
|
|
56292
|
-
getData
|
|
57170
|
+
getData,
|
|
57171
|
+
user
|
|
56293
57172
|
} = config;
|
|
56294
57173
|
const handleMergeSubjects = React.useCallback(async mergeData => {
|
|
56295
57174
|
try {
|
|
56296
57175
|
if (AdminService.mergeSubjects) {
|
|
56297
|
-
await AdminService.mergeSubjects(
|
|
57176
|
+
await AdminService.mergeSubjects({
|
|
57177
|
+
subject: 'stakeholder',
|
|
57178
|
+
...mergeData
|
|
57179
|
+
});
|
|
56298
57180
|
antd.message.success(t("Subjects merged successfully"));
|
|
56299
57181
|
} else {
|
|
56300
57182
|
console.warn("AdminService.mergeSubjects is not implemented");
|
|
@@ -56304,13 +57186,14 @@ function AdminSubjectsScreen({
|
|
|
56304
57186
|
handleError?.(err);
|
|
56305
57187
|
}
|
|
56306
57188
|
}, [AdminService, t, handleError]);
|
|
56307
|
-
|
|
56308
|
-
// Use custom getData if provided, otherwise use default AdminService.getSubjects
|
|
56309
57189
|
const getSubjects = React.useCallback(params => {
|
|
56310
57190
|
if (getData) {
|
|
56311
57191
|
return getData(params);
|
|
56312
57192
|
}
|
|
56313
|
-
return AdminService.getSubjects(
|
|
57193
|
+
return AdminService.getSubjects({
|
|
57194
|
+
subject: 'stakeholder',
|
|
57195
|
+
params
|
|
57196
|
+
});
|
|
56314
57197
|
}, [getData, AdminService]);
|
|
56315
57198
|
return /*#__PURE__*/jsxRuntime.jsx(SubjectsTable, {
|
|
56316
57199
|
t: t,
|
|
@@ -56331,7 +57214,9 @@ function AdminSubjectsScreen({
|
|
|
56331
57214
|
category: options?.category,
|
|
56332
57215
|
countries: options?.countries
|
|
56333
57216
|
}
|
|
56334
|
-
}
|
|
57217
|
+
},
|
|
57218
|
+
user: user,
|
|
57219
|
+
options: options
|
|
56335
57220
|
});
|
|
56336
57221
|
}
|
|
56337
57222
|
|
|
@@ -56354,28 +57239,33 @@ function AdminLocationScreen({
|
|
|
56354
57239
|
headerTitle = "location",
|
|
56355
57240
|
breadcrumbs,
|
|
56356
57241
|
refetchTrigger,
|
|
56357
|
-
getData
|
|
57242
|
+
getData,
|
|
57243
|
+
user
|
|
56358
57244
|
} = config;
|
|
56359
57245
|
const handleMergeLocations = React.useCallback(async mergeData => {
|
|
56360
57246
|
try {
|
|
56361
57247
|
if (AdminService.mergeLocations) {
|
|
56362
|
-
await AdminService.mergeLocations(
|
|
57248
|
+
await AdminService.mergeLocations({
|
|
57249
|
+
subject: 'location',
|
|
57250
|
+
...mergeData
|
|
57251
|
+
});
|
|
56363
57252
|
antd.message.success(t("Locations merged successfully"));
|
|
56364
57253
|
} else {
|
|
56365
57254
|
console.warn("AdminService.mergeLocations is not implemented");
|
|
56366
|
-
antd.message.
|
|
57255
|
+
antd.message.error(t("Locations not merged"));
|
|
56367
57256
|
}
|
|
56368
57257
|
} catch (err) {
|
|
56369
57258
|
handleError?.(err);
|
|
56370
57259
|
}
|
|
56371
57260
|
}, [AdminService, t, handleError]);
|
|
56372
|
-
|
|
56373
|
-
// Use custom getData if provided, otherwise use default AdminService.getLocations
|
|
56374
|
-
const getLocations = React.useCallback(params => {
|
|
57261
|
+
const getSubjects = React.useCallback(params => {
|
|
56375
57262
|
if (getData) {
|
|
56376
57263
|
return getData(params);
|
|
56377
57264
|
}
|
|
56378
|
-
return AdminService.
|
|
57265
|
+
return AdminService.getSubjects({
|
|
57266
|
+
subject: 'location',
|
|
57267
|
+
params
|
|
57268
|
+
});
|
|
56379
57269
|
}, [getData, AdminService]);
|
|
56380
57270
|
return /*#__PURE__*/jsxRuntime.jsx(LocationTable, {
|
|
56381
57271
|
t: t,
|
|
@@ -56384,19 +57274,21 @@ function AdminLocationScreen({
|
|
|
56384
57274
|
location: location,
|
|
56385
57275
|
module: module,
|
|
56386
57276
|
headerTitle: headerTitle,
|
|
56387
|
-
getData:
|
|
57277
|
+
getData: getSubjects,
|
|
56388
57278
|
isMobile: isMobile,
|
|
56389
57279
|
defaultPageSize: defaultPageSize,
|
|
56390
57280
|
view: view,
|
|
56391
57281
|
breadcrumbs: breadcrumbs,
|
|
56392
|
-
|
|
57282
|
+
mergeLocationsFunction: handleMergeLocations,
|
|
56393
57283
|
refetchTrigger: refetchTrigger,
|
|
56394
57284
|
config: {
|
|
56395
57285
|
options: {
|
|
56396
57286
|
category: options?.category,
|
|
56397
57287
|
countries: options?.countries
|
|
56398
57288
|
}
|
|
56399
|
-
}
|
|
57289
|
+
},
|
|
57290
|
+
user: user,
|
|
57291
|
+
options: options
|
|
56400
57292
|
});
|
|
56401
57293
|
}
|
|
56402
57294
|
|
|
@@ -56409,6 +57301,8 @@ function getAdminRoutes(config) {
|
|
|
56409
57301
|
useAdminAccountsViewConfig,
|
|
56410
57302
|
useAdminSubjectsConfig,
|
|
56411
57303
|
useAdminLocationConfig,
|
|
57304
|
+
useAdminSubjectsViewConfig,
|
|
57305
|
+
useAdminLocationViewConfig,
|
|
56412
57306
|
userIsAdmin
|
|
56413
57307
|
} = config;
|
|
56414
57308
|
const APP_PREFIX = "APP_".concat(appName.toUpperCase());
|
|
@@ -56480,13 +57374,13 @@ function getAdminRoutes(config) {
|
|
|
56480
57374
|
visible: user => userIsAdmin(user),
|
|
56481
57375
|
component: subjectsIndexComponent
|
|
56482
57376
|
}, ...(typeof useAdminLocationConfig === "function" ? [{
|
|
56483
|
-
path: "subjects/location",
|
|
57377
|
+
path: "management/subjects/location",
|
|
56484
57378
|
key: "".concat(APP_PREFIX, "_ADMIN_SUBJECTS_LOCATIONS"),
|
|
56485
57379
|
exact: true,
|
|
56486
57380
|
visible: user => userIsAdmin(user),
|
|
56487
57381
|
component: /*#__PURE__*/jsxRuntime.jsx(LocationWrapper, {})
|
|
56488
57382
|
}] : []), ...(typeof useAdminSubjectsConfig === "function" ? [{
|
|
56489
|
-
path: "subjects/stakeholder",
|
|
57383
|
+
path: "management/subjects/stakeholder",
|
|
56490
57384
|
key: "".concat(APP_PREFIX, "_ADMIN_SUBJECTS_STAKEHOLDERS"),
|
|
56491
57385
|
exact: true,
|
|
56492
57386
|
visible: user => userIsAdmin(user),
|
|
@@ -62755,6 +63649,7 @@ exports.AdminUsersScreen = AdminUsersScreen;
|
|
|
62755
63649
|
exports.AdminView = AdminView$1;
|
|
62756
63650
|
exports.AjaxSelect = AjaxSelectMain;
|
|
62757
63651
|
exports.Animated = Animated;
|
|
63652
|
+
exports.AppInvitation = AppInvitation;
|
|
62758
63653
|
exports.Applications = Applications;
|
|
62759
63654
|
exports.AreaChart = AreaChart;
|
|
62760
63655
|
exports.AuthForm = AuthForm;
|