@undp/carbon-library 1.0.274-CARBON-338.0 → 1.0.274-CARBON-363.19
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/cjs/index.js +766 -540
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/Components/Common/AntComponents/antTableComponents.d.ts +9 -6
- package/dist/cjs/types/Definitions/Definitions/ndcDetails.definitions.d.ts +42 -0
- package/dist/esm/index.js +768 -542
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Components/Common/AntComponents/antTableComponents.d.ts +9 -6
- package/dist/esm/types/Definitions/Definitions/ndcDetails.definitions.d.ts +42 -0
- package/dist/locales/i18n/ndc/en.json +24 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
@@ -2047,7 +2047,7 @@ exports.NdcActionStatus = void 0;
|
|
2047
2047
|
NdcActionStatus["PENDING"] = "Pending";
|
2048
2048
|
NdcActionStatus["APPROVED"] = "Approved";
|
2049
2049
|
})(exports.NdcActionStatus || (exports.NdcActionStatus = {}));
|
2050
|
-
var getNdcActionStatusEnumVal = function (value) {
|
2050
|
+
var getNdcActionStatusEnumVal$1 = function (value) {
|
2051
2051
|
var index = Object.keys(exports.NdcActionStatus).indexOf(value);
|
2052
2052
|
if (index < 0) {
|
2053
2053
|
return value;
|
@@ -2055,7 +2055,7 @@ var getNdcActionStatusEnumVal = function (value) {
|
|
2055
2055
|
return Object.values(exports.NdcActionStatus)[index];
|
2056
2056
|
};
|
2057
2057
|
var getNdcStatusTagType = function (status) {
|
2058
|
-
switch (getNdcActionStatusEnumVal(status)) {
|
2058
|
+
switch (getNdcActionStatusEnumVal$1(status)) {
|
2059
2059
|
case exports.NdcActionStatus.PENDING:
|
2060
2060
|
return "processing";
|
2061
2061
|
case exports.NdcActionStatus.APPROVED:
|
@@ -26675,622 +26675,848 @@ var RegistryDashboardComponent = function (props) {
|
|
26675
26675
|
lastUpdateTransferLocations))))))))) : ("")));
|
26676
26676
|
};
|
26677
26677
|
|
26678
|
-
|
26679
|
-
var EditableRow = function (_a) {
|
26680
|
-
_a.index; var props = __rest(_a, ["index"]);
|
26681
|
-
var form = antd.Form.useForm()[0];
|
26682
|
-
return (React.createElement(antd.Form, { form: form, component: false },
|
26683
|
-
React.createElement(EditableContext.Provider, { value: form },
|
26684
|
-
React.createElement("tr", __assign({}, props)))));
|
26685
|
-
};
|
26678
|
+
React.createContext(null);
|
26686
26679
|
var EditableCell = function (_a) {
|
26687
|
-
var
|
26688
|
-
|
26689
|
-
|
26690
|
-
|
26691
|
-
|
26692
|
-
|
26693
|
-
|
26694
|
-
|
26695
|
-
|
26696
|
-
|
26697
|
-
|
26698
|
-
|
26699
|
-
|
26700
|
-
|
26701
|
-
|
26702
|
-
|
26703
|
-
|
26704
|
-
|
26705
|
-
|
26706
|
-
|
26707
|
-
|
26708
|
-
|
26709
|
-
|
26710
|
-
|
26711
|
-
|
26712
|
-
|
26713
|
-
|
26714
|
-
|
26715
|
-
|
26716
|
-
|
26717
|
-
|
26718
|
-
|
26719
|
-
|
26720
|
-
|
26721
|
-
|
26722
|
-
|
26723
|
-
|
26724
|
-
|
26725
|
-
required: true,
|
26726
|
-
message: "".concat(title, " is required."),
|
26727
|
-
},
|
26728
|
-
] },
|
26729
|
-
React.createElement(antd.Input, { ref: inputRef, onPressEnter: save, onBlur: save }))) : (React.createElement("div", { className: "editable-cell-value-wrap", style: { paddingRight: 24, minWidth: "100px", minHeight: "20px" }, onClick: toggleEdit }, children));
|
26730
|
-
}
|
26731
|
-
return React.createElement("td", __assign({}, restProps), childNode);
|
26680
|
+
var editing = _a.editing, dataIndex = _a.dataIndex, title = _a.title; _a.inputType; var record = _a.record; _a.index; var children = _a.children, onBlurHandler = _a.onBlurHandler, t = _a.t, restProps = __rest(_a, ["editing", "dataIndex", "title", "inputType", "record", "index", "children", "onBlurHandler", "t"]);
|
26681
|
+
return (React.createElement("td", __assign({}, restProps), editing && dataIndex === "nationalPlanObjective" ? (React.createElement(antd.Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [
|
26682
|
+
{
|
26683
|
+
validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
|
26684
|
+
var trimValue;
|
26685
|
+
return __generator(this, function (_a) {
|
26686
|
+
trimValue = typeof value === "string" ? value.trim() : value;
|
26687
|
+
if (!trimValue) {
|
26688
|
+
throw new Error("".concat(title, " ").concat(t("ndc:isRequired")));
|
26689
|
+
}
|
26690
|
+
return [2 /*return*/];
|
26691
|
+
});
|
26692
|
+
}); },
|
26693
|
+
},
|
26694
|
+
] },
|
26695
|
+
React.createElement(antd.Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:nationalPlanObjectivePlaceHolder") }))) : editing && dataIndex === "kpi" ? (React.createElement(antd.Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [
|
26696
|
+
{
|
26697
|
+
validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
|
26698
|
+
var trimValue;
|
26699
|
+
return __generator(this, function (_a) {
|
26700
|
+
trimValue = typeof value === "string" ? value.trim() : value;
|
26701
|
+
if (trimValue) {
|
26702
|
+
if (isNaN(+trimValue)) {
|
26703
|
+
throw new Error(t("ndc:kpiInvalidFormat"));
|
26704
|
+
}
|
26705
|
+
else if (+trimValue === 0) {
|
26706
|
+
throw new Error(t("ndc:kpiGreaterThanZero"));
|
26707
|
+
}
|
26708
|
+
}
|
26709
|
+
else {
|
26710
|
+
throw new Error("".concat(title, " ").concat(t("ndc:isRequired")));
|
26711
|
+
}
|
26712
|
+
return [2 /*return*/];
|
26713
|
+
});
|
26714
|
+
}); },
|
26715
|
+
},
|
26716
|
+
] },
|
26717
|
+
React.createElement(antd.Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:kpiPlaceHolder") }))) : (children)));
|
26732
26718
|
};
|
26733
26719
|
|
26734
|
-
var css_248z$4 = ".ndc-steps-actions {\n display: flex;\n flex-direction: row-reverse;\n margin-right: 1rem;\n justify-content: center; }\n .ndc-steps-actions .action-btn {\n border: 1px solid #16b1ff;\n color: #16b1ff;\n margin-right: 1rem; }\n .ndc-steps-actions .back-btn {\n border: 1px solid rgba(140, 140, 140, 0.7);\n color: rgba(140, 140, 140, 0.7);\n margin-right: 1rem; }\n .ndc-steps-actions .mg-left-1 {\n margin-left: 1rem; }\n";
|
26720
|
+
var css_248z$4 = ".ndc-steps-actions {\n display: flex;\n flex-direction: row-reverse;\n margin-right: 1rem;\n justify-content: center; }\n .ndc-steps-actions .action-btn {\n border: 1px solid #16b1ff;\n color: #16b1ff;\n margin-right: 1rem; }\n .ndc-steps-actions .back-btn {\n border: 1px solid rgba(140, 140, 140, 0.7);\n color: rgba(140, 140, 140, 0.7);\n margin-right: 1rem; }\n .ndc-steps-actions .mg-left-1 {\n margin-left: 1rem; }\n\n.ndc-details .ant-input-number-input-wrap {\n margin-right: 10px; }\n\n.ndc-details tbody {\n vertical-align: top; }\n\n.ndc-details td .ant-space-item {\n margin-top: 5px; }\n\n.ndc-details .btn-danger {\n color: #ff4d4f !important;\n border-color: #ff8183 !important; }\n\n.ndc-details .btnAddNewMainAct {\n margin-bottom: 16;\n width: 100%;\n height: 45px;\n border-radius: 10px;\n border: 1px solid rgba(58, 53, 65, 0.5);\n background: #FFF;\n color: #16b1ff;\n text-align: center;\n font-family: Inter;\n font-size: 16px;\n font-style: normal;\n font-weight: 500; }\n\n.ndc-details .btnAddNewMainAct:disabled {\n color: rgba(0, 0, 0, 0.25);\n border-color: #d9d9d9;\n background: #f5f5f5;\n text-shadow: none;\n box-shadow: none; }\n";
|
26735
26721
|
styleInject(css_248z$4);
|
26736
26722
|
|
26737
|
-
var
|
26738
|
-
(function (
|
26739
|
-
|
26740
|
-
|
26741
|
-
})(
|
26723
|
+
var NdcDetailsActionType;
|
26724
|
+
(function (NdcDetailsActionType) {
|
26725
|
+
NdcDetailsActionType["MainAction"] = "MainAction";
|
26726
|
+
NdcDetailsActionType["SubAction"] = "SubAction";
|
26727
|
+
})(NdcDetailsActionType || (NdcDetailsActionType = {}));
|
26728
|
+
var NdcDetailsActionStatus;
|
26729
|
+
(function (NdcDetailsActionStatus) {
|
26730
|
+
NdcDetailsActionStatus["New"] = "New";
|
26731
|
+
NdcDetailsActionStatus["Pending"] = "Pending";
|
26732
|
+
NdcDetailsActionStatus["Approved"] = "Approved";
|
26733
|
+
NdcDetailsActionStatus["Rejected"] = "Rejected";
|
26734
|
+
})(NdcDetailsActionStatus || (NdcDetailsActionStatus = {}));
|
26735
|
+
var getNdcActionStatusEnumVal = function (value) {
|
26736
|
+
var index = Object.keys(NdcDetailsActionStatus).indexOf(value);
|
26737
|
+
if (index < 0) {
|
26738
|
+
return value;
|
26739
|
+
}
|
26740
|
+
return Object.values(NdcDetailsActionStatus)[index];
|
26741
|
+
};
|
26742
|
+
var getNdcActionStatusTagType = function (status) {
|
26743
|
+
switch (getNdcActionStatusEnumVal(status)) {
|
26744
|
+
case NdcDetailsActionStatus.Rejected:
|
26745
|
+
return "error";
|
26746
|
+
case NdcDetailsActionStatus.Pending:
|
26747
|
+
return "processing";
|
26748
|
+
case NdcDetailsActionStatus.Approved:
|
26749
|
+
return "success";
|
26750
|
+
default:
|
26751
|
+
return "default";
|
26752
|
+
}
|
26753
|
+
};
|
26754
|
+
|
26742
26755
|
var NdcDetailsComponent = function (props) {
|
26743
|
-
var t = props.t
|
26756
|
+
var t = props.t, useConnection = props.useConnection, useUserContext = props.useUserContext;
|
26744
26757
|
var RangePicker = antd.DatePicker.RangePicker;
|
26745
|
-
var _a = React.useState([]),
|
26746
|
-
var _b = React.useState(false), loading = _b[0]
|
26747
|
-
var periodItemsRef = React.useRef([]);
|
26758
|
+
var _a = React.useState([]), ndcActionsList = _a[0], setNdcActionsList = _a[1];
|
26759
|
+
var _b = React.useState(false), loading = _b[0], setLoading = _b[1];
|
26748
26760
|
var _c = React.useState([]), periodItems = _c[0], setPeriodItems = _c[1];
|
26749
|
-
var _d = React.useState(
|
26750
|
-
var
|
26751
|
-
var addedNdcDetailId = React.useRef(0);
|
26752
|
-
var selectedNdcDetail = React.useRef({});
|
26761
|
+
var _d = React.useState({}), selectedPeriod = _d[0], setSelectedPeriod = _d[1];
|
26762
|
+
var selectedDateRangeRef = React.useRef({});
|
26753
26763
|
var _e = React.useState(0), tableKey = _e[0], setTableKey = _e[1];
|
26764
|
+
var _f = useConnection(), get = _f.get, post = _f.post, put = _f.put;
|
26765
|
+
var _g = React.useState([]), ministryOrgList = _g[0], setMinistryOrgList = _g[1];
|
26766
|
+
var _h = React.useState({}), actionInfo = _h[0], setActionInfo = _h[1];
|
26767
|
+
var _j = React.useState(false), openConfirmationModal = _j[0], setOpenConfirmationModal = _j[1];
|
26768
|
+
var form = antd.Form.useForm()[0];
|
26769
|
+
var _k = React.useState(null), editingKey = _k[0], setEditingKey = _k[1];
|
26770
|
+
var _l = React.useState(0), nextAvailableActionId = _l[0], setNextAvailableActionId = _l[1];
|
26771
|
+
var _m = React.useState([]), expandedRowKeys = _m[0], setExpandedRowKeys = _m[1];
|
26772
|
+
var _o = React.useState([]), subNdcActionsForPeriod = _o[0], setSubNdcActionsForPeriod = _o[1];
|
26773
|
+
var _p = React.useState(1), currentPage = _p[0], setCurrentPage = _p[1];
|
26774
|
+
var _q = React.useState(10), pageSize = _q[0], setPageSize = _q[1];
|
26775
|
+
var isEditing = function (record) { return record.id === editingKey; };
|
26776
|
+
var isMainActionInEditMode = function () {
|
26777
|
+
if (editingKey) {
|
26778
|
+
var action = ndcActionsList.find(function (item) { return item.id === editingKey; });
|
26779
|
+
if (action && action.actionType === NdcDetailsActionType.MainAction) {
|
26780
|
+
return true;
|
26781
|
+
}
|
26782
|
+
}
|
26783
|
+
return false;
|
26784
|
+
};
|
26754
26785
|
var userInfoState = useUserContext().userInfoState;
|
26755
|
-
|
26756
|
-
|
26757
|
-
|
26786
|
+
React.useEffect(function () {
|
26787
|
+
if (expandedRowKeys && expandedRowKeys.length > 0) {
|
26788
|
+
var expandedKey = expandedRowKeys[0];
|
26789
|
+
setNdcSubActionsForMainAction(expandedKey);
|
26790
|
+
}
|
26791
|
+
}, ndcActionsList);
|
26792
|
+
var loginMinistry = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT
|
26793
|
+
? process.env.REACT_APP_GOVERNMENT_MINISTRY
|
26794
|
+
? process.env.REACT_APP_GOVERNMENT_MINISTRY
|
26795
|
+
: "Ministry Of Environment"
|
26796
|
+
: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY
|
26797
|
+
? userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyName
|
26798
|
+
: undefined;
|
26799
|
+
var isGovernmentUser = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT &&
|
26800
|
+
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly;
|
26801
|
+
var isMainNdcActionsEditable = !selectedPeriod.finalized &&
|
26802
|
+
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT &&
|
26803
|
+
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly;
|
26804
|
+
var isSubNdcActionsEditable = function (record) {
|
26805
|
+
return (!selectedPeriod.finalized &&
|
26806
|
+
record.status !== NdcDetailsActionStatus.Approved &&
|
26807
|
+
((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT ||
|
26808
|
+
((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY &&
|
26809
|
+
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyName) === record.ministryName)) &&
|
26758
26810
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly);
|
26759
26811
|
};
|
26760
|
-
var
|
26761
|
-
return (
|
26812
|
+
var checkSubNdcActionCreatePermission = function () {
|
26813
|
+
return (!selectedPeriod.finalized &&
|
26814
|
+
((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT ||
|
26815
|
+
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY) &&
|
26762
26816
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly);
|
26763
26817
|
};
|
26818
|
+
var isNdcActionEditable = function (record) {
|
26819
|
+
if (record.actionType === NdcDetailsActionType.MainAction) {
|
26820
|
+
return isMainNdcActionsEditable;
|
26821
|
+
}
|
26822
|
+
else if (record.actionType === NdcDetailsActionType.SubAction) {
|
26823
|
+
return isSubNdcActionsEditable(record);
|
26824
|
+
}
|
26825
|
+
};
|
26826
|
+
var ndcMainDetailsForPeriod = selectedPeriod.key !== "add_new"
|
26827
|
+
? ndcActionsList.filter(function (ndcDetail) {
|
26828
|
+
return (ndcDetail.periodId === parseInt(selectedPeriod.key) &&
|
26829
|
+
ndcDetail.actionType === NdcDetailsActionType.MainAction);
|
26830
|
+
})
|
26831
|
+
: [];
|
26832
|
+
var setNdcSubActionsForMainAction = function (mainActionId) {
|
26833
|
+
var subNdcDetails = ndcActionsList.filter(function (ndcDetail) {
|
26834
|
+
return (ndcDetail.parentActionId === mainActionId &&
|
26835
|
+
ndcDetail.actionType === NdcDetailsActionType.SubAction);
|
26836
|
+
});
|
26837
|
+
var emptySubNdcRow = {
|
26838
|
+
id: nextAvailableActionId,
|
26839
|
+
actionType: NdcDetailsActionType.SubAction,
|
26840
|
+
nationalPlanObjective: "",
|
26841
|
+
kpi: "",
|
26842
|
+
ministryName: loginMinistry,
|
26843
|
+
status: NdcDetailsActionStatus.New,
|
26844
|
+
parentActionId: mainActionId,
|
26845
|
+
};
|
26846
|
+
if (checkSubNdcActionCreatePermission()) {
|
26847
|
+
subNdcDetails = __spreadArray(__spreadArray([], subNdcDetails, true), [emptySubNdcRow], false);
|
26848
|
+
setEditingKey(nextAvailableActionId);
|
26849
|
+
setNextAvailableActionId(function (value) { return value + 1; });
|
26850
|
+
form.setFieldsValue({
|
26851
|
+
nationalPlanObjective: "",
|
26852
|
+
kpi: "",
|
26853
|
+
});
|
26854
|
+
}
|
26855
|
+
setSubNdcActionsForPeriod(subNdcDetails);
|
26856
|
+
};
|
26764
26857
|
var inRange = function (num, min, max) {
|
26765
26858
|
return num >= min && num <= max;
|
26766
26859
|
};
|
26767
|
-
function
|
26768
|
-
var
|
26769
|
-
|
26770
|
-
|
26771
|
-
|
26772
|
-
|
26773
|
-
|
26774
|
-
|
26775
|
-
|
26776
|
-
|
26777
|
-
|
26778
|
-
|
26779
|
-
|
26780
|
-
|
26781
|
-
|
26782
|
-
|
26783
|
-
|
26784
|
-
|
26785
|
-
|
26786
|
-
|
26787
|
-
|
26788
|
-
|
26789
|
-
|
26790
|
-
}
|
26791
|
-
var handleSave = function (row) {
|
26792
|
-
setNdcDetailsData(function (prevData) {
|
26793
|
-
var newData = JSON.parse(JSON.stringify(prevData));
|
26794
|
-
if (row.type === NdcActionType.main) {
|
26795
|
-
var index = newData.findIndex(function (item) { return row.key === item.key; });
|
26796
|
-
if (index !== -1) {
|
26797
|
-
newData[index] = __assign(__assign({}, newData[index]), row);
|
26798
|
-
}
|
26799
|
-
}
|
26800
|
-
else {
|
26801
|
-
var parentIndex = newData.findIndex(function (item) { return row.ndcActionId === item.key; });
|
26802
|
-
var parentItem = newData[parentIndex];
|
26803
|
-
if (parentItem) {
|
26804
|
-
if (parentItem.subNdcDetails) {
|
26805
|
-
var itemIndex = parentItem.subNdcDetails.findIndex(function (item) { return row.key === item.key; });
|
26806
|
-
if (itemIndex === -1) {
|
26807
|
-
parentItem.subNdcDetails.push(row);
|
26808
|
-
}
|
26809
|
-
else {
|
26810
|
-
parentItem.subNdcDetails[itemIndex] = __assign({}, row);
|
26811
|
-
}
|
26860
|
+
var handleSave = function (row) { return __awaiter(void 0, void 0, void 0, function () {
|
26861
|
+
var updatedFields, updatedItem, exception_2;
|
26862
|
+
return __generator(this, function (_a) {
|
26863
|
+
switch (_a.label) {
|
26864
|
+
case 0:
|
26865
|
+
_a.trys.push([0, 9, , 10]);
|
26866
|
+
updatedFields = void 0;
|
26867
|
+
_a.label = 1;
|
26868
|
+
case 1:
|
26869
|
+
_a.trys.push([1, 3, , 4]);
|
26870
|
+
return [4 /*yield*/, form.validateFields()];
|
26871
|
+
case 2:
|
26872
|
+
updatedFields = (_a.sent());
|
26873
|
+
return [3 /*break*/, 4];
|
26874
|
+
case 3:
|
26875
|
+
_a.sent();
|
26876
|
+
return [2 /*return*/];
|
26877
|
+
case 4:
|
26878
|
+
updatedItem = __assign(__assign({}, row), updatedFields);
|
26879
|
+
if (!(updatedItem.status === NdcDetailsActionStatus.New)) return [3 /*break*/, 6];
|
26880
|
+
if (isGovernmentUser &&
|
26881
|
+
updatedItem.actionType === NdcDetailsActionType.SubAction) {
|
26882
|
+
updatedItem.status = NdcDetailsActionStatus.Approved;
|
26812
26883
|
}
|
26813
26884
|
else {
|
26814
|
-
|
26885
|
+
updatedItem.status = NdcDetailsActionStatus.Pending;
|
26815
26886
|
}
|
26816
|
-
|
26817
|
-
|
26818
|
-
|
26887
|
+
return [4 /*yield*/, post("national/programme/addNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseInt(updatedItem.kpi.toString()) }))];
|
26888
|
+
case 5:
|
26889
|
+
_a.sent();
|
26890
|
+
return [3 /*break*/, 8];
|
26891
|
+
case 6:
|
26892
|
+
updatedItem.status = NdcDetailsActionStatus.Pending;
|
26893
|
+
return [4 /*yield*/, put("national/programme/updateNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseInt(updatedItem.kpi.toString()) }))];
|
26894
|
+
case 7:
|
26895
|
+
_a.sent();
|
26896
|
+
_a.label = 8;
|
26897
|
+
case 8:
|
26898
|
+
fetchNdcDetailActions();
|
26899
|
+
setEditingKey(null);
|
26900
|
+
return [3 /*break*/, 10];
|
26901
|
+
case 9:
|
26902
|
+
exception_2 = _a.sent();
|
26903
|
+
setEditingKey(null);
|
26904
|
+
antd.message.open({
|
26905
|
+
type: "error",
|
26906
|
+
content: exception_2.message,
|
26907
|
+
duration: 3,
|
26908
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
26909
|
+
});
|
26910
|
+
return [3 /*break*/, 10];
|
26911
|
+
case 10: return [2 /*return*/];
|
26819
26912
|
}
|
26820
|
-
return newData;
|
26821
26913
|
});
|
26822
|
-
};
|
26823
|
-
var
|
26824
|
-
|
26825
|
-
|
26826
|
-
|
26827
|
-
|
26828
|
-
|
26829
|
-
|
26830
|
-
|
26831
|
-
|
26832
|
-
|
26833
|
-
|
26834
|
-
|
26835
|
-
|
26836
|
-
|
26837
|
-
|
26838
|
-
|
26839
|
-
|
26840
|
-
|
26841
|
-
|
26842
|
-
|
26843
|
-
|
26844
|
-
|
26845
|
-
|
26846
|
-
|
26847
|
-
|
26914
|
+
}); };
|
26915
|
+
var actionMenu = function (record) {
|
26916
|
+
if (record.status === NdcDetailsActionStatus.Pending &&
|
26917
|
+
isGovernmentUser &&
|
26918
|
+
!selectedPeriod.finalized) {
|
26919
|
+
return (React.createElement(antd.List, { className: "action-menu", size: "small", dataSource: [
|
26920
|
+
{
|
26921
|
+
text: t("ndc:approve"),
|
26922
|
+
icon: React.createElement(Icon__namespace.BoxArrowInDown, null),
|
26923
|
+
click: function () {
|
26924
|
+
setActionInfo({
|
26925
|
+
action: "Approve",
|
26926
|
+
headerText: t("ndc:actionApproveTitle"),
|
26927
|
+
type: "primary",
|
26928
|
+
icon: React.createElement(Icon__namespace.BoxArrowInDown, null),
|
26929
|
+
recordId: record.id,
|
26930
|
+
});
|
26931
|
+
setOpenConfirmationModal(true);
|
26932
|
+
},
|
26933
|
+
},
|
26934
|
+
{
|
26935
|
+
text: t("ndc:reject"),
|
26936
|
+
icon: React.createElement(Icon__namespace.XOctagon, null),
|
26937
|
+
click: function () {
|
26938
|
+
setActionInfo({
|
26939
|
+
action: "Reject",
|
26940
|
+
headerText: t("ndc:rejectApproveTitle"),
|
26941
|
+
type: "danger",
|
26942
|
+
icon: React.createElement(Icon__namespace.XOctagon, null),
|
26943
|
+
recordId: record.id,
|
26944
|
+
});
|
26945
|
+
setOpenConfirmationModal(true);
|
26946
|
+
},
|
26947
|
+
},
|
26948
|
+
], renderItem: function (item) { return (React.createElement(antd.List.Item, { onClick: item.click },
|
26949
|
+
React.createElement(antd.Typography.Text, { className: "action-icon color-error" }, item.icon),
|
26950
|
+
React.createElement("span", null, item.text))); } }));
|
26848
26951
|
}
|
26849
26952
|
else {
|
26850
|
-
return
|
26953
|
+
return null;
|
26851
26954
|
}
|
26852
26955
|
};
|
26853
26956
|
var defaultColumns = [
|
26854
26957
|
{
|
26855
26958
|
title: t("ndc:ndcColumnsNationalPlanObj"),
|
26856
|
-
dataIndex: "
|
26857
|
-
key: "
|
26959
|
+
dataIndex: "nationalPlanObjective",
|
26960
|
+
key: "nationalPlanObjective",
|
26858
26961
|
align: "left",
|
26962
|
+
width: 400,
|
26859
26963
|
editable: true,
|
26860
|
-
|
26861
|
-
render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(antd.Space, { size: "middle" },
|
26862
|
-
React.createElement("span", null, record.nationalPlanObj))) : (React.createElement("input", { placeholder: "Please add Programmes", className: "ant-input", type: "text" })))); },
|
26964
|
+
render: function (_, record) { return (React.createElement(antd.Space, { size: "middle" }, record.nationalPlanObjective ? (React.createElement("span", null, record.nationalPlanObjective)) : (React.createElement(antd.Input, { placeholder: "Enter National Plan Objective" })))); },
|
26863
26965
|
},
|
26864
26966
|
{
|
26865
26967
|
title: t("ndc:ndcColumnsKpi"),
|
26866
26968
|
dataIndex: "kpi",
|
26867
26969
|
key: "kpi",
|
26868
26970
|
align: "left",
|
26971
|
+
width: 100,
|
26869
26972
|
editable: true,
|
26870
|
-
|
26871
|
-
render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(antd.Space, { size: "middle" },
|
26872
|
-
React.createElement("span", null, record.kpi))) : (React.createElement("input", { placeholder: "Enter Kpi", className: "ant-input", type: "text" })))); },
|
26973
|
+
render: function (_, record) { return (React.createElement(antd.Space, { size: "middle" }, record.kpi ? (React.createElement("span", null, record.kpi)) : (React.createElement(antd.Input, { placeholder: "Enter Kpi" })))); },
|
26873
26974
|
},
|
26874
26975
|
{
|
26875
|
-
title: "
|
26876
|
-
dataIndex: "
|
26877
|
-
key: "
|
26976
|
+
title: t("ndc:ndcColumnsMinistry"),
|
26977
|
+
dataIndex: "ministryName",
|
26978
|
+
key: "ministryName",
|
26878
26979
|
align: "left",
|
26879
|
-
|
26880
|
-
|
26881
|
-
render: function (_, record) { return (React.createElement(React.Fragment, null,
|
26882
|
-
React.createElement(
|
26980
|
+
width: 300,
|
26981
|
+
editable: false,
|
26982
|
+
render: function (_, record) { return (React.createElement(React.Fragment, null,
|
26983
|
+
React.createElement(antd.Select, { disabled: !(isSubNdcActionsEditable(record) && isEditing(record)), defaultValue: record.ministryName ? record.ministryName : loginMinistry, style: { width: 220 }, onChange: function (value, option) {
|
26984
|
+
record.ministryName = option.label;
|
26985
|
+
handleSave(record);
|
26986
|
+
}, options: ministryOrgList }))); },
|
26987
|
+
},
|
26988
|
+
{
|
26989
|
+
title: t("ndc:ndcColumnsStatus"),
|
26990
|
+
dataIndex: "status",
|
26991
|
+
key: "status",
|
26992
|
+
align: "left",
|
26993
|
+
width: 200,
|
26994
|
+
editable: false,
|
26995
|
+
render: function (_, record) {
|
26996
|
+
var menu = actionMenu(record);
|
26997
|
+
return (React.createElement("div", { onClick: function (event) { return event.stopPropagation(); } },
|
26998
|
+
record.actionType === NdcDetailsActionType.SubAction &&
|
26999
|
+
record.status !== NdcDetailsActionStatus.New ? (React.createElement(antd.Tooltip, { title: record.status, color: TooltipColor, key: TooltipColor },
|
27000
|
+
React.createElement(antd.Tag, { className: "clickable", color: getNdcActionStatusTagType(record.status) }, addSpaces(record.status)))) : (""),
|
27001
|
+
record.actionType === NdcDetailsActionType.SubAction && menu ? (React.createElement(antd.Popover, { placement: "bottomRight", content: menu, trigger: "click" },
|
27002
|
+
React.createElement(icons.EllipsisOutlined, { rotate: 90, style: {
|
27003
|
+
fontWeight: 600,
|
27004
|
+
fontSize: "1rem",
|
27005
|
+
cursor: "pointer",
|
27006
|
+
} }))) : (React.createElement("span", null))));
|
27007
|
+
},
|
26883
27008
|
},
|
26884
27009
|
];
|
26885
27010
|
var columns = defaultColumns.map(function (col) {
|
26886
27011
|
if (!col.editable) {
|
26887
27012
|
return col;
|
26888
27013
|
}
|
26889
|
-
return __assign(__assign({}, col), { onCell: function (record) {
|
26890
|
-
|
26891
|
-
|
26892
|
-
|
26893
|
-
|
26894
|
-
|
26895
|
-
|
27014
|
+
return __assign(__assign({}, col), { onCell: function (record) {
|
27015
|
+
return {
|
27016
|
+
record: record,
|
27017
|
+
editing: isEditing(record),
|
27018
|
+
dataIndex: col.dataIndex,
|
27019
|
+
title: col.title,
|
27020
|
+
onBlurHandler: function (record) {
|
27021
|
+
if (isEditing(record)) {
|
27022
|
+
handleSave(record);
|
27023
|
+
}
|
27024
|
+
},
|
27025
|
+
t: t,
|
27026
|
+
};
|
27027
|
+
} });
|
26896
27028
|
});
|
26897
|
-
function
|
26898
|
-
|
26899
|
-
|
26900
|
-
|
26901
|
-
|
26902
|
-
|
26903
|
-
|
26904
|
-
|
26905
|
-
|
26906
|
-
|
26907
|
-
|
26908
|
-
|
26909
|
-
|
26910
|
-
|
26911
|
-
|
26912
|
-
|
26913
|
-
|
26914
|
-
|
26915
|
-
|
26916
|
-
|
26917
|
-
|
26918
|
-
|
26919
|
-
|
26920
|
-
|
26921
|
-
|
27029
|
+
function onClickedAddNewNdcDetail() {
|
27030
|
+
return __awaiter(this, void 0, void 0, function () {
|
27031
|
+
var periodId, newData_1, lastPage;
|
27032
|
+
return __generator(this, function (_a) {
|
27033
|
+
if (selectedPeriod.key !== "add_new") {
|
27034
|
+
form.setFieldsValue({
|
27035
|
+
nationalPlanObjective: "",
|
27036
|
+
kpi: "",
|
27037
|
+
});
|
27038
|
+
periodId = parseInt(selectedPeriod.key);
|
27039
|
+
newData_1 = {
|
27040
|
+
id: nextAvailableActionId,
|
27041
|
+
actionType: NdcDetailsActionType.MainAction,
|
27042
|
+
nationalPlanObjective: "",
|
27043
|
+
kpi: "",
|
27044
|
+
ministryName: loginMinistry,
|
27045
|
+
periodId: periodId,
|
27046
|
+
status: NdcDetailsActionStatus.New,
|
27047
|
+
};
|
27048
|
+
setEditingKey(nextAvailableActionId);
|
27049
|
+
setNextAvailableActionId(function (value) { return value + 1; });
|
27050
|
+
setNdcActionsList(function (ndcActionsList) { return __spreadArray(__spreadArray([], ndcActionsList, true), [
|
27051
|
+
newData_1,
|
27052
|
+
], false); });
|
27053
|
+
setTableKey(function (key) { return key + 1; });
|
27054
|
+
if (ndcMainDetailsForPeriod.length + 1 > pageSize) {
|
27055
|
+
lastPage = Math.ceil(ndcMainDetailsForPeriod.length / pageSize);
|
27056
|
+
setCurrentPage(lastPage);
|
27057
|
+
}
|
27058
|
+
}
|
27059
|
+
return [2 /*return*/];
|
27060
|
+
});
|
27061
|
+
});
|
26922
27062
|
}
|
26923
27063
|
var components = {
|
26924
27064
|
body: {
|
26925
|
-
row: EditableRow,
|
26926
27065
|
cell: EditableCell,
|
26927
27066
|
},
|
26928
27067
|
};
|
26929
|
-
|
26930
|
-
|
26931
|
-
|
26932
|
-
|
26933
|
-
|
26934
|
-
|
26935
|
-
|
26936
|
-
|
26937
|
-
// marginBottom: 16,
|
26938
|
-
// }}
|
26939
|
-
// >
|
26940
|
-
// Add a row
|
26941
|
-
// </Button>
|
26942
|
-
// <Table
|
26943
|
-
// components={components}
|
26944
|
-
// rowClassName={() => 'editable-row'}
|
26945
|
-
// bordered
|
26946
|
-
// dataSource={ndcDetailsData}
|
26947
|
-
// columns={columns}
|
26948
|
-
// />
|
26949
|
-
// </div>
|
26950
|
-
);
|
26951
|
-
}
|
26952
|
-
var onCancelPeriod = function () { };
|
26953
|
-
var onAddNewPeriod = function () {
|
26954
|
-
if (selectedPeriod &&
|
26955
|
-
selectedPeriod.current &&
|
26956
|
-
selectedPeriod.current.start &&
|
26957
|
-
selectedPeriod.current.end) {
|
26958
|
-
var newPeriodItem_1 = {
|
26959
|
-
key: "".concat(selectedPeriod.current.start, "-").concat(selectedPeriod.current.end),
|
26960
|
-
label: "".concat(selectedPeriod.current.start, "-").concat(selectedPeriod.current.end),
|
26961
|
-
start: selectedPeriod.current.start,
|
26962
|
-
end: selectedPeriod.current.end,
|
26963
|
-
children: ndcDetailsTableContent(),
|
26964
|
-
};
|
26965
|
-
var existingIndex = periodItemsRef.current.findIndex(function (item) {
|
26966
|
-
return inRange(newPeriodItem_1.start, item.start, item.end) ||
|
26967
|
-
inRange(newPeriodItem_1.end, item.start, item.end);
|
27068
|
+
var onClickedDeletePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27069
|
+
return __generator(this, function (_a) {
|
27070
|
+
setActionInfo({
|
27071
|
+
action: "Delete",
|
27072
|
+
headerText: t("ndc:periodDeleteConfirmTitle"),
|
27073
|
+
type: "danger",
|
27074
|
+
icon: React.createElement(Icon__namespace.XCircle, null),
|
27075
|
+
recordId: selectedPeriod.key,
|
26968
27076
|
});
|
26969
|
-
|
26970
|
-
|
26971
|
-
|
27077
|
+
setOpenConfirmationModal(true);
|
27078
|
+
return [2 /*return*/];
|
27079
|
+
});
|
27080
|
+
}); };
|
27081
|
+
var onClickedFinalizePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27082
|
+
var pendingActions;
|
27083
|
+
return __generator(this, function (_a) {
|
27084
|
+
if (subNdcActionsForPeriod.length === 0) {
|
27085
|
+
antd.message.open({
|
27086
|
+
type: "error",
|
27087
|
+
content: t("ndc:finalizeNdcEmptyErrorText"),
|
27088
|
+
duration: 3,
|
27089
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27090
|
+
});
|
27091
|
+
return [2 /*return*/];
|
26972
27092
|
}
|
26973
|
-
|
27093
|
+
pendingActions = subNdcActionsForPeriod.filter(function (action) {
|
27094
|
+
return action.status === NdcDetailsActionStatus.Pending;
|
27095
|
+
});
|
27096
|
+
if (pendingActions && pendingActions.length > 0) {
|
26974
27097
|
antd.message.open({
|
26975
27098
|
type: "error",
|
26976
|
-
content: t("ndc:
|
27099
|
+
content: t("ndc:finalizeErrorText"),
|
26977
27100
|
duration: 3,
|
26978
27101
|
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
26979
27102
|
});
|
26980
27103
|
}
|
27104
|
+
else {
|
27105
|
+
setActionInfo({
|
27106
|
+
action: "Finalize",
|
27107
|
+
headerText: t("ndc:finalizeApproveTitle"),
|
27108
|
+
text: t("ndc:finalizeApproveSubTitle"),
|
27109
|
+
type: "primary",
|
27110
|
+
icon: React.createElement(Icon__namespace.Clipboard2Check, null),
|
27111
|
+
recordId: selectedPeriod.key,
|
27112
|
+
});
|
27113
|
+
setOpenConfirmationModal(true);
|
27114
|
+
}
|
27115
|
+
return [2 /*return*/];
|
27116
|
+
});
|
27117
|
+
}); };
|
27118
|
+
var onMainTableRowExpand = function (expanded, record) {
|
27119
|
+
var keys = [];
|
27120
|
+
if (expanded) {
|
27121
|
+
keys.push(record.id);
|
26981
27122
|
}
|
26982
|
-
|
26983
|
-
|
26984
|
-
if (periodItems && periodItems.length > 3) {
|
26985
|
-
setSelectedTab(periodItems[periodItems.length - 1].key);
|
26986
|
-
}
|
26987
|
-
}, [periodItems]);
|
26988
|
-
var onDateRangeChanged = function (range) {
|
26989
|
-
var period = {
|
26990
|
-
start: Number(moment(range[0]).year()),
|
26991
|
-
end: Number(moment(range[1]).year()),
|
26992
|
-
};
|
26993
|
-
selectedPeriod.current = period;
|
27123
|
+
setExpandedRowKeys(keys);
|
27124
|
+
setNdcSubActionsForMainAction(record.id);
|
26994
27125
|
};
|
26995
27126
|
function addNewPeriodContent() {
|
26996
27127
|
return (React.createElement("div", null,
|
26997
|
-
React.createElement(antd.Row,
|
26998
|
-
React.createElement(
|
26999
|
-
|
27000
|
-
React.createElement(
|
27001
|
-
React.createElement(antd.Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit"))
|
27002
|
-
React.createElement(antd.Button, { className: "back-btn", onClick: onCancelPeriod, loading: loading }, t("ndc:back"))))));
|
27003
|
-
}
|
27004
|
-
function getSubNdcActionContent(record) {
|
27005
|
-
selectedNdcDetail.current = record;
|
27006
|
-
return (React.createElement(antd.Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getSubNdcDetails(record.key), columns: columns, showHeader: false, pagination: false }));
|
27128
|
+
React.createElement(antd.Row, { justify: "start", align: "middle", gutter: [16, 16] },
|
27129
|
+
React.createElement(antd.Col, { flex: "340px" },
|
27130
|
+
React.createElement(RangePicker, { disabledDate: function (current) { return moment(current).year() < 1900; }, onChange: onDateRangeChanged, picker: "year" })),
|
27131
|
+
React.createElement(antd.Col, { flex: "auto" },
|
27132
|
+
React.createElement(antd.Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit"))))));
|
27007
27133
|
}
|
27008
|
-
var
|
27009
|
-
|
27134
|
+
var onChange = function (page, size) {
|
27135
|
+
setCurrentPage(page);
|
27136
|
+
setPageSize(size);
|
27010
27137
|
};
|
27011
|
-
|
27012
|
-
|
27013
|
-
|
27014
|
-
|
27015
|
-
|
27016
|
-
|
27017
|
-
|
27018
|
-
|
27019
|
-
|
27020
|
-
|
27021
|
-
|
27022
|
-
|
27023
|
-
|
27024
|
-
|
27025
|
-
|
27026
|
-
|
27027
|
-
|
27028
|
-
|
27029
|
-
|
27030
|
-
|
27031
|
-
|
27032
|
-
|
27033
|
-
|
27034
|
-
|
27035
|
-
|
27036
|
-
|
27037
|
-
|
27038
|
-
|
27039
|
-
|
27040
|
-
|
27041
|
-
|
27042
|
-
|
27043
|
-
|
27044
|
-
|
27045
|
-
|
27046
|
-
|
27047
|
-
|
27048
|
-
|
27049
|
-
|
27050
|
-
|
27051
|
-
|
27052
|
-
|
27053
|
-
|
27054
|
-
|
27055
|
-
|
27056
|
-
|
27057
|
-
|
27058
|
-
|
27059
|
-
|
27060
|
-
|
27061
|
-
|
27062
|
-
|
27063
|
-
],
|
27064
|
-
},
|
27065
|
-
{
|
27066
|
-
key: 12,
|
27067
|
-
type: NdcActionType.main,
|
27068
|
-
startDate: new Date("2019-03-25"),
|
27069
|
-
endDate: new Date("2019-08-25"),
|
27070
|
-
nationalPlanObj: "Other",
|
27071
|
-
kpi: 10500,
|
27072
|
-
ministry: "Ministry of Environment",
|
27073
|
-
subNdcDetails: [
|
27074
|
-
{
|
27075
|
-
key: 8,
|
27076
|
-
ndcActionId: 12,
|
27077
|
-
type: NdcActionType.sub,
|
27078
|
-
startDate: new Date("2019-03-25"),
|
27079
|
-
endDate: new Date("2020-03-25"),
|
27080
|
-
nationalPlanObj: "",
|
27081
|
-
kpi: "",
|
27082
|
-
ministry: "",
|
27083
|
-
},
|
27084
|
-
],
|
27085
|
-
},
|
27086
|
-
{
|
27087
|
-
key: 3,
|
27088
|
-
type: NdcActionType.main,
|
27089
|
-
startDate: new Date("2021-03-25"),
|
27090
|
-
endDate: new Date("2022-03-25"),
|
27091
|
-
nationalPlanObj: "Consolidate and increase the stock and quality of productive infrastructure by 50%",
|
27092
|
-
kpi: 48,
|
27093
|
-
ministry: "Ministry of Environment",
|
27094
|
-
subNdcDetails: [
|
27095
|
-
{
|
27096
|
-
key: 9,
|
27097
|
-
ndcActionId: 3,
|
27098
|
-
type: NdcActionType.sub,
|
27099
|
-
startDate: new Date("2019-03-25"),
|
27100
|
-
endDate: new Date("2020-03-25"),
|
27101
|
-
nationalPlanObj: "",
|
27102
|
-
kpi: "",
|
27103
|
-
ministry: "",
|
27104
|
-
},
|
27105
|
-
],
|
27106
|
-
},
|
27107
|
-
{
|
27108
|
-
key: 4,
|
27109
|
-
type: NdcActionType.main,
|
27110
|
-
startDate: new Date("2022-03-25"),
|
27111
|
-
endDate: new Date("2022-05-25"),
|
27112
|
-
nationalPlanObj: "Enhance the productivity and social wellbeing of the population",
|
27113
|
-
kpi: 20,
|
27114
|
-
ministry: "Ministry of Environment",
|
27115
|
-
subNdcDetails: [
|
27116
|
-
{
|
27117
|
-
key: 10,
|
27118
|
-
ndcActionId: 4,
|
27119
|
-
type: NdcActionType.sub,
|
27120
|
-
startDate: new Date("2019-03-25"),
|
27121
|
-
endDate: new Date("2020-03-25"),
|
27122
|
-
nationalPlanObj: "",
|
27123
|
-
kpi: "",
|
27124
|
-
ministry: "",
|
27125
|
-
},
|
27126
|
-
],
|
27127
|
-
},
|
27128
|
-
{
|
27129
|
-
key: 5,
|
27130
|
-
type: NdcActionType.main,
|
27131
|
-
startDate: new Date("2022-03-25"),
|
27132
|
-
endDate: new Date("2023-03-25"),
|
27133
|
-
nationalPlanObj: "Strengthen the role of the state in guiding and facilitating development",
|
27134
|
-
kpi: 10,
|
27135
|
-
ministry: "Ministry of Environment",
|
27136
|
-
subNdcDetails: [
|
27137
|
-
{
|
27138
|
-
key: 11,
|
27139
|
-
ndcActionId: 5,
|
27140
|
-
type: NdcActionType.sub,
|
27141
|
-
startDate: new Date("2019-03-25"),
|
27142
|
-
endDate: new Date("2020-03-25"),
|
27143
|
-
nationalPlanObj: "",
|
27144
|
-
kpi: "",
|
27145
|
-
ministry: "",
|
27146
|
-
},
|
27147
|
-
],
|
27148
|
-
},
|
27149
|
-
{
|
27150
|
-
key: 13,
|
27151
|
-
type: NdcActionType.main,
|
27152
|
-
startDate: new Date("2022-03-25"),
|
27153
|
-
endDate: new Date("2023-03-25"),
|
27154
|
-
nationalPlanObj: "Convert to solar energy",
|
27155
|
-
kpi: 50000,
|
27156
|
-
ministry: "Ministry of Environment",
|
27157
|
-
subNdcDetails: [
|
27158
|
-
{
|
27159
|
-
key: 11,
|
27160
|
-
ndcActionId: 13,
|
27161
|
-
type: NdcActionType.sub,
|
27162
|
-
startDate: new Date("2019-03-25"),
|
27163
|
-
endDate: new Date("2020-03-25"),
|
27164
|
-
nationalPlanObj: "Convert to solar energy",
|
27165
|
-
kpi: "3000",
|
27166
|
-
ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
|
27167
|
-
},
|
27168
|
-
{
|
27169
|
-
key: 14,
|
27170
|
-
ndcActionId: 13,
|
27171
|
-
type: NdcActionType.sub,
|
27172
|
-
startDate: new Date("2019-03-25"),
|
27173
|
-
endDate: new Date("2020-03-25"),
|
27174
|
-
nationalPlanObj: "",
|
27175
|
-
kpi: "",
|
27176
|
-
ministry: "",
|
27177
|
-
},
|
27178
|
-
],
|
27179
|
-
},
|
27180
|
-
{
|
27181
|
-
key: 15,
|
27182
|
-
type: NdcActionType.main,
|
27183
|
-
startDate: new Date("2022-03-25"),
|
27184
|
-
endDate: new Date("2023-03-25"),
|
27185
|
-
nationalPlanObj: "Strengthen the private sector to create jobs",
|
27186
|
-
kpi: 10000,
|
27187
|
-
ministry: "Ministry of Environment",
|
27188
|
-
subNdcDetails: [
|
27189
|
-
{
|
27190
|
-
key: 16,
|
27191
|
-
ndcActionId: 15,
|
27192
|
-
type: NdcActionType.sub,
|
27193
|
-
startDate: new Date("2019-03-25"),
|
27194
|
-
endDate: new Date("2020-03-25"),
|
27195
|
-
nationalPlanObj: "Strengthen the private sector to create jobs",
|
27196
|
-
kpi: "7200",
|
27197
|
-
ministry: "Ministry of Tourism (MoT)",
|
27198
|
-
},
|
27199
|
-
{
|
27200
|
-
key: 17,
|
27201
|
-
ndcActionId: 15,
|
27202
|
-
type: NdcActionType.sub,
|
27203
|
-
startDate: new Date("2019-03-25"),
|
27204
|
-
endDate: new Date("2020-03-25"),
|
27205
|
-
nationalPlanObj: "",
|
27206
|
-
kpi: "",
|
27207
|
-
ministry: "",
|
27208
|
-
},
|
27209
|
-
],
|
27210
|
-
},
|
27211
|
-
{
|
27212
|
-
key: 18,
|
27213
|
-
type: NdcActionType.main,
|
27214
|
-
startDate: new Date("2022-03-25"),
|
27215
|
-
endDate: new Date("2023-03-25"),
|
27216
|
-
nationalPlanObj: "Other",
|
27217
|
-
kpi: "",
|
27218
|
-
ministry: "Ministry of Environment",
|
27219
|
-
subNdcDetails: [
|
27220
|
-
{
|
27221
|
-
key: 19,
|
27222
|
-
ndcActionId: 18,
|
27223
|
-
type: NdcActionType.sub,
|
27224
|
-
startDate: new Date("2019-03-25"),
|
27225
|
-
endDate: new Date("2020-03-25"),
|
27226
|
-
nationalPlanObj: "Strengthen the private sector to create jobs",
|
27227
|
-
kpi: "",
|
27228
|
-
ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
|
27138
|
+
function mainNdcActionTableContent() {
|
27139
|
+
return (React.createElement("div", null,
|
27140
|
+
React.createElement(antd.Row, null,
|
27141
|
+
React.createElement(antd.Col, { span: 24 },
|
27142
|
+
React.createElement(antd.Form, { form: form, component: false },
|
27143
|
+
React.createElement(antd.Table, { tableLayout: "fixed", key: tableKey, className: "common-table-class", rowKey: "id", pagination: {
|
27144
|
+
current: currentPage,
|
27145
|
+
pageSize: pageSize,
|
27146
|
+
total: ndcMainDetailsForPeriod.length,
|
27147
|
+
showQuickJumper: true,
|
27148
|
+
showSizeChanger: true,
|
27149
|
+
onChange: onChange,
|
27150
|
+
}, components: components, rowClassName: function () { return "editable-row"; }, bordered: true, loading: loading, dataSource: ndcMainDetailsForPeriod, columns: columns, expandedRowKeys: expandedRowKeys, onExpand: onMainTableRowExpand, expandable: {
|
27151
|
+
expandedRowRender: function (record) {
|
27152
|
+
return subNdcActionTableContent();
|
27153
|
+
},
|
27154
|
+
columnWidth: 40,
|
27155
|
+
}, onRow: function (record, rowIndex) {
|
27156
|
+
return {
|
27157
|
+
onClick: function (event) {
|
27158
|
+
if (record.id &&
|
27159
|
+
isNdcActionEditable(record) &&
|
27160
|
+
!isEditing(record)) {
|
27161
|
+
form.setFieldsValue(__assign({}, record));
|
27162
|
+
setEditingKey(record.id);
|
27163
|
+
}
|
27164
|
+
},
|
27165
|
+
onMouseLeave: function () {
|
27166
|
+
if (isEditing(record)) {
|
27167
|
+
handleSave(record);
|
27168
|
+
}
|
27169
|
+
},
|
27170
|
+
};
|
27171
|
+
}, footer: function () {
|
27172
|
+
return isGovernmentUser &&
|
27173
|
+
!selectedPeriod.finalized && (React.createElement(antd.Row, { justify: "center" },
|
27174
|
+
React.createElement(antd.Button, { className: "btnAddNewMainAct", disabled: isMainActionInEditMode(), onClick: onClickedAddNewNdcDetail, type: "default" }, t("ndc:addNdcAction"))));
|
27175
|
+
} })))),
|
27176
|
+
isGovernmentUser && !selectedPeriod.finalized ? (React.createElement(antd.Row, { justify: "end" },
|
27177
|
+
React.createElement(antd.Button, { className: "mg-left-1 btn-danger", onClick: onClickedDeletePeriod, htmlType: "submit", loading: loading }, t("ndc:delete")),
|
27178
|
+
React.createElement(antd.Button, { className: "mg-left-1", type: "primary", onClick: onClickedFinalizePeriod, htmlType: "submit", loading: loading }, t("ndc:finalize")))) : ("")));
|
27179
|
+
}
|
27180
|
+
function subNdcActionTableContent(record) {
|
27181
|
+
return (React.createElement(antd.Table, { tableLayout: "fixed", rowKey: "id", components: components, rowClassName: function () { return "editable-row"; }, className: "common-table-class", bordered: true, dataSource: subNdcActionsForPeriod, loading: loading, onRow: function (record, rowIndex) {
|
27182
|
+
return {
|
27183
|
+
onClick: function (event) {
|
27184
|
+
if (record.id &&
|
27185
|
+
isNdcActionEditable(record) &&
|
27186
|
+
!isEditing(record)) {
|
27187
|
+
form.setFieldsValue(__assign({}, record));
|
27188
|
+
setEditingKey(record.id);
|
27189
|
+
}
|
27229
27190
|
},
|
27230
|
-
{
|
27231
|
-
|
27232
|
-
|
27233
|
-
|
27234
|
-
startDate: new Date("2019-03-25"),
|
27235
|
-
endDate: new Date("2020-03-25"),
|
27236
|
-
nationalPlanObj: "",
|
27237
|
-
kpi: "",
|
27238
|
-
ministry: "",
|
27191
|
+
onMouseLeave: function () {
|
27192
|
+
if (isEditing(record)) {
|
27193
|
+
handleSave(record);
|
27194
|
+
}
|
27239
27195
|
},
|
27240
|
-
|
27241
|
-
},
|
27242
|
-
|
27243
|
-
|
27244
|
-
|
27245
|
-
|
27246
|
-
|
27247
|
-
|
27248
|
-
|
27249
|
-
|
27250
|
-
|
27251
|
-
|
27252
|
-
|
27253
|
-
|
27254
|
-
|
27255
|
-
|
27256
|
-
|
27257
|
-
|
27258
|
-
|
27259
|
-
|
27260
|
-
|
27261
|
-
|
27262
|
-
|
27263
|
-
|
27264
|
-
|
27265
|
-
|
27196
|
+
};
|
27197
|
+
}, columns: columns, showHeader: false, pagination: false }));
|
27198
|
+
}
|
27199
|
+
var onAddNewPeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27200
|
+
var periodItem_1, existingIndex, response, addedPeriodItem, updatedPeriodItem_1, exception_3;
|
27201
|
+
return __generator(this, function (_a) {
|
27202
|
+
switch (_a.label) {
|
27203
|
+
case 0:
|
27204
|
+
_a.trys.push([0, 4, , 5]);
|
27205
|
+
if (!(selectedDateRangeRef && selectedDateRangeRef.current)) return [3 /*break*/, 3];
|
27206
|
+
periodItem_1 = {
|
27207
|
+
startYear: selectedDateRangeRef.current.startYear,
|
27208
|
+
endYear: selectedDateRangeRef.current.endYear,
|
27209
|
+
finalized: false,
|
27210
|
+
};
|
27211
|
+
existingIndex = periodItems.findIndex(function (item) {
|
27212
|
+
return inRange(periodItem_1.startYear, item.startYear, item.endYear) ||
|
27213
|
+
inRange(periodItem_1.endYear, item.startYear, item.endYear);
|
27214
|
+
});
|
27215
|
+
if (!(existingIndex === -1)) return [3 /*break*/, 2];
|
27216
|
+
return [4 /*yield*/, post("national/programme/addNdcDetailsPeriod", __assign({}, periodItem_1))];
|
27217
|
+
case 1:
|
27218
|
+
response = _a.sent();
|
27219
|
+
if (response && response.data) {
|
27220
|
+
addedPeriodItem = response.data;
|
27221
|
+
updatedPeriodItem_1 = __assign(__assign({}, addedPeriodItem), { key: addedPeriodItem.id, label: "".concat(addedPeriodItem.startYear, "-").concat(addedPeriodItem.endYear) });
|
27222
|
+
setPeriodItems(function (items) { return __spreadArray(__spreadArray([], items, true), [updatedPeriodItem_1], false); });
|
27223
|
+
setSelectedPeriod(updatedPeriodItem_1);
|
27224
|
+
}
|
27225
|
+
return [3 /*break*/, 3];
|
27226
|
+
case 2:
|
27227
|
+
antd.message.open({
|
27228
|
+
type: "error",
|
27229
|
+
content: t("ndc:rangeAlreadyExists"),
|
27230
|
+
duration: 3,
|
27231
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27232
|
+
});
|
27233
|
+
_a.label = 3;
|
27234
|
+
case 3: return [3 /*break*/, 5];
|
27235
|
+
case 4:
|
27236
|
+
exception_3 = _a.sent();
|
27237
|
+
antd.message.open({
|
27238
|
+
type: "error",
|
27239
|
+
content: exception_3.message,
|
27240
|
+
duration: 3,
|
27241
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27242
|
+
});
|
27243
|
+
return [3 /*break*/, 5];
|
27244
|
+
case 5: return [2 /*return*/];
|
27245
|
+
}
|
27246
|
+
});
|
27247
|
+
}); };
|
27248
|
+
var onDateRangeChanged = function (range) {
|
27249
|
+
var period = {
|
27250
|
+
startYear: Number(moment(range[0]).year()),
|
27251
|
+
endYear: Number(moment(range[1]).year()),
|
27252
|
+
};
|
27253
|
+
if (period.startYear === period.endYear) {
|
27254
|
+
antd.message.open({
|
27255
|
+
type: "error",
|
27256
|
+
content: t("ndc:rangeAlreadyExists"),
|
27257
|
+
duration: 3,
|
27258
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27266
27259
|
});
|
27267
27260
|
}
|
27268
|
-
|
27269
|
-
|
27270
|
-
|
27271
|
-
|
27261
|
+
else {
|
27262
|
+
selectedDateRangeRef.current = period;
|
27263
|
+
}
|
27264
|
+
};
|
27265
|
+
var onTabChange = function (key) {
|
27266
|
+
var selectedPeriod = periodItems.find(function (item) { return item.key === key; });
|
27267
|
+
if (selectedPeriod) {
|
27268
|
+
setSelectedPeriod(selectedPeriod);
|
27269
|
+
}
|
27270
|
+
};
|
27271
|
+
var onActionConfirmed = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27272
|
+
var actionResponse, exception_4;
|
27273
|
+
return __generator(this, function (_a) {
|
27274
|
+
switch (_a.label) {
|
27275
|
+
case 0:
|
27276
|
+
setLoading(true);
|
27277
|
+
_a.label = 1;
|
27278
|
+
case 1:
|
27279
|
+
_a.trys.push([1, 10, , 11]);
|
27280
|
+
if (!(actionInfo.action === "Approve")) return [3 /*break*/, 3];
|
27281
|
+
return [4 /*yield*/, post("national/programme/approveNdcDetailsAction", {
|
27282
|
+
id: actionInfo.recordId,
|
27283
|
+
})];
|
27284
|
+
case 2:
|
27285
|
+
actionResponse = _a.sent();
|
27286
|
+
return [3 /*break*/, 9];
|
27287
|
+
case 3:
|
27288
|
+
if (!(actionInfo.action === "Reject")) return [3 /*break*/, 5];
|
27289
|
+
return [4 /*yield*/, post("national/programme/rejectNdcDetailsAction", {
|
27290
|
+
id: actionInfo.recordId,
|
27291
|
+
})];
|
27292
|
+
case 4:
|
27293
|
+
actionResponse = _a.sent();
|
27294
|
+
return [3 /*break*/, 9];
|
27295
|
+
case 5:
|
27296
|
+
if (!(actionInfo.action === "Finalize")) return [3 /*break*/, 7];
|
27297
|
+
return [4 /*yield*/, post("national/programme/finalizeNdcDetailsPeriod", {
|
27298
|
+
id: selectedPeriod.key,
|
27299
|
+
})];
|
27300
|
+
case 6:
|
27301
|
+
actionResponse = _a.sent();
|
27302
|
+
return [3 /*break*/, 9];
|
27303
|
+
case 7:
|
27304
|
+
if (!(actionInfo.action === "Delete")) return [3 /*break*/, 9];
|
27305
|
+
return [4 /*yield*/, post("national/programme/deleteNdcDetailsPeriod", {
|
27306
|
+
id: selectedPeriod.key,
|
27307
|
+
})];
|
27308
|
+
case 8:
|
27309
|
+
actionResponse = _a.sent();
|
27310
|
+
_a.label = 9;
|
27311
|
+
case 9: return [3 /*break*/, 11];
|
27312
|
+
case 10:
|
27313
|
+
exception_4 = _a.sent();
|
27314
|
+
antd.message.open({
|
27315
|
+
type: "error",
|
27316
|
+
content: exception_4.message,
|
27317
|
+
duration: 3,
|
27318
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27319
|
+
});
|
27320
|
+
return [3 /*break*/, 11];
|
27321
|
+
case 11:
|
27322
|
+
if (actionResponse) {
|
27323
|
+
if (actionInfo.action === "Delete") {
|
27324
|
+
antd.message.open({
|
27325
|
+
type: "success",
|
27326
|
+
content: t("ndc:deletePeriodSuccessMsg"),
|
27327
|
+
duration: 3,
|
27328
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27329
|
+
});
|
27330
|
+
fetchNdcDetailPeriods();
|
27331
|
+
}
|
27332
|
+
else if (actionInfo.action === "Finalize") {
|
27333
|
+
antd.message.open({
|
27334
|
+
type: "success",
|
27335
|
+
content: t("ndc:finalizeSuccessMsg"),
|
27336
|
+
duration: 3,
|
27337
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27338
|
+
});
|
27339
|
+
fetchNdcDetailPeriods();
|
27340
|
+
}
|
27341
|
+
else if (actionInfo.action === "Approve") {
|
27342
|
+
antd.message.open({
|
27343
|
+
type: "success",
|
27344
|
+
content: t("ndc:approveSuccessMsg"),
|
27345
|
+
duration: 3,
|
27346
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27347
|
+
});
|
27348
|
+
fetchNdcDetailActions();
|
27349
|
+
}
|
27350
|
+
else if (actionInfo.action === "Reject") {
|
27351
|
+
antd.message.open({
|
27352
|
+
type: "success",
|
27353
|
+
content: t("ndc:rejectSuccessMsg"),
|
27354
|
+
duration: 3,
|
27355
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27356
|
+
});
|
27357
|
+
fetchNdcDetailActions();
|
27358
|
+
}
|
27359
|
+
}
|
27360
|
+
setOpenConfirmationModal(false);
|
27361
|
+
setLoading(false);
|
27362
|
+
return [2 /*return*/];
|
27363
|
+
}
|
27364
|
+
});
|
27365
|
+
}); };
|
27366
|
+
var onActionCanceled = function () {
|
27367
|
+
setOpenConfirmationModal(false);
|
27368
|
+
};
|
27369
|
+
var fetchNdcDetailPeriods = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27370
|
+
var periods, addNewTab, response, exception_5;
|
27371
|
+
return __generator(this, function (_a) {
|
27372
|
+
switch (_a.label) {
|
27373
|
+
case 0:
|
27374
|
+
setLoading(true);
|
27375
|
+
_a.label = 1;
|
27376
|
+
case 1:
|
27377
|
+
_a.trys.push([1, 3, 4, 5]);
|
27378
|
+
periods = [];
|
27379
|
+
addNewTab = {
|
27380
|
+
key: "add_new",
|
27381
|
+
label: "Add New",
|
27382
|
+
startYear: 0,
|
27383
|
+
endYear: 0,
|
27384
|
+
finalized: false,
|
27385
|
+
deleted: false,
|
27386
|
+
};
|
27387
|
+
return [4 /*yield*/, get("national/programme/queryNdcDetailsPeriod")];
|
27388
|
+
case 2:
|
27389
|
+
response = _a.sent();
|
27390
|
+
if (response && response.data) {
|
27391
|
+
periods = response.data.map(function (period) {
|
27392
|
+
return __assign(__assign({}, period), { key: period.id, label: period.finalized ? (React.createElement("span", null,
|
27393
|
+
React.createElement(icons.LockOutlined, null),
|
27394
|
+
" ",
|
27395
|
+
period.startYear,
|
27396
|
+
"-",
|
27397
|
+
period.endYear,
|
27398
|
+
" ")) : ("".concat(period.startYear, "-").concat(period.endYear)) });
|
27399
|
+
});
|
27400
|
+
}
|
27401
|
+
if (isGovernmentUser) {
|
27402
|
+
periods.unshift(addNewTab);
|
27403
|
+
}
|
27404
|
+
setPeriodItems(periods);
|
27405
|
+
if (isGovernmentUser) {
|
27406
|
+
setSelectedPeriod(addNewTab);
|
27407
|
+
}
|
27408
|
+
else {
|
27409
|
+
setSelectedPeriod(periods[0]);
|
27410
|
+
}
|
27411
|
+
setLoading(false);
|
27412
|
+
return [3 /*break*/, 5];
|
27413
|
+
case 3:
|
27414
|
+
exception_5 = _a.sent();
|
27415
|
+
antd.message.open({
|
27416
|
+
type: "error",
|
27417
|
+
content: exception_5.message,
|
27418
|
+
duration: 3,
|
27419
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27420
|
+
});
|
27421
|
+
return [3 /*break*/, 5];
|
27422
|
+
case 4:
|
27423
|
+
setLoading(false);
|
27424
|
+
return [7 /*endfinally*/];
|
27425
|
+
case 5: return [2 /*return*/];
|
27426
|
+
}
|
27427
|
+
});
|
27428
|
+
}); };
|
27429
|
+
var fetchNdcDetailActions = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27430
|
+
var response, maxActionId, exception_6;
|
27431
|
+
return __generator(this, function (_a) {
|
27432
|
+
switch (_a.label) {
|
27433
|
+
case 0:
|
27434
|
+
setLoading(true);
|
27435
|
+
_a.label = 1;
|
27436
|
+
case 1:
|
27437
|
+
_a.trys.push([1, 3, 4, 5]);
|
27438
|
+
return [4 /*yield*/, get("national/programme/queryNdcDetailsAction")];
|
27439
|
+
case 2:
|
27440
|
+
response = _a.sent();
|
27441
|
+
if (response && response.data) {
|
27442
|
+
maxActionId = Math.max.apply(Math, response.data.map(function (item) { return item.id; }));
|
27443
|
+
setNextAvailableActionId(maxActionId + 1);
|
27444
|
+
setNdcActionsList(response.data);
|
27445
|
+
}
|
27446
|
+
setLoading(false);
|
27447
|
+
return [3 /*break*/, 5];
|
27448
|
+
case 3:
|
27449
|
+
exception_6 = _a.sent();
|
27450
|
+
antd.message.open({
|
27451
|
+
type: "error",
|
27452
|
+
content: exception_6.message,
|
27453
|
+
duration: 3,
|
27454
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27455
|
+
});
|
27456
|
+
return [3 /*break*/, 5];
|
27457
|
+
case 4:
|
27458
|
+
setLoading(false);
|
27459
|
+
return [7 /*endfinally*/];
|
27460
|
+
case 5: return [2 /*return*/];
|
27461
|
+
}
|
27462
|
+
});
|
27463
|
+
}); };
|
27464
|
+
var fetchMinistries = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27465
|
+
var response, ministryOrgDetails, exception_7;
|
27466
|
+
return __generator(this, function (_a) {
|
27467
|
+
switch (_a.label) {
|
27468
|
+
case 0:
|
27469
|
+
setLoading(true);
|
27470
|
+
_a.label = 1;
|
27471
|
+
case 1:
|
27472
|
+
_a.trys.push([1, 3, 4, 5]);
|
27473
|
+
return [4 /*yield*/, get("national/organisation/getMinistries")];
|
27474
|
+
case 2:
|
27475
|
+
response = _a.sent();
|
27476
|
+
if (response && response.data) {
|
27477
|
+
ministryOrgDetails = response.data.map(function (value) {
|
27478
|
+
return {
|
27479
|
+
value: value.company_companyId,
|
27480
|
+
label: value.company_name,
|
27481
|
+
};
|
27482
|
+
});
|
27483
|
+
setMinistryOrgList(ministryOrgDetails);
|
27484
|
+
}
|
27485
|
+
setLoading(false);
|
27486
|
+
return [3 /*break*/, 5];
|
27487
|
+
case 3:
|
27488
|
+
exception_7 = _a.sent();
|
27489
|
+
antd.message.open({
|
27490
|
+
type: "error",
|
27491
|
+
content: exception_7.message,
|
27492
|
+
duration: 3,
|
27493
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27494
|
+
});
|
27495
|
+
return [3 /*break*/, 5];
|
27496
|
+
case 4:
|
27497
|
+
setLoading(false);
|
27498
|
+
return [7 /*endfinally*/];
|
27499
|
+
case 5: return [2 /*return*/];
|
27500
|
+
}
|
27501
|
+
});
|
27502
|
+
}); };
|
27503
|
+
React.useEffect(function () {
|
27504
|
+
fetchNdcDetailPeriods();
|
27505
|
+
fetchNdcDetailActions();
|
27506
|
+
fetchMinistries();
|
27272
27507
|
}, []);
|
27273
|
-
return (React.createElement("div", { className: "ndc-
|
27508
|
+
return (React.createElement("div", { className: "ndc-details content-container" },
|
27274
27509
|
React.createElement("div", { className: "title-bar" },
|
27275
27510
|
React.createElement(antd.Row, { justify: "space-between", align: "middle" },
|
27276
27511
|
React.createElement(antd.Col, { span: 20 },
|
27277
27512
|
React.createElement("div", { className: "body-title" }, t("ndc:ndcTitle")),
|
27278
27513
|
React.createElement("div", { className: "body-sub-title" }, t("ndc:ndcSubTitle"))))),
|
27279
27514
|
React.createElement("div", null,
|
27280
|
-
React.createElement(antd.Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey:
|
27281
|
-
|
27282
|
-
|
27283
|
-
|
27284
|
-
|
27285
|
-
indentSize: 0,
|
27286
|
-
defaultExpandedRowKeys: [selectedNdcDetail.current.key],
|
27287
|
-
}, footer: function () {
|
27288
|
-
return isAddNdcActionVisible() && (React.createElement(antd.Row, { justify: "center" },
|
27289
|
-
React.createElement(antd.Button, { onClick: onAddNewNdcDetail, type: "default", style: {
|
27290
|
-
marginBottom: 16,
|
27291
|
-
width: "100%",
|
27292
|
-
} }, t("ndc:addNdcAction"))));
|
27293
|
-
} }))))));
|
27515
|
+
React.createElement(antd.Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedPeriod.key, onChange: onTabChange })),
|
27516
|
+
React.createElement("div", null, selectedPeriod.key === "add_new"
|
27517
|
+
? addNewPeriodContent()
|
27518
|
+
: mainNdcActionTableContent()),
|
27519
|
+
React.createElement(UserActionConfirmationModel, { t: t, actionInfo: actionInfo, onActionConfirmed: onActionConfirmed, onActionCanceled: onActionCanceled, openModal: openConfirmationModal, errorMsg: "", loading: loading })));
|
27294
27520
|
};
|
27295
27521
|
|
27296
27522
|
var ImgWithFallback = function (_a) {
|
@@ -29083,7 +29309,7 @@ exports.getCreditStageVal = getCreditStageVal;
|
|
29083
29309
|
exports.getFinancialFields = getFinancialFields;
|
29084
29310
|
exports.getGeneralFields = getGeneralFields;
|
29085
29311
|
exports.getInvestmentStatusEnumVal = getInvestmentStatusEnumVal;
|
29086
|
-
exports.getNdcActionStatusEnumVal = getNdcActionStatusEnumVal;
|
29312
|
+
exports.getNdcActionStatusEnumVal = getNdcActionStatusEnumVal$1;
|
29087
29313
|
exports.getNdcStatusTagType = getNdcStatusTagType;
|
29088
29314
|
exports.getRetirementTypeString = getRetirementTypeString;
|
29089
29315
|
exports.getStageEnumVal = getStageEnumVal;
|