@undp/carbon-library 1.0.274-CARBON-363.39 → 1.0.274-CARBON-338.2
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 +543 -790
- 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 +545 -792
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Components/Common/AntComponents/antTableComponents.d.ts +6 -9
- package/dist/locales/i18n/ndc/en.json +3 -28
- 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,869 +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
|
-
|
26682
|
-
|
26683
|
-
|
26684
|
-
|
26685
|
-
|
26686
|
-
|
26687
|
-
|
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
|
-
|
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));
|
26730
|
+
}
|
26731
|
+
return React.createElement("td", __assign({}, restProps), childNode);
|
26721
26732
|
};
|
26722
26733
|
|
26723
|
-
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";
|
26724
26735
|
styleInject(css_248z$4);
|
26725
26736
|
|
26726
|
-
var
|
26727
|
-
(function (
|
26728
|
-
|
26729
|
-
|
26730
|
-
})(
|
26731
|
-
var NdcDetailsActionStatus;
|
26732
|
-
(function (NdcDetailsActionStatus) {
|
26733
|
-
NdcDetailsActionStatus["New"] = "New";
|
26734
|
-
NdcDetailsActionStatus["Pending"] = "Pending";
|
26735
|
-
NdcDetailsActionStatus["Approved"] = "Approved";
|
26736
|
-
NdcDetailsActionStatus["Rejected"] = "Rejected";
|
26737
|
-
})(NdcDetailsActionStatus || (NdcDetailsActionStatus = {}));
|
26738
|
-
var getNdcActionStatusEnumVal = function (value) {
|
26739
|
-
var index = Object.keys(NdcDetailsActionStatus).indexOf(value);
|
26740
|
-
if (index < 0) {
|
26741
|
-
return value;
|
26742
|
-
}
|
26743
|
-
return Object.values(NdcDetailsActionStatus)[index];
|
26744
|
-
};
|
26745
|
-
var getNdcActionStatusTagType = function (status) {
|
26746
|
-
switch (getNdcActionStatusEnumVal(status)) {
|
26747
|
-
case NdcDetailsActionStatus.Rejected:
|
26748
|
-
return "error";
|
26749
|
-
case NdcDetailsActionStatus.Pending:
|
26750
|
-
return "processing";
|
26751
|
-
case NdcDetailsActionStatus.Approved:
|
26752
|
-
return "success";
|
26753
|
-
default:
|
26754
|
-
return "default";
|
26755
|
-
}
|
26756
|
-
};
|
26757
|
-
|
26737
|
+
var NdcActionType;
|
26738
|
+
(function (NdcActionType) {
|
26739
|
+
NdcActionType[NdcActionType["main"] = 0] = "main";
|
26740
|
+
NdcActionType[NdcActionType["sub"] = 1] = "sub";
|
26741
|
+
})(NdcActionType || (NdcActionType = {}));
|
26758
26742
|
var NdcDetailsComponent = function (props) {
|
26759
|
-
var t = props.t
|
26743
|
+
var t = props.t; props.useConnection; var useUserContext = props.useUserContext;
|
26760
26744
|
var RangePicker = antd.DatePicker.RangePicker;
|
26761
|
-
var _a = React.useState([]),
|
26762
|
-
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([]);
|
26763
26748
|
var _c = React.useState([]), periodItems = _c[0], setPeriodItems = _c[1];
|
26764
|
-
var _d = React.useState(
|
26765
|
-
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({});
|
26766
26753
|
var _e = React.useState(0), tableKey = _e[0], setTableKey = _e[1];
|
26767
|
-
var _f = useConnection(), get = _f.get, post = _f.post, put = _f.put;
|
26768
|
-
var _g = React.useState([]), ministryOrgList = _g[0], setMinistryOrgList = _g[1];
|
26769
|
-
var _h = React.useState({}), actionInfo = _h[0], setActionInfo = _h[1];
|
26770
|
-
var _j = React.useState(false), openConfirmationModal = _j[0], setOpenConfirmationModal = _j[1];
|
26771
|
-
var form = antd.Form.useForm()[0];
|
26772
|
-
var _k = React.useState(null), editingKey = _k[0], setEditingKey = _k[1];
|
26773
|
-
var _l = React.useState(0), nextAvailableActionId = _l[0], setNextAvailableActionId = _l[1];
|
26774
|
-
var _m = React.useState([]), expandedRowKeys = _m[0], setExpandedRowKeys = _m[1];
|
26775
|
-
var _o = React.useState([]), subNdcActionsForPeriod = _o[0], setSubNdcActionsForPeriod = _o[1];
|
26776
|
-
var _p = React.useState(1), currentPage = _p[0], setCurrentPage = _p[1];
|
26777
|
-
var _q = React.useState(10), pageSize = _q[0], setPageSize = _q[1];
|
26778
|
-
var isEditing = function (record) { return record.id === editingKey; };
|
26779
|
-
var isMainActionInEditMode = function () {
|
26780
|
-
if (editingKey) {
|
26781
|
-
var action = ndcActionsList.find(function (item) { return item.id === editingKey; });
|
26782
|
-
if (action && action.actionType === NdcDetailsActionType.MainAction) {
|
26783
|
-
return true;
|
26784
|
-
}
|
26785
|
-
}
|
26786
|
-
return false;
|
26787
|
-
};
|
26788
26754
|
var userInfoState = useUserContext().userInfoState;
|
26789
|
-
|
26790
|
-
|
26791
|
-
|
26792
|
-
setNdcSubActionsForMainAction(expandedKey);
|
26793
|
-
}
|
26794
|
-
}, ndcActionsList);
|
26795
|
-
var loginMinistry = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT
|
26796
|
-
? process.env.REACT_APP_GOVERNMENT_MINISTRY
|
26797
|
-
? process.env.REACT_APP_GOVERNMENT_MINISTRY
|
26798
|
-
: "Ministry Of Environment"
|
26799
|
-
: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY
|
26800
|
-
? userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyName
|
26801
|
-
: undefined;
|
26802
|
-
var isGovernmentUser = (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 isMainNdcActionsEditable = !selectedPeriod.finalized &&
|
26805
|
-
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT &&
|
26806
|
-
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly;
|
26807
|
-
var isSubNdcActionsEditable = function (record) {
|
26808
|
-
return (!selectedPeriod.finalized &&
|
26809
|
-
record.status !== NdcDetailsActionStatus.Approved &&
|
26810
|
-
((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT ||
|
26811
|
-
((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY &&
|
26812
|
-
(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) &&
|
26813
26758
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly);
|
26814
26759
|
};
|
26815
|
-
var
|
26816
|
-
return (
|
26817
|
-
((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT ||
|
26818
|
-
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY) &&
|
26760
|
+
var isAddNdcActionVisible = function () {
|
26761
|
+
return ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT &&
|
26819
26762
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly);
|
26820
26763
|
};
|
26821
|
-
var isNdcActionEditable = function (record) {
|
26822
|
-
if (record.actionType === NdcDetailsActionType.MainAction) {
|
26823
|
-
return isMainNdcActionsEditable;
|
26824
|
-
}
|
26825
|
-
else if (record.actionType === NdcDetailsActionType.SubAction) {
|
26826
|
-
return isSubNdcActionsEditable(record);
|
26827
|
-
}
|
26828
|
-
};
|
26829
|
-
var ndcMainDetailsForPeriod = selectedPeriod.key !== "add_new"
|
26830
|
-
? ndcActionsList.filter(function (ndcDetail) {
|
26831
|
-
return (ndcDetail.periodId === parseInt(selectedPeriod.key) &&
|
26832
|
-
ndcDetail.actionType === NdcDetailsActionType.MainAction);
|
26833
|
-
})
|
26834
|
-
: [];
|
26835
|
-
var setNdcSubActionsForMainAction = function (mainActionId) {
|
26836
|
-
var subNdcDetails = ndcActionsList.filter(function (ndcDetail) {
|
26837
|
-
return (ndcDetail.parentActionId === mainActionId &&
|
26838
|
-
ndcDetail.actionType === NdcDetailsActionType.SubAction);
|
26839
|
-
});
|
26840
|
-
var emptySubNdcRow = {
|
26841
|
-
id: nextAvailableActionId,
|
26842
|
-
actionType: NdcDetailsActionType.SubAction,
|
26843
|
-
nationalPlanObjective: "",
|
26844
|
-
kpi: "",
|
26845
|
-
ministryName: loginMinistry,
|
26846
|
-
status: NdcDetailsActionStatus.New,
|
26847
|
-
parentActionId: mainActionId,
|
26848
|
-
};
|
26849
|
-
if (checkSubNdcActionCreatePermission()) {
|
26850
|
-
subNdcDetails = __spreadArray(__spreadArray([], subNdcDetails, true), [emptySubNdcRow], false);
|
26851
|
-
setEditingKey(nextAvailableActionId);
|
26852
|
-
setNextAvailableActionId(function (value) { return value + 1; });
|
26853
|
-
form.setFieldsValue({
|
26854
|
-
nationalPlanObjective: "",
|
26855
|
-
kpi: "",
|
26856
|
-
});
|
26857
|
-
}
|
26858
|
-
setSubNdcActionsForPeriod(subNdcDetails);
|
26859
|
-
};
|
26860
26764
|
var inRange = function (num, min, max) {
|
26861
26765
|
return num >= min && num <= max;
|
26862
26766
|
};
|
26863
|
-
|
26864
|
-
var
|
26865
|
-
|
26866
|
-
|
26867
|
-
|
26868
|
-
|
26869
|
-
|
26870
|
-
|
26871
|
-
|
26872
|
-
|
26873
|
-
|
26874
|
-
|
26875
|
-
|
26876
|
-
|
26877
|
-
|
26878
|
-
|
26879
|
-
|
26880
|
-
|
26881
|
-
|
26882
|
-
|
26883
|
-
|
26884
|
-
|
26885
|
-
|
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
|
+
}
|
26886
26812
|
}
|
26887
26813
|
else {
|
26888
|
-
|
26814
|
+
parentItem.subNdcDetails = [row];
|
26889
26815
|
}
|
26890
|
-
|
26891
|
-
|
26892
|
-
|
26893
|
-
return [3 /*break*/, 8];
|
26894
|
-
case 6:
|
26895
|
-
updatedItem.status = NdcDetailsActionStatus.Pending;
|
26896
|
-
return [4 /*yield*/, put("national/programme/updateNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseInt(updatedItem.kpi.toString()) }))];
|
26897
|
-
case 7:
|
26898
|
-
_a.sent();
|
26899
|
-
_a.label = 8;
|
26900
|
-
case 8:
|
26901
|
-
fetchNdcDetailActions();
|
26902
|
-
setEditingKey(null);
|
26903
|
-
return [3 /*break*/, 10];
|
26904
|
-
case 9:
|
26905
|
-
exception_2 = _a.sent();
|
26906
|
-
setEditingKey(null);
|
26907
|
-
antd.message.open({
|
26908
|
-
type: "error",
|
26909
|
-
content: exception_2.message,
|
26910
|
-
duration: 3,
|
26911
|
-
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
26912
|
-
});
|
26913
|
-
return [3 /*break*/, 10];
|
26914
|
-
case 10: return [2 /*return*/];
|
26816
|
+
}
|
26817
|
+
newData[parentIndex] = __assign({}, parentItem);
|
26818
|
+
setTableKey(function (key) { return key + 1; });
|
26915
26819
|
}
|
26820
|
+
return newData;
|
26916
26821
|
});
|
26917
|
-
}
|
26918
|
-
var
|
26919
|
-
|
26920
|
-
|
26921
|
-
|
26922
|
-
|
26923
|
-
|
26924
|
-
|
26925
|
-
icon: React.createElement(Icon__namespace.BoxArrowInDown, null),
|
26926
|
-
click: function () {
|
26927
|
-
setActionInfo({
|
26928
|
-
action: "Approve",
|
26929
|
-
headerText: t("ndc:actionApproveTitle"),
|
26930
|
-
type: "primary",
|
26931
|
-
icon: React.createElement(Icon__namespace.BoxArrowInDown, null),
|
26932
|
-
recordId: record.id,
|
26933
|
-
});
|
26934
|
-
setOpenConfirmationModal(true);
|
26935
|
-
},
|
26936
|
-
},
|
26937
|
-
{
|
26938
|
-
text: t("ndc:reject"),
|
26939
|
-
icon: React.createElement(Icon__namespace.XOctagon, null),
|
26940
|
-
click: function () {
|
26941
|
-
setActionInfo({
|
26942
|
-
action: "Reject",
|
26943
|
-
headerText: t("ndc:rejectApproveTitle"),
|
26944
|
-
type: "danger",
|
26945
|
-
icon: React.createElement(Icon__namespace.XOctagon, null),
|
26946
|
-
recordId: record.id,
|
26947
|
-
});
|
26948
|
-
setOpenConfirmationModal(true);
|
26949
|
-
},
|
26950
|
-
},
|
26951
|
-
], renderItem: function (item) { return (React.createElement(antd.List.Item, { onClick: item.click },
|
26952
|
-
React.createElement(antd.Typography.Text, { className: "action-icon color-error" }, item.icon),
|
26953
|
-
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;
|
26954
26830
|
}
|
26955
26831
|
else {
|
26956
|
-
return
|
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;
|
26848
|
+
}
|
26849
|
+
else {
|
26850
|
+
return [];
|
26957
26851
|
}
|
26958
26852
|
};
|
26959
26853
|
var defaultColumns = [
|
26960
26854
|
{
|
26961
26855
|
title: t("ndc:ndcColumnsNationalPlanObj"),
|
26962
|
-
dataIndex: "
|
26963
|
-
key: "
|
26856
|
+
dataIndex: "nationalPlanObj",
|
26857
|
+
key: "nationalPlanObj",
|
26964
26858
|
align: "left",
|
26965
|
-
width: 400,
|
26966
26859
|
editable: true,
|
26967
|
-
|
26968
|
-
|
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" })))); },
|
26969
26863
|
},
|
26970
26864
|
{
|
26971
26865
|
title: t("ndc:ndcColumnsKpi"),
|
26972
26866
|
dataIndex: "kpi",
|
26973
26867
|
key: "kpi",
|
26974
26868
|
align: "left",
|
26975
|
-
width: 100,
|
26976
26869
|
editable: true,
|
26977
|
-
|
26978
|
-
|
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" })))); },
|
26979
26873
|
},
|
26980
26874
|
{
|
26981
|
-
title:
|
26982
|
-
dataIndex: "
|
26983
|
-
key: "
|
26875
|
+
title: "Government Department",
|
26876
|
+
dataIndex: "ministry",
|
26877
|
+
key: "ministry",
|
26984
26878
|
align: "left",
|
26985
|
-
|
26986
|
-
|
26987
|
-
render: function (_, record) { return (React.createElement(
|
26988
|
-
React.createElement(
|
26989
|
-
record.ministryName = option.label;
|
26990
|
-
handleSave(record);
|
26991
|
-
}, options: ministryOrgList }))); },
|
26992
|
-
},
|
26993
|
-
{
|
26994
|
-
title: t("ndc:ndcColumnsStatus"),
|
26995
|
-
dataIndex: "status",
|
26996
|
-
key: "status",
|
26997
|
-
align: "left",
|
26998
|
-
width: 200,
|
26999
|
-
editable: false,
|
27000
|
-
render: function (_, record) {
|
27001
|
-
var menu = actionMenu(record);
|
27002
|
-
return (React.createElement("div", { onClick: function (event) { return event.stopPropagation(); } },
|
27003
|
-
record.actionType === NdcDetailsActionType.SubAction &&
|
27004
|
-
record.status !== NdcDetailsActionStatus.New ? (React.createElement(antd.Tooltip, { title: record.status, color: TooltipColor, key: TooltipColor },
|
27005
|
-
React.createElement(antd.Tag, { className: "clickable", color: getNdcActionStatusTagType(record.status) }, addSpaces(record.status)))) : (""),
|
27006
|
-
record.actionType === NdcDetailsActionType.SubAction && menu ? (React.createElement(antd.Popover, { placement: "bottomRight", content: menu, trigger: "click" },
|
27007
|
-
React.createElement(icons.EllipsisOutlined, { rotate: 90, style: {
|
27008
|
-
fontWeight: 600,
|
27009
|
-
fontSize: "1rem",
|
27010
|
-
cursor: "pointer",
|
27011
|
-
} }))) : (React.createElement("span", null))));
|
27012
|
-
},
|
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" })))); },
|
27013
26883
|
},
|
27014
26884
|
];
|
27015
26885
|
var columns = defaultColumns.map(function (col) {
|
27016
26886
|
if (!col.editable) {
|
27017
26887
|
return col;
|
27018
26888
|
}
|
27019
|
-
return __assign(__assign({}, col), { onCell: function (record) {
|
27020
|
-
|
27021
|
-
|
27022
|
-
|
27023
|
-
|
27024
|
-
|
27025
|
-
|
27026
|
-
if (isEditing(record)) {
|
27027
|
-
handleSave(record);
|
27028
|
-
}
|
27029
|
-
},
|
27030
|
-
t: t,
|
27031
|
-
};
|
27032
|
-
} });
|
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
|
+
}); } });
|
27033
26896
|
});
|
27034
|
-
function
|
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
|
-
if (ndcMainDetailsForPeriod.length + 1 > pageSize) {
|
27060
|
-
lastPage = Math.ceil(ndcMainDetailsForPeriod.length / pageSize);
|
27061
|
-
setCurrentPage(lastPage);
|
27062
|
-
}
|
27063
|
-
}
|
27064
|
-
return [2 /*return*/];
|
27065
|
-
});
|
27066
|
-
});
|
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));
|
27067
26922
|
}
|
27068
26923
|
var components = {
|
27069
26924
|
body: {
|
26925
|
+
row: EditableRow,
|
27070
26926
|
cell: EditableCell,
|
27071
26927
|
},
|
27072
26928
|
};
|
27073
|
-
|
27074
|
-
|
27075
|
-
|
27076
|
-
|
27077
|
-
|
27078
|
-
|
27079
|
-
|
27080
|
-
|
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);
|
27081
26968
|
});
|
27082
|
-
|
27083
|
-
|
27084
|
-
|
27085
|
-
}); };
|
27086
|
-
var onClickedFinalizePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27087
|
-
var isPendingActionAvailable;
|
27088
|
-
return __generator(this, function (_a) {
|
27089
|
-
if (ndcMainDetailsForPeriod.length === 0) {
|
27090
|
-
antd.message.open({
|
27091
|
-
type: "error",
|
27092
|
-
content: t("ndc:finalizeNdcEmptyErrorText"),
|
27093
|
-
duration: 3,
|
27094
|
-
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27095
|
-
});
|
27096
|
-
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);
|
27097
26972
|
}
|
27098
|
-
|
27099
|
-
ndcMainDetailsForPeriod.forEach(function (mainAction) {
|
27100
|
-
var pendingActions = ndcActionsList.filter(function (action) {
|
27101
|
-
return (action.status === NdcDetailsActionStatus.Pending &&
|
27102
|
-
action.actionType === NdcDetailsActionType.SubAction &&
|
27103
|
-
action.parentActionId === mainAction.id);
|
27104
|
-
});
|
27105
|
-
if (pendingActions && pendingActions.length > 0) {
|
27106
|
-
isPendingActionAvailable = true;
|
27107
|
-
return;
|
27108
|
-
}
|
27109
|
-
});
|
27110
|
-
if (isPendingActionAvailable) {
|
26973
|
+
else {
|
27111
26974
|
antd.message.open({
|
27112
26975
|
type: "error",
|
27113
|
-
content: t("ndc:
|
26976
|
+
content: t("ndc:rangeAlreadyExists"),
|
27114
26977
|
duration: 3,
|
27115
26978
|
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27116
26979
|
});
|
27117
26980
|
}
|
27118
|
-
else {
|
27119
|
-
setActionInfo({
|
27120
|
-
action: "Finalize",
|
27121
|
-
headerText: t("ndc:finalizeApproveTitle"),
|
27122
|
-
text: t("ndc:finalizeApproveSubTitle"),
|
27123
|
-
type: "primary",
|
27124
|
-
icon: React.createElement(Icon__namespace.Clipboard2Check, null),
|
27125
|
-
recordId: selectedPeriod.key,
|
27126
|
-
});
|
27127
|
-
setOpenConfirmationModal(true);
|
27128
|
-
}
|
27129
|
-
return [2 /*return*/];
|
27130
|
-
});
|
27131
|
-
}); };
|
27132
|
-
var onMainTableRowExpand = function (expanded, record) {
|
27133
|
-
var keys = [];
|
27134
|
-
if (expanded) {
|
27135
|
-
keys.push(record.id);
|
27136
26981
|
}
|
27137
|
-
setExpandedRowKeys(keys);
|
27138
|
-
setNdcSubActionsForMainAction(record.id);
|
27139
26982
|
};
|
27140
|
-
function
|
27141
|
-
|
27142
|
-
|
27143
|
-
|
27144
|
-
|
27145
|
-
|
27146
|
-
|
27147
|
-
|
27148
|
-
|
27149
|
-
|
27150
|
-
|
26983
|
+
React.useEffect(function () {
|
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;
|
27151
26994
|
};
|
27152
|
-
function
|
26995
|
+
function addNewPeriodContent() {
|
27153
26996
|
return (React.createElement("div", null,
|
27154
26997
|
React.createElement(antd.Row, null,
|
27155
|
-
React.createElement(
|
27156
|
-
|
27157
|
-
|
27158
|
-
|
27159
|
-
|
27160
|
-
|
27161
|
-
|
27162
|
-
|
27163
|
-
|
27164
|
-
}, components: components, rowClassName: function () { return "editable-row"; }, bordered: true, loading: loading, dataSource: ndcMainDetailsForPeriod, columns: columns, expandedRowKeys: expandedRowKeys, onExpand: onMainTableRowExpand, expandable: {
|
27165
|
-
expandedRowRender: function (record) {
|
27166
|
-
return subNdcActionTableContent();
|
27167
|
-
},
|
27168
|
-
columnWidth: 40,
|
27169
|
-
}, onRow: function (record, rowIndex) {
|
27170
|
-
return {
|
27171
|
-
onClick: function (event) {
|
27172
|
-
if (record.id &&
|
27173
|
-
isNdcActionEditable(record) &&
|
27174
|
-
!isEditing(record)) {
|
27175
|
-
form.setFieldsValue(__assign({}, record));
|
27176
|
-
setEditingKey(record.id);
|
27177
|
-
}
|
27178
|
-
},
|
27179
|
-
onMouseLeave: function () {
|
27180
|
-
if (isEditing(record)) {
|
27181
|
-
handleSave(record);
|
27182
|
-
}
|
27183
|
-
},
|
27184
|
-
};
|
27185
|
-
}, footer: function () {
|
27186
|
-
return isGovernmentUser &&
|
27187
|
-
!selectedPeriod.finalized && (React.createElement(antd.Row, { justify: "center" },
|
27188
|
-
React.createElement(antd.Button, { className: "btnAddNewMainAct", disabled: isMainActionInEditMode(), onClick: onClickedAddNewNdcDetail, type: "default" }, t("ndc:addNdcAction"))));
|
27189
|
-
} })))),
|
27190
|
-
isGovernmentUser && !selectedPeriod.finalized ? (React.createElement(antd.Row, { justify: "end" },
|
27191
|
-
React.createElement(antd.Button, { className: "mg-left-1 btn-danger", onClick: onClickedDeletePeriod, htmlType: "submit", disabled: isMainActionInEditMode(), loading: loading }, t("ndc:delete")),
|
27192
|
-
React.createElement(antd.Button, { className: "mg-left-1", type: "primary", onClick: onClickedFinalizePeriod, disabled: isMainActionInEditMode(), htmlType: "submit", loading: loading }, t("ndc:finalize")))) : ("")));
|
27193
|
-
}
|
27194
|
-
function subNdcActionTableContent(record) {
|
27195
|
-
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) {
|
27196
|
-
return {
|
27197
|
-
onClick: function (event) {
|
27198
|
-
if (record.id &&
|
27199
|
-
isNdcActionEditable(record) &&
|
27200
|
-
!isEditing(record)) {
|
27201
|
-
form.setFieldsValue(__assign({}, record));
|
27202
|
-
setEditingKey(record.id);
|
27203
|
-
}
|
27204
|
-
},
|
27205
|
-
onMouseLeave: function () {
|
27206
|
-
if (isEditing(record)) {
|
27207
|
-
handleSave(record);
|
27208
|
-
}
|
27209
|
-
},
|
27210
|
-
};
|
27211
|
-
}, columns: columns, showHeader: false, pagination: false }));
|
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 }));
|
27212
27007
|
}
|
27213
|
-
var onAddNewPeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27214
|
-
var periodItem_1, existingIndex, response, addedPeriodItem, updatedPeriodItem_1, exception_3;
|
27215
|
-
return __generator(this, function (_a) {
|
27216
|
-
switch (_a.label) {
|
27217
|
-
case 0:
|
27218
|
-
_a.trys.push([0, 4, , 5]);
|
27219
|
-
if (!(selectedDateRangeRef &&
|
27220
|
-
selectedDateRangeRef.current &&
|
27221
|
-
selectedDateRangeRef.current.startYear &&
|
27222
|
-
selectedDateRangeRef.current.endYear)) return [3 /*break*/, 3];
|
27223
|
-
periodItem_1 = {
|
27224
|
-
startYear: selectedDateRangeRef.current.startYear,
|
27225
|
-
endYear: selectedDateRangeRef.current.endYear,
|
27226
|
-
finalized: false,
|
27227
|
-
};
|
27228
|
-
existingIndex = periodItems.findIndex(function (item) {
|
27229
|
-
return inRange(periodItem_1.startYear, item.startYear, item.endYear) ||
|
27230
|
-
inRange(periodItem_1.endYear, item.startYear, item.endYear);
|
27231
|
-
});
|
27232
|
-
if (!(existingIndex === -1)) return [3 /*break*/, 2];
|
27233
|
-
return [4 /*yield*/, post("national/programme/addNdcDetailsPeriod", __assign({}, periodItem_1))];
|
27234
|
-
case 1:
|
27235
|
-
response = _a.sent();
|
27236
|
-
if (response && response.data) {
|
27237
|
-
addedPeriodItem = response.data;
|
27238
|
-
updatedPeriodItem_1 = __assign(__assign({}, addedPeriodItem), { key: addedPeriodItem.id, label: "".concat(addedPeriodItem.startYear, "-").concat(addedPeriodItem.endYear) });
|
27239
|
-
setPeriodItems(function (items) { return __spreadArray(__spreadArray([], items, true), [updatedPeriodItem_1], false); });
|
27240
|
-
setSelectedPeriod(updatedPeriodItem_1);
|
27241
|
-
}
|
27242
|
-
return [3 /*break*/, 3];
|
27243
|
-
case 2:
|
27244
|
-
antd.message.open({
|
27245
|
-
type: "error",
|
27246
|
-
content: t("ndc:rangeAlreadyExists"),
|
27247
|
-
duration: 3,
|
27248
|
-
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27249
|
-
});
|
27250
|
-
_a.label = 3;
|
27251
|
-
case 3: return [3 /*break*/, 5];
|
27252
|
-
case 4:
|
27253
|
-
exception_3 = _a.sent();
|
27254
|
-
antd.message.open({
|
27255
|
-
type: "error",
|
27256
|
-
content: exception_3.message,
|
27257
|
-
duration: 3,
|
27258
|
-
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27259
|
-
});
|
27260
|
-
return [3 /*break*/, 5];
|
27261
|
-
case 5: return [2 /*return*/];
|
27262
|
-
}
|
27263
|
-
});
|
27264
|
-
}); };
|
27265
|
-
var onDateRangeChanged = function (range) {
|
27266
|
-
if (range) {
|
27267
|
-
var period = {
|
27268
|
-
startYear: Number(moment(range[0]).year()),
|
27269
|
-
endYear: Number(moment(range[1]).year()),
|
27270
|
-
};
|
27271
|
-
if (period.startYear === period.endYear) {
|
27272
|
-
antd.message.open({
|
27273
|
-
type: "error",
|
27274
|
-
content: t("ndc:sameStartEndDates"),
|
27275
|
-
duration: 3,
|
27276
|
-
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27277
|
-
});
|
27278
|
-
}
|
27279
|
-
else {
|
27280
|
-
selectedDateRangeRef.current = period;
|
27281
|
-
}
|
27282
|
-
}
|
27283
|
-
};
|
27284
27008
|
var onTabChange = function (key) {
|
27285
|
-
|
27286
|
-
if (selectedPeriod) {
|
27287
|
-
setSelectedPeriod(selectedPeriod);
|
27288
|
-
}
|
27009
|
+
setSelectedTab(key);
|
27289
27010
|
};
|
27290
|
-
var onActionConfirmed = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27291
|
-
var actionResponse, exception_4;
|
27292
|
-
return __generator(this, function (_a) {
|
27293
|
-
switch (_a.label) {
|
27294
|
-
case 0:
|
27295
|
-
setLoading(true);
|
27296
|
-
_a.label = 1;
|
27297
|
-
case 1:
|
27298
|
-
_a.trys.push([1, 10, , 11]);
|
27299
|
-
if (!(actionInfo.action === "Approve")) return [3 /*break*/, 3];
|
27300
|
-
return [4 /*yield*/, post("national/programme/approveNdcDetailsAction", {
|
27301
|
-
id: actionInfo.recordId,
|
27302
|
-
})];
|
27303
|
-
case 2:
|
27304
|
-
actionResponse = _a.sent();
|
27305
|
-
return [3 /*break*/, 9];
|
27306
|
-
case 3:
|
27307
|
-
if (!(actionInfo.action === "Reject")) return [3 /*break*/, 5];
|
27308
|
-
return [4 /*yield*/, post("national/programme/rejectNdcDetailsAction", {
|
27309
|
-
id: actionInfo.recordId,
|
27310
|
-
})];
|
27311
|
-
case 4:
|
27312
|
-
actionResponse = _a.sent();
|
27313
|
-
return [3 /*break*/, 9];
|
27314
|
-
case 5:
|
27315
|
-
if (!(actionInfo.action === "Finalize")) return [3 /*break*/, 7];
|
27316
|
-
return [4 /*yield*/, post("national/programme/finalizeNdcDetailsPeriod", {
|
27317
|
-
id: selectedPeriod.key,
|
27318
|
-
})];
|
27319
|
-
case 6:
|
27320
|
-
actionResponse = _a.sent();
|
27321
|
-
return [3 /*break*/, 9];
|
27322
|
-
case 7:
|
27323
|
-
if (!(actionInfo.action === "Delete")) return [3 /*break*/, 9];
|
27324
|
-
return [4 /*yield*/, post("national/programme/deleteNdcDetailsPeriod", {
|
27325
|
-
id: selectedPeriod.key,
|
27326
|
-
})];
|
27327
|
-
case 8:
|
27328
|
-
actionResponse = _a.sent();
|
27329
|
-
_a.label = 9;
|
27330
|
-
case 9: return [3 /*break*/, 11];
|
27331
|
-
case 10:
|
27332
|
-
exception_4 = _a.sent();
|
27333
|
-
antd.message.open({
|
27334
|
-
type: "error",
|
27335
|
-
content: exception_4.message,
|
27336
|
-
duration: 3,
|
27337
|
-
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27338
|
-
});
|
27339
|
-
return [3 /*break*/, 11];
|
27340
|
-
case 11:
|
27341
|
-
if (actionResponse) {
|
27342
|
-
if (actionInfo.action === "Delete") {
|
27343
|
-
antd.message.open({
|
27344
|
-
type: "success",
|
27345
|
-
content: t("ndc:deletePeriodSuccessMsg"),
|
27346
|
-
duration: 3,
|
27347
|
-
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27348
|
-
});
|
27349
|
-
fetchNdcDetailPeriods();
|
27350
|
-
}
|
27351
|
-
else if (actionInfo.action === "Finalize") {
|
27352
|
-
antd.message.open({
|
27353
|
-
type: "success",
|
27354
|
-
content: t("ndc:finalizeSuccessMsg"),
|
27355
|
-
duration: 3,
|
27356
|
-
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27357
|
-
});
|
27358
|
-
fetchNdcDetailPeriods();
|
27359
|
-
setTableKey(function (key) { return key + 1; });
|
27360
|
-
setEditingKey(null);
|
27361
|
-
}
|
27362
|
-
else if (actionInfo.action === "Approve") {
|
27363
|
-
antd.message.open({
|
27364
|
-
type: "success",
|
27365
|
-
content: t("ndc:approveSuccessMsg"),
|
27366
|
-
duration: 3,
|
27367
|
-
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27368
|
-
});
|
27369
|
-
fetchNdcDetailActions();
|
27370
|
-
}
|
27371
|
-
else if (actionInfo.action === "Reject") {
|
27372
|
-
antd.message.open({
|
27373
|
-
type: "success",
|
27374
|
-
content: t("ndc:rejectSuccessMsg"),
|
27375
|
-
duration: 3,
|
27376
|
-
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27377
|
-
});
|
27378
|
-
fetchNdcDetailActions();
|
27379
|
-
}
|
27380
|
-
}
|
27381
|
-
setOpenConfirmationModal(false);
|
27382
|
-
setLoading(false);
|
27383
|
-
return [2 /*return*/];
|
27384
|
-
}
|
27385
|
-
});
|
27386
|
-
}); };
|
27387
|
-
var onActionCanceled = function () {
|
27388
|
-
setOpenConfirmationModal(false);
|
27389
|
-
};
|
27390
|
-
var fetchNdcDetailPeriods = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27391
|
-
var periods, addNewTab, response, exception_5;
|
27392
|
-
return __generator(this, function (_a) {
|
27393
|
-
switch (_a.label) {
|
27394
|
-
case 0:
|
27395
|
-
setLoading(true);
|
27396
|
-
_a.label = 1;
|
27397
|
-
case 1:
|
27398
|
-
_a.trys.push([1, 3, 4, 5]);
|
27399
|
-
periods = [];
|
27400
|
-
addNewTab = {
|
27401
|
-
key: "add_new",
|
27402
|
-
label: "Add New",
|
27403
|
-
startYear: 0,
|
27404
|
-
endYear: 0,
|
27405
|
-
finalized: false,
|
27406
|
-
deleted: false,
|
27407
|
-
};
|
27408
|
-
return [4 /*yield*/, get("national/programme/queryNdcDetailsPeriod")];
|
27409
|
-
case 2:
|
27410
|
-
response = _a.sent();
|
27411
|
-
if (response && response.data) {
|
27412
|
-
periods = response.data.map(function (period) {
|
27413
|
-
return __assign(__assign({}, period), { key: period.id, label: period.finalized ? (React.createElement("span", null,
|
27414
|
-
React.createElement(icons.LockOutlined, null),
|
27415
|
-
" ",
|
27416
|
-
period.startYear,
|
27417
|
-
"-",
|
27418
|
-
period.endYear,
|
27419
|
-
" ")) : ("".concat(period.startYear, "-").concat(period.endYear)) });
|
27420
|
-
});
|
27421
|
-
}
|
27422
|
-
if (isGovernmentUser) {
|
27423
|
-
periods.unshift(addNewTab);
|
27424
|
-
}
|
27425
|
-
setPeriodItems(periods);
|
27426
|
-
if (isGovernmentUser) {
|
27427
|
-
setSelectedPeriod(addNewTab);
|
27428
|
-
}
|
27429
|
-
else {
|
27430
|
-
setSelectedPeriod(periods[0]);
|
27431
|
-
}
|
27432
|
-
setLoading(false);
|
27433
|
-
return [3 /*break*/, 5];
|
27434
|
-
case 3:
|
27435
|
-
exception_5 = _a.sent();
|
27436
|
-
antd.message.open({
|
27437
|
-
type: "error",
|
27438
|
-
content: exception_5.message,
|
27439
|
-
duration: 3,
|
27440
|
-
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27441
|
-
});
|
27442
|
-
return [3 /*break*/, 5];
|
27443
|
-
case 4:
|
27444
|
-
setLoading(false);
|
27445
|
-
return [7 /*endfinally*/];
|
27446
|
-
case 5: return [2 /*return*/];
|
27447
|
-
}
|
27448
|
-
});
|
27449
|
-
}); };
|
27450
|
-
var fetchNdcDetailActions = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27451
|
-
var response, maxActionId, exception_6;
|
27452
|
-
return __generator(this, function (_a) {
|
27453
|
-
switch (_a.label) {
|
27454
|
-
case 0:
|
27455
|
-
setLoading(true);
|
27456
|
-
_a.label = 1;
|
27457
|
-
case 1:
|
27458
|
-
_a.trys.push([1, 3, 4, 5]);
|
27459
|
-
return [4 /*yield*/, get("national/programme/queryNdcDetailsAction")];
|
27460
|
-
case 2:
|
27461
|
-
response = _a.sent();
|
27462
|
-
if (response && response.data) {
|
27463
|
-
maxActionId = Math.max.apply(Math, response.data.map(function (item) { return item.id; }));
|
27464
|
-
setNextAvailableActionId(maxActionId + 1);
|
27465
|
-
setNdcActionsList(response.data);
|
27466
|
-
}
|
27467
|
-
setLoading(false);
|
27468
|
-
return [3 /*break*/, 5];
|
27469
|
-
case 3:
|
27470
|
-
exception_6 = _a.sent();
|
27471
|
-
antd.message.open({
|
27472
|
-
type: "error",
|
27473
|
-
content: exception_6.message,
|
27474
|
-
duration: 3,
|
27475
|
-
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27476
|
-
});
|
27477
|
-
return [3 /*break*/, 5];
|
27478
|
-
case 4:
|
27479
|
-
setLoading(false);
|
27480
|
-
return [7 /*endfinally*/];
|
27481
|
-
case 5: return [2 /*return*/];
|
27482
|
-
}
|
27483
|
-
});
|
27484
|
-
}); };
|
27485
|
-
var fetchMinistries = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27486
|
-
var response, ministryOrgDetails, exception_7;
|
27487
|
-
return __generator(this, function (_a) {
|
27488
|
-
switch (_a.label) {
|
27489
|
-
case 0:
|
27490
|
-
setLoading(true);
|
27491
|
-
_a.label = 1;
|
27492
|
-
case 1:
|
27493
|
-
_a.trys.push([1, 3, 4, 5]);
|
27494
|
-
return [4 /*yield*/, get("national/organisation/getMinistries")];
|
27495
|
-
case 2:
|
27496
|
-
response = _a.sent();
|
27497
|
-
if (response && response.data) {
|
27498
|
-
ministryOrgDetails = response.data.map(function (value) {
|
27499
|
-
return {
|
27500
|
-
value: value.company_companyId,
|
27501
|
-
label: value.company_name,
|
27502
|
-
};
|
27503
|
-
});
|
27504
|
-
setMinistryOrgList(ministryOrgDetails);
|
27505
|
-
}
|
27506
|
-
setLoading(false);
|
27507
|
-
return [3 /*break*/, 5];
|
27508
|
-
case 3:
|
27509
|
-
exception_7 = _a.sent();
|
27510
|
-
antd.message.open({
|
27511
|
-
type: "error",
|
27512
|
-
content: exception_7.message,
|
27513
|
-
duration: 3,
|
27514
|
-
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27515
|
-
});
|
27516
|
-
return [3 /*break*/, 5];
|
27517
|
-
case 4:
|
27518
|
-
setLoading(false);
|
27519
|
-
return [7 /*endfinally*/];
|
27520
|
-
case 5: return [2 /*return*/];
|
27521
|
-
}
|
27522
|
-
});
|
27523
|
-
}); };
|
27524
27011
|
React.useEffect(function () {
|
27525
|
-
|
27526
|
-
|
27527
|
-
|
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);
|
27528
27272
|
}, []);
|
27529
|
-
return (React.createElement("div", { className: "ndc-
|
27273
|
+
return (React.createElement("div", { className: "ndc-management content-container" },
|
27530
27274
|
React.createElement("div", { className: "title-bar" },
|
27531
27275
|
React.createElement(antd.Row, { justify: "space-between", align: "middle" },
|
27532
27276
|
React.createElement(antd.Col, { span: 20 },
|
27533
27277
|
React.createElement("div", { className: "body-title" }, t("ndc:ndcTitle")),
|
27534
27278
|
React.createElement("div", { className: "body-sub-title" }, t("ndc:ndcSubTitle"))))),
|
27535
27279
|
React.createElement("div", null,
|
27536
|
-
React.createElement(antd.Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey:
|
27537
|
-
React.createElement("div", null,
|
27538
|
-
|
27539
|
-
|
27540
|
-
|
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
|
+
} }))))));
|
27541
27294
|
};
|
27542
27295
|
|
27543
27296
|
var ImgWithFallback = function (_a) {
|
@@ -28110,8 +27863,8 @@ var ProgrammeTransferForm = function (props) {
|
|
28110
27863
|
},
|
28111
27864
|
{
|
28112
27865
|
key: "companyRole",
|
28113
|
-
operation: "
|
28114
|
-
value:
|
27866
|
+
operation: "=",
|
27867
|
+
value: exports.CompanyRole.PROGRAMME_DEVELOPER,
|
28115
27868
|
},
|
28116
27869
|
],
|
28117
27870
|
sort: {
|
@@ -29330,7 +29083,7 @@ exports.getCreditStageVal = getCreditStageVal;
|
|
29330
29083
|
exports.getFinancialFields = getFinancialFields;
|
29331
29084
|
exports.getGeneralFields = getGeneralFields;
|
29332
29085
|
exports.getInvestmentStatusEnumVal = getInvestmentStatusEnumVal;
|
29333
|
-
exports.getNdcActionStatusEnumVal = getNdcActionStatusEnumVal
|
29086
|
+
exports.getNdcActionStatusEnumVal = getNdcActionStatusEnumVal;
|
29334
29087
|
exports.getNdcStatusTagType = getNdcStatusTagType;
|
29335
29088
|
exports.getRetirementTypeString = getRetirementTypeString;
|
29336
29089
|
exports.getStageEnumVal = getStageEnumVal;
|