@undp/carbon-library 1.0.274-CARBON-338.2 → 1.0.274-CARBON-363.43
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 +790 -543
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/Components/Common/AntComponents/antTableComponents.d.ts +9 -6
- package/dist/cjs/types/Definitions/Definitions/ndcDetails.definitions.d.ts +42 -0
- package/dist/esm/index.js +792 -545
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Components/Common/AntComponents/antTableComponents.d.ts +9 -6
- package/dist/esm/types/Definitions/Definitions/ndcDetails.definitions.d.ts +42 -0
- package/dist/locales/i18n/ndc/en.json +28 -3
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
@@ -2047,7 +2047,7 @@ exports.NdcActionStatus = void 0;
|
|
2047
2047
|
NdcActionStatus["PENDING"] = "Pending";
|
2048
2048
|
NdcActionStatus["APPROVED"] = "Approved";
|
2049
2049
|
})(exports.NdcActionStatus || (exports.NdcActionStatus = {}));
|
2050
|
-
var getNdcActionStatusEnumVal = function (value) {
|
2050
|
+
var getNdcActionStatusEnumVal$1 = function (value) {
|
2051
2051
|
var index = Object.keys(exports.NdcActionStatus).indexOf(value);
|
2052
2052
|
if (index < 0) {
|
2053
2053
|
return value;
|
@@ -2055,7 +2055,7 @@ var getNdcActionStatusEnumVal = function (value) {
|
|
2055
2055
|
return Object.values(exports.NdcActionStatus)[index];
|
2056
2056
|
};
|
2057
2057
|
var getNdcStatusTagType = function (status) {
|
2058
|
-
switch (getNdcActionStatusEnumVal(status)) {
|
2058
|
+
switch (getNdcActionStatusEnumVal$1(status)) {
|
2059
2059
|
case exports.NdcActionStatus.PENDING:
|
2060
2060
|
return "processing";
|
2061
2061
|
case exports.NdcActionStatus.APPROVED:
|
@@ -26675,622 +26675,869 @@ var RegistryDashboardComponent = function (props) {
|
|
26675
26675
|
lastUpdateTransferLocations))))))))) : ("")));
|
26676
26676
|
};
|
26677
26677
|
|
26678
|
-
|
26679
|
-
var EditableRow = function (_a) {
|
26680
|
-
_a.index; var props = __rest(_a, ["index"]);
|
26681
|
-
var form = antd.Form.useForm()[0];
|
26682
|
-
return (React.createElement(antd.Form, { form: form, component: false },
|
26683
|
-
React.createElement(EditableContext.Provider, { value: form },
|
26684
|
-
React.createElement("tr", __assign({}, props)))));
|
26685
|
-
};
|
26678
|
+
React.createContext(null);
|
26686
26679
|
var EditableCell = function (_a) {
|
26687
|
-
var
|
26688
|
-
|
26689
|
-
|
26690
|
-
|
26691
|
-
|
26692
|
-
|
26693
|
-
|
26694
|
-
|
26695
|
-
|
26696
|
-
|
26697
|
-
|
26698
|
-
|
26699
|
-
|
26700
|
-
|
26701
|
-
|
26702
|
-
|
26703
|
-
|
26704
|
-
|
26705
|
-
|
26706
|
-
|
26707
|
-
|
26708
|
-
|
26709
|
-
|
26710
|
-
|
26711
|
-
|
26712
|
-
|
26713
|
-
|
26714
|
-
|
26715
|
-
|
26716
|
-
|
26717
|
-
|
26718
|
-
|
26719
|
-
|
26720
|
-
|
26721
|
-
|
26722
|
-
|
26723
|
-
|
26724
|
-
|
26725
|
-
|
26726
|
-
|
26727
|
-
|
26728
|
-
] },
|
26729
|
-
React.createElement(antd.Input, { ref: inputRef, onPressEnter: save, onBlur: save }))) : (React.createElement("div", { className: "editable-cell-value-wrap", style: { paddingRight: 24, minWidth: "100px", minHeight: "20px" }, onClick: toggleEdit }, children));
|
26730
|
-
}
|
26731
|
-
return React.createElement("td", __assign({}, restProps), childNode);
|
26680
|
+
var editing = _a.editing, dataIndex = _a.dataIndex, title = _a.title; _a.inputType; var record = _a.record; _a.index; var children = _a.children, onBlurHandler = _a.onBlurHandler, t = _a.t, restProps = __rest(_a, ["editing", "dataIndex", "title", "inputType", "record", "index", "children", "onBlurHandler", "t"]);
|
26681
|
+
return (React.createElement("td", __assign({}, restProps), editing && dataIndex === "nationalPlanObjective" ? (React.createElement(antd.Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [
|
26682
|
+
{
|
26683
|
+
validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
|
26684
|
+
var trimValue;
|
26685
|
+
return __generator(this, function (_a) {
|
26686
|
+
trimValue = typeof value === "string" ? value.trim() : value;
|
26687
|
+
if (!trimValue) {
|
26688
|
+
throw new Error("".concat(title, " ").concat(t("ndc:isRequired")));
|
26689
|
+
}
|
26690
|
+
return [2 /*return*/];
|
26691
|
+
});
|
26692
|
+
}); },
|
26693
|
+
},
|
26694
|
+
] },
|
26695
|
+
React.createElement(antd.Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:nationalPlanObjectivePlaceHolder") }))) : editing && dataIndex === "kpi" ? (React.createElement(antd.Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [
|
26696
|
+
{
|
26697
|
+
validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
|
26698
|
+
var trimValue;
|
26699
|
+
return __generator(this, function (_a) {
|
26700
|
+
trimValue = typeof value === "string" ? value.trim() : value;
|
26701
|
+
if (trimValue) {
|
26702
|
+
if (isNaN(+trimValue)) {
|
26703
|
+
throw new Error(t("ndc:kpiInvalidFormat"));
|
26704
|
+
}
|
26705
|
+
else if (+trimValue === 0) {
|
26706
|
+
throw new Error(t("ndc:kpiGreaterThanZero"));
|
26707
|
+
}
|
26708
|
+
else if (trimValue.toString().length > 7) {
|
26709
|
+
throw new Error(t("ndc:kpiMaxLength"));
|
26710
|
+
}
|
26711
|
+
}
|
26712
|
+
else {
|
26713
|
+
throw new Error("".concat(title, " ").concat(t("ndc:isRequired")));
|
26714
|
+
}
|
26715
|
+
return [2 /*return*/];
|
26716
|
+
});
|
26717
|
+
}); },
|
26718
|
+
},
|
26719
|
+
] },
|
26720
|
+
React.createElement(antd.Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:kpiPlaceHolder") }))) : (children)));
|
26732
26721
|
};
|
26733
26722
|
|
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";
|
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\n.ndc-details .ant-input-number-input-wrap {\n margin-right: 10px; }\n\n.ndc-details tbody {\n vertical-align: top; }\n\n.ndc-details td .ant-space-item {\n margin-top: 5px; }\n\n.ndc-details .btn-danger {\n color: #ff4d4f !important;\n border-color: #ff8183 !important; }\n\n.ndc-details .btnAddNewMainAct {\n margin-bottom: 16;\n width: 100%;\n height: 45px;\n border-radius: 10px;\n border: 1px solid rgba(58, 53, 65, 0.5);\n background: #FFF;\n color: #16b1ff;\n text-align: center;\n font-family: Inter;\n font-size: 16px;\n font-style: normal;\n font-weight: 500; }\n\n.ndc-details .btnAddNewMainAct:disabled {\n color: rgba(0, 0, 0, 0.25);\n border-color: #d9d9d9;\n background: #f5f5f5;\n text-shadow: none;\n box-shadow: none; }\n";
|
26735
26724
|
styleInject(css_248z$4);
|
26736
26725
|
|
26737
|
-
var
|
26738
|
-
(function (
|
26739
|
-
|
26740
|
-
|
26741
|
-
})(
|
26726
|
+
var NdcDetailsActionType;
|
26727
|
+
(function (NdcDetailsActionType) {
|
26728
|
+
NdcDetailsActionType["MainAction"] = "MainAction";
|
26729
|
+
NdcDetailsActionType["SubAction"] = "SubAction";
|
26730
|
+
})(NdcDetailsActionType || (NdcDetailsActionType = {}));
|
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
|
+
|
26742
26758
|
var NdcDetailsComponent = function (props) {
|
26743
|
-
var t = props.t
|
26759
|
+
var t = props.t, useConnection = props.useConnection, useUserContext = props.useUserContext;
|
26744
26760
|
var RangePicker = antd.DatePicker.RangePicker;
|
26745
|
-
var _a = React.useState([]),
|
26746
|
-
var _b = React.useState(false), loading = _b[0]
|
26747
|
-
var periodItemsRef = React.useRef([]);
|
26761
|
+
var _a = React.useState([]), ndcActionsList = _a[0], setNdcActionsList = _a[1];
|
26762
|
+
var _b = React.useState(false), loading = _b[0], setLoading = _b[1];
|
26748
26763
|
var _c = React.useState([]), periodItems = _c[0], setPeriodItems = _c[1];
|
26749
|
-
var _d = React.useState(
|
26750
|
-
var
|
26751
|
-
var addedNdcDetailId = React.useRef(0);
|
26752
|
-
var selectedNdcDetail = React.useRef({});
|
26764
|
+
var _d = React.useState({}), selectedPeriod = _d[0], setSelectedPeriod = _d[1];
|
26765
|
+
var selectedDateRangeRef = React.useRef({});
|
26753
26766
|
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
|
+
};
|
26754
26788
|
var userInfoState = useUserContext().userInfoState;
|
26755
|
-
|
26756
|
-
|
26757
|
-
|
26789
|
+
React.useEffect(function () {
|
26790
|
+
if (expandedRowKeys && expandedRowKeys.length > 0) {
|
26791
|
+
var expandedKey = expandedRowKeys[0];
|
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)) &&
|
26758
26813
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly);
|
26759
26814
|
};
|
26760
|
-
var
|
26761
|
-
return (
|
26815
|
+
var checkSubNdcActionCreatePermission = function () {
|
26816
|
+
return (!selectedPeriod.finalized &&
|
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) &&
|
26762
26819
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly);
|
26763
26820
|
};
|
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
|
+
};
|
26764
26860
|
var inRange = function (num, min, max) {
|
26765
26861
|
return num >= min && num <= max;
|
26766
26862
|
};
|
26767
|
-
function
|
26768
|
-
var
|
26769
|
-
|
26770
|
-
|
26771
|
-
|
26772
|
-
|
26773
|
-
|
26774
|
-
|
26775
|
-
|
26776
|
-
|
26777
|
-
|
26778
|
-
|
26779
|
-
|
26780
|
-
|
26781
|
-
|
26782
|
-
|
26783
|
-
|
26784
|
-
|
26785
|
-
|
26786
|
-
|
26787
|
-
|
26788
|
-
|
26789
|
-
|
26790
|
-
}
|
26791
|
-
var handleSave = function (row) {
|
26792
|
-
setNdcDetailsData(function (prevData) {
|
26793
|
-
var newData = JSON.parse(JSON.stringify(prevData));
|
26794
|
-
if (row.type === NdcActionType.main) {
|
26795
|
-
var index = newData.findIndex(function (item) { return row.key === item.key; });
|
26796
|
-
if (index !== -1) {
|
26797
|
-
newData[index] = __assign(__assign({}, newData[index]), row);
|
26798
|
-
}
|
26799
|
-
}
|
26800
|
-
else {
|
26801
|
-
var parentIndex = newData.findIndex(function (item) { return row.ndcActionId === item.key; });
|
26802
|
-
var parentItem = newData[parentIndex];
|
26803
|
-
if (parentItem) {
|
26804
|
-
if (parentItem.subNdcDetails) {
|
26805
|
-
var itemIndex = parentItem.subNdcDetails.findIndex(function (item) { return row.key === item.key; });
|
26806
|
-
if (itemIndex === -1) {
|
26807
|
-
parentItem.subNdcDetails.push(row);
|
26808
|
-
}
|
26809
|
-
else {
|
26810
|
-
parentItem.subNdcDetails[itemIndex] = __assign({}, row);
|
26811
|
-
}
|
26863
|
+
var handleSave = function (row) { return __awaiter(void 0, void 0, void 0, function () {
|
26864
|
+
var updatedFields, updatedItem, exception_2;
|
26865
|
+
return __generator(this, function (_a) {
|
26866
|
+
switch (_a.label) {
|
26867
|
+
case 0:
|
26868
|
+
_a.trys.push([0, 9, , 10]);
|
26869
|
+
updatedFields = void 0;
|
26870
|
+
_a.label = 1;
|
26871
|
+
case 1:
|
26872
|
+
_a.trys.push([1, 3, , 4]);
|
26873
|
+
return [4 /*yield*/, form.validateFields()];
|
26874
|
+
case 2:
|
26875
|
+
updatedFields = (_a.sent());
|
26876
|
+
return [3 /*break*/, 4];
|
26877
|
+
case 3:
|
26878
|
+
_a.sent();
|
26879
|
+
return [2 /*return*/];
|
26880
|
+
case 4:
|
26881
|
+
updatedItem = __assign(__assign({}, row), updatedFields);
|
26882
|
+
if (!(updatedItem.status === NdcDetailsActionStatus.New)) return [3 /*break*/, 6];
|
26883
|
+
if (isGovernmentUser &&
|
26884
|
+
updatedItem.actionType === NdcDetailsActionType.SubAction) {
|
26885
|
+
updatedItem.status = NdcDetailsActionStatus.Approved;
|
26812
26886
|
}
|
26813
26887
|
else {
|
26814
|
-
|
26888
|
+
updatedItem.status = NdcDetailsActionStatus.Pending;
|
26815
26889
|
}
|
26816
|
-
|
26817
|
-
|
26818
|
-
|
26890
|
+
return [4 /*yield*/, post("national/programme/addNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseInt(updatedItem.kpi.toString()) }))];
|
26891
|
+
case 5:
|
26892
|
+
_a.sent();
|
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*/];
|
26819
26915
|
}
|
26820
|
-
return newData;
|
26821
26916
|
});
|
26822
|
-
};
|
26823
|
-
var
|
26824
|
-
|
26825
|
-
|
26826
|
-
|
26827
|
-
|
26828
|
-
|
26829
|
-
|
26830
|
-
|
26831
|
-
|
26832
|
-
|
26833
|
-
|
26834
|
-
|
26835
|
-
|
26836
|
-
|
26837
|
-
|
26838
|
-
|
26839
|
-
|
26840
|
-
|
26841
|
-
|
26842
|
-
|
26843
|
-
|
26844
|
-
|
26845
|
-
|
26846
|
-
|
26847
|
-
|
26917
|
+
}); };
|
26918
|
+
var actionMenu = function (record) {
|
26919
|
+
if (record.status === NdcDetailsActionStatus.Pending &&
|
26920
|
+
isGovernmentUser &&
|
26921
|
+
!selectedPeriod.finalized) {
|
26922
|
+
return (React.createElement(antd.List, { className: "action-menu", size: "small", dataSource: [
|
26923
|
+
{
|
26924
|
+
text: t("ndc:approve"),
|
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))); } }));
|
26848
26954
|
}
|
26849
26955
|
else {
|
26850
|
-
return
|
26956
|
+
return null;
|
26851
26957
|
}
|
26852
26958
|
};
|
26853
26959
|
var defaultColumns = [
|
26854
26960
|
{
|
26855
26961
|
title: t("ndc:ndcColumnsNationalPlanObj"),
|
26856
|
-
dataIndex: "
|
26857
|
-
key: "
|
26962
|
+
dataIndex: "nationalPlanObjective",
|
26963
|
+
key: "nationalPlanObjective",
|
26858
26964
|
align: "left",
|
26965
|
+
width: 400,
|
26859
26966
|
editable: true,
|
26860
|
-
|
26861
|
-
|
26862
|
-
React.createElement("span", null, record.nationalPlanObj))) : (React.createElement("input", { placeholder: "Please add Programmes", className: "ant-input", type: "text" })))); },
|
26967
|
+
render: function (_, record) { return (React.createElement(antd.Space, { size: "middle" }, record.nationalPlanObjective ? (React.createElement(antd.Tooltip, { title: isNdcActionEditable(record) ? "" : t("ndc:ndcUnauthorisedMsg") },
|
26968
|
+
React.createElement("span", null, record.nationalPlanObjective))) : (React.createElement(antd.Input, { placeholder: "Enter National Plan Objective" })))); },
|
26863
26969
|
},
|
26864
26970
|
{
|
26865
26971
|
title: t("ndc:ndcColumnsKpi"),
|
26866
26972
|
dataIndex: "kpi",
|
26867
26973
|
key: "kpi",
|
26868
26974
|
align: "left",
|
26975
|
+
width: 100,
|
26869
26976
|
editable: true,
|
26870
|
-
|
26871
|
-
|
26872
|
-
React.createElement("span", null, record.kpi))) : (React.createElement("input", { placeholder: "Enter Kpi", className: "ant-input", type: "text" })))); },
|
26977
|
+
render: function (_, record) { return (React.createElement(antd.Space, { size: "middle" }, record.kpi ? (React.createElement(antd.Tooltip, { title: isNdcActionEditable(record) ? "" : t("ndc:ndcUnauthorisedMsg") },
|
26978
|
+
React.createElement("span", null, record.kpi))) : (React.createElement(antd.Input, { placeholder: "Enter Kpi" })))); },
|
26873
26979
|
},
|
26874
26980
|
{
|
26875
|
-
title: "
|
26876
|
-
dataIndex: "
|
26877
|
-
key: "
|
26981
|
+
title: t("ndc:ndcColumnsMinistry"),
|
26982
|
+
dataIndex: "ministryName",
|
26983
|
+
key: "ministryName",
|
26878
26984
|
align: "left",
|
26879
|
-
|
26880
|
-
|
26881
|
-
render: function (_, record) { return (React.createElement(
|
26882
|
-
React.createElement(
|
26985
|
+
width: 300,
|
26986
|
+
editable: false,
|
26987
|
+
render: function (_, record) { return (React.createElement(antd.Tooltip, { title: isSubNdcActionsEditable(record) ? "" : t("ndc:ndcUnauthorisedMsg") },
|
26988
|
+
React.createElement(antd.Select, { disabled: !(isSubNdcActionsEditable(record) && isEditing(record)), defaultValue: record.ministryName ? record.ministryName : loginMinistry, style: { width: 220 }, onChange: function (value, option) {
|
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
|
+
},
|
26883
27013
|
},
|
26884
27014
|
];
|
26885
27015
|
var columns = defaultColumns.map(function (col) {
|
26886
27016
|
if (!col.editable) {
|
26887
27017
|
return col;
|
26888
27018
|
}
|
26889
|
-
return __assign(__assign({}, col), { onCell: function (record) {
|
26890
|
-
|
26891
|
-
|
26892
|
-
|
26893
|
-
|
26894
|
-
|
26895
|
-
|
27019
|
+
return __assign(__assign({}, col), { onCell: function (record) {
|
27020
|
+
return {
|
27021
|
+
record: record,
|
27022
|
+
editing: isEditing(record),
|
27023
|
+
dataIndex: col.dataIndex,
|
27024
|
+
title: col.title,
|
27025
|
+
onBlurHandler: function (record) {
|
27026
|
+
if (isEditing(record)) {
|
27027
|
+
handleSave(record);
|
27028
|
+
}
|
27029
|
+
},
|
27030
|
+
t: t,
|
27031
|
+
};
|
27032
|
+
} });
|
26896
27033
|
});
|
26897
|
-
function
|
26898
|
-
|
26899
|
-
|
26900
|
-
|
26901
|
-
|
26902
|
-
|
26903
|
-
|
26904
|
-
|
26905
|
-
|
26906
|
-
|
26907
|
-
|
26908
|
-
|
26909
|
-
|
26910
|
-
|
26911
|
-
|
26912
|
-
|
26913
|
-
|
26914
|
-
|
26915
|
-
|
26916
|
-
|
26917
|
-
|
26918
|
-
|
26919
|
-
|
26920
|
-
|
26921
|
-
|
27034
|
+
function onClickedAddNewNdcDetail() {
|
27035
|
+
return __awaiter(this, void 0, void 0, function () {
|
27036
|
+
var periodId, newData_1, lastPage;
|
27037
|
+
return __generator(this, function (_a) {
|
27038
|
+
if (selectedPeriod.key !== "add_new") {
|
27039
|
+
form.setFieldsValue({
|
27040
|
+
nationalPlanObjective: "",
|
27041
|
+
kpi: "",
|
27042
|
+
});
|
27043
|
+
periodId = parseInt(selectedPeriod.key);
|
27044
|
+
newData_1 = {
|
27045
|
+
id: nextAvailableActionId,
|
27046
|
+
actionType: NdcDetailsActionType.MainAction,
|
27047
|
+
nationalPlanObjective: "",
|
27048
|
+
kpi: "",
|
27049
|
+
ministryName: loginMinistry,
|
27050
|
+
periodId: periodId,
|
27051
|
+
status: NdcDetailsActionStatus.New,
|
27052
|
+
};
|
27053
|
+
setEditingKey(nextAvailableActionId);
|
27054
|
+
setNextAvailableActionId(function (value) { return value + 1; });
|
27055
|
+
setNdcActionsList(function (ndcActionsList) { return __spreadArray(__spreadArray([], ndcActionsList, true), [
|
27056
|
+
newData_1,
|
27057
|
+
], false); });
|
27058
|
+
setTableKey(function (key) { return key + 1; });
|
27059
|
+
if (ndcMainDetailsForPeriod.length + 1 > pageSize) {
|
27060
|
+
lastPage = Math.ceil(ndcMainDetailsForPeriod.length / pageSize);
|
27061
|
+
setCurrentPage(lastPage);
|
27062
|
+
}
|
27063
|
+
}
|
27064
|
+
return [2 /*return*/];
|
27065
|
+
});
|
27066
|
+
});
|
26922
27067
|
}
|
26923
27068
|
var components = {
|
26924
27069
|
body: {
|
26925
|
-
row: EditableRow,
|
26926
27070
|
cell: EditableCell,
|
26927
27071
|
},
|
26928
27072
|
};
|
26929
|
-
|
26930
|
-
|
26931
|
-
|
26932
|
-
|
26933
|
-
|
26934
|
-
|
26935
|
-
|
26936
|
-
|
26937
|
-
// marginBottom: 16,
|
26938
|
-
// }}
|
26939
|
-
// >
|
26940
|
-
// Add a row
|
26941
|
-
// </Button>
|
26942
|
-
// <Table
|
26943
|
-
// components={components}
|
26944
|
-
// rowClassName={() => 'editable-row'}
|
26945
|
-
// bordered
|
26946
|
-
// dataSource={ndcDetailsData}
|
26947
|
-
// columns={columns}
|
26948
|
-
// />
|
26949
|
-
// </div>
|
26950
|
-
);
|
26951
|
-
}
|
26952
|
-
var onCancelPeriod = function () { };
|
26953
|
-
var onAddNewPeriod = function () {
|
26954
|
-
if (selectedPeriod &&
|
26955
|
-
selectedPeriod.current &&
|
26956
|
-
selectedPeriod.current.start &&
|
26957
|
-
selectedPeriod.current.end) {
|
26958
|
-
var newPeriodItem_1 = {
|
26959
|
-
key: "".concat(selectedPeriod.current.start, "-").concat(selectedPeriod.current.end),
|
26960
|
-
label: "".concat(selectedPeriod.current.start, "-").concat(selectedPeriod.current.end),
|
26961
|
-
start: selectedPeriod.current.start,
|
26962
|
-
end: selectedPeriod.current.end,
|
26963
|
-
children: ndcDetailsTableContent(),
|
26964
|
-
};
|
26965
|
-
var existingIndex = periodItemsRef.current.findIndex(function (item) {
|
26966
|
-
return inRange(newPeriodItem_1.start, item.start, item.end) ||
|
26967
|
-
inRange(newPeriodItem_1.end, item.start, item.end);
|
27073
|
+
var onClickedDeletePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27074
|
+
return __generator(this, function (_a) {
|
27075
|
+
setActionInfo({
|
27076
|
+
action: "Delete",
|
27077
|
+
headerText: t("ndc:periodDeleteConfirmTitle"),
|
27078
|
+
type: "danger",
|
27079
|
+
icon: React.createElement(Icon__namespace.XCircle, null),
|
27080
|
+
recordId: selectedPeriod.key,
|
26968
27081
|
});
|
26969
|
-
|
26970
|
-
|
26971
|
-
|
27082
|
+
setOpenConfirmationModal(true);
|
27083
|
+
return [2 /*return*/];
|
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*/];
|
26972
27097
|
}
|
26973
|
-
|
27098
|
+
isPendingActionAvailable = false;
|
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) {
|
26974
27111
|
antd.message.open({
|
26975
27112
|
type: "error",
|
26976
|
-
content: t("ndc:
|
27113
|
+
content: t("ndc:finalizeErrorText"),
|
26977
27114
|
duration: 3,
|
26978
27115
|
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
26979
27116
|
});
|
26980
27117
|
}
|
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);
|
26981
27136
|
}
|
26982
|
-
|
26983
|
-
|
26984
|
-
if (periodItems && periodItems.length > 3) {
|
26985
|
-
setSelectedTab(periodItems[periodItems.length - 1].key);
|
26986
|
-
}
|
26987
|
-
}, [periodItems]);
|
26988
|
-
var onDateRangeChanged = function (range) {
|
26989
|
-
var period = {
|
26990
|
-
start: Number(moment(range[0]).year()),
|
26991
|
-
end: Number(moment(range[1]).year()),
|
26992
|
-
};
|
26993
|
-
selectedPeriod.current = period;
|
27137
|
+
setExpandedRowKeys(keys);
|
27138
|
+
setNdcSubActionsForMainAction(record.id);
|
26994
27139
|
};
|
26995
27140
|
function addNewPeriodContent() {
|
26996
27141
|
return (React.createElement("div", null,
|
26997
|
-
React.createElement(antd.Row,
|
26998
|
-
React.createElement(
|
26999
|
-
|
27000
|
-
React.createElement(
|
27001
|
-
React.createElement(antd.Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit"))
|
27002
|
-
React.createElement(antd.Button, { className: "back-btn", onClick: onCancelPeriod, loading: loading }, t("ndc:back"))))));
|
27003
|
-
}
|
27004
|
-
function getSubNdcActionContent(record) {
|
27005
|
-
selectedNdcDetail.current = record;
|
27006
|
-
return (React.createElement(antd.Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getSubNdcDetails(record.key), columns: columns, showHeader: false, pagination: false }));
|
27142
|
+
React.createElement(antd.Row, { justify: "start", align: "middle", gutter: [16, 16] },
|
27143
|
+
React.createElement(antd.Col, { flex: "340px" },
|
27144
|
+
React.createElement(RangePicker, { disabledDate: function (current) { return moment(current).year() < 1900; }, onChange: onDateRangeChanged, picker: "year" })),
|
27145
|
+
React.createElement(antd.Col, { flex: "auto" },
|
27146
|
+
React.createElement(antd.Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit"))))));
|
27007
27147
|
}
|
27008
|
-
var
|
27009
|
-
|
27148
|
+
var onChange = function (page, size) {
|
27149
|
+
setCurrentPage(page);
|
27150
|
+
setPageSize(size);
|
27010
27151
|
};
|
27011
|
-
|
27012
|
-
|
27013
|
-
|
27014
|
-
|
27015
|
-
|
27016
|
-
|
27017
|
-
|
27018
|
-
|
27019
|
-
|
27020
|
-
|
27021
|
-
|
27022
|
-
|
27023
|
-
|
27024
|
-
|
27025
|
-
|
27026
|
-
|
27027
|
-
|
27028
|
-
|
27029
|
-
|
27030
|
-
|
27031
|
-
|
27032
|
-
|
27033
|
-
|
27034
|
-
|
27035
|
-
|
27036
|
-
|
27037
|
-
|
27038
|
-
|
27039
|
-
|
27040
|
-
|
27041
|
-
|
27042
|
-
|
27043
|
-
|
27044
|
-
|
27045
|
-
|
27046
|
-
|
27047
|
-
|
27048
|
-
|
27049
|
-
|
27050
|
-
|
27051
|
-
|
27052
|
-
|
27053
|
-
|
27054
|
-
|
27055
|
-
|
27056
|
-
|
27057
|
-
|
27058
|
-
|
27059
|
-
|
27060
|
-
|
27061
|
-
|
27062
|
-
|
27063
|
-
],
|
27064
|
-
},
|
27065
|
-
{
|
27066
|
-
key: 12,
|
27067
|
-
type: NdcActionType.main,
|
27068
|
-
startDate: new Date("2019-03-25"),
|
27069
|
-
endDate: new Date("2019-08-25"),
|
27070
|
-
nationalPlanObj: "Other",
|
27071
|
-
kpi: 10500,
|
27072
|
-
ministry: "Ministry of Environment",
|
27073
|
-
subNdcDetails: [
|
27074
|
-
{
|
27075
|
-
key: 8,
|
27076
|
-
ndcActionId: 12,
|
27077
|
-
type: NdcActionType.sub,
|
27078
|
-
startDate: new Date("2019-03-25"),
|
27079
|
-
endDate: new Date("2020-03-25"),
|
27080
|
-
nationalPlanObj: "",
|
27081
|
-
kpi: "",
|
27082
|
-
ministry: "",
|
27083
|
-
},
|
27084
|
-
],
|
27085
|
-
},
|
27086
|
-
{
|
27087
|
-
key: 3,
|
27088
|
-
type: NdcActionType.main,
|
27089
|
-
startDate: new Date("2021-03-25"),
|
27090
|
-
endDate: new Date("2022-03-25"),
|
27091
|
-
nationalPlanObj: "Consolidate and increase the stock and quality of productive infrastructure by 50%",
|
27092
|
-
kpi: 48,
|
27093
|
-
ministry: "Ministry of Environment",
|
27094
|
-
subNdcDetails: [
|
27095
|
-
{
|
27096
|
-
key: 9,
|
27097
|
-
ndcActionId: 3,
|
27098
|
-
type: NdcActionType.sub,
|
27099
|
-
startDate: new Date("2019-03-25"),
|
27100
|
-
endDate: new Date("2020-03-25"),
|
27101
|
-
nationalPlanObj: "",
|
27102
|
-
kpi: "",
|
27103
|
-
ministry: "",
|
27104
|
-
},
|
27105
|
-
],
|
27106
|
-
},
|
27107
|
-
{
|
27108
|
-
key: 4,
|
27109
|
-
type: NdcActionType.main,
|
27110
|
-
startDate: new Date("2022-03-25"),
|
27111
|
-
endDate: new Date("2022-05-25"),
|
27112
|
-
nationalPlanObj: "Enhance the productivity and social wellbeing of the population",
|
27113
|
-
kpi: 20,
|
27114
|
-
ministry: "Ministry of Environment",
|
27115
|
-
subNdcDetails: [
|
27116
|
-
{
|
27117
|
-
key: 10,
|
27118
|
-
ndcActionId: 4,
|
27119
|
-
type: NdcActionType.sub,
|
27120
|
-
startDate: new Date("2019-03-25"),
|
27121
|
-
endDate: new Date("2020-03-25"),
|
27122
|
-
nationalPlanObj: "",
|
27123
|
-
kpi: "",
|
27124
|
-
ministry: "",
|
27125
|
-
},
|
27126
|
-
],
|
27127
|
-
},
|
27128
|
-
{
|
27129
|
-
key: 5,
|
27130
|
-
type: NdcActionType.main,
|
27131
|
-
startDate: new Date("2022-03-25"),
|
27132
|
-
endDate: new Date("2023-03-25"),
|
27133
|
-
nationalPlanObj: "Strengthen the role of the state in guiding and facilitating development",
|
27134
|
-
kpi: 10,
|
27135
|
-
ministry: "Ministry of Environment",
|
27136
|
-
subNdcDetails: [
|
27137
|
-
{
|
27138
|
-
key: 11,
|
27139
|
-
ndcActionId: 5,
|
27140
|
-
type: NdcActionType.sub,
|
27141
|
-
startDate: new Date("2019-03-25"),
|
27142
|
-
endDate: new Date("2020-03-25"),
|
27143
|
-
nationalPlanObj: "",
|
27144
|
-
kpi: "",
|
27145
|
-
ministry: "",
|
27146
|
-
},
|
27147
|
-
],
|
27148
|
-
},
|
27149
|
-
{
|
27150
|
-
key: 13,
|
27151
|
-
type: NdcActionType.main,
|
27152
|
-
startDate: new Date("2022-03-25"),
|
27153
|
-
endDate: new Date("2023-03-25"),
|
27154
|
-
nationalPlanObj: "Convert to solar energy",
|
27155
|
-
kpi: 50000,
|
27156
|
-
ministry: "Ministry of Environment",
|
27157
|
-
subNdcDetails: [
|
27158
|
-
{
|
27159
|
-
key: 11,
|
27160
|
-
ndcActionId: 13,
|
27161
|
-
type: NdcActionType.sub,
|
27162
|
-
startDate: new Date("2019-03-25"),
|
27163
|
-
endDate: new Date("2020-03-25"),
|
27164
|
-
nationalPlanObj: "Convert to solar energy",
|
27165
|
-
kpi: "3000",
|
27166
|
-
ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
|
27167
|
-
},
|
27168
|
-
{
|
27169
|
-
key: 14,
|
27170
|
-
ndcActionId: 13,
|
27171
|
-
type: NdcActionType.sub,
|
27172
|
-
startDate: new Date("2019-03-25"),
|
27173
|
-
endDate: new Date("2020-03-25"),
|
27174
|
-
nationalPlanObj: "",
|
27175
|
-
kpi: "",
|
27176
|
-
ministry: "",
|
27177
|
-
},
|
27178
|
-
],
|
27179
|
-
},
|
27180
|
-
{
|
27181
|
-
key: 15,
|
27182
|
-
type: NdcActionType.main,
|
27183
|
-
startDate: new Date("2022-03-25"),
|
27184
|
-
endDate: new Date("2023-03-25"),
|
27185
|
-
nationalPlanObj: "Strengthen the private sector to create jobs",
|
27186
|
-
kpi: 10000,
|
27187
|
-
ministry: "Ministry of Environment",
|
27188
|
-
subNdcDetails: [
|
27189
|
-
{
|
27190
|
-
key: 16,
|
27191
|
-
ndcActionId: 15,
|
27192
|
-
type: NdcActionType.sub,
|
27193
|
-
startDate: new Date("2019-03-25"),
|
27194
|
-
endDate: new Date("2020-03-25"),
|
27195
|
-
nationalPlanObj: "Strengthen the private sector to create jobs",
|
27196
|
-
kpi: "7200",
|
27197
|
-
ministry: "Ministry of Tourism (MoT)",
|
27198
|
-
},
|
27199
|
-
{
|
27200
|
-
key: 17,
|
27201
|
-
ndcActionId: 15,
|
27202
|
-
type: NdcActionType.sub,
|
27203
|
-
startDate: new Date("2019-03-25"),
|
27204
|
-
endDate: new Date("2020-03-25"),
|
27205
|
-
nationalPlanObj: "",
|
27206
|
-
kpi: "",
|
27207
|
-
ministry: "",
|
27208
|
-
},
|
27209
|
-
],
|
27210
|
-
},
|
27211
|
-
{
|
27212
|
-
key: 18,
|
27213
|
-
type: NdcActionType.main,
|
27214
|
-
startDate: new Date("2022-03-25"),
|
27215
|
-
endDate: new Date("2023-03-25"),
|
27216
|
-
nationalPlanObj: "Other",
|
27217
|
-
kpi: "",
|
27218
|
-
ministry: "Ministry of Environment",
|
27219
|
-
subNdcDetails: [
|
27220
|
-
{
|
27221
|
-
key: 19,
|
27222
|
-
ndcActionId: 18,
|
27223
|
-
type: NdcActionType.sub,
|
27224
|
-
startDate: new Date("2019-03-25"),
|
27225
|
-
endDate: new Date("2020-03-25"),
|
27226
|
-
nationalPlanObj: "Strengthen the private sector to create jobs",
|
27227
|
-
kpi: "",
|
27228
|
-
ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
|
27152
|
+
function mainNdcActionTableContent() {
|
27153
|
+
return (React.createElement("div", null,
|
27154
|
+
React.createElement(antd.Row, null,
|
27155
|
+
React.createElement(antd.Col, { span: 24 },
|
27156
|
+
React.createElement(antd.Form, { form: form, component: false },
|
27157
|
+
React.createElement(antd.Table, { tableLayout: "fixed", key: tableKey, className: "common-table-class", rowKey: "id", pagination: {
|
27158
|
+
current: currentPage,
|
27159
|
+
pageSize: pageSize,
|
27160
|
+
total: ndcMainDetailsForPeriod.length,
|
27161
|
+
showQuickJumper: true,
|
27162
|
+
showSizeChanger: true,
|
27163
|
+
onChange: onChange,
|
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
|
+
}
|
27229
27204
|
},
|
27230
|
-
{
|
27231
|
-
|
27232
|
-
|
27233
|
-
|
27234
|
-
startDate: new Date("2019-03-25"),
|
27235
|
-
endDate: new Date("2020-03-25"),
|
27236
|
-
nationalPlanObj: "",
|
27237
|
-
kpi: "",
|
27238
|
-
ministry: "",
|
27205
|
+
onMouseLeave: function () {
|
27206
|
+
if (isEditing(record)) {
|
27207
|
+
handleSave(record);
|
27208
|
+
}
|
27239
27209
|
},
|
27240
|
-
|
27241
|
-
},
|
27242
|
-
|
27243
|
-
|
27244
|
-
|
27245
|
-
|
27246
|
-
|
27247
|
-
|
27248
|
-
|
27249
|
-
|
27250
|
-
|
27251
|
-
|
27252
|
-
|
27253
|
-
|
27254
|
-
|
27255
|
-
|
27256
|
-
|
27257
|
-
|
27258
|
-
|
27259
|
-
|
27260
|
-
|
27261
|
-
|
27262
|
-
|
27263
|
-
|
27264
|
-
|
27265
|
-
|
27266
|
-
|
27210
|
+
};
|
27211
|
+
}, columns: columns, showHeader: false, pagination: false }));
|
27212
|
+
}
|
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
|
+
}
|
27267
27282
|
}
|
27268
|
-
|
27269
|
-
|
27270
|
-
|
27271
|
-
|
27283
|
+
};
|
27284
|
+
var onTabChange = function (key) {
|
27285
|
+
var selectedPeriod = periodItems.find(function (item) { return item.key === key; });
|
27286
|
+
if (selectedPeriod) {
|
27287
|
+
setSelectedPeriod(selectedPeriod);
|
27288
|
+
}
|
27289
|
+
};
|
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
|
+
setExpandedRowKeys([]);
|
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
|
+
React.useEffect(function () {
|
27525
|
+
fetchNdcDetailPeriods();
|
27526
|
+
fetchNdcDetailActions();
|
27527
|
+
fetchMinistries();
|
27272
27528
|
}, []);
|
27273
|
-
return (React.createElement("div", { className: "ndc-
|
27529
|
+
return (React.createElement("div", { className: "ndc-details content-container" },
|
27274
27530
|
React.createElement("div", { className: "title-bar" },
|
27275
27531
|
React.createElement(antd.Row, { justify: "space-between", align: "middle" },
|
27276
27532
|
React.createElement(antd.Col, { span: 20 },
|
27277
27533
|
React.createElement("div", { className: "body-title" }, t("ndc:ndcTitle")),
|
27278
27534
|
React.createElement("div", { className: "body-sub-title" }, t("ndc:ndcSubTitle"))))),
|
27279
27535
|
React.createElement("div", null,
|
27280
|
-
React.createElement(antd.Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey:
|
27281
|
-
|
27282
|
-
|
27283
|
-
|
27284
|
-
|
27285
|
-
indentSize: 0,
|
27286
|
-
defaultExpandedRowKeys: [selectedNdcDetail.current.key],
|
27287
|
-
}, footer: function () {
|
27288
|
-
return isAddNdcActionVisible() && (React.createElement(antd.Row, { justify: "center" },
|
27289
|
-
React.createElement(antd.Button, { onClick: onAddNewNdcDetail, type: "default", style: {
|
27290
|
-
marginBottom: 16,
|
27291
|
-
width: "100%",
|
27292
|
-
} }, t("ndc:addNdcAction"))));
|
27293
|
-
} }))))));
|
27536
|
+
React.createElement(antd.Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedPeriod.key, onChange: onTabChange })),
|
27537
|
+
React.createElement("div", null, selectedPeriod.key === "add_new"
|
27538
|
+
? addNewPeriodContent()
|
27539
|
+
: mainNdcActionTableContent()),
|
27540
|
+
React.createElement(UserActionConfirmationModel, { t: t, actionInfo: actionInfo, onActionConfirmed: onActionConfirmed, onActionCanceled: onActionCanceled, openModal: openConfirmationModal, errorMsg: "", loading: loading })));
|
27294
27541
|
};
|
27295
27542
|
|
27296
27543
|
var ImgWithFallback = function (_a) {
|
@@ -27863,8 +28110,8 @@ var ProgrammeTransferForm = function (props) {
|
|
27863
28110
|
},
|
27864
28111
|
{
|
27865
28112
|
key: "companyRole",
|
27866
|
-
operation: "
|
27867
|
-
value:
|
28113
|
+
operation: "!=",
|
28114
|
+
value: "Certifier",
|
27868
28115
|
},
|
27869
28116
|
],
|
27870
28117
|
sort: {
|
@@ -29083,7 +29330,7 @@ exports.getCreditStageVal = getCreditStageVal;
|
|
29083
29330
|
exports.getFinancialFields = getFinancialFields;
|
29084
29331
|
exports.getGeneralFields = getGeneralFields;
|
29085
29332
|
exports.getInvestmentStatusEnumVal = getInvestmentStatusEnumVal;
|
29086
|
-
exports.getNdcActionStatusEnumVal = getNdcActionStatusEnumVal;
|
29333
|
+
exports.getNdcActionStatusEnumVal = getNdcActionStatusEnumVal$1;
|
29087
29334
|
exports.getNdcStatusTagType = getNdcStatusTagType;
|
29088
29335
|
exports.getRetirementTypeString = getRetirementTypeString;
|
29089
29336
|
exports.getStageEnumVal = getStageEnumVal;
|