@undp/carbon-library 1.0.281 → 1.0.283

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 CHANGED
@@ -2051,7 +2051,7 @@ exports.NdcActionStatus = void 0;
2051
2051
  NdcActionStatus["PENDING"] = "Pending";
2052
2052
  NdcActionStatus["APPROVED"] = "Approved";
2053
2053
  })(exports.NdcActionStatus || (exports.NdcActionStatus = {}));
2054
- var getNdcActionStatusEnumVal = function (value) {
2054
+ var getNdcActionStatusEnumVal$1 = function (value) {
2055
2055
  var index = Object.keys(exports.NdcActionStatus).indexOf(value);
2056
2056
  if (index < 0) {
2057
2057
  return value;
@@ -2059,7 +2059,7 @@ var getNdcActionStatusEnumVal = function (value) {
2059
2059
  return Object.values(exports.NdcActionStatus)[index];
2060
2060
  };
2061
2061
  var getNdcStatusTagType = function (status) {
2062
- switch (getNdcActionStatusEnumVal(status)) {
2062
+ switch (getNdcActionStatusEnumVal$1(status)) {
2063
2063
  case exports.NdcActionStatus.PENDING:
2064
2064
  return "processing";
2065
2065
  case exports.NdcActionStatus.APPROVED:
@@ -21798,7 +21798,7 @@ var NdcActionViewComponent = function (props) {
21798
21798
  (reportData === null || reportData === void 0 ? void 0 : reportData.status) === exports.DocumentStatus.ACCEPTED && (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
21799
21799
  (reportData === null || reportData === void 0 ? void 0 : reportData.status) === exports.DocumentStatus.REJECTED && (React.createElement(icons.ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))),
21800
21800
  React.createElement("div", { className: "link mg-left-1" }, (reportData === null || reportData === void 0 ? void 0 : reportData.url) && linkDocVisible(reportData === null || reportData === void 0 ? void 0 : reportData.status) && (React.createElement("a", { href: reportData === null || reportData === void 0 ? void 0 : reportData.url, target: "_blank", rel: "noopener noreferrer", download: true },
21801
- React.createElement(icons.BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } })))),
21801
+ React.createElement(icons.BookOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } })))),
21802
21802
  (reportData === null || reportData === void 0 ? void 0 : reportData.txTime) && (React.createElement("div", { className: "time" },
21803
21803
  moment(parseInt(reportData === null || reportData === void 0 ? void 0 : reportData.txTime)).format("DD MMMM YYYY @ HH:mm"),
21804
21804
  " ~ " + reportVersion))));
@@ -21955,13 +21955,15 @@ var NdcActionViewComponent = function (props) {
21955
21955
  ((_b = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.agricultureProperties) === null || _b === void 0 ? void 0 : _b.landAreaUnit);
21956
21956
  }
21957
21957
  if ((ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.typeOfMitigation) === exports.MitigationTypes.AGRICULTURE &&
21958
- (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) === exports.MitigationSubTypes.SOIL_ENRICHMENT_BIOCHAR &&
21958
+ (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) ===
21959
+ exports.MitigationSubTypes.SOIL_ENRICHMENT_BIOCHAR &&
21959
21960
  (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties)) {
21960
21961
  mitigationDetails[t("ndcAction:viewMitigationWeight")] =
21961
- addCommSep((_c = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties) === null || _c === void 0 ? void 0 : _c.weight) + 't';
21962
+ addCommSep((_c = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties) === null || _c === void 0 ? void 0 : _c.weight) + "t";
21962
21963
  }
21963
21964
  if ((ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.typeOfMitigation) === exports.MitigationTypes.SOLAR &&
21964
- (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) === exports.MitigationSubTypes.SOLAR_PHOTOVOLTAICS_PV &&
21965
+ (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) ===
21966
+ exports.MitigationSubTypes.SOLAR_PHOTOVOLTAICS_PV &&
21965
21967
  (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.solarProperties)) {
21966
21968
  mitigationDetails[t("ndcAction:viewMitigationEnergyGeneration")] =
21967
21969
  addCommSep((_d = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.solarProperties) === null || _d === void 0 ? void 0 : _d.energyGeneration) +
@@ -21970,15 +21972,17 @@ var NdcActionViewComponent = function (props) {
21970
21972
  (_f = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.solarProperties) === null || _f === void 0 ? void 0 : _f.consumerGroup;
21971
21973
  }
21972
21974
  if ((ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.typeOfMitigation) === exports.MitigationTypes.SOLAR &&
21973
- ((ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) === exports.MitigationSubTypes.SOLAR_WATER_PUMPING_OFF_GRID ||
21974
- (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) === exports.MitigationSubTypes.SOLAR_WATER_PUMPING_ON_GRID) &&
21975
+ ((ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) ===
21976
+ exports.MitigationSubTypes.SOLAR_WATER_PUMPING_OFF_GRID ||
21977
+ (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) ===
21978
+ exports.MitigationSubTypes.SOLAR_WATER_PUMPING_ON_GRID) &&
21975
21979
  (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties)) {
21976
21980
  mitigationDetails[t("ndcAction:viewMitigationEnergyGeneration")] =
21977
- addCommSep((_g = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties) === null || _g === void 0 ? void 0 : _g.energyGeneration) +
21978
- ((_h = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties) === null || _h === void 0 ? void 0 : _h.energyGenerationUnit);
21981
+ addCommSep((_g = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties) === null || _g === void 0 ? void 0 : _g.energyGeneration) + ((_h = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties) === null || _h === void 0 ? void 0 : _h.energyGenerationUnit);
21979
21982
  }
21980
21983
  if ((ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.typeOfMitigation) === exports.MitigationTypes.EE_HOUSEHOLDS &&
21981
- (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) === exports.MitigationSubTypes.STOVES_HOUSES_IN_NAMIBIA &&
21984
+ (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) ===
21985
+ exports.MitigationSubTypes.STOVES_HOUSES_IN_NAMIBIA &&
21982
21986
  (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties)) {
21983
21987
  mitigationDetails[t("ndcAction:viewMitigationNoOfDays")] =
21984
21988
  (_j = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties) === null || _j === void 0 ? void 0 : _j.numberOfDays;
@@ -22161,23 +22165,24 @@ var NdcActionViewComponent = function (props) {
22161
22165
  : "empty" }, t("programme:monitoringReport")),
22162
22166
  (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.txTime) && (React.createElement("div", { className: "time" },
22163
22167
  moment(parseInt(monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.txTime)).format("DD MMMM YYYY @ HH:mm"),
22164
- " ~ " + monitoringReportversion))),
22168
+ " ~ " + monitoringReportversion)))),
22169
+ React.createElement(antd.Row, null,
22165
22170
  React.createElement("div", { className: "icon" }, !(monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url) && (React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly
22166
22171
  ? t("programme:notAuthToUploadDoc")
22167
22172
  : uploadDocUserPermission(userInfoState, exports.DocType.MONITORING_REPORT, programmeOwnerId)
22168
22173
  ? !canUploadMonitorReport &&
22169
22174
  t("programme:programmeNotAuth")
22170
22175
  : t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
22171
- React.createElement(icons.FileAddOutlined, null))))),
22172
- (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url) && (React.createElement(antd.Row, null,
22173
- React.createElement("div", { className: "icon" },
22174
- (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.status) ===
22175
- exports.DocumentStatus.ACCEPTED && (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
22176
- (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.status) ===
22177
- exports.DocumentStatus.REJECTED && (React.createElement(icons.ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))),
22178
- React.createElement("div", { className: "link mg-left-1" }, (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url) &&
22179
- linkDocVisible(monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.status) && (React.createElement("a", { href: monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url, target: "_blank", rel: "noopener noreferrer", download: true },
22180
- React.createElement(icons.BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))))))),
22176
+ React.createElement(icons.FileAddOutlined, null)))),
22177
+ (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url) && (React.createElement(React.Fragment, null,
22178
+ React.createElement("div", { className: "icon" },
22179
+ (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.status) ===
22180
+ exports.DocumentStatus.ACCEPTED && (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
22181
+ (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.status) ===
22182
+ exports.DocumentStatus.REJECTED && (React.createElement(icons.ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))),
22183
+ React.createElement("div", { className: "link mg-left-1" }, (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url) &&
22184
+ linkDocVisible(monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.status) && (React.createElement("a", { href: monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url, target: "_blank", rel: "noopener noreferrer", download: true },
22185
+ React.createElement(icons.BookOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } })))))))),
22181
22186
  React.createElement("div", { className: "report-details" },
22182
22187
  React.createElement("div", { className: "report-type" },
22183
22188
  React.createElement("div", { className: "name-time-container" },
@@ -22186,23 +22191,24 @@ var NdcActionViewComponent = function (props) {
22186
22191
  : "empty" }, t("programme:verificationReport")),
22187
22192
  (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.txTime) && (React.createElement("div", { className: "time" },
22188
22193
  moment(parseInt(verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.txTime)).format("DD MMMM YYYY @ HH:mm"),
22189
- " ~ " + verificationReportVersion))),
22194
+ " ~ " + verificationReportVersion)))),
22195
+ React.createElement(antd.Row, null,
22190
22196
  React.createElement("div", { className: "icon" }, !(verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url) && (React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly
22191
22197
  ? t("programme:notAuthToUploadDoc")
22192
22198
  : uploadDocUserPermission(userInfoState, exports.DocType.VERIFICATION_REPORT, programmeOwnerId)
22193
22199
  ? !monitoringReportAccepted &&
22194
22200
  t("programme:monitoringRepNotApproved")
22195
22201
  : t("programme:notAuthToUploadDoc"), overlayClassName: "custom-tooltip" },
22196
- React.createElement(icons.FileAddOutlined, null))))),
22197
- (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url) && (React.createElement(antd.Row, null,
22198
- React.createElement("div", { className: "icon" },
22199
- (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.status) ===
22200
- exports.DocumentStatus.ACCEPTED && (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
22201
- (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.status) ===
22202
- exports.DocumentStatus.REJECTED && (React.createElement(icons.ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))),
22203
- React.createElement("div", { className: "link mg-left-1" }, (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url) &&
22204
- linkDocVisible(verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.status) && (React.createElement("a", { href: verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url, target: "_blank", rel: "noopener noreferrer", download: true },
22205
- React.createElement(icons.BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } })))))))))))),
22202
+ React.createElement(icons.FileAddOutlined, null)))),
22203
+ (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url) && (React.createElement(React.Fragment, null,
22204
+ React.createElement("div", { className: "icon" },
22205
+ (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.status) ===
22206
+ exports.DocumentStatus.ACCEPTED && (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
22207
+ (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.status) ===
22208
+ exports.DocumentStatus.REJECTED && (React.createElement(icons.ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))),
22209
+ React.createElement("div", { className: "link mg-left-1" }, (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url) &&
22210
+ linkDocVisible(verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.status) && (React.createElement("a", { href: verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url, target: "_blank", rel: "noopener noreferrer", download: true },
22211
+ React.createElement(icons.BookOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } }))))))))))))),
22206
22212
  ((ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.action) === exports.NdcActionTypes.Mitigation ||
22207
22213
  (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.action) === exports.NdcActionTypes.CrossCutting) && (React.createElement(antd.Row, null,
22208
22214
  React.createElement(antd.Col, { lg: 24, className: "gutter-row" },
@@ -26752,622 +26758,891 @@ var RegistryDashboardComponent = function (props) {
26752
26758
  lastUpdateTransferLocations))))))))) : ("")));
26753
26759
  };
26754
26760
 
26755
- var EditableContext = React.createContext(null);
26756
- var EditableRow = function (_a) {
26757
- _a.index; var props = __rest(_a, ["index"]);
26758
- var form = antd.Form.useForm()[0];
26759
- return (React.createElement(antd.Form, { form: form, component: false },
26760
- React.createElement(EditableContext.Provider, { value: form },
26761
- React.createElement("tr", __assign({}, props)))));
26762
- };
26761
+ React.createContext(null);
26763
26762
  var EditableCell = function (_a) {
26764
- var title = _a.title, editable = _a.editable, children = _a.children, dataIndex = _a.dataIndex, record = _a.record, handleSave = _a.handleSave, restProps = __rest(_a, ["title", "editable", "children", "dataIndex", "record", "handleSave"]);
26765
- var _b = React.useState(false), editing = _b[0], setEditing = _b[1];
26766
- var inputRef = React.useRef(null);
26767
- var form = React.useContext(EditableContext);
26768
- React.useEffect(function () {
26769
- if (editing) {
26770
- inputRef.current.focus();
26771
- }
26772
- }, [editing]);
26773
- var toggleEdit = function () {
26774
- var _a;
26775
- setEditing(!editing);
26776
- form.setFieldsValue((_a = {}, _a[dataIndex] = record[dataIndex], _a));
26777
- };
26778
- var save = function () { return __awaiter(void 0, void 0, void 0, function () {
26779
- var values, errInfo_1;
26780
- return __generator(this, function (_a) {
26781
- switch (_a.label) {
26782
- case 0:
26783
- _a.trys.push([0, 2, , 3]);
26784
- return [4 /*yield*/, form.validateFields()];
26785
- case 1:
26786
- values = _a.sent();
26787
- toggleEdit();
26788
- handleSave(__assign(__assign({}, record), values));
26789
- return [3 /*break*/, 3];
26790
- case 2:
26791
- errInfo_1 = _a.sent();
26792
- console.log("Save failed:", errInfo_1);
26793
- return [3 /*break*/, 3];
26794
- case 3: return [2 /*return*/];
26795
- }
26796
- });
26797
- }); };
26798
- var childNode = children;
26799
- if (editable) {
26800
- childNode = editing ? (React.createElement(antd.Form.Item, { style: { margin: 0 }, name: dataIndex, rules: [
26801
- {
26802
- required: true,
26803
- message: "".concat(title, " is required."),
26804
- },
26805
- ] },
26806
- 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));
26807
- }
26808
- return React.createElement("td", __assign({}, restProps), childNode);
26763
+ 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"]);
26764
+ return (React.createElement("td", __assign({}, restProps), editing && dataIndex === "nationalPlanObjective" ? (React.createElement(antd.Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [
26765
+ {
26766
+ validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
26767
+ var trimValue;
26768
+ return __generator(this, function (_a) {
26769
+ trimValue = typeof value === "string" ? value.trim() : value;
26770
+ if (!trimValue) {
26771
+ throw new Error("".concat(title, " ").concat(t("ndc:isRequired")));
26772
+ }
26773
+ return [2 /*return*/];
26774
+ });
26775
+ }); },
26776
+ },
26777
+ ] },
26778
+ 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: [
26779
+ {
26780
+ validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
26781
+ var trimValue;
26782
+ return __generator(this, function (_a) {
26783
+ trimValue = typeof value === "string" ? value.trim() : value;
26784
+ if (trimValue) {
26785
+ if (isNaN(+trimValue)) {
26786
+ throw new Error(t("ndc:kpiInvalidFormat"));
26787
+ }
26788
+ else if (+trimValue <= 0) {
26789
+ throw new Error(t("ndc:kpiGreaterThanZero"));
26790
+ }
26791
+ else if (trimValue.toString().length > 7) {
26792
+ throw new Error(t("ndc:kpiMaxLength"));
26793
+ }
26794
+ }
26795
+ else {
26796
+ throw new Error("".concat(title, " ").concat(t("ndc:isRequired")));
26797
+ }
26798
+ return [2 /*return*/];
26799
+ });
26800
+ }); },
26801
+ },
26802
+ ] },
26803
+ React.createElement(antd.Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:kpiPlaceHolder") }))) : (children)));
26809
26804
  };
26810
26805
 
26811
- var css_248z$7 = ".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";
26806
+ var css_248z$7 = ".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";
26812
26807
  styleInject(css_248z$7);
26813
26808
 
26814
- var NdcActionType;
26815
- (function (NdcActionType) {
26816
- NdcActionType[NdcActionType["main"] = 0] = "main";
26817
- NdcActionType[NdcActionType["sub"] = 1] = "sub";
26818
- })(NdcActionType || (NdcActionType = {}));
26809
+ var NdcDetailsActionType;
26810
+ (function (NdcDetailsActionType) {
26811
+ NdcDetailsActionType["MainAction"] = "MainAction";
26812
+ NdcDetailsActionType["SubAction"] = "SubAction";
26813
+ })(NdcDetailsActionType || (NdcDetailsActionType = {}));
26814
+ var NdcDetailsActionStatus;
26815
+ (function (NdcDetailsActionStatus) {
26816
+ NdcDetailsActionStatus["New"] = "New";
26817
+ NdcDetailsActionStatus["Pending"] = "Pending";
26818
+ NdcDetailsActionStatus["Approved"] = "Approved";
26819
+ NdcDetailsActionStatus["Rejected"] = "Rejected";
26820
+ })(NdcDetailsActionStatus || (NdcDetailsActionStatus = {}));
26821
+ var getNdcActionStatusEnumVal = function (value) {
26822
+ var index = Object.keys(NdcDetailsActionStatus).indexOf(value);
26823
+ if (index < 0) {
26824
+ return value;
26825
+ }
26826
+ return Object.values(NdcDetailsActionStatus)[index];
26827
+ };
26828
+ var getNdcActionStatusTagType = function (status) {
26829
+ switch (getNdcActionStatusEnumVal(status)) {
26830
+ case NdcDetailsActionStatus.Rejected:
26831
+ return "error";
26832
+ case NdcDetailsActionStatus.Pending:
26833
+ return "processing";
26834
+ case NdcDetailsActionStatus.Approved:
26835
+ return "success";
26836
+ default:
26837
+ return "default";
26838
+ }
26839
+ };
26840
+
26819
26841
  var NdcDetailsComponent = function (props) {
26820
- var t = props.t; props.useConnection; var useUserContext = props.useUserContext;
26842
+ var t = props.t, useConnection = props.useConnection, useUserContext = props.useUserContext;
26821
26843
  var RangePicker = antd.DatePicker.RangePicker;
26822
- var _a = React.useState([]), ndcDetailsData = _a[0], setNdcDetailsData = _a[1];
26823
- var _b = React.useState(false), loading = _b[0]; _b[1];
26824
- var periodItemsRef = React.useRef([]);
26844
+ var _a = React.useState([]), ndcActionsList = _a[0], setNdcActionsList = _a[1];
26845
+ var _b = React.useState(false), loading = _b[0], setLoading = _b[1];
26825
26846
  var _c = React.useState([]), periodItems = _c[0], setPeriodItems = _c[1];
26826
- var _d = React.useState("add_new"), selectedTab = _d[0], setSelectedTab = _d[1];
26827
- var selectedPeriod = React.useRef({});
26828
- var addedNdcDetailId = React.useRef(0);
26829
- var selectedNdcDetail = React.useRef({});
26847
+ var _d = React.useState({}), selectedPeriod = _d[0], setSelectedPeriod = _d[1];
26848
+ var selectedDateRangeRef = React.useRef({});
26830
26849
  var _e = React.useState(0), tableKey = _e[0], setTableKey = _e[1];
26850
+ var _f = useConnection(), get = _f.get, post = _f.post, put = _f.put;
26851
+ var _g = React.useState([]), ministryOrgList = _g[0], setMinistryOrgList = _g[1];
26852
+ var _h = React.useState({}), actionInfo = _h[0], setActionInfo = _h[1];
26853
+ var _j = React.useState(false), openConfirmationModal = _j[0], setOpenConfirmationModal = _j[1];
26854
+ var form = antd.Form.useForm()[0];
26855
+ var _k = React.useState(null), editingKey = _k[0], setEditingKey = _k[1];
26856
+ var _l = React.useState(0), nextAvailableActionId = _l[0], setNextAvailableActionId = _l[1];
26857
+ var _m = React.useState([]), expandedRowKeys = _m[0], setExpandedRowKeys = _m[1];
26858
+ var _o = React.useState([]), subNdcActionsForPeriod = _o[0], setSubNdcActionsForPeriod = _o[1];
26859
+ var _p = React.useState(1), currentPage = _p[0], setCurrentPage = _p[1];
26860
+ var _q = React.useState(10), pageSize = _q[0], setPageSize = _q[1];
26861
+ var isEditing = function (record) { return record.id === editingKey; };
26862
+ var isMainActionInEditMode = function () {
26863
+ var unsavedMainActions = ndcMainDetailsForPeriod.filter(function (item) {
26864
+ return item.status === NdcDetailsActionStatus.New &&
26865
+ item.actionType === NdcDetailsActionType.MainAction;
26866
+ });
26867
+ return unsavedMainActions.length > 0 ? true : false;
26868
+ };
26831
26869
  var userInfoState = useUserContext().userInfoState;
26832
- var isAddRangeVisible = function () {
26833
- return (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY ||
26834
- (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT) &&
26870
+ React.useEffect(function () {
26871
+ if (expandedRowKeys && expandedRowKeys.length > 0) {
26872
+ var expandedKey = expandedRowKeys[0];
26873
+ setNdcSubActionsForMainAction(expandedKey);
26874
+ }
26875
+ }, ndcActionsList);
26876
+ var loginMinistry = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT
26877
+ ? process.env.REACT_APP_GOVERNMENT_MINISTRY
26878
+ ? process.env.REACT_APP_GOVERNMENT_MINISTRY
26879
+ : "Ministry Of Environment"
26880
+ : (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY
26881
+ ? userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyName
26882
+ : undefined;
26883
+ var isGovernmentUser = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT &&
26884
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly;
26885
+ var isMainNdcActionsEditable = !selectedPeriod.finalized &&
26886
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT &&
26887
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly;
26888
+ var isSubNdcActionsEditable = function (record) {
26889
+ return (!selectedPeriod.finalized &&
26890
+ record.status !== NdcDetailsActionStatus.Approved &&
26891
+ ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT ||
26892
+ ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY &&
26893
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyName) === record.ministryName)) &&
26835
26894
  (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly);
26836
26895
  };
26837
- var isAddNdcActionVisible = function () {
26838
- return ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT &&
26896
+ var checkSubNdcActionCreatePermission = function () {
26897
+ return (!selectedPeriod.finalized &&
26898
+ ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT ||
26899
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY) &&
26839
26900
  (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== exports.Role.ViewOnly);
26840
26901
  };
26902
+ var isNdcActionEditable = function (record) {
26903
+ if (record.actionType === NdcDetailsActionType.MainAction) {
26904
+ return isMainNdcActionsEditable;
26905
+ }
26906
+ else if (record.actionType === NdcDetailsActionType.SubAction) {
26907
+ return isSubNdcActionsEditable(record);
26908
+ }
26909
+ };
26910
+ var ndcMainDetailsForPeriod = selectedPeriod.key !== "add_new"
26911
+ ? ndcActionsList.filter(function (ndcDetail) {
26912
+ return (ndcDetail.periodId === parseInt(selectedPeriod.key) &&
26913
+ ndcDetail.actionType === NdcDetailsActionType.MainAction);
26914
+ })
26915
+ : [];
26916
+ var setNdcSubActionsForMainAction = function (mainActionId) {
26917
+ var subNdcDetails = ndcActionsList.filter(function (ndcDetail) {
26918
+ return (ndcDetail.parentActionId === mainActionId &&
26919
+ ndcDetail.actionType === NdcDetailsActionType.SubAction);
26920
+ });
26921
+ var emptySubNdcRow = {
26922
+ id: nextAvailableActionId,
26923
+ actionType: NdcDetailsActionType.SubAction,
26924
+ nationalPlanObjective: "",
26925
+ kpi: "",
26926
+ ministryName: loginMinistry,
26927
+ status: NdcDetailsActionStatus.New,
26928
+ parentActionId: mainActionId,
26929
+ };
26930
+ if (checkSubNdcActionCreatePermission()) {
26931
+ subNdcDetails = __spreadArray(__spreadArray([], subNdcDetails, true), [emptySubNdcRow], false);
26932
+ setEditingKey(nextAvailableActionId);
26933
+ setNextAvailableActionId(function (value) { return value + 1; });
26934
+ form.setFieldsValue({
26935
+ nationalPlanObjective: "",
26936
+ kpi: "",
26937
+ });
26938
+ }
26939
+ setSubNdcActionsForPeriod(subNdcDetails);
26940
+ };
26841
26941
  var inRange = function (num, min, max) {
26842
26942
  return num >= min && num <= max;
26843
26943
  };
26844
- function onAddNewSubNdcDetail() {
26845
- var range = selectedTab.split("-");
26846
- var ndcDetail = ndcDetailsData.find(function (item) { return item.key === selectedNdcDetail.current.key; });
26847
- var ndcDetailItemIndex = ndcDetailsData.findIndex(function (item) { return item.key === selectedNdcDetail.current.key; });
26848
- if (ndcDetail) {
26849
- addedNdcDetailId.current = addedNdcDetailId.current + 1;
26850
- var newData = {
26851
- key: addedNdcDetailId.current,
26852
- startDate: new Date("".concat(Number(range[0]), "-01-24 23:12:00")),
26853
- endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
26854
- ndcActionId: ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.key,
26855
- nationalPlanObj: "",
26856
- kpi: "",
26857
- ministry: "",
26858
- };
26859
- if (!ndcDetail.subNdcDetails) {
26860
- ndcDetail.subNdcDetails = [];
26861
- }
26862
- ndcDetail.subNdcDetails.push(newData);
26863
- }
26864
- ndcDetailsData[ndcDetailItemIndex] = ndcDetail;
26865
- setNdcDetailsData(ndcDetailsData);
26866
- setTableKey(function (key) { return key + 1; });
26867
- }
26868
- var handleSave = function (row) {
26869
- setNdcDetailsData(function (prevData) {
26870
- var newData = JSON.parse(JSON.stringify(prevData));
26871
- if (row.type === NdcActionType.main) {
26872
- var index = newData.findIndex(function (item) { return row.key === item.key; });
26873
- if (index !== -1) {
26874
- newData[index] = __assign(__assign({}, newData[index]), row);
26875
- }
26876
- }
26877
- else {
26878
- var parentIndex = newData.findIndex(function (item) { return row.ndcActionId === item.key; });
26879
- var parentItem = newData[parentIndex];
26880
- if (parentItem) {
26881
- if (parentItem.subNdcDetails) {
26882
- var itemIndex = parentItem.subNdcDetails.findIndex(function (item) { return row.key === item.key; });
26883
- if (itemIndex === -1) {
26884
- parentItem.subNdcDetails.push(row);
26885
- }
26886
- else {
26887
- parentItem.subNdcDetails[itemIndex] = __assign({}, row);
26888
- }
26944
+ var ClearEditMode = function () {
26945
+ var unsavedMainActions = ndcActionsList.filter(function (item) {
26946
+ return item.status === NdcDetailsActionStatus.New &&
26947
+ item.actionType === NdcDetailsActionType.MainAction;
26948
+ });
26949
+ if (unsavedMainActions && unsavedMainActions.length) {
26950
+ var updatedActions = ndcActionsList.filter(function (item) { return !unsavedMainActions.includes(item); });
26951
+ setNdcActionsList(updatedActions);
26952
+ }
26953
+ setEditingKey(null);
26954
+ };
26955
+ var handleSave = function (row) { return __awaiter(void 0, void 0, void 0, function () {
26956
+ var updatedFields, updatedItem, exception_2;
26957
+ return __generator(this, function (_a) {
26958
+ switch (_a.label) {
26959
+ case 0:
26960
+ _a.trys.push([0, 9, , 10]);
26961
+ updatedFields = void 0;
26962
+ _a.label = 1;
26963
+ case 1:
26964
+ _a.trys.push([1, 3, , 4]);
26965
+ return [4 /*yield*/, form.validateFields()];
26966
+ case 2:
26967
+ updatedFields = (_a.sent());
26968
+ return [3 /*break*/, 4];
26969
+ case 3:
26970
+ _a.sent();
26971
+ return [2 /*return*/];
26972
+ case 4:
26973
+ if (!updatedFields) {
26974
+ ClearEditMode();
26975
+ return [2 /*return*/];
26976
+ }
26977
+ else if (updatedFields.kpi === row.kpi &&
26978
+ updatedFields.nationalPlanObjective === row.nationalPlanObjective) {
26979
+ ClearEditMode();
26980
+ return [2 /*return*/];
26981
+ }
26982
+ updatedItem = __assign(__assign({}, row), updatedFields);
26983
+ if (!(updatedItem.status === NdcDetailsActionStatus.New)) return [3 /*break*/, 6];
26984
+ if (isGovernmentUser &&
26985
+ updatedItem.actionType === NdcDetailsActionType.SubAction) {
26986
+ updatedItem.status = NdcDetailsActionStatus.Approved;
26889
26987
  }
26890
26988
  else {
26891
- parentItem.subNdcDetails = [row];
26989
+ updatedItem.status = NdcDetailsActionStatus.Pending;
26892
26990
  }
26893
- }
26894
- newData[parentIndex] = __assign({}, parentItem);
26895
- setTableKey(function (key) { return key + 1; });
26991
+ return [4 /*yield*/, post("national/programme/addNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseInt(updatedItem.kpi.toString()) }))];
26992
+ case 5:
26993
+ _a.sent();
26994
+ return [3 /*break*/, 8];
26995
+ case 6:
26996
+ updatedItem.status = NdcDetailsActionStatus.Pending;
26997
+ return [4 /*yield*/, put("national/programme/updateNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseInt(updatedItem.kpi.toString()) }))];
26998
+ case 7:
26999
+ _a.sent();
27000
+ _a.label = 8;
27001
+ case 8:
27002
+ fetchNdcDetailActions();
27003
+ ClearEditMode();
27004
+ return [3 /*break*/, 10];
27005
+ case 9:
27006
+ exception_2 = _a.sent();
27007
+ ClearEditMode();
27008
+ antd.message.open({
27009
+ type: "error",
27010
+ content: exception_2.message,
27011
+ duration: 3,
27012
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27013
+ });
27014
+ return [3 /*break*/, 10];
27015
+ case 10: return [2 /*return*/];
26896
27016
  }
26897
- return newData;
26898
27017
  });
26899
- };
26900
- var getNdcDetailsForPeriod = function () {
26901
- var range = selectedTab.split("-");
26902
- if (range.length > 1) {
26903
- var filteredData = ndcDetailsData.filter(function (item) {
26904
- return inRange(Number(moment(item.startDate).year()), Number(range[0]), Number(range[1]));
26905
- });
26906
- return filteredData;
26907
- }
26908
- else {
26909
- return [];
26910
- }
26911
- };
26912
- var getSubNdcDetails = function (key) {
26913
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
26914
- var ndcDetail = ndcDetailsData.find(function (item) { return item.key === key; });
26915
- if (ndcDetail) {
26916
- if (((_b = ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.subNdcDetails[((_a = ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.subNdcDetails) === null || _a === void 0 ? void 0 : _a.length) - 1]) === null || _b === void 0 ? void 0 : _b.ministry.trim()) !== "" &&
26917
- ((_d = ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.subNdcDetails[((_c = ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.subNdcDetails) === null || _c === void 0 ? void 0 : _c.length) - 1]) === null || _d === void 0 ? void 0 : _d.ministry) &&
26918
- ((_f = ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.subNdcDetails[((_e = ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.subNdcDetails) === null || _e === void 0 ? void 0 : _e.length) - 1]) === null || _f === void 0 ? void 0 : _f.nationalPlanObj.trim()) !== "" &&
26919
- ((_h = ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.subNdcDetails[((_g = ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.subNdcDetails) === null || _g === void 0 ? void 0 : _g.length) - 1]) === null || _h === void 0 ? void 0 : _h.nationalPlanObj) &&
26920
- String((_k = ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.subNdcDetails[((_j = ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.subNdcDetails) === null || _j === void 0 ? void 0 : _j.length) - 1]) === null || _k === void 0 ? void 0 : _k.kpi).trim() !== "" &&
26921
- String((_m = ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.subNdcDetails[((_l = ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.subNdcDetails) === null || _l === void 0 ? void 0 : _l.length) - 1]) === null || _m === void 0 ? void 0 : _m.kpi)) {
26922
- onAddNewSubNdcDetail();
26923
- }
26924
- return ndcDetail.subNdcDetails;
27018
+ }); };
27019
+ var actionMenu = function (record) {
27020
+ if (record.status === NdcDetailsActionStatus.Pending &&
27021
+ isGovernmentUser &&
27022
+ !selectedPeriod.finalized) {
27023
+ return (React.createElement(antd.List, { className: "action-menu", size: "small", dataSource: [
27024
+ {
27025
+ text: t("ndc:approve"),
27026
+ icon: React.createElement(Icon__namespace.BoxArrowInDown, null),
27027
+ style: "color-primary",
27028
+ click: function () {
27029
+ setActionInfo({
27030
+ action: "Approve",
27031
+ headerText: t("ndc:actionApproveTitle"),
27032
+ type: "primary",
27033
+ icon: React.createElement(Icon__namespace.BoxArrowInDown, null),
27034
+ recordId: record.id,
27035
+ });
27036
+ setOpenConfirmationModal(true);
27037
+ },
27038
+ },
27039
+ {
27040
+ text: t("ndc:reject"),
27041
+ icon: React.createElement(Icon__namespace.XOctagon, null),
27042
+ style: "color-error",
27043
+ click: function () {
27044
+ setActionInfo({
27045
+ action: "Reject",
27046
+ headerText: t("ndc:rejectApproveTitle"),
27047
+ type: "danger",
27048
+ icon: React.createElement(Icon__namespace.XOctagon, null),
27049
+ recordId: record.id,
27050
+ });
27051
+ setOpenConfirmationModal(true);
27052
+ },
27053
+ },
27054
+ ], renderItem: function (item) { return (React.createElement(antd.List.Item, { onClick: item.click },
27055
+ React.createElement(antd.Typography.Text, { className: "action-icon ".concat(item.style) }, item.icon),
27056
+ React.createElement("span", null, item.text))); } }));
26925
27057
  }
26926
27058
  else {
26927
- return [];
27059
+ return null;
26928
27060
  }
26929
27061
  };
26930
27062
  var defaultColumns = [
26931
27063
  {
26932
27064
  title: t("ndc:ndcColumnsNationalPlanObj"),
26933
- dataIndex: "nationalPlanObj",
26934
- key: "nationalPlanObj",
27065
+ dataIndex: "nationalPlanObjective",
27066
+ key: "nationalPlanObjective",
26935
27067
  align: "left",
27068
+ width: 400,
26936
27069
  editable: true,
26937
- width: "50%",
26938
- render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(antd.Space, { size: "middle" },
26939
- React.createElement("span", null, record.nationalPlanObj))) : (React.createElement("input", { placeholder: "Please add Programmes", className: "ant-input", type: "text" })))); },
27070
+ render: function (_, record) { return (React.createElement(antd.Space, { size: "middle" }, record.nationalPlanObjective ? (React.createElement(antd.Tooltip, { title: isNdcActionEditable(record) ? "" : t("ndc:ndcUnauthorisedMsg") },
27071
+ React.createElement("span", null, record.nationalPlanObjective))) : (React.createElement(antd.Input, { placeholder: t("ndc:nationalPlanObjectivePlaceHolder") })))); },
26940
27072
  },
26941
27073
  {
26942
27074
  title: t("ndc:ndcColumnsKpi"),
26943
27075
  dataIndex: "kpi",
26944
27076
  key: "kpi",
26945
27077
  align: "left",
27078
+ width: 100,
26946
27079
  editable: true,
26947
- width: "10%",
26948
- render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(antd.Space, { size: "middle" },
26949
- React.createElement("span", null, record.kpi))) : (React.createElement("input", { placeholder: "Enter Kpi", className: "ant-input", type: "text" })))); },
27080
+ render: function (_, record) { return (React.createElement(antd.Space, { size: "middle" }, record.kpi ? (React.createElement(antd.Tooltip, { title: isNdcActionEditable(record) ? "" : t("ndc:ndcUnauthorisedMsg") },
27081
+ React.createElement("span", null, record.kpi))) : (React.createElement(antd.Input, { placeholder: "Enter Kpi" })))); },
26950
27082
  },
26951
27083
  {
26952
- title: "Government Department",
26953
- dataIndex: "ministry",
26954
- key: "ministry",
27084
+ title: t("ndc:ndcColumnsMinistry"),
27085
+ dataIndex: "ministryName",
27086
+ key: "ministryName",
26955
27087
  align: "left",
26956
- editable: true,
26957
- width: "40%",
26958
- render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(antd.Space, { size: "middle" },
26959
- React.createElement("span", null, record.ministry))) : (React.createElement("input", { placeholder: "Please add the Government Department", className: "ant-input", type: "text" })))); },
27088
+ width: 300,
27089
+ editable: false,
27090
+ render: function (_, record) { return (React.createElement(antd.Tooltip, { title: isSubNdcActionsEditable(record) ? "" : t("ndc:ndcUnauthorisedMsg") },
27091
+ React.createElement(antd.Select, { disabled: !(isSubNdcActionsEditable(record) && isEditing(record)), defaultValue: record.ministryName ? record.ministryName : loginMinistry, style: { width: 220 }, onChange: function (value, option) {
27092
+ record.ministryName = option.label;
27093
+ handleSave(record);
27094
+ }, options: ministryOrgList }))); },
27095
+ },
27096
+ {
27097
+ title: t("ndc:ndcColumnsStatus"),
27098
+ dataIndex: "status",
27099
+ key: "status",
27100
+ align: "left",
27101
+ width: 200,
27102
+ editable: false,
27103
+ render: function (_, record) {
27104
+ var menu = actionMenu(record);
27105
+ return (React.createElement("div", { onClick: function (event) { return event.stopPropagation(); } },
27106
+ record.actionType === NdcDetailsActionType.SubAction &&
27107
+ record.status !== NdcDetailsActionStatus.New ? (React.createElement(antd.Tooltip, { title: record.status, color: TooltipColor, key: TooltipColor },
27108
+ React.createElement(antd.Tag, { className: "clickable", color: getNdcActionStatusTagType(record.status) }, addSpaces(record.status)))) : (""),
27109
+ record.actionType === NdcDetailsActionType.SubAction && menu ? (React.createElement(antd.Popover, { placement: "bottomRight", content: menu, trigger: "click" },
27110
+ React.createElement(icons.EllipsisOutlined, { rotate: 90, style: {
27111
+ fontWeight: 600,
27112
+ fontSize: "1rem",
27113
+ cursor: "pointer",
27114
+ } }))) : (React.createElement("span", null))));
27115
+ },
26960
27116
  },
26961
27117
  ];
26962
27118
  var columns = defaultColumns.map(function (col) {
26963
27119
  if (!col.editable) {
26964
27120
  return col;
26965
27121
  }
26966
- return __assign(__assign({}, col), { onCell: function (record) { return ({
26967
- record: record,
26968
- editable: col.editable,
26969
- dataIndex: col.dataIndex,
26970
- title: col.title,
26971
- handleSave: handleSave,
26972
- }); } });
27122
+ return __assign(__assign({}, col), { onCell: function (record) {
27123
+ return {
27124
+ record: record,
27125
+ editing: isEditing(record),
27126
+ dataIndex: col.dataIndex,
27127
+ title: col.title,
27128
+ onBlurHandler: function (record) {
27129
+ if (isEditing(record)) {
27130
+ handleSave(record);
27131
+ }
27132
+ },
27133
+ t: t,
27134
+ };
27135
+ } });
26973
27136
  });
26974
- function onAddNewNdcDetail() {
26975
- var range = selectedTab.split("-");
26976
- var ndcActionId = ++addedNdcDetailId.current;
26977
- var newData = {
26978
- key: ndcActionId,
26979
- type: NdcActionType.main,
26980
- startDate: new Date("".concat(Number(range[0]), "-01-24 23:12:00")),
26981
- endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
26982
- nationalPlanObj: "",
26983
- kpi: "",
26984
- ministry: "",
26985
- subNdcDetails: [
26986
- {
26987
- key: ++addedNdcDetailId.current,
26988
- ndcActionId: ndcActionId,
26989
- type: NdcActionType.sub,
26990
- startDate: new Date("2019-03-25"),
26991
- endDate: new Date("2020-03-25"),
26992
- nationalPlanObj: "",
26993
- kpi: "",
26994
- ministry: "",
26995
- },
26996
- ],
26997
- };
26998
- setNdcDetailsData(__spreadArray(__spreadArray([], ndcDetailsData, true), [newData], false));
27137
+ function onClickedAddNewNdcDetail() {
27138
+ return __awaiter(this, void 0, void 0, function () {
27139
+ var periodId, newData_1, lastPage;
27140
+ return __generator(this, function (_a) {
27141
+ if (selectedPeriod.key !== "add_new") {
27142
+ form.setFieldsValue({
27143
+ nationalPlanObjective: "",
27144
+ kpi: "",
27145
+ });
27146
+ periodId = parseInt(selectedPeriod.key);
27147
+ newData_1 = {
27148
+ id: nextAvailableActionId,
27149
+ actionType: NdcDetailsActionType.MainAction,
27150
+ nationalPlanObjective: "",
27151
+ kpi: "",
27152
+ ministryName: loginMinistry,
27153
+ periodId: periodId,
27154
+ status: NdcDetailsActionStatus.New,
27155
+ };
27156
+ setEditingKey(nextAvailableActionId);
27157
+ setNextAvailableActionId(function (value) { return value + 1; });
27158
+ setNdcActionsList(function (ndcActionsList) { return __spreadArray(__spreadArray([], ndcActionsList, true), [
27159
+ newData_1,
27160
+ ], false); });
27161
+ setTableKey(function (key) { return key + 1; });
27162
+ if (ndcMainDetailsForPeriod.length + 1 > pageSize) {
27163
+ lastPage = Math.ceil(ndcMainDetailsForPeriod.length / pageSize);
27164
+ setCurrentPage(lastPage);
27165
+ }
27166
+ }
27167
+ return [2 /*return*/];
27168
+ });
27169
+ });
26999
27170
  }
27000
27171
  var components = {
27001
27172
  body: {
27002
- row: EditableRow,
27003
27173
  cell: EditableCell,
27004
27174
  },
27005
27175
  };
27006
- //commented because rendering issue
27007
- function ndcDetailsTableContent() {
27008
- return (React.createElement("div", null)
27009
- // <div>
27010
- // <Button
27011
- // onClick={onAddNewNdcDetail}
27012
- // type="primary"
27013
- // style={{
27014
- // marginBottom: 16,
27015
- // }}
27016
- // >
27017
- // Add a row
27018
- // </Button>
27019
- // <Table
27020
- // components={components}
27021
- // rowClassName={() => 'editable-row'}
27022
- // bordered
27023
- // dataSource={ndcDetailsData}
27024
- // columns={columns}
27025
- // />
27026
- // </div>
27027
- );
27028
- }
27029
- var onCancelPeriod = function () { };
27030
- var onAddNewPeriod = function () {
27031
- if (selectedPeriod &&
27032
- selectedPeriod.current &&
27033
- selectedPeriod.current.start &&
27034
- selectedPeriod.current.end) {
27035
- var newPeriodItem_1 = {
27036
- key: "".concat(selectedPeriod.current.start, "-").concat(selectedPeriod.current.end),
27037
- label: "".concat(selectedPeriod.current.start, "-").concat(selectedPeriod.current.end),
27038
- start: selectedPeriod.current.start,
27039
- end: selectedPeriod.current.end,
27040
- children: ndcDetailsTableContent(),
27041
- };
27042
- var existingIndex = periodItemsRef.current.findIndex(function (item) {
27043
- return inRange(newPeriodItem_1.start, item.start, item.end) ||
27044
- inRange(newPeriodItem_1.end, item.start, item.end);
27176
+ var onClickedDeletePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
27177
+ return __generator(this, function (_a) {
27178
+ setActionInfo({
27179
+ action: "Delete",
27180
+ headerText: t("ndc:periodDeleteConfirmTitle"),
27181
+ type: "danger",
27182
+ icon: React.createElement(Icon__namespace.XCircle, null),
27183
+ recordId: selectedPeriod.key,
27045
27184
  });
27046
- if (existingIndex === -1) {
27047
- setPeriodItems(function (items) { return __spreadArray(__spreadArray([], items, true), [newPeriodItem_1], false); });
27048
- periodItemsRef.current = __spreadArray(__spreadArray([], periodItemsRef.current, true), [newPeriodItem_1], false);
27185
+ setOpenConfirmationModal(true);
27186
+ return [2 /*return*/];
27187
+ });
27188
+ }); };
27189
+ var onClickedFinalizePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
27190
+ var isPendingActionAvailable;
27191
+ return __generator(this, function (_a) {
27192
+ if (ndcMainDetailsForPeriod.length === 0) {
27193
+ antd.message.open({
27194
+ type: "error",
27195
+ content: t("ndc:finalizeNdcEmptyErrorText"),
27196
+ duration: 3,
27197
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27198
+ });
27199
+ return [2 /*return*/];
27049
27200
  }
27050
- else {
27201
+ isPendingActionAvailable = false;
27202
+ ndcMainDetailsForPeriod.forEach(function (mainAction) {
27203
+ var pendingActions = ndcActionsList.filter(function (action) {
27204
+ return (action.status === NdcDetailsActionStatus.Pending &&
27205
+ action.actionType === NdcDetailsActionType.SubAction &&
27206
+ action.parentActionId === mainAction.id);
27207
+ });
27208
+ if (pendingActions && pendingActions.length > 0) {
27209
+ isPendingActionAvailable = true;
27210
+ return;
27211
+ }
27212
+ });
27213
+ if (isPendingActionAvailable) {
27051
27214
  antd.message.open({
27052
27215
  type: "error",
27053
- content: t("ndc:rangeAlreadyExists"),
27216
+ content: t("ndc:finalizeErrorText"),
27054
27217
  duration: 3,
27055
27218
  style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27056
27219
  });
27057
27220
  }
27221
+ else {
27222
+ setActionInfo({
27223
+ action: "Finalize",
27224
+ headerText: t("ndc:finalizeApproveTitle"),
27225
+ text: t("ndc:finalizeApproveSubTitle"),
27226
+ type: "primary",
27227
+ icon: React.createElement(Icon__namespace.Clipboard2Check, null),
27228
+ recordId: selectedPeriod.key,
27229
+ });
27230
+ setOpenConfirmationModal(true);
27231
+ }
27232
+ return [2 /*return*/];
27233
+ });
27234
+ }); };
27235
+ var onMainTableRowExpand = function (expanded, record) {
27236
+ var keys = [];
27237
+ if (expanded) {
27238
+ keys.push(record.id);
27058
27239
  }
27059
- };
27060
- React.useEffect(function () {
27061
- if (periodItems && periodItems.length > 3) {
27062
- setSelectedTab(periodItems[periodItems.length - 1].key);
27063
- }
27064
- }, [periodItems]);
27065
- var onDateRangeChanged = function (range) {
27066
- var period = {
27067
- start: Number(moment(range[0]).year()),
27068
- end: Number(moment(range[1]).year()),
27069
- };
27070
- selectedPeriod.current = period;
27240
+ setExpandedRowKeys(keys);
27241
+ setNdcSubActionsForMainAction(record.id);
27071
27242
  };
27072
27243
  function addNewPeriodContent() {
27073
27244
  return (React.createElement("div", null,
27074
- React.createElement(antd.Row, null,
27075
- React.createElement(RangePicker, { onChange: onDateRangeChanged, picker: "year" })),
27076
- React.createElement(antd.Row, { className: "mg-top-1" },
27077
- React.createElement("div", { className: "ndc-steps-actions" },
27078
- React.createElement(antd.Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit")),
27079
- React.createElement(antd.Button, { className: "back-btn", onClick: onCancelPeriod, loading: loading }, t("ndc:back"))))));
27080
- }
27081
- function getSubNdcActionContent(record) {
27082
- selectedNdcDetail.current = record;
27083
- return (React.createElement(antd.Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getSubNdcDetails(record.key), columns: columns, showHeader: false, pagination: false }));
27245
+ React.createElement(antd.Row, { justify: "start", align: "middle", gutter: [16, 16] },
27246
+ React.createElement(antd.Col, { flex: "340px" },
27247
+ React.createElement(RangePicker, { disabledDate: function (current) { return moment(current).year() < 1900; }, onChange: onDateRangeChanged, picker: "year" })),
27248
+ React.createElement(antd.Col, { flex: "auto" },
27249
+ React.createElement(antd.Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit"))))));
27084
27250
  }
27085
- var onTabChange = function (key) {
27086
- setSelectedTab(key);
27251
+ var onChange = function (page, size) {
27252
+ setCurrentPage(page);
27253
+ setPageSize(size);
27087
27254
  };
27088
- React.useEffect(function () {
27089
- var defaultNdcDetails = [
27090
- {
27091
- key: 1,
27092
- type: NdcActionType.main,
27093
- startDate: new Date("2019-03-25"),
27094
- endDate: new Date("2020-03-25"),
27095
- nationalPlanObj: "Enhance value addition in key growth opportunities",
27096
- kpi: 25,
27097
- ministry: "Ministry of Environment",
27098
- subNdcDetails: [
27099
- {
27100
- key: 6,
27101
- ndcActionId: 1,
27102
- type: NdcActionType.sub,
27103
- startDate: new Date("2019-03-25"),
27104
- endDate: new Date("2020-03-25"),
27105
- nationalPlanObj: "Enhance value addition in key growth opportunities sub details",
27106
- kpi: 25,
27107
- ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
27108
- },
27109
- {
27110
- key: 7,
27111
- ndcActionId: 1,
27112
- type: NdcActionType.sub,
27113
- startDate: new Date("2019-03-25"),
27114
- endDate: new Date("2020-03-25"),
27115
- nationalPlanObj: "",
27116
- kpi: "",
27117
- ministry: "",
27118
- },
27119
- ],
27120
- },
27121
- {
27122
- key: 2,
27123
- type: NdcActionType.main,
27124
- startDate: new Date("2019-03-25"),
27125
- endDate: new Date("2019-08-25"),
27126
- nationalPlanObj: "Strengthen the private sector to create 10,000 jobs",
27127
- kpi: 10500,
27128
- ministry: "Ministry of Environment",
27129
- subNdcDetails: [
27130
- {
27131
- key: 8,
27132
- ndcActionId: 2,
27133
- type: NdcActionType.sub,
27134
- startDate: new Date("2019-03-25"),
27135
- endDate: new Date("2020-03-25"),
27136
- nationalPlanObj: "",
27137
- kpi: "",
27138
- ministry: "",
27139
- },
27140
- ],
27141
- },
27142
- {
27143
- key: 12,
27144
- type: NdcActionType.main,
27145
- startDate: new Date("2019-03-25"),
27146
- endDate: new Date("2019-08-25"),
27147
- nationalPlanObj: "Other",
27148
- kpi: 10500,
27149
- ministry: "Ministry of Environment",
27150
- subNdcDetails: [
27151
- {
27152
- key: 8,
27153
- ndcActionId: 12,
27154
- type: NdcActionType.sub,
27155
- startDate: new Date("2019-03-25"),
27156
- endDate: new Date("2020-03-25"),
27157
- nationalPlanObj: "",
27158
- kpi: "",
27159
- ministry: "",
27255
+ function mainNdcActionTableContent() {
27256
+ return (React.createElement("div", null,
27257
+ React.createElement(antd.Row, null,
27258
+ React.createElement(antd.Col, { span: 24 },
27259
+ React.createElement(antd.Form, { form: form, component: false },
27260
+ React.createElement(antd.Table, { tableLayout: "fixed", key: tableKey, className: "common-table-class", rowKey: "id", pagination: {
27261
+ current: currentPage,
27262
+ pageSize: pageSize,
27263
+ total: ndcMainDetailsForPeriod.length,
27264
+ showQuickJumper: true,
27265
+ showSizeChanger: true,
27266
+ onChange: onChange,
27267
+ }, components: components, rowClassName: function () { return "editable-row"; }, bordered: true, loading: loading, dataSource: ndcMainDetailsForPeriod, columns: columns, expandedRowKeys: expandedRowKeys, onExpand: onMainTableRowExpand, expandable: {
27268
+ expandedRowRender: function (record) {
27269
+ return subNdcActionTableContent();
27270
+ },
27271
+ columnWidth: 40,
27272
+ }, onRow: function (record, rowIndex) {
27273
+ return {
27274
+ onClick: function (event) {
27275
+ if (record.id &&
27276
+ isNdcActionEditable(record) &&
27277
+ !isEditing(record)) {
27278
+ form.setFieldsValue(__assign({}, record));
27279
+ setEditingKey(record.id);
27280
+ }
27281
+ },
27282
+ onMouseLeave: function () {
27283
+ if (isEditing(record)) {
27284
+ handleSave(record);
27285
+ }
27286
+ },
27287
+ };
27288
+ }, footer: function () {
27289
+ return isGovernmentUser &&
27290
+ !selectedPeriod.finalized && (React.createElement(antd.Row, { justify: "center" },
27291
+ React.createElement(antd.Button, { className: "btnAddNewMainAct", disabled: isMainActionInEditMode(), onClick: onClickedAddNewNdcDetail, type: "default" }, t("ndc:addNdcAction"))));
27292
+ } })))),
27293
+ isGovernmentUser && !selectedPeriod.finalized ? (React.createElement(antd.Row, { justify: "end" }, isMainActionInEditMode() ? (React.createElement(React.Fragment, null,
27294
+ React.createElement(antd.Button, { className: "mg-left-1", disabled: true }, t("ndc:delete")),
27295
+ React.createElement(antd.Button, { className: "mg-left-1", disabled: true }, t("ndc:finalize")))) : (React.createElement(React.Fragment, null,
27296
+ React.createElement(antd.Button, { className: "mg-left-1 btn-danger", onClick: onClickedDeletePeriod, htmlType: "submit", loading: loading }, t("ndc:delete")),
27297
+ React.createElement(antd.Button, { className: "mg-left-1", type: "primary", onClick: onClickedFinalizePeriod, htmlType: "submit", loading: loading }, t("ndc:finalize")))))) : ("")));
27298
+ }
27299
+ function subNdcActionTableContent(record) {
27300
+ 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) {
27301
+ return {
27302
+ onClick: function (event) {
27303
+ if (record.id &&
27304
+ isNdcActionEditable(record) &&
27305
+ !isEditing(record)) {
27306
+ form.setFieldsValue(__assign({}, record));
27307
+ setEditingKey(record.id);
27308
+ }
27160
27309
  },
27161
- ],
27162
- },
27163
- {
27164
- key: 3,
27165
- type: NdcActionType.main,
27166
- startDate: new Date("2021-03-25"),
27167
- endDate: new Date("2022-03-25"),
27168
- nationalPlanObj: "Consolidate and increase the stock and quality of productive infrastructure by 50%",
27169
- kpi: 48,
27170
- ministry: "Ministry of Environment",
27171
- subNdcDetails: [
27172
- {
27173
- key: 9,
27174
- ndcActionId: 3,
27175
- type: NdcActionType.sub,
27176
- startDate: new Date("2019-03-25"),
27177
- endDate: new Date("2020-03-25"),
27178
- nationalPlanObj: "",
27179
- kpi: "",
27180
- ministry: "",
27310
+ onMouseLeave: function () {
27311
+ if (isEditing(record)) {
27312
+ handleSave(record);
27313
+ }
27181
27314
  },
27182
- ],
27183
- },
27184
- {
27185
- key: 4,
27186
- type: NdcActionType.main,
27187
- startDate: new Date("2022-03-25"),
27188
- endDate: new Date("2022-05-25"),
27189
- nationalPlanObj: "Enhance the productivity and social wellbeing of the population",
27190
- kpi: 20,
27191
- ministry: "Ministry of Environment",
27192
- subNdcDetails: [
27193
- {
27194
- key: 10,
27195
- ndcActionId: 4,
27196
- type: NdcActionType.sub,
27197
- startDate: new Date("2019-03-25"),
27198
- endDate: new Date("2020-03-25"),
27199
- nationalPlanObj: "",
27200
- kpi: "",
27201
- ministry: "",
27202
- },
27203
- ],
27204
- },
27205
- {
27206
- key: 5,
27207
- type: NdcActionType.main,
27208
- startDate: new Date("2022-03-25"),
27209
- endDate: new Date("2023-03-25"),
27210
- nationalPlanObj: "Strengthen the role of the state in guiding and facilitating development",
27211
- kpi: 10,
27212
- ministry: "Ministry of Environment",
27213
- subNdcDetails: [
27214
- {
27215
- key: 11,
27216
- ndcActionId: 5,
27217
- type: NdcActionType.sub,
27218
- startDate: new Date("2019-03-25"),
27219
- endDate: new Date("2020-03-25"),
27220
- nationalPlanObj: "",
27221
- kpi: "",
27222
- ministry: "",
27223
- },
27224
- ],
27225
- },
27226
- {
27227
- key: 13,
27228
- type: NdcActionType.main,
27229
- startDate: new Date("2022-03-25"),
27230
- endDate: new Date("2023-03-25"),
27231
- nationalPlanObj: "Convert to solar energy",
27232
- kpi: 50000,
27233
- ministry: "Ministry of Environment",
27234
- subNdcDetails: [
27235
- {
27236
- key: 11,
27237
- ndcActionId: 13,
27238
- type: NdcActionType.sub,
27239
- startDate: new Date("2019-03-25"),
27240
- endDate: new Date("2020-03-25"),
27241
- nationalPlanObj: "Convert to solar energy",
27242
- kpi: "3000",
27243
- ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
27244
- },
27245
- {
27246
- key: 14,
27247
- ndcActionId: 13,
27248
- type: NdcActionType.sub,
27249
- startDate: new Date("2019-03-25"),
27250
- endDate: new Date("2020-03-25"),
27251
- nationalPlanObj: "",
27252
- kpi: "",
27253
- ministry: "",
27254
- },
27255
- ],
27256
- },
27257
- {
27258
- key: 15,
27259
- type: NdcActionType.main,
27260
- startDate: new Date("2022-03-25"),
27261
- endDate: new Date("2023-03-25"),
27262
- nationalPlanObj: "Strengthen the private sector to create jobs",
27263
- kpi: 10000,
27264
- ministry: "Ministry of Environment",
27265
- subNdcDetails: [
27266
- {
27267
- key: 16,
27268
- ndcActionId: 15,
27269
- type: NdcActionType.sub,
27270
- startDate: new Date("2019-03-25"),
27271
- endDate: new Date("2020-03-25"),
27272
- nationalPlanObj: "Strengthen the private sector to create jobs",
27273
- kpi: "7200",
27274
- ministry: "Ministry of Tourism (MoT)",
27275
- },
27276
- {
27277
- key: 17,
27278
- ndcActionId: 15,
27279
- type: NdcActionType.sub,
27280
- startDate: new Date("2019-03-25"),
27281
- endDate: new Date("2020-03-25"),
27282
- nationalPlanObj: "",
27283
- kpi: "",
27284
- ministry: "",
27285
- },
27286
- ],
27287
- },
27288
- {
27289
- key: 18,
27290
- type: NdcActionType.main,
27291
- startDate: new Date("2022-03-25"),
27292
- endDate: new Date("2023-03-25"),
27293
- nationalPlanObj: "Other",
27294
- kpi: "",
27295
- ministry: "Ministry of Environment",
27296
- subNdcDetails: [
27297
- {
27298
- key: 19,
27299
- ndcActionId: 18,
27300
- type: NdcActionType.sub,
27301
- startDate: new Date("2019-03-25"),
27302
- endDate: new Date("2020-03-25"),
27303
- nationalPlanObj: "Strengthen the private sector to create jobs",
27304
- kpi: "",
27305
- ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
27306
- },
27307
- {
27308
- key: 20,
27309
- ndcActionId: 18,
27310
- type: NdcActionType.sub,
27311
- startDate: new Date("2019-03-25"),
27312
- endDate: new Date("2020-03-25"),
27313
- nationalPlanObj: "",
27314
- kpi: "",
27315
- ministry: "",
27316
- },
27317
- ],
27318
- },
27319
- ];
27320
- var initialPeriods = [
27321
- {
27322
- key: "2019-2020",
27323
- label: "2019-2020",
27324
- start: 2019,
27325
- end: 2020,
27326
- children: ndcDetailsTableContent(),
27327
- },
27328
- {
27329
- key: "2021-2023",
27330
- label: "2021-2023",
27331
- start: 2021,
27332
- end: 2021,
27333
- children: ndcDetailsTableContent(),
27334
- },
27335
- ];
27336
- if (isAddRangeVisible()) {
27337
- initialPeriods.unshift({
27338
- key: "add_new",
27339
- label: "Add New",
27340
- start: 0,
27341
- end: 0,
27342
- children: addNewPeriodContent(),
27343
- });
27315
+ };
27316
+ }, columns: columns, showHeader: false, pagination: false }));
27317
+ }
27318
+ var onAddNewPeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
27319
+ var periodItem_1, existingIndex, response, addedPeriodItem, updatedPeriodItem_1, exception_3;
27320
+ return __generator(this, function (_a) {
27321
+ switch (_a.label) {
27322
+ case 0:
27323
+ _a.trys.push([0, 4, , 5]);
27324
+ if (!(selectedDateRangeRef &&
27325
+ selectedDateRangeRef.current &&
27326
+ selectedDateRangeRef.current.startYear &&
27327
+ selectedDateRangeRef.current.endYear)) return [3 /*break*/, 3];
27328
+ periodItem_1 = {
27329
+ startYear: selectedDateRangeRef.current.startYear,
27330
+ endYear: selectedDateRangeRef.current.endYear,
27331
+ finalized: false,
27332
+ };
27333
+ existingIndex = periodItems.findIndex(function (item) {
27334
+ return inRange(periodItem_1.startYear, item.startYear, item.endYear) ||
27335
+ inRange(periodItem_1.endYear, item.startYear, item.endYear);
27336
+ });
27337
+ if (!(existingIndex === -1)) return [3 /*break*/, 2];
27338
+ return [4 /*yield*/, post("national/programme/addNdcDetailsPeriod", __assign({}, periodItem_1))];
27339
+ case 1:
27340
+ response = _a.sent();
27341
+ if (response && response.data) {
27342
+ addedPeriodItem = response.data;
27343
+ updatedPeriodItem_1 = __assign(__assign({}, addedPeriodItem), { key: addedPeriodItem.id, label: "".concat(addedPeriodItem.startYear, "-").concat(addedPeriodItem.endYear) });
27344
+ setPeriodItems(function (items) { return __spreadArray(__spreadArray([], items, true), [updatedPeriodItem_1], false); });
27345
+ setSelectedPeriod(updatedPeriodItem_1);
27346
+ }
27347
+ return [3 /*break*/, 3];
27348
+ case 2:
27349
+ antd.message.open({
27350
+ type: "error",
27351
+ content: t("ndc:rangeAlreadyExists"),
27352
+ duration: 3,
27353
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27354
+ });
27355
+ _a.label = 3;
27356
+ case 3: return [3 /*break*/, 5];
27357
+ case 4:
27358
+ exception_3 = _a.sent();
27359
+ antd.message.open({
27360
+ type: "error",
27361
+ content: exception_3.message,
27362
+ duration: 3,
27363
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27364
+ });
27365
+ return [3 /*break*/, 5];
27366
+ case 5: return [2 /*return*/];
27367
+ }
27368
+ });
27369
+ }); };
27370
+ var onDateRangeChanged = function (range) {
27371
+ if (range) {
27372
+ var period = {
27373
+ startYear: Number(moment(range[0]).year()),
27374
+ endYear: Number(moment(range[1]).year()),
27375
+ };
27376
+ if (period.startYear === period.endYear) {
27377
+ antd.message.open({
27378
+ type: "error",
27379
+ content: t("ndc:sameStartEndDates"),
27380
+ duration: 3,
27381
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27382
+ });
27383
+ }
27384
+ else {
27385
+ selectedDateRangeRef.current = period;
27386
+ }
27387
+ }
27388
+ };
27389
+ var onTabChange = function (key) {
27390
+ var selectedPeriod = periodItems.find(function (item) { return item.key === key; });
27391
+ if (selectedPeriod) {
27392
+ setSelectedPeriod(selectedPeriod);
27344
27393
  }
27345
- addedNdcDetailId.current = 20;
27346
- setPeriodItems(initialPeriods);
27347
- periodItemsRef.current = initialPeriods;
27348
- setNdcDetailsData(defaultNdcDetails);
27394
+ };
27395
+ var onActionConfirmed = function () { return __awaiter(void 0, void 0, void 0, function () {
27396
+ var actionResponse, exception_4;
27397
+ return __generator(this, function (_a) {
27398
+ switch (_a.label) {
27399
+ case 0:
27400
+ setLoading(true);
27401
+ _a.label = 1;
27402
+ case 1:
27403
+ _a.trys.push([1, 10, , 11]);
27404
+ if (!(actionInfo.action === "Approve")) return [3 /*break*/, 3];
27405
+ return [4 /*yield*/, post("national/programme/approveNdcDetailsAction", {
27406
+ id: actionInfo.recordId,
27407
+ })];
27408
+ case 2:
27409
+ actionResponse = _a.sent();
27410
+ return [3 /*break*/, 9];
27411
+ case 3:
27412
+ if (!(actionInfo.action === "Reject")) return [3 /*break*/, 5];
27413
+ return [4 /*yield*/, post("national/programme/rejectNdcDetailsAction", {
27414
+ id: actionInfo.recordId,
27415
+ })];
27416
+ case 4:
27417
+ actionResponse = _a.sent();
27418
+ return [3 /*break*/, 9];
27419
+ case 5:
27420
+ if (!(actionInfo.action === "Finalize")) return [3 /*break*/, 7];
27421
+ return [4 /*yield*/, post("national/programme/finalizeNdcDetailsPeriod", {
27422
+ id: selectedPeriod.key,
27423
+ })];
27424
+ case 6:
27425
+ actionResponse = _a.sent();
27426
+ return [3 /*break*/, 9];
27427
+ case 7:
27428
+ if (!(actionInfo.action === "Delete")) return [3 /*break*/, 9];
27429
+ return [4 /*yield*/, post("national/programme/deleteNdcDetailsPeriod", {
27430
+ id: selectedPeriod.key,
27431
+ })];
27432
+ case 8:
27433
+ actionResponse = _a.sent();
27434
+ _a.label = 9;
27435
+ case 9: return [3 /*break*/, 11];
27436
+ case 10:
27437
+ exception_4 = _a.sent();
27438
+ antd.message.open({
27439
+ type: "error",
27440
+ content: exception_4.message,
27441
+ duration: 3,
27442
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27443
+ });
27444
+ return [3 /*break*/, 11];
27445
+ case 11:
27446
+ if (actionResponse) {
27447
+ if (actionInfo.action === "Delete") {
27448
+ antd.message.open({
27449
+ type: "success",
27450
+ content: t("ndc:deletePeriodSuccessMsg"),
27451
+ duration: 3,
27452
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27453
+ });
27454
+ fetchNdcDetailPeriods();
27455
+ }
27456
+ else if (actionInfo.action === "Finalize") {
27457
+ antd.message.open({
27458
+ type: "success",
27459
+ content: t("ndc:finalizeSuccessMsg"),
27460
+ duration: 3,
27461
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27462
+ });
27463
+ fetchNdcDetailPeriods();
27464
+ setExpandedRowKeys([]);
27465
+ ClearEditMode();
27466
+ }
27467
+ else if (actionInfo.action === "Approve") {
27468
+ antd.message.open({
27469
+ type: "success",
27470
+ content: t("ndc:approveSuccessMsg"),
27471
+ duration: 3,
27472
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27473
+ });
27474
+ fetchNdcDetailActions();
27475
+ }
27476
+ else if (actionInfo.action === "Reject") {
27477
+ antd.message.open({
27478
+ type: "success",
27479
+ content: t("ndc:rejectSuccessMsg"),
27480
+ duration: 3,
27481
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27482
+ });
27483
+ fetchNdcDetailActions();
27484
+ }
27485
+ }
27486
+ setOpenConfirmationModal(false);
27487
+ setLoading(false);
27488
+ return [2 /*return*/];
27489
+ }
27490
+ });
27491
+ }); };
27492
+ var onActionCanceled = function () {
27493
+ setOpenConfirmationModal(false);
27494
+ };
27495
+ var fetchNdcDetailPeriods = function () { return __awaiter(void 0, void 0, void 0, function () {
27496
+ var periods, addNewTab, response, exception_5;
27497
+ return __generator(this, function (_a) {
27498
+ switch (_a.label) {
27499
+ case 0:
27500
+ setLoading(true);
27501
+ _a.label = 1;
27502
+ case 1:
27503
+ _a.trys.push([1, 3, 4, 5]);
27504
+ periods = [];
27505
+ addNewTab = {
27506
+ key: "add_new",
27507
+ label: "Add New",
27508
+ startYear: 0,
27509
+ endYear: 0,
27510
+ finalized: false,
27511
+ deleted: false,
27512
+ };
27513
+ return [4 /*yield*/, get("national/programme/queryNdcDetailsPeriod")];
27514
+ case 2:
27515
+ response = _a.sent();
27516
+ if (response && response.data) {
27517
+ periods = response.data.map(function (period) {
27518
+ return __assign(__assign({}, period), { key: period.id, label: period.finalized ? (React.createElement("span", null,
27519
+ React.createElement(icons.LockOutlined, null),
27520
+ " ",
27521
+ period.startYear,
27522
+ "-",
27523
+ period.endYear,
27524
+ " ")) : ("".concat(period.startYear, "-").concat(period.endYear)) });
27525
+ });
27526
+ }
27527
+ if (isGovernmentUser) {
27528
+ periods.unshift(addNewTab);
27529
+ }
27530
+ setPeriodItems(periods);
27531
+ if (isGovernmentUser) {
27532
+ setSelectedPeriod(addNewTab);
27533
+ }
27534
+ else {
27535
+ setSelectedPeriod(periods[0]);
27536
+ }
27537
+ setLoading(false);
27538
+ return [3 /*break*/, 5];
27539
+ case 3:
27540
+ exception_5 = _a.sent();
27541
+ antd.message.open({
27542
+ type: "error",
27543
+ content: exception_5.message,
27544
+ duration: 3,
27545
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27546
+ });
27547
+ return [3 /*break*/, 5];
27548
+ case 4:
27549
+ setLoading(false);
27550
+ return [7 /*endfinally*/];
27551
+ case 5: return [2 /*return*/];
27552
+ }
27553
+ });
27554
+ }); };
27555
+ var fetchNdcDetailActions = function () { return __awaiter(void 0, void 0, void 0, function () {
27556
+ var response, maxActionId, exception_6;
27557
+ return __generator(this, function (_a) {
27558
+ switch (_a.label) {
27559
+ case 0:
27560
+ setLoading(true);
27561
+ _a.label = 1;
27562
+ case 1:
27563
+ _a.trys.push([1, 3, 4, 5]);
27564
+ return [4 /*yield*/, get("national/programme/queryNdcDetailsAction")];
27565
+ case 2:
27566
+ response = _a.sent();
27567
+ if (response && response.data) {
27568
+ maxActionId = Math.max.apply(Math, response.data.map(function (item) { return item.id; }));
27569
+ setNextAvailableActionId(maxActionId + 1);
27570
+ setNdcActionsList(response.data);
27571
+ }
27572
+ setLoading(false);
27573
+ return [3 /*break*/, 5];
27574
+ case 3:
27575
+ exception_6 = _a.sent();
27576
+ antd.message.open({
27577
+ type: "error",
27578
+ content: exception_6.message,
27579
+ duration: 3,
27580
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27581
+ });
27582
+ return [3 /*break*/, 5];
27583
+ case 4:
27584
+ setLoading(false);
27585
+ return [7 /*endfinally*/];
27586
+ case 5: return [2 /*return*/];
27587
+ }
27588
+ });
27589
+ }); };
27590
+ var fetchMinistries = function () { return __awaiter(void 0, void 0, void 0, function () {
27591
+ var response, ministryOrgDetails, exception_7;
27592
+ return __generator(this, function (_a) {
27593
+ switch (_a.label) {
27594
+ case 0:
27595
+ setLoading(true);
27596
+ _a.label = 1;
27597
+ case 1:
27598
+ _a.trys.push([1, 3, 4, 5]);
27599
+ return [4 /*yield*/, get("national/organisation/getMinistries")];
27600
+ case 2:
27601
+ response = _a.sent();
27602
+ if (response && response.data) {
27603
+ ministryOrgDetails = response.data.map(function (value) {
27604
+ return {
27605
+ value: value.company_companyId,
27606
+ label: value.company_name,
27607
+ };
27608
+ });
27609
+ setMinistryOrgList(ministryOrgDetails);
27610
+ }
27611
+ setLoading(false);
27612
+ return [3 /*break*/, 5];
27613
+ case 3:
27614
+ exception_7 = _a.sent();
27615
+ antd.message.open({
27616
+ type: "error",
27617
+ content: exception_7.message,
27618
+ duration: 3,
27619
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27620
+ });
27621
+ return [3 /*break*/, 5];
27622
+ case 4:
27623
+ setLoading(false);
27624
+ return [7 /*endfinally*/];
27625
+ case 5: return [2 /*return*/];
27626
+ }
27627
+ });
27628
+ }); };
27629
+ React.useEffect(function () {
27630
+ fetchNdcDetailPeriods();
27631
+ fetchNdcDetailActions();
27632
+ fetchMinistries();
27349
27633
  }, []);
27350
- return (React.createElement("div", { className: "ndc-management content-container" },
27634
+ return (React.createElement("div", { className: "ndc-details content-container" },
27351
27635
  React.createElement("div", { className: "title-bar" },
27352
27636
  React.createElement(antd.Row, { justify: "space-between", align: "middle" },
27353
27637
  React.createElement(antd.Col, { span: 20 },
27354
27638
  React.createElement("div", { className: "body-title" }, t("ndc:ndcTitle")),
27355
27639
  React.createElement("div", { className: "body-sub-title" }, t("ndc:ndcSubTitle"))))),
27356
27640
  React.createElement("div", null,
27357
- React.createElement(antd.Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedTab, onChange: onTabChange })),
27358
- selectedTab !== "add_new" && (React.createElement("div", null,
27359
- React.createElement("div", null,
27360
- React.createElement(antd.Table, { key: tableKey, components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getNdcDetailsForPeriod(), columns: columns, expandable: {
27361
- expandedRowRender: function (record) { return getSubNdcActionContent(record); },
27362
- indentSize: 0,
27363
- defaultExpandedRowKeys: [selectedNdcDetail.current.key],
27364
- }, footer: function () {
27365
- return isAddNdcActionVisible() && (React.createElement(antd.Row, { justify: "center" },
27366
- React.createElement(antd.Button, { onClick: onAddNewNdcDetail, type: "default", style: {
27367
- marginBottom: 16,
27368
- width: "100%",
27369
- } }, t("ndc:addNdcAction"))));
27370
- } }))))));
27641
+ React.createElement(antd.Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedPeriod.key, onChange: onTabChange })),
27642
+ React.createElement("div", null, selectedPeriod.key === "add_new"
27643
+ ? addNewPeriodContent()
27644
+ : mainNdcActionTableContent()),
27645
+ React.createElement(UserActionConfirmationModel, { t: t, actionInfo: actionInfo, onActionConfirmed: onActionConfirmed, onActionCanceled: onActionCanceled, openModal: openConfirmationModal, errorMsg: "", loading: loading })));
27371
27646
  };
27372
27647
 
27373
27648
  var ImgWithFallback = function (_a) {
@@ -28142,7 +28417,7 @@ var RejectDocumentationConfirmationModel = function (props) {
28142
28417
  React.createElement(antd.Button, { className: "mg-left-2", type: "primary", danger: true, htmlType: "submit", loading: loading, disabled: actionInfo.type === "reject" && comment === "" }, "REJECT")))));
28143
28418
  };
28144
28419
 
28145
- var css_248z$5 = ".ndc-action-body {\n display: flex;\n flex-direction: column;\n width: 100%; }\n .ndc-action-body .report-details {\n display: flex;\n flex-direction: row;\n width: 100%;\n align-items: flex-start;\n justify-content: space-between; }\n .ndc-action-body .report-details .report-type {\n display: flex;\n flex-direction: row;\n width: 60%;\n align-items: flex-start; }\n .ndc-action-body .report-details .report-type .name-time-container {\n display: flex;\n flex-direction: column;\n width: 70%;\n margin-bottom: 0.5rem; }\n .ndc-action-body .report-details .report-type .name {\n font-weight: 600;\n color: rgba(58, 53, 65, 0.8); }\n .ndc-action-body .report-details .report-type .icon {\n display: flex;\n align-items: center;\n width: 30%; }\n .ndc-action-body .report-details .report-type .empty {\n font-weight: 600;\n color: #cacaca; }\n .ndc-action-body .report-details .report-link {\n display: flex;\n flex-direction: row;\n width: 40%;\n align-items: center;\n justify-content: flex-start;\n gap: 20px; }\n .ndc-action-body .report-details .report-link .version {\n font-weight: 600;\n color: #cacaca; }\n .ndc-action-body .report-details .report-link .link {\n margin-left: 1rem; }\n";
28420
+ var css_248z$5 = ".ndc-action-body {\n display: flex;\n flex-direction: column;\n width: 100%; }\n .ndc-action-body .report-details {\n display: flex;\n flex-direction: row;\n width: 100%;\n align-items: flex-start;\n justify-content: space-between; }\n .ndc-action-body .report-details .report-type {\n display: flex;\n flex-direction: row;\n width: 60%;\n align-items: flex-start; }\n .ndc-action-body .report-details .report-type .name-time-container {\n display: flex;\n flex-direction: column;\n width: 70%;\n margin-bottom: 0.5rem; }\n .ndc-action-body .report-details .report-type .name {\n font-weight: 600;\n color: rgba(58, 53, 65, 0.8); }\n .ndc-action-body .report-details .report-type .icon {\n display: flex;\n width: 30%; }\n .ndc-action-body .report-details .report-type .empty {\n font-weight: 600;\n color: #cacaca; }\n .ndc-action-body .report-details .report-link {\n display: flex;\n flex-direction: row;\n width: 40%;\n justify-content: flex-start;\n gap: 20px;\n align-items: start; }\n .ndc-action-body .report-details .report-link .version {\n font-weight: 600;\n color: #cacaca; }\n .ndc-action-body .report-details .report-link .link {\n margin-left: 1rem; }\n";
28146
28421
  styleInject(css_248z$5);
28147
28422
 
28148
28423
  var NdcActionBody = function (props) {
@@ -28408,7 +28683,7 @@ var NdcActionBody = function (props) {
28408
28683
  React.createElement("div", { className: "icon" }, (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url) ? (monitoringReportPending ? ((companyRolePermission || ministryLevelPermission) && (React.createElement(React.Fragment, null,
28409
28684
  React.createElement(icons.LikeOutlined, { onClick: function () {
28410
28685
  return docAction(monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.id, exports.DocumentStatus.ACCEPTED, monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.actionId, monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.type);
28411
- }, className: "common-progress-icon", style: { color: "#976ED7" } }),
28686
+ }, className: "common-progress-icon", style: { color: "#976ED7", paddingTop: '3px' } }),
28412
28687
  React.createElement(icons.DislikeOutlined, { onClick: function () {
28413
28688
  setRejectDocData({
28414
28689
  id: monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.id,
@@ -28423,8 +28698,8 @@ var NdcActionBody = function (props) {
28423
28698
  icon: React.createElement(icons.DislikeOutlined, null),
28424
28699
  });
28425
28700
  setOpenRejectDocConfirmationModal(true);
28426
- }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70" } })))) : monitoringReportAccepted ? (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })) : (monitoringReportRejected && (React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
28427
- React.createElement(icons.ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))))) : (React.createElement(React.Fragment, null,
28701
+ }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70", paddingTop: '3px' } })))) : monitoringReportAccepted ? (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380", paddingTop: '3px' } })) : (monitoringReportRejected && (React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
28702
+ React.createElement(icons.ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70", paddingTop: '3px' } }))))) : (React.createElement(React.Fragment, null,
28428
28703
  React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly
28429
28704
  ? t("programme:notAuthToUploadDoc")
28430
28705
  : uploadDocUserPermission(userInfoState, exports.DocType.MONITORING_REPORT, programmeOwnerId, ministryLevelPermission)
@@ -28455,7 +28730,7 @@ var NdcActionBody = function (props) {
28455
28730
  } }))))),
28456
28731
  (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url) && (React.createElement("div", { className: "report-link" },
28457
28732
  React.createElement("div", { className: "link" }, linkDocVisible(monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.status) && (React.createElement("a", { href: monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url, target: "_blank", rel: "noopener noreferrer", download: true },
28458
- React.createElement(icons.BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } })))),
28733
+ React.createElement(icons.BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47", paddingTop: '3px' } })))),
28459
28734
  !monitoringReportAccepted && (React.createElement(React.Fragment, null,
28460
28735
  React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly
28461
28736
  ? t("programme:notAuthToUploadDoc")
@@ -28498,7 +28773,7 @@ var NdcActionBody = function (props) {
28498
28773
  ministryLevelPermission) && (React.createElement(React.Fragment, null,
28499
28774
  React.createElement(icons.LikeOutlined, { onClick: function () {
28500
28775
  return docAction(verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.id, exports.DocumentStatus.ACCEPTED, verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.actionId, verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.type);
28501
- }, className: "common-progress-icon", style: { color: "#976ED7" } }),
28776
+ }, className: "common-progress-icon", style: { color: "#976ED7", paddingTop: '3px' } }),
28502
28777
  React.createElement(icons.DislikeOutlined, { onClick: function () {
28503
28778
  setRejectDocData({
28504
28779
  id: verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.id,
@@ -28513,8 +28788,8 @@ var NdcActionBody = function (props) {
28513
28788
  icon: React.createElement(icons.DislikeOutlined, null),
28514
28789
  });
28515
28790
  setOpenRejectDocConfirmationModal(true);
28516
- }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70" } })))) : verificationReportAccepted ? (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })) : (verifcationReportRejected && (React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
28517
- React.createElement(icons.ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))))) : (React.createElement(React.Fragment, null,
28791
+ }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70", paddingTop: '3px' } })))) : verificationReportAccepted ? (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380", paddingTop: '3px' } })) : (verifcationReportRejected && (React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
28792
+ React.createElement(icons.ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70", paddingTop: '3px' } }))))) : (React.createElement(React.Fragment, null,
28518
28793
  React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly
28519
28794
  ? t("programme:notAuthToUploadDoc")
28520
28795
  : uploadDocUserPermission(userInfoState, exports.DocType.VERIFICATION_REPORT, programmeOwnerId, ministryLevelPermission)
@@ -28545,7 +28820,7 @@ var NdcActionBody = function (props) {
28545
28820
  } })))))),
28546
28821
  (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url) && (React.createElement("div", { className: "report-link" },
28547
28822
  React.createElement("div", { className: "link" }, linkDocVisible(verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.status) && (React.createElement("a", { href: verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url, target: "_blank", rel: "noopener noreferrer", download: true },
28548
- React.createElement(icons.BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } })))),
28823
+ React.createElement(icons.BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47", paddingTop: '3px' } })))),
28549
28824
  !verificationReportAccepted && monitoringReportAccepted && (React.createElement(React.Fragment, null,
28550
28825
  React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly
28551
28826
  ? t("programme:notAuthToUploadDoc")
@@ -28578,7 +28853,7 @@ var NdcActionBody = function (props) {
28578
28853
  React.createElement(RejectDocumentationConfirmationModel, { actionInfo: actionInfo, onActionConfirmed: handleOk, onActionCanceled: handleCancel, openModal: openRejectDocConfirmationModal, errorMsg: "", loading: loading, translator: translator })));
28579
28854
  };
28580
28855
 
28581
- var css_248z$4 = ".info-view .title-icon {\n padding-right: 10px; }\n\n.info-view .title-text {\n color: rgba(58, 53, 65, 0.8);\n font-weight: 600; }\n\n.info-view .title {\n margin-bottom: 5px; }\n\n.info-view .field-key {\n color: rgba(58, 53, 65, 0.6);\n font-weight: 500;\n text-overflow: ellipsis;\n overflow: hidden; }\n .info-view .field-key .label-container {\n display: flex;\n flex-direction: row; }\n .info-view .field-key .label {\n width: 70%; }\n .info-view .field-key .label-uploaded {\n color: rgba(58, 53, 65, 0.8);\n width: 70%; }\n\n.info-view .field-value {\n color: rgba(58, 53, 65, 0.6);\n text-overflow: ellipsis;\n overflow: hidden; }\n .info-view .field-value .link {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n gap: 20px; }\n\n.info-view .field {\n margin: 15px 25px;\n font-size: 0.8rem; }\n";
28856
+ var css_248z$4 = ".info-view .title-icon {\n padding-right: 10px; }\n\n.info-view .title-text {\n color: rgba(58, 53, 65, 0.8);\n font-weight: 600; }\n\n.info-view .title {\n margin-bottom: 5px; }\n\n.info-view .field-key {\n color: rgba(58, 53, 65, 0.6);\n font-weight: 500;\n text-overflow: ellipsis;\n overflow: hidden; }\n .info-view .field-key .label-container {\n display: flex;\n flex-direction: row;\n align-items: start; }\n .info-view .field-key .label {\n width: 70%; }\n .info-view .field-key .label-uploaded {\n color: rgba(58, 53, 65, 0.8);\n width: 70%; }\n\n.info-view .field-value {\n color: rgba(58, 53, 65, 0.6);\n text-overflow: ellipsis;\n overflow: hidden; }\n .info-view .field-value .link {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n gap: 20px; }\n\n.info-view .field {\n margin: 15px 25px;\n font-size: 0.8rem; }\n";
28582
28857
  styleInject(css_248z$4);
28583
28858
 
28584
28859
  var ProgrammeDocuments = function (props) {
@@ -28825,7 +29100,7 @@ var ProgrammeDocuments = function (props) {
28825
29100
  (designDocActionPermission || ministryLevelPermission) && (React.createElement(React.Fragment, null,
28826
29101
  React.createElement(icons.LikeOutlined, { onClick: function () {
28827
29102
  return docAction(designDocId, exports.DocumentStatus.ACCEPTED);
28828
- }, className: "common-progress-icon", style: { color: "#976ED7" } }),
29103
+ }, className: "common-progress-icon", style: { color: "#976ED7", paddingTop: "3px" } }),
28829
29104
  React.createElement(icons.DislikeOutlined, { onClick: function () {
28830
29105
  setRejectDocData({ id: designDocId });
28831
29106
  setActionInfo({
@@ -28836,8 +29111,8 @@ var ProgrammeDocuments = function (props) {
28836
29111
  icon: React.createElement(icons.DislikeOutlined, null),
28837
29112
  });
28838
29113
  setOpenRejectDocConfirmationModal(true);
28839
- }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70" } }))),
28840
- designDocStatus === exports.DocumentStatus.ACCEPTED && (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
29114
+ }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70", paddingTop: "3px" } }))),
29115
+ designDocStatus === exports.DocumentStatus.ACCEPTED && (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380", paddingTop: "3px" } })),
28841
29116
  designDocStatus === exports.DocumentStatus.REJECTED && (React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
28842
29117
  React.createElement(icons.ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } })))),
28843
29118
  designDocUrl !== "" && (React.createElement("div", { className: "time" },
@@ -28845,15 +29120,23 @@ var ProgrammeDocuments = function (props) {
28845
29120
  " ~ " + designDocversion))),
28846
29121
  React.createElement(antd.Col, { span: 6, className: "field-value" }, designDocUrl !== "" ? (React.createElement("div", { className: "link" },
28847
29122
  linkDocVisible(designDocStatus) && (React.createElement("a", { href: designDocUrl, target: "_blank", rel: "noopener noreferrer", download: true },
28848
- React.createElement(icons.BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))),
29123
+ React.createElement(icons.BookOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } }))),
28849
29124
  designDocStatus !== exports.DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
28850
29125
  React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly ||
28851
29126
  (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.CERTIFIER
28852
29127
  ? t("programme:notAuthToUploadDoc")
28853
29128
  : !uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
28854
29129
  React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission)
28855
- ? { color: "#3F3A47", cursor: "pointer", margin: "0px 0px 2.5px 0px" }
28856
- : { color: "#cacaca", cursor: "default", margin: "0px 0px 2.5px 0px" }, onClick: function () {
29130
+ ? {
29131
+ color: "#3F3A47",
29132
+ cursor: "pointer",
29133
+ margin: "0px 0px 1.5px 0px",
29134
+ }
29135
+ : {
29136
+ color: "#cacaca",
29137
+ cursor: "default",
29138
+ margin: "0px 0px 1.5px 0px",
29139
+ }, onClick: function () {
28857
29140
  return uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && handleDesignDocFileUpload();
28858
29141
  } })),
28859
29142
  React.createElement("input", { type: "file", ref: fileInputRef, style: { display: "none" }, accept: ".xls, .xlsx, .ppt, .pptx, .csv, .doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
@@ -28866,8 +29149,16 @@ var ProgrammeDocuments = function (props) {
28866
29149
  ? t("programme:notAuthToUploadDoc")
28867
29150
  : !uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
28868
29151
  React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission)
28869
- ? { color: "#3F3A47", cursor: "pointer", margin: "0px 0px 2.5px 0px" }
28870
- : { color: "#cacaca", cursor: "default", margin: "0px 0px 2.5px 0px" }, onClick: function () {
29152
+ ? {
29153
+ color: "#3F3A47",
29154
+ cursor: "pointer",
29155
+ margin: "0px 0px 1.5px 0px",
29156
+ }
29157
+ : {
29158
+ color: "#cacaca",
29159
+ cursor: "default",
29160
+ margin: "0px 0px 1.5px 0px",
29161
+ }, onClick: function () {
28871
29162
  return uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && handleDesignDocFileUpload();
28872
29163
  } })),
28873
29164
  React.createElement("input", { type: "file", ref: fileInputRef, style: { display: "none" }, accept: ".xls, .xlsx, .ppt, .pptx, .csv, .doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
@@ -28893,7 +29184,7 @@ var ProgrammeDocuments = function (props) {
28893
29184
  (companyRolePermission || ministryLevelPermission) && (React.createElement(React.Fragment, null,
28894
29185
  React.createElement(icons.LikeOutlined, { onClick: function () {
28895
29186
  return docAction(methDocId, exports.DocumentStatus.ACCEPTED);
28896
- }, className: "common-progress-icon", style: { color: "#976ED7" } }),
29187
+ }, className: "common-progress-icon", style: { color: "#976ED7", paddingTop: "3px" } }),
28897
29188
  React.createElement(icons.DislikeOutlined, { onClick: function () {
28898
29189
  setRejectDocData({ id: methDocId });
28899
29190
  setActionInfo({
@@ -28904,8 +29195,8 @@ var ProgrammeDocuments = function (props) {
28904
29195
  icon: React.createElement(icons.DislikeOutlined, null),
28905
29196
  });
28906
29197
  setOpenRejectDocConfirmationModal(true);
28907
- }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70" } }))),
28908
- methodDocStatus === exports.DocumentStatus.ACCEPTED && (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
29198
+ }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70", paddingTop: "3px" } }))),
29199
+ methodDocStatus === exports.DocumentStatus.ACCEPTED && (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380", paddingTop: "3px" } })),
28909
29200
  methodDocStatus === exports.DocumentStatus.REJECTED && (React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
28910
29201
  React.createElement(icons.ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } })))),
28911
29202
  methodologyDocUrl !== "" && (React.createElement("div", { className: "time" },
@@ -28913,15 +29204,22 @@ var ProgrammeDocuments = function (props) {
28913
29204
  " ~ " + methDocversion))),
28914
29205
  React.createElement(antd.Col, { span: 6, className: "field-value" }, methodologyDocUrl !== "" ? (React.createElement("div", { className: "link" },
28915
29206
  linkDocVisible(methodDocStatus) && (React.createElement("a", { href: methodologyDocUrl, target: "_blank", rel: "noopener noreferrer", download: true },
28916
- React.createElement(icons.BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))),
29207
+ React.createElement(icons.BookOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } }))),
28917
29208
  methodDocStatus !== exports.DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
28918
29209
  React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly
28919
29210
  ? t("programme:notAuthToUploadDoc")
28920
29211
  : !uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
28921
29212
  React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: designDocStatus === exports.DocumentStatus.ACCEPTED &&
28922
29213
  uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission)
28923
- ? { color: "#3F3A47", cursor: "pointer", margin: "0px 0px 2.5px 0px" }
28924
- : { color: "#cacaca", margin: "0px 0px 2.5px 0px" }, onClick: function () {
29214
+ ? {
29215
+ color: "#3F3A47",
29216
+ cursor: "pointer",
29217
+ margin: "0px 0px 1.5px 0px",
29218
+ }
29219
+ : {
29220
+ color: "#cacaca",
29221
+ margin: "0px 0px 1.5px 0px",
29222
+ }, onClick: function () {
28925
29223
  return designDocStatus === exports.DocumentStatus.ACCEPTED &&
28926
29224
  uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission) &&
28927
29225
  handleMethodologyFileUpload();
@@ -28940,8 +29238,16 @@ var ProgrammeDocuments = function (props) {
28940
29238
  : t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
28941
29239
  React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: designDocStatus === exports.DocumentStatus.ACCEPTED &&
28942
29240
  uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission)
28943
- ? { color: "#3F3A47", cursor: "pointer", margin: "0px 0px 2.5px 0px" }
28944
- : { color: "#cacaca", cursor: "default", margin: "0px 0px 2.5px 0px" }, onClick: function () {
29241
+ ? {
29242
+ color: "#3F3A47",
29243
+ cursor: "pointer",
29244
+ margin: "0px 0px 1.5px 0px",
29245
+ }
29246
+ : {
29247
+ color: "#cacaca",
29248
+ cursor: "default",
29249
+ margin: "0px 0px 1.5px 0px",
29250
+ }, onClick: function () {
28945
29251
  return designDocStatus === exports.DocumentStatus.ACCEPTED &&
28946
29252
  uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission) &&
28947
29253
  handleMethodologyFileUpload();
@@ -28970,7 +29276,7 @@ var ProgrammeDocuments = function (props) {
28970
29276
  (ministryLevelPermission || companyRolePermission) && (React.createElement(React.Fragment, null,
28971
29277
  React.createElement(icons.LikeOutlined, { onClick: function () {
28972
29278
  return docAction(impactAssessmentId, exports.DocumentStatus.ACCEPTED);
28973
- }, className: "common-progress-icon", style: { color: "#976ED7" } }),
29279
+ }, className: "common-progress-icon", style: { color: "#976ED7", paddingTop: "3px" } }),
28974
29280
  React.createElement(icons.DislikeOutlined, { onClick: function () {
28975
29281
  setRejectDocData({ id: impactAssessmentId });
28976
29282
  setActionInfo({
@@ -28981,8 +29287,8 @@ var ProgrammeDocuments = function (props) {
28981
29287
  icon: React.createElement(icons.DislikeOutlined, null),
28982
29288
  });
28983
29289
  setOpenRejectDocConfirmationModal(true);
28984
- }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70" } }))),
28985
- impactAssessmentStatus === exports.DocumentStatus.ACCEPTED && (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
29290
+ }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70", paddingTop: "3px" } }))),
29291
+ impactAssessmentStatus === exports.DocumentStatus.ACCEPTED && (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380", paddingTop: "3px" } })),
28986
29292
  impactAssessmentStatus === exports.DocumentStatus.REJECTED && (React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
28987
29293
  React.createElement(icons.ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } })))),
28988
29294
  impactAssessmentUrl !== "" && (React.createElement("div", { className: "time" },
@@ -28990,13 +29296,22 @@ var ProgrammeDocuments = function (props) {
28990
29296
  " ~ " + impactAssessmentversion))),
28991
29297
  React.createElement(antd.Col, { span: 6, className: "field-value" }, impactAssessmentUrl !== "" ? (React.createElement("div", { className: "link" },
28992
29298
  linkDocVisible(impactAssessmentStatus) && (React.createElement("a", { href: impactAssessmentUrl, target: "_blank", rel: "noopener noreferrer", download: true },
28993
- React.createElement(icons.BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))),
29299
+ React.createElement("div", null,
29300
+ React.createElement(icons.BookOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } })))),
28994
29301
  impactAssessmentStatus !== exports.DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
28995
29302
  React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: impactAssessmentToolTipTitle, overlayClassName: "custom-tooltip" },
28996
29303
  React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: uploadImpactAssessmentDocUserPermission &&
28997
29304
  !isProjectRejected
28998
- ? { color: "#3F3A47", cursor: "pointer", margin: "0px 0px 2.5px 0px" }
28999
- : { color: "#cacaca", cursor: "default", margin: "0px 0px 2.5px 0px" }, onClick: function () {
29305
+ ? {
29306
+ color: "#3F3A47",
29307
+ cursor: "pointer",
29308
+ margin: "0px 0px 1.5px 0px",
29309
+ }
29310
+ : {
29311
+ color: "#cacaca",
29312
+ cursor: "default",
29313
+ margin: "0px 0px 1.5px 0px",
29314
+ }, onClick: function () {
29000
29315
  return uploadImpactAssessmentDocUserPermission &&
29001
29316
  !isProjectRejected &&
29002
29317
  handleImpactAssessmentFileUpload();
@@ -29009,8 +29324,16 @@ var ProgrammeDocuments = function (props) {
29009
29324
  React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: impactAssessmentToolTipTitle, overlayClassName: "custom-tooltip" },
29010
29325
  React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: uploadImpactAssessmentDocUserPermission &&
29011
29326
  !isProjectRejected
29012
- ? { color: "#3F3A47", cursor: "pointer", margin: "0px 0px 2.5px 0px" }
29013
- : { color: "#cacaca", cursor: "default", margin: "0px 0px 2.5px 0px" }, onClick: function () {
29327
+ ? {
29328
+ color: "#3F3A47",
29329
+ cursor: "pointer",
29330
+ margin: "0px 0px 1.5px 0px",
29331
+ }
29332
+ : {
29333
+ color: "#cacaca",
29334
+ cursor: "default",
29335
+ margin: "0px 0px 1.5px 0px",
29336
+ }, onClick: function () {
29014
29337
  return uploadImpactAssessmentDocUserPermission &&
29015
29338
  !isProjectRejected &&
29016
29339
  handleImpactAssessmentFileUpload();
@@ -33860,7 +34183,7 @@ exports.getCreditStageVal = getCreditStageVal;
33860
34183
  exports.getFinancialFields = getFinancialFields;
33861
34184
  exports.getGeneralFields = getGeneralFields;
33862
34185
  exports.getInvestmentStatusEnumVal = getInvestmentStatusEnumVal;
33863
- exports.getNdcActionStatusEnumVal = getNdcActionStatusEnumVal;
34186
+ exports.getNdcActionStatusEnumVal = getNdcActionStatusEnumVal$1;
33864
34187
  exports.getNdcStatusTagType = getNdcStatusTagType;
33865
34188
  exports.getRetirementTypeString = getRetirementTypeString;
33866
34189
  exports.getStageEnumVal = getStageEnumVal;