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