@undp/carbon-library 1.0.274-CARBON-338.1 → 1.0.274-CARBON-363.27
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 +770 -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 +772 -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 +25 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
@@ -2047,7 +2047,7 @@ exports.NdcActionStatus = void 0;
|
|
2047
2047
|
NdcActionStatus["PENDING"] = "Pending";
|
2048
2048
|
NdcActionStatus["APPROVED"] = "Approved";
|
2049
2049
|
})(exports.NdcActionStatus || (exports.NdcActionStatus = {}));
|
2050
|
-
var getNdcActionStatusEnumVal = function (value) {
|
2050
|
+
var getNdcActionStatusEnumVal$1 = function (value) {
|
2051
2051
|
var index = Object.keys(exports.NdcActionStatus).indexOf(value);
|
2052
2052
|
if (index < 0) {
|
2053
2053
|
return value;
|
@@ -2055,7 +2055,7 @@ var getNdcActionStatusEnumVal = function (value) {
|
|
2055
2055
|
return Object.values(exports.NdcActionStatus)[index];
|
2056
2056
|
};
|
2057
2057
|
var getNdcStatusTagType = function (status) {
|
2058
|
-
switch (getNdcActionStatusEnumVal(status)) {
|
2058
|
+
switch (getNdcActionStatusEnumVal$1(status)) {
|
2059
2059
|
case exports.NdcActionStatus.PENDING:
|
2060
2060
|
return "processing";
|
2061
2061
|
case exports.NdcActionStatus.APPROVED:
|
@@ -26675,622 +26675,851 @@ 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 > 8) {
|
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
|
-
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" })))); },
|
26967
|
+
render: function (_, record) { return (React.createElement(antd.Space, { size: "middle" }, record.nationalPlanObjective ? (React.createElement("span", null, record.nationalPlanObjective)) : (React.createElement(antd.Input, { placeholder: "Enter National Plan Objective" })))); },
|
26863
26968
|
},
|
26864
26969
|
{
|
26865
26970
|
title: t("ndc:ndcColumnsKpi"),
|
26866
26971
|
dataIndex: "kpi",
|
26867
26972
|
key: "kpi",
|
26868
26973
|
align: "left",
|
26974
|
+
width: 100,
|
26869
26975
|
editable: true,
|
26870
|
-
|
26871
|
-
render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(antd.Space, { size: "middle" },
|
26872
|
-
React.createElement("span", null, record.kpi))) : (React.createElement("input", { placeholder: "Enter Kpi", className: "ant-input", type: "text" })))); },
|
26976
|
+
render: function (_, record) { return (React.createElement(antd.Space, { size: "middle" }, record.kpi ? (React.createElement("span", null, record.kpi)) : (React.createElement(antd.Input, { placeholder: "Enter Kpi" })))); },
|
26873
26977
|
},
|
26874
26978
|
{
|
26875
|
-
title: "
|
26876
|
-
dataIndex: "
|
26877
|
-
key: "
|
26979
|
+
title: t("ndc:ndcColumnsMinistry"),
|
26980
|
+
dataIndex: "ministryName",
|
26981
|
+
key: "ministryName",
|
26878
26982
|
align: "left",
|
26879
|
-
|
26880
|
-
|
26881
|
-
render: function (_, record) { return (React.createElement(React.Fragment, null,
|
26882
|
-
React.createElement(
|
26983
|
+
width: 300,
|
26984
|
+
editable: false,
|
26985
|
+
render: function (_, record) { return (React.createElement(React.Fragment, null,
|
26986
|
+
React.createElement(antd.Select, { disabled: !(isSubNdcActionsEditable(record) && isEditing(record)), defaultValue: record.ministryName ? record.ministryName : loginMinistry, style: { width: 220 }, onChange: function (value, option) {
|
26987
|
+
record.ministryName = option.label;
|
26988
|
+
handleSave(record);
|
26989
|
+
}, options: ministryOrgList }))); },
|
26990
|
+
},
|
26991
|
+
{
|
26992
|
+
title: t("ndc:ndcColumnsStatus"),
|
26993
|
+
dataIndex: "status",
|
26994
|
+
key: "status",
|
26995
|
+
align: "left",
|
26996
|
+
width: 200,
|
26997
|
+
editable: false,
|
26998
|
+
render: function (_, record) {
|
26999
|
+
var menu = actionMenu(record);
|
27000
|
+
return (React.createElement("div", { onClick: function (event) { return event.stopPropagation(); } },
|
27001
|
+
record.actionType === NdcDetailsActionType.SubAction &&
|
27002
|
+
record.status !== NdcDetailsActionStatus.New ? (React.createElement(antd.Tooltip, { title: record.status, color: TooltipColor, key: TooltipColor },
|
27003
|
+
React.createElement(antd.Tag, { className: "clickable", color: getNdcActionStatusTagType(record.status) }, addSpaces(record.status)))) : (""),
|
27004
|
+
record.actionType === NdcDetailsActionType.SubAction && menu ? (React.createElement(antd.Popover, { placement: "bottomRight", content: menu, trigger: "click" },
|
27005
|
+
React.createElement(icons.EllipsisOutlined, { rotate: 90, style: {
|
27006
|
+
fontWeight: 600,
|
27007
|
+
fontSize: "1rem",
|
27008
|
+
cursor: "pointer",
|
27009
|
+
} }))) : (React.createElement("span", null))));
|
27010
|
+
},
|
26883
27011
|
},
|
26884
27012
|
];
|
26885
27013
|
var columns = defaultColumns.map(function (col) {
|
26886
27014
|
if (!col.editable) {
|
26887
27015
|
return col;
|
26888
27016
|
}
|
26889
|
-
return __assign(__assign({}, col), { onCell: function (record) {
|
26890
|
-
|
26891
|
-
|
26892
|
-
|
26893
|
-
|
26894
|
-
|
26895
|
-
|
27017
|
+
return __assign(__assign({}, col), { onCell: function (record) {
|
27018
|
+
return {
|
27019
|
+
record: record,
|
27020
|
+
editing: isEditing(record),
|
27021
|
+
dataIndex: col.dataIndex,
|
27022
|
+
title: col.title,
|
27023
|
+
onBlurHandler: function (record) {
|
27024
|
+
if (isEditing(record)) {
|
27025
|
+
handleSave(record);
|
27026
|
+
}
|
27027
|
+
},
|
27028
|
+
t: t,
|
27029
|
+
};
|
27030
|
+
} });
|
26896
27031
|
});
|
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
|
-
|
27032
|
+
function onClickedAddNewNdcDetail() {
|
27033
|
+
return __awaiter(this, void 0, void 0, function () {
|
27034
|
+
var periodId, newData_1, lastPage;
|
27035
|
+
return __generator(this, function (_a) {
|
27036
|
+
if (selectedPeriod.key !== "add_new") {
|
27037
|
+
form.setFieldsValue({
|
27038
|
+
nationalPlanObjective: "",
|
27039
|
+
kpi: "",
|
27040
|
+
});
|
27041
|
+
periodId = parseInt(selectedPeriod.key);
|
27042
|
+
newData_1 = {
|
27043
|
+
id: nextAvailableActionId,
|
27044
|
+
actionType: NdcDetailsActionType.MainAction,
|
27045
|
+
nationalPlanObjective: "",
|
27046
|
+
kpi: "",
|
27047
|
+
ministryName: loginMinistry,
|
27048
|
+
periodId: periodId,
|
27049
|
+
status: NdcDetailsActionStatus.New,
|
27050
|
+
};
|
27051
|
+
setEditingKey(nextAvailableActionId);
|
27052
|
+
setNextAvailableActionId(function (value) { return value + 1; });
|
27053
|
+
setNdcActionsList(function (ndcActionsList) { return __spreadArray(__spreadArray([], ndcActionsList, true), [
|
27054
|
+
newData_1,
|
27055
|
+
], false); });
|
27056
|
+
setTableKey(function (key) { return key + 1; });
|
27057
|
+
if (ndcMainDetailsForPeriod.length + 1 > pageSize) {
|
27058
|
+
lastPage = Math.ceil(ndcMainDetailsForPeriod.length / pageSize);
|
27059
|
+
setCurrentPage(lastPage);
|
27060
|
+
}
|
27061
|
+
}
|
27062
|
+
return [2 /*return*/];
|
27063
|
+
});
|
27064
|
+
});
|
26922
27065
|
}
|
26923
27066
|
var components = {
|
26924
27067
|
body: {
|
26925
|
-
row: EditableRow,
|
26926
27068
|
cell: EditableCell,
|
26927
27069
|
},
|
26928
27070
|
};
|
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);
|
27071
|
+
var onClickedDeletePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27072
|
+
return __generator(this, function (_a) {
|
27073
|
+
setActionInfo({
|
27074
|
+
action: "Delete",
|
27075
|
+
headerText: t("ndc:periodDeleteConfirmTitle"),
|
27076
|
+
type: "danger",
|
27077
|
+
icon: React.createElement(Icon__namespace.XCircle, null),
|
27078
|
+
recordId: selectedPeriod.key,
|
26968
27079
|
});
|
26969
|
-
|
26970
|
-
|
26971
|
-
|
27080
|
+
setOpenConfirmationModal(true);
|
27081
|
+
return [2 /*return*/];
|
27082
|
+
});
|
27083
|
+
}); };
|
27084
|
+
var onClickedFinalizePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27085
|
+
var pendingActions;
|
27086
|
+
return __generator(this, function (_a) {
|
27087
|
+
if (subNdcActionsForPeriod.length === 0) {
|
27088
|
+
antd.message.open({
|
27089
|
+
type: "error",
|
27090
|
+
content: t("ndc:finalizeNdcEmptyErrorText"),
|
27091
|
+
duration: 3,
|
27092
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27093
|
+
});
|
27094
|
+
return [2 /*return*/];
|
26972
27095
|
}
|
26973
|
-
|
27096
|
+
pendingActions = subNdcActionsForPeriod.filter(function (action) {
|
27097
|
+
return action.status === NdcDetailsActionStatus.Pending;
|
27098
|
+
});
|
27099
|
+
if (pendingActions && pendingActions.length > 0) {
|
26974
27100
|
antd.message.open({
|
26975
27101
|
type: "error",
|
26976
|
-
content: t("ndc:
|
27102
|
+
content: t("ndc:finalizeErrorText"),
|
26977
27103
|
duration: 3,
|
26978
27104
|
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
26979
27105
|
});
|
26980
27106
|
}
|
27107
|
+
else {
|
27108
|
+
setActionInfo({
|
27109
|
+
action: "Finalize",
|
27110
|
+
headerText: t("ndc:finalizeApproveTitle"),
|
27111
|
+
text: t("ndc:finalizeApproveSubTitle"),
|
27112
|
+
type: "primary",
|
27113
|
+
icon: React.createElement(Icon__namespace.Clipboard2Check, null),
|
27114
|
+
recordId: selectedPeriod.key,
|
27115
|
+
});
|
27116
|
+
setOpenConfirmationModal(true);
|
27117
|
+
}
|
27118
|
+
return [2 /*return*/];
|
27119
|
+
});
|
27120
|
+
}); };
|
27121
|
+
var onMainTableRowExpand = function (expanded, record) {
|
27122
|
+
var keys = [];
|
27123
|
+
if (expanded) {
|
27124
|
+
keys.push(record.id);
|
26981
27125
|
}
|
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;
|
27126
|
+
setExpandedRowKeys(keys);
|
27127
|
+
setNdcSubActionsForMainAction(record.id);
|
26994
27128
|
};
|
26995
27129
|
function addNewPeriodContent() {
|
26996
27130
|
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 }));
|
27131
|
+
React.createElement(antd.Row, { justify: "start", align: "middle", gutter: [16, 16] },
|
27132
|
+
React.createElement(antd.Col, { flex: "340px" },
|
27133
|
+
React.createElement(RangePicker, { disabledDate: function (current) { return moment(current).year() < 1900; }, onChange: onDateRangeChanged, picker: "year" })),
|
27134
|
+
React.createElement(antd.Col, { flex: "auto" },
|
27135
|
+
React.createElement(antd.Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit"))))));
|
27007
27136
|
}
|
27008
|
-
var
|
27009
|
-
|
27137
|
+
var onChange = function (page, size) {
|
27138
|
+
setCurrentPage(page);
|
27139
|
+
setPageSize(size);
|
27010
27140
|
};
|
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)",
|
27141
|
+
function mainNdcActionTableContent() {
|
27142
|
+
return (React.createElement("div", null,
|
27143
|
+
React.createElement(antd.Row, null,
|
27144
|
+
React.createElement(antd.Col, { span: 24 },
|
27145
|
+
React.createElement(antd.Form, { form: form, component: false },
|
27146
|
+
React.createElement(antd.Table, { tableLayout: "fixed", key: tableKey, className: "common-table-class", rowKey: "id", pagination: {
|
27147
|
+
current: currentPage,
|
27148
|
+
pageSize: pageSize,
|
27149
|
+
total: ndcMainDetailsForPeriod.length,
|
27150
|
+
showQuickJumper: true,
|
27151
|
+
showSizeChanger: true,
|
27152
|
+
onChange: onChange,
|
27153
|
+
}, components: components, rowClassName: function () { return "editable-row"; }, bordered: true, loading: loading, dataSource: ndcMainDetailsForPeriod, columns: columns, expandedRowKeys: expandedRowKeys, onExpand: onMainTableRowExpand, expandable: {
|
27154
|
+
expandedRowRender: function (record) {
|
27155
|
+
return subNdcActionTableContent();
|
27156
|
+
},
|
27157
|
+
columnWidth: 40,
|
27158
|
+
}, onRow: function (record, rowIndex) {
|
27159
|
+
return {
|
27160
|
+
onClick: function (event) {
|
27161
|
+
if (record.id &&
|
27162
|
+
isNdcActionEditable(record) &&
|
27163
|
+
!isEditing(record)) {
|
27164
|
+
form.setFieldsValue(__assign({}, record));
|
27165
|
+
setEditingKey(record.id);
|
27166
|
+
}
|
27167
|
+
},
|
27168
|
+
onMouseLeave: function () {
|
27169
|
+
if (isEditing(record)) {
|
27170
|
+
handleSave(record);
|
27171
|
+
}
|
27172
|
+
},
|
27173
|
+
};
|
27174
|
+
}, footer: function () {
|
27175
|
+
return isGovernmentUser &&
|
27176
|
+
!selectedPeriod.finalized && (React.createElement(antd.Row, { justify: "center" },
|
27177
|
+
React.createElement(antd.Button, { className: "btnAddNewMainAct", disabled: isMainActionInEditMode(), onClick: onClickedAddNewNdcDetail, type: "default" }, t("ndc:addNdcAction"))));
|
27178
|
+
} })))),
|
27179
|
+
isGovernmentUser && !selectedPeriod.finalized ? (React.createElement(antd.Row, { justify: "end" },
|
27180
|
+
React.createElement(antd.Button, { className: "mg-left-1 btn-danger", onClick: onClickedDeletePeriod, htmlType: "submit", loading: loading }, t("ndc:delete")),
|
27181
|
+
React.createElement(antd.Button, { className: "mg-left-1", type: "primary", onClick: onClickedFinalizePeriod, htmlType: "submit", loading: loading }, t("ndc:finalize")))) : ("")));
|
27182
|
+
}
|
27183
|
+
function subNdcActionTableContent(record) {
|
27184
|
+
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) {
|
27185
|
+
return {
|
27186
|
+
onClick: function (event) {
|
27187
|
+
if (record.id &&
|
27188
|
+
isNdcActionEditable(record) &&
|
27189
|
+
!isEditing(record)) {
|
27190
|
+
form.setFieldsValue(__assign({}, record));
|
27191
|
+
setEditingKey(record.id);
|
27192
|
+
}
|
27229
27193
|
},
|
27230
|
-
{
|
27231
|
-
|
27232
|
-
|
27233
|
-
|
27234
|
-
startDate: new Date("2019-03-25"),
|
27235
|
-
endDate: new Date("2020-03-25"),
|
27236
|
-
nationalPlanObj: "",
|
27237
|
-
kpi: "",
|
27238
|
-
ministry: "",
|
27194
|
+
onMouseLeave: function () {
|
27195
|
+
if (isEditing(record)) {
|
27196
|
+
handleSave(record);
|
27197
|
+
}
|
27239
27198
|
},
|
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
|
-
|
27199
|
+
};
|
27200
|
+
}, columns: columns, showHeader: false, pagination: false }));
|
27201
|
+
}
|
27202
|
+
var onAddNewPeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27203
|
+
var periodItem_1, existingIndex, response, addedPeriodItem, updatedPeriodItem_1, exception_3;
|
27204
|
+
return __generator(this, function (_a) {
|
27205
|
+
switch (_a.label) {
|
27206
|
+
case 0:
|
27207
|
+
_a.trys.push([0, 4, , 5]);
|
27208
|
+
if (!(selectedDateRangeRef && selectedDateRangeRef.current)) return [3 /*break*/, 3];
|
27209
|
+
periodItem_1 = {
|
27210
|
+
startYear: selectedDateRangeRef.current.startYear,
|
27211
|
+
endYear: selectedDateRangeRef.current.endYear,
|
27212
|
+
finalized: false,
|
27213
|
+
};
|
27214
|
+
existingIndex = periodItems.findIndex(function (item) {
|
27215
|
+
return inRange(periodItem_1.startYear, item.startYear, item.endYear) ||
|
27216
|
+
inRange(periodItem_1.endYear, item.startYear, item.endYear);
|
27217
|
+
});
|
27218
|
+
if (!(existingIndex === -1)) return [3 /*break*/, 2];
|
27219
|
+
return [4 /*yield*/, post("national/programme/addNdcDetailsPeriod", __assign({}, periodItem_1))];
|
27220
|
+
case 1:
|
27221
|
+
response = _a.sent();
|
27222
|
+
if (response && response.data) {
|
27223
|
+
addedPeriodItem = response.data;
|
27224
|
+
updatedPeriodItem_1 = __assign(__assign({}, addedPeriodItem), { key: addedPeriodItem.id, label: "".concat(addedPeriodItem.startYear, "-").concat(addedPeriodItem.endYear) });
|
27225
|
+
setPeriodItems(function (items) { return __spreadArray(__spreadArray([], items, true), [updatedPeriodItem_1], false); });
|
27226
|
+
setSelectedPeriod(updatedPeriodItem_1);
|
27227
|
+
}
|
27228
|
+
return [3 /*break*/, 3];
|
27229
|
+
case 2:
|
27230
|
+
antd.message.open({
|
27231
|
+
type: "error",
|
27232
|
+
content: t("ndc:rangeAlreadyExists"),
|
27233
|
+
duration: 3,
|
27234
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27235
|
+
});
|
27236
|
+
_a.label = 3;
|
27237
|
+
case 3: return [3 /*break*/, 5];
|
27238
|
+
case 4:
|
27239
|
+
exception_3 = _a.sent();
|
27240
|
+
antd.message.open({
|
27241
|
+
type: "error",
|
27242
|
+
content: exception_3.message,
|
27243
|
+
duration: 3,
|
27244
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27245
|
+
});
|
27246
|
+
return [3 /*break*/, 5];
|
27247
|
+
case 5: return [2 /*return*/];
|
27248
|
+
}
|
27249
|
+
});
|
27250
|
+
}); };
|
27251
|
+
var onDateRangeChanged = function (range) {
|
27252
|
+
var period = {
|
27253
|
+
startYear: Number(moment(range[0]).year()),
|
27254
|
+
endYear: Number(moment(range[1]).year()),
|
27255
|
+
};
|
27256
|
+
if (period.startYear === period.endYear) {
|
27257
|
+
antd.message.open({
|
27258
|
+
type: "error",
|
27259
|
+
content: t("ndc:rangeAlreadyExists"),
|
27260
|
+
duration: 3,
|
27261
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27266
27262
|
});
|
27267
27263
|
}
|
27268
|
-
|
27269
|
-
|
27270
|
-
|
27271
|
-
|
27264
|
+
else {
|
27265
|
+
selectedDateRangeRef.current = period;
|
27266
|
+
}
|
27267
|
+
};
|
27268
|
+
var onTabChange = function (key) {
|
27269
|
+
var selectedPeriod = periodItems.find(function (item) { return item.key === key; });
|
27270
|
+
if (selectedPeriod) {
|
27271
|
+
setSelectedPeriod(selectedPeriod);
|
27272
|
+
}
|
27273
|
+
};
|
27274
|
+
var onActionConfirmed = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27275
|
+
var actionResponse, exception_4;
|
27276
|
+
return __generator(this, function (_a) {
|
27277
|
+
switch (_a.label) {
|
27278
|
+
case 0:
|
27279
|
+
setLoading(true);
|
27280
|
+
_a.label = 1;
|
27281
|
+
case 1:
|
27282
|
+
_a.trys.push([1, 10, , 11]);
|
27283
|
+
if (!(actionInfo.action === "Approve")) return [3 /*break*/, 3];
|
27284
|
+
return [4 /*yield*/, post("national/programme/approveNdcDetailsAction", {
|
27285
|
+
id: actionInfo.recordId,
|
27286
|
+
})];
|
27287
|
+
case 2:
|
27288
|
+
actionResponse = _a.sent();
|
27289
|
+
return [3 /*break*/, 9];
|
27290
|
+
case 3:
|
27291
|
+
if (!(actionInfo.action === "Reject")) return [3 /*break*/, 5];
|
27292
|
+
return [4 /*yield*/, post("national/programme/rejectNdcDetailsAction", {
|
27293
|
+
id: actionInfo.recordId,
|
27294
|
+
})];
|
27295
|
+
case 4:
|
27296
|
+
actionResponse = _a.sent();
|
27297
|
+
return [3 /*break*/, 9];
|
27298
|
+
case 5:
|
27299
|
+
if (!(actionInfo.action === "Finalize")) return [3 /*break*/, 7];
|
27300
|
+
return [4 /*yield*/, post("national/programme/finalizeNdcDetailsPeriod", {
|
27301
|
+
id: selectedPeriod.key,
|
27302
|
+
})];
|
27303
|
+
case 6:
|
27304
|
+
actionResponse = _a.sent();
|
27305
|
+
return [3 /*break*/, 9];
|
27306
|
+
case 7:
|
27307
|
+
if (!(actionInfo.action === "Delete")) return [3 /*break*/, 9];
|
27308
|
+
return [4 /*yield*/, post("national/programme/deleteNdcDetailsPeriod", {
|
27309
|
+
id: selectedPeriod.key,
|
27310
|
+
})];
|
27311
|
+
case 8:
|
27312
|
+
actionResponse = _a.sent();
|
27313
|
+
_a.label = 9;
|
27314
|
+
case 9: return [3 /*break*/, 11];
|
27315
|
+
case 10:
|
27316
|
+
exception_4 = _a.sent();
|
27317
|
+
antd.message.open({
|
27318
|
+
type: "error",
|
27319
|
+
content: exception_4.message,
|
27320
|
+
duration: 3,
|
27321
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27322
|
+
});
|
27323
|
+
return [3 /*break*/, 11];
|
27324
|
+
case 11:
|
27325
|
+
if (actionResponse) {
|
27326
|
+
if (actionInfo.action === "Delete") {
|
27327
|
+
antd.message.open({
|
27328
|
+
type: "success",
|
27329
|
+
content: t("ndc:deletePeriodSuccessMsg"),
|
27330
|
+
duration: 3,
|
27331
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27332
|
+
});
|
27333
|
+
fetchNdcDetailPeriods();
|
27334
|
+
}
|
27335
|
+
else if (actionInfo.action === "Finalize") {
|
27336
|
+
antd.message.open({
|
27337
|
+
type: "success",
|
27338
|
+
content: t("ndc:finalizeSuccessMsg"),
|
27339
|
+
duration: 3,
|
27340
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27341
|
+
});
|
27342
|
+
fetchNdcDetailPeriods();
|
27343
|
+
}
|
27344
|
+
else if (actionInfo.action === "Approve") {
|
27345
|
+
antd.message.open({
|
27346
|
+
type: "success",
|
27347
|
+
content: t("ndc:approveSuccessMsg"),
|
27348
|
+
duration: 3,
|
27349
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27350
|
+
});
|
27351
|
+
fetchNdcDetailActions();
|
27352
|
+
}
|
27353
|
+
else if (actionInfo.action === "Reject") {
|
27354
|
+
antd.message.open({
|
27355
|
+
type: "success",
|
27356
|
+
content: t("ndc:rejectSuccessMsg"),
|
27357
|
+
duration: 3,
|
27358
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27359
|
+
});
|
27360
|
+
fetchNdcDetailActions();
|
27361
|
+
}
|
27362
|
+
}
|
27363
|
+
setOpenConfirmationModal(false);
|
27364
|
+
setLoading(false);
|
27365
|
+
return [2 /*return*/];
|
27366
|
+
}
|
27367
|
+
});
|
27368
|
+
}); };
|
27369
|
+
var onActionCanceled = function () {
|
27370
|
+
setOpenConfirmationModal(false);
|
27371
|
+
};
|
27372
|
+
var fetchNdcDetailPeriods = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27373
|
+
var periods, addNewTab, response, exception_5;
|
27374
|
+
return __generator(this, function (_a) {
|
27375
|
+
switch (_a.label) {
|
27376
|
+
case 0:
|
27377
|
+
setLoading(true);
|
27378
|
+
_a.label = 1;
|
27379
|
+
case 1:
|
27380
|
+
_a.trys.push([1, 3, 4, 5]);
|
27381
|
+
periods = [];
|
27382
|
+
addNewTab = {
|
27383
|
+
key: "add_new",
|
27384
|
+
label: "Add New",
|
27385
|
+
startYear: 0,
|
27386
|
+
endYear: 0,
|
27387
|
+
finalized: false,
|
27388
|
+
deleted: false,
|
27389
|
+
};
|
27390
|
+
return [4 /*yield*/, get("national/programme/queryNdcDetailsPeriod")];
|
27391
|
+
case 2:
|
27392
|
+
response = _a.sent();
|
27393
|
+
if (response && response.data) {
|
27394
|
+
periods = response.data.map(function (period) {
|
27395
|
+
return __assign(__assign({}, period), { key: period.id, label: period.finalized ? (React.createElement("span", null,
|
27396
|
+
React.createElement(icons.LockOutlined, null),
|
27397
|
+
" ",
|
27398
|
+
period.startYear,
|
27399
|
+
"-",
|
27400
|
+
period.endYear,
|
27401
|
+
" ")) : ("".concat(period.startYear, "-").concat(period.endYear)) });
|
27402
|
+
});
|
27403
|
+
}
|
27404
|
+
if (isGovernmentUser) {
|
27405
|
+
periods.unshift(addNewTab);
|
27406
|
+
}
|
27407
|
+
setPeriodItems(periods);
|
27408
|
+
if (isGovernmentUser) {
|
27409
|
+
setSelectedPeriod(addNewTab);
|
27410
|
+
}
|
27411
|
+
else {
|
27412
|
+
setSelectedPeriod(periods[0]);
|
27413
|
+
}
|
27414
|
+
setLoading(false);
|
27415
|
+
return [3 /*break*/, 5];
|
27416
|
+
case 3:
|
27417
|
+
exception_5 = _a.sent();
|
27418
|
+
antd.message.open({
|
27419
|
+
type: "error",
|
27420
|
+
content: exception_5.message,
|
27421
|
+
duration: 3,
|
27422
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27423
|
+
});
|
27424
|
+
return [3 /*break*/, 5];
|
27425
|
+
case 4:
|
27426
|
+
setLoading(false);
|
27427
|
+
return [7 /*endfinally*/];
|
27428
|
+
case 5: return [2 /*return*/];
|
27429
|
+
}
|
27430
|
+
});
|
27431
|
+
}); };
|
27432
|
+
var fetchNdcDetailActions = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27433
|
+
var response, maxActionId, exception_6;
|
27434
|
+
return __generator(this, function (_a) {
|
27435
|
+
switch (_a.label) {
|
27436
|
+
case 0:
|
27437
|
+
setLoading(true);
|
27438
|
+
_a.label = 1;
|
27439
|
+
case 1:
|
27440
|
+
_a.trys.push([1, 3, 4, 5]);
|
27441
|
+
return [4 /*yield*/, get("national/programme/queryNdcDetailsAction")];
|
27442
|
+
case 2:
|
27443
|
+
response = _a.sent();
|
27444
|
+
if (response && response.data) {
|
27445
|
+
maxActionId = Math.max.apply(Math, response.data.map(function (item) { return item.id; }));
|
27446
|
+
setNextAvailableActionId(maxActionId + 1);
|
27447
|
+
setNdcActionsList(response.data);
|
27448
|
+
}
|
27449
|
+
setLoading(false);
|
27450
|
+
return [3 /*break*/, 5];
|
27451
|
+
case 3:
|
27452
|
+
exception_6 = _a.sent();
|
27453
|
+
antd.message.open({
|
27454
|
+
type: "error",
|
27455
|
+
content: exception_6.message,
|
27456
|
+
duration: 3,
|
27457
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27458
|
+
});
|
27459
|
+
return [3 /*break*/, 5];
|
27460
|
+
case 4:
|
27461
|
+
setLoading(false);
|
27462
|
+
return [7 /*endfinally*/];
|
27463
|
+
case 5: return [2 /*return*/];
|
27464
|
+
}
|
27465
|
+
});
|
27466
|
+
}); };
|
27467
|
+
var fetchMinistries = function () { return __awaiter(void 0, void 0, void 0, function () {
|
27468
|
+
var response, ministryOrgDetails, exception_7;
|
27469
|
+
return __generator(this, function (_a) {
|
27470
|
+
switch (_a.label) {
|
27471
|
+
case 0:
|
27472
|
+
setLoading(true);
|
27473
|
+
_a.label = 1;
|
27474
|
+
case 1:
|
27475
|
+
_a.trys.push([1, 3, 4, 5]);
|
27476
|
+
return [4 /*yield*/, get("national/organisation/getMinistries")];
|
27477
|
+
case 2:
|
27478
|
+
response = _a.sent();
|
27479
|
+
if (response && response.data) {
|
27480
|
+
ministryOrgDetails = response.data.map(function (value) {
|
27481
|
+
return {
|
27482
|
+
value: value.company_companyId,
|
27483
|
+
label: value.company_name,
|
27484
|
+
};
|
27485
|
+
});
|
27486
|
+
setMinistryOrgList(ministryOrgDetails);
|
27487
|
+
}
|
27488
|
+
setLoading(false);
|
27489
|
+
return [3 /*break*/, 5];
|
27490
|
+
case 3:
|
27491
|
+
exception_7 = _a.sent();
|
27492
|
+
antd.message.open({
|
27493
|
+
type: "error",
|
27494
|
+
content: exception_7.message,
|
27495
|
+
duration: 3,
|
27496
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
27497
|
+
});
|
27498
|
+
return [3 /*break*/, 5];
|
27499
|
+
case 4:
|
27500
|
+
setLoading(false);
|
27501
|
+
return [7 /*endfinally*/];
|
27502
|
+
case 5: return [2 /*return*/];
|
27503
|
+
}
|
27504
|
+
});
|
27505
|
+
}); };
|
27506
|
+
React.useEffect(function () {
|
27507
|
+
fetchNdcDetailPeriods();
|
27508
|
+
fetchNdcDetailActions();
|
27509
|
+
fetchMinistries();
|
27272
27510
|
}, []);
|
27273
|
-
return (React.createElement("div", { className: "ndc-
|
27511
|
+
return (React.createElement("div", { className: "ndc-details content-container" },
|
27274
27512
|
React.createElement("div", { className: "title-bar" },
|
27275
27513
|
React.createElement(antd.Row, { justify: "space-between", align: "middle" },
|
27276
27514
|
React.createElement(antd.Col, { span: 20 },
|
27277
27515
|
React.createElement("div", { className: "body-title" }, t("ndc:ndcTitle")),
|
27278
27516
|
React.createElement("div", { className: "body-sub-title" }, t("ndc:ndcSubTitle"))))),
|
27279
27517
|
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
|
-
} }))))));
|
27518
|
+
React.createElement(antd.Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedPeriod.key, onChange: onTabChange })),
|
27519
|
+
React.createElement("div", null, selectedPeriod.key === "add_new"
|
27520
|
+
? addNewPeriodContent()
|
27521
|
+
: mainNdcActionTableContent()),
|
27522
|
+
React.createElement(UserActionConfirmationModel, { t: t, actionInfo: actionInfo, onActionConfirmed: onActionConfirmed, onActionCanceled: onActionCanceled, openModal: openConfirmationModal, errorMsg: "", loading: loading })));
|
27294
27523
|
};
|
27295
27524
|
|
27296
27525
|
var ImgWithFallback = function (_a) {
|
@@ -27879,12 +28108,10 @@ var ProgrammeTransferForm = function (props) {
|
|
27879
28108
|
label: d.name,
|
27880
28109
|
value: d.companyId,
|
27881
28110
|
state: d.state,
|
27882
|
-
companyRole: d.companyRole,
|
27883
28111
|
}); })
|
27884
28112
|
.filter(function (d) {
|
27885
28113
|
return (d.value !== userCompanyId &&
|
27886
|
-
parseInt(d.state) === exports.CompanyState.ACTIVE.valueOf()
|
27887
|
-
d.companyRole === exports.CompanyRole.PROGRAMME_DEVELOPER.valueOf());
|
28114
|
+
parseInt(d.state) === exports.CompanyState.ACTIVE.valueOf());
|
27888
28115
|
}));
|
27889
28116
|
return [3 /*break*/, 3];
|
27890
28117
|
case 2:
|
@@ -29085,7 +29312,7 @@ exports.getCreditStageVal = getCreditStageVal;
|
|
29085
29312
|
exports.getFinancialFields = getFinancialFields;
|
29086
29313
|
exports.getGeneralFields = getGeneralFields;
|
29087
29314
|
exports.getInvestmentStatusEnumVal = getInvestmentStatusEnumVal;
|
29088
|
-
exports.getNdcActionStatusEnumVal = getNdcActionStatusEnumVal;
|
29315
|
+
exports.getNdcActionStatusEnumVal = getNdcActionStatusEnumVal$1;
|
29089
29316
|
exports.getNdcStatusTagType = getNdcStatusTagType;
|
29090
29317
|
exports.getRetirementTypeString = getRetirementTypeString;
|
29091
29318
|
exports.getStageEnumVal = getStageEnumVal;
|