@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/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { PlusOutlined, FilterOutlined, BankOutlined, SafetyOutlined, AuditOutlined, ExperimentOutlined, UploadOutlined, UserOutlined, MinusCircleOutlined, StarOutlined, ToolOutlined, EyeOutlined, SearchOutlined, EllipsisOutlined, EditOutlined, DeleteOutlined, FileAddOutlined, CheckCircleOutlined, ExclamationCircleOutlined, BookOutlined, CaretDownOutlined, EyeInvisibleOutlined, GlobalOutlined, FlagOutlined, LineChartOutlined, LikeOutlined, DislikeOutlined, PlusCircleOutlined, LockFilled, DownloadOutlined, CloseCircleOutlined } from '@ant-design/icons';
1
+ import { PlusOutlined, FilterOutlined, BankOutlined, SafetyOutlined, AuditOutlined, ExperimentOutlined, UploadOutlined, UserOutlined, MinusCircleOutlined, StarOutlined, ToolOutlined, EyeOutlined, SearchOutlined, EllipsisOutlined, EditOutlined, DeleteOutlined, FileAddOutlined, CheckCircleOutlined, ExclamationCircleOutlined, BookOutlined, CaretDownOutlined, LockOutlined, EyeInvisibleOutlined, GlobalOutlined, FlagOutlined, LineChartOutlined, LikeOutlined, DislikeOutlined, PlusCircleOutlined, LockFilled, DownloadOutlined, CloseCircleOutlined } from '@ant-design/icons';
2
2
  import { Input, Radio, Space, Row, Col, Button, Dropdown, Table, Empty, message, Form, Steps, Upload, InputNumber, Tooltip, Select, Modal, Alert, Skeleton, Card, Tag, Checkbox, DatePicker, Popover, List, Typography, Spin, Tabs, Progress, Collapse } from 'antd';
3
- import React, { useState, useEffect, useRef, useContext } from 'react';
3
+ import React, { useState, useEffect, useRef } from 'react';
4
4
  import { DateTime } from 'luxon';
5
5
  import { Buffer } from 'buffer';
6
6
  import PhoneInput, { formatPhoneNumberIntl, formatPhoneNumber } from 'react-phone-number-input';
@@ -2030,7 +2030,7 @@ var NdcActionStatus;
2030
2030
  NdcActionStatus["PENDING"] = "Pending";
2031
2031
  NdcActionStatus["APPROVED"] = "Approved";
2032
2032
  })(NdcActionStatus || (NdcActionStatus = {}));
2033
- var getNdcActionStatusEnumVal = function (value) {
2033
+ var getNdcActionStatusEnumVal$1 = function (value) {
2034
2034
  var index = Object.keys(NdcActionStatus).indexOf(value);
2035
2035
  if (index < 0) {
2036
2036
  return value;
@@ -2038,7 +2038,7 @@ var getNdcActionStatusEnumVal = function (value) {
2038
2038
  return Object.values(NdcActionStatus)[index];
2039
2039
  };
2040
2040
  var getNdcStatusTagType = function (status) {
2041
- switch (getNdcActionStatusEnumVal(status)) {
2041
+ switch (getNdcActionStatusEnumVal$1(status)) {
2042
2042
  case NdcActionStatus.PENDING:
2043
2043
  return "processing";
2044
2044
  case NdcActionStatus.APPROVED:
@@ -21777,7 +21777,7 @@ var NdcActionViewComponent = function (props) {
21777
21777
  (reportData === null || reportData === void 0 ? void 0 : reportData.status) === DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
21778
21778
  (reportData === null || reportData === void 0 ? void 0 : reportData.status) === DocumentStatus.REJECTED && (React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))),
21779
21779
  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 },
21780
- React.createElement(BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } })))),
21780
+ React.createElement(BookOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } })))),
21781
21781
  (reportData === null || reportData === void 0 ? void 0 : reportData.txTime) && (React.createElement("div", { className: "time" },
21782
21782
  moment(parseInt(reportData === null || reportData === void 0 ? void 0 : reportData.txTime)).format("DD MMMM YYYY @ HH:mm"),
21783
21783
  " ~ " + reportVersion))));
@@ -21934,13 +21934,15 @@ var NdcActionViewComponent = function (props) {
21934
21934
  ((_b = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.agricultureProperties) === null || _b === void 0 ? void 0 : _b.landAreaUnit);
21935
21935
  }
21936
21936
  if ((ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.typeOfMitigation) === MitigationTypes.AGRICULTURE &&
21937
- (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) === MitigationSubTypes.SOIL_ENRICHMENT_BIOCHAR &&
21937
+ (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) ===
21938
+ MitigationSubTypes.SOIL_ENRICHMENT_BIOCHAR &&
21938
21939
  (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties)) {
21939
21940
  mitigationDetails[t("ndcAction:viewMitigationWeight")] =
21940
- addCommSep((_c = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties) === null || _c === void 0 ? void 0 : _c.weight) + 't';
21941
+ addCommSep((_c = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties) === null || _c === void 0 ? void 0 : _c.weight) + "t";
21941
21942
  }
21942
21943
  if ((ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.typeOfMitigation) === MitigationTypes.SOLAR &&
21943
- (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) === MitigationSubTypes.SOLAR_PHOTOVOLTAICS_PV &&
21944
+ (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) ===
21945
+ MitigationSubTypes.SOLAR_PHOTOVOLTAICS_PV &&
21944
21946
  (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.solarProperties)) {
21945
21947
  mitigationDetails[t("ndcAction:viewMitigationEnergyGeneration")] =
21946
21948
  addCommSep((_d = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.solarProperties) === null || _d === void 0 ? void 0 : _d.energyGeneration) +
@@ -21949,15 +21951,17 @@ var NdcActionViewComponent = function (props) {
21949
21951
  (_f = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.solarProperties) === null || _f === void 0 ? void 0 : _f.consumerGroup;
21950
21952
  }
21951
21953
  if ((ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.typeOfMitigation) === MitigationTypes.SOLAR &&
21952
- ((ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) === MitigationSubTypes.SOLAR_WATER_PUMPING_OFF_GRID ||
21953
- (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) === MitigationSubTypes.SOLAR_WATER_PUMPING_ON_GRID) &&
21954
+ ((ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) ===
21955
+ MitigationSubTypes.SOLAR_WATER_PUMPING_OFF_GRID ||
21956
+ (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) ===
21957
+ MitigationSubTypes.SOLAR_WATER_PUMPING_ON_GRID) &&
21954
21958
  (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties)) {
21955
21959
  mitigationDetails[t("ndcAction:viewMitigationEnergyGeneration")] =
21956
- addCommSep((_g = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties) === null || _g === void 0 ? void 0 : _g.energyGeneration) +
21957
- ((_h = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties) === null || _h === void 0 ? void 0 : _h.energyGenerationUnit);
21960
+ 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);
21958
21961
  }
21959
21962
  if ((ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.typeOfMitigation) === MitigationTypes.EE_HOUSEHOLDS &&
21960
- (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) === MitigationSubTypes.STOVES_HOUSES_IN_NAMIBIA &&
21963
+ (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.subTypeOfMitigation) ===
21964
+ MitigationSubTypes.STOVES_HOUSES_IN_NAMIBIA &&
21961
21965
  (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties)) {
21962
21966
  mitigationDetails[t("ndcAction:viewMitigationNoOfDays")] =
21963
21967
  (_j = ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.creditCalculationProperties) === null || _j === void 0 ? void 0 : _j.numberOfDays;
@@ -22140,23 +22144,24 @@ var NdcActionViewComponent = function (props) {
22140
22144
  : "empty" }, t("programme:monitoringReport")),
22141
22145
  (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.txTime) && (React.createElement("div", { className: "time" },
22142
22146
  moment(parseInt(monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.txTime)).format("DD MMMM YYYY @ HH:mm"),
22143
- " ~ " + monitoringReportversion))),
22147
+ " ~ " + monitoringReportversion)))),
22148
+ React.createElement(Row, null,
22144
22149
  React.createElement("div", { className: "icon" }, !(monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url) && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly
22145
22150
  ? t("programme:notAuthToUploadDoc")
22146
22151
  : uploadDocUserPermission(userInfoState, DocType.MONITORING_REPORT, programmeOwnerId)
22147
22152
  ? !canUploadMonitorReport &&
22148
22153
  t("programme:programmeNotAuth")
22149
22154
  : t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
22150
- React.createElement(FileAddOutlined, null))))),
22151
- (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url) && (React.createElement(Row, null,
22152
- React.createElement("div", { className: "icon" },
22153
- (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.status) ===
22154
- DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
22155
- (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.status) ===
22156
- DocumentStatus.REJECTED && (React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))),
22157
- React.createElement("div", { className: "link mg-left-1" }, (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url) &&
22158
- 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 },
22159
- React.createElement(BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))))))),
22155
+ React.createElement(FileAddOutlined, null)))),
22156
+ (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url) && (React.createElement(React.Fragment, null,
22157
+ React.createElement("div", { className: "icon" },
22158
+ (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.status) ===
22159
+ DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
22160
+ (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.status) ===
22161
+ DocumentStatus.REJECTED && (React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))),
22162
+ React.createElement("div", { className: "link mg-left-1" }, (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url) &&
22163
+ 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 },
22164
+ React.createElement(BookOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } })))))))),
22160
22165
  React.createElement("div", { className: "report-details" },
22161
22166
  React.createElement("div", { className: "report-type" },
22162
22167
  React.createElement("div", { className: "name-time-container" },
@@ -22165,23 +22170,24 @@ var NdcActionViewComponent = function (props) {
22165
22170
  : "empty" }, t("programme:verificationReport")),
22166
22171
  (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.txTime) && (React.createElement("div", { className: "time" },
22167
22172
  moment(parseInt(verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.txTime)).format("DD MMMM YYYY @ HH:mm"),
22168
- " ~ " + verificationReportVersion))),
22173
+ " ~ " + verificationReportVersion)))),
22174
+ React.createElement(Row, null,
22169
22175
  React.createElement("div", { className: "icon" }, !(verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url) && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly
22170
22176
  ? t("programme:notAuthToUploadDoc")
22171
22177
  : uploadDocUserPermission(userInfoState, DocType.VERIFICATION_REPORT, programmeOwnerId)
22172
22178
  ? !monitoringReportAccepted &&
22173
22179
  t("programme:monitoringRepNotApproved")
22174
22180
  : t("programme:notAuthToUploadDoc"), overlayClassName: "custom-tooltip" },
22175
- React.createElement(FileAddOutlined, null))))),
22176
- (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url) && (React.createElement(Row, null,
22177
- React.createElement("div", { className: "icon" },
22178
- (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.status) ===
22179
- DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
22180
- (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.status) ===
22181
- DocumentStatus.REJECTED && (React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))),
22182
- React.createElement("div", { className: "link mg-left-1" }, (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url) &&
22183
- 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 },
22184
- React.createElement(BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } })))))))))))),
22181
+ React.createElement(FileAddOutlined, null)))),
22182
+ (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url) && (React.createElement(React.Fragment, null,
22183
+ React.createElement("div", { className: "icon" },
22184
+ (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.status) ===
22185
+ DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
22186
+ (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.status) ===
22187
+ DocumentStatus.REJECTED && (React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))),
22188
+ React.createElement("div", { className: "link mg-left-1" }, (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url) &&
22189
+ 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 },
22190
+ React.createElement(BookOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } }))))))))))))),
22185
22191
  ((ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.action) === NdcActionTypes.Mitigation ||
22186
22192
  (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.action) === NdcActionTypes.CrossCutting) && (React.createElement(Row, null,
22187
22193
  React.createElement(Col, { lg: 24, className: "gutter-row" },
@@ -26731,622 +26737,891 @@ var RegistryDashboardComponent = function (props) {
26731
26737
  lastUpdateTransferLocations))))))))) : ("")));
26732
26738
  };
26733
26739
 
26734
- var EditableContext = React.createContext(null);
26735
- var EditableRow = function (_a) {
26736
- _a.index; var props = __rest(_a, ["index"]);
26737
- var form = Form.useForm()[0];
26738
- return (React.createElement(Form, { form: form, component: false },
26739
- React.createElement(EditableContext.Provider, { value: form },
26740
- React.createElement("tr", __assign({}, props)))));
26741
- };
26740
+ React.createContext(null);
26742
26741
  var EditableCell = function (_a) {
26743
- 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"]);
26744
- var _b = useState(false), editing = _b[0], setEditing = _b[1];
26745
- var inputRef = useRef(null);
26746
- var form = useContext(EditableContext);
26747
- useEffect(function () {
26748
- if (editing) {
26749
- inputRef.current.focus();
26750
- }
26751
- }, [editing]);
26752
- var toggleEdit = function () {
26753
- var _a;
26754
- setEditing(!editing);
26755
- form.setFieldsValue((_a = {}, _a[dataIndex] = record[dataIndex], _a));
26756
- };
26757
- var save = function () { return __awaiter(void 0, void 0, void 0, function () {
26758
- var values, errInfo_1;
26759
- return __generator(this, function (_a) {
26760
- switch (_a.label) {
26761
- case 0:
26762
- _a.trys.push([0, 2, , 3]);
26763
- return [4 /*yield*/, form.validateFields()];
26764
- case 1:
26765
- values = _a.sent();
26766
- toggleEdit();
26767
- handleSave(__assign(__assign({}, record), values));
26768
- return [3 /*break*/, 3];
26769
- case 2:
26770
- errInfo_1 = _a.sent();
26771
- console.log("Save failed:", errInfo_1);
26772
- return [3 /*break*/, 3];
26773
- case 3: return [2 /*return*/];
26774
- }
26775
- });
26776
- }); };
26777
- var childNode = children;
26778
- if (editable) {
26779
- childNode = editing ? (React.createElement(Form.Item, { style: { margin: 0 }, name: dataIndex, rules: [
26780
- {
26781
- required: true,
26782
- message: "".concat(title, " is required."),
26783
- },
26784
- ] },
26785
- React.createElement(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));
26786
- }
26787
- return React.createElement("td", __assign({}, restProps), childNode);
26742
+ 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"]);
26743
+ return (React.createElement("td", __assign({}, restProps), editing && dataIndex === "nationalPlanObjective" ? (React.createElement(Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [
26744
+ {
26745
+ validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
26746
+ var trimValue;
26747
+ return __generator(this, function (_a) {
26748
+ trimValue = typeof value === "string" ? value.trim() : value;
26749
+ if (!trimValue) {
26750
+ throw new Error("".concat(title, " ").concat(t("ndc:isRequired")));
26751
+ }
26752
+ return [2 /*return*/];
26753
+ });
26754
+ }); },
26755
+ },
26756
+ ] },
26757
+ React.createElement(Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:nationalPlanObjectivePlaceHolder") }))) : editing && dataIndex === "kpi" ? (React.createElement(Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [
26758
+ {
26759
+ validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
26760
+ var trimValue;
26761
+ return __generator(this, function (_a) {
26762
+ trimValue = typeof value === "string" ? value.trim() : value;
26763
+ if (trimValue) {
26764
+ if (isNaN(+trimValue)) {
26765
+ throw new Error(t("ndc:kpiInvalidFormat"));
26766
+ }
26767
+ else if (+trimValue <= 0) {
26768
+ throw new Error(t("ndc:kpiGreaterThanZero"));
26769
+ }
26770
+ else if (trimValue.toString().length > 7) {
26771
+ throw new Error(t("ndc:kpiMaxLength"));
26772
+ }
26773
+ }
26774
+ else {
26775
+ throw new Error("".concat(title, " ").concat(t("ndc:isRequired")));
26776
+ }
26777
+ return [2 /*return*/];
26778
+ });
26779
+ }); },
26780
+ },
26781
+ ] },
26782
+ React.createElement(Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:kpiPlaceHolder") }))) : (children)));
26788
26783
  };
26789
26784
 
26790
- 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";
26785
+ 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";
26791
26786
  styleInject(css_248z$7);
26792
26787
 
26793
- var NdcActionType;
26794
- (function (NdcActionType) {
26795
- NdcActionType[NdcActionType["main"] = 0] = "main";
26796
- NdcActionType[NdcActionType["sub"] = 1] = "sub";
26797
- })(NdcActionType || (NdcActionType = {}));
26788
+ var NdcDetailsActionType;
26789
+ (function (NdcDetailsActionType) {
26790
+ NdcDetailsActionType["MainAction"] = "MainAction";
26791
+ NdcDetailsActionType["SubAction"] = "SubAction";
26792
+ })(NdcDetailsActionType || (NdcDetailsActionType = {}));
26793
+ var NdcDetailsActionStatus;
26794
+ (function (NdcDetailsActionStatus) {
26795
+ NdcDetailsActionStatus["New"] = "New";
26796
+ NdcDetailsActionStatus["Pending"] = "Pending";
26797
+ NdcDetailsActionStatus["Approved"] = "Approved";
26798
+ NdcDetailsActionStatus["Rejected"] = "Rejected";
26799
+ })(NdcDetailsActionStatus || (NdcDetailsActionStatus = {}));
26800
+ var getNdcActionStatusEnumVal = function (value) {
26801
+ var index = Object.keys(NdcDetailsActionStatus).indexOf(value);
26802
+ if (index < 0) {
26803
+ return value;
26804
+ }
26805
+ return Object.values(NdcDetailsActionStatus)[index];
26806
+ };
26807
+ var getNdcActionStatusTagType = function (status) {
26808
+ switch (getNdcActionStatusEnumVal(status)) {
26809
+ case NdcDetailsActionStatus.Rejected:
26810
+ return "error";
26811
+ case NdcDetailsActionStatus.Pending:
26812
+ return "processing";
26813
+ case NdcDetailsActionStatus.Approved:
26814
+ return "success";
26815
+ default:
26816
+ return "default";
26817
+ }
26818
+ };
26819
+
26798
26820
  var NdcDetailsComponent = function (props) {
26799
- var t = props.t; props.useConnection; var useUserContext = props.useUserContext;
26821
+ var t = props.t, useConnection = props.useConnection, useUserContext = props.useUserContext;
26800
26822
  var RangePicker = DatePicker.RangePicker;
26801
- var _a = useState([]), ndcDetailsData = _a[0], setNdcDetailsData = _a[1];
26802
- var _b = useState(false), loading = _b[0]; _b[1];
26803
- var periodItemsRef = useRef([]);
26823
+ var _a = useState([]), ndcActionsList = _a[0], setNdcActionsList = _a[1];
26824
+ var _b = useState(false), loading = _b[0], setLoading = _b[1];
26804
26825
  var _c = useState([]), periodItems = _c[0], setPeriodItems = _c[1];
26805
- var _d = useState("add_new"), selectedTab = _d[0], setSelectedTab = _d[1];
26806
- var selectedPeriod = useRef({});
26807
- var addedNdcDetailId = useRef(0);
26808
- var selectedNdcDetail = useRef({});
26826
+ var _d = useState({}), selectedPeriod = _d[0], setSelectedPeriod = _d[1];
26827
+ var selectedDateRangeRef = useRef({});
26809
26828
  var _e = useState(0), tableKey = _e[0], setTableKey = _e[1];
26829
+ var _f = useConnection(), get = _f.get, post = _f.post, put = _f.put;
26830
+ var _g = useState([]), ministryOrgList = _g[0], setMinistryOrgList = _g[1];
26831
+ var _h = useState({}), actionInfo = _h[0], setActionInfo = _h[1];
26832
+ var _j = useState(false), openConfirmationModal = _j[0], setOpenConfirmationModal = _j[1];
26833
+ var form = Form.useForm()[0];
26834
+ var _k = useState(null), editingKey = _k[0], setEditingKey = _k[1];
26835
+ var _l = useState(0), nextAvailableActionId = _l[0], setNextAvailableActionId = _l[1];
26836
+ var _m = useState([]), expandedRowKeys = _m[0], setExpandedRowKeys = _m[1];
26837
+ var _o = useState([]), subNdcActionsForPeriod = _o[0], setSubNdcActionsForPeriod = _o[1];
26838
+ var _p = useState(1), currentPage = _p[0], setCurrentPage = _p[1];
26839
+ var _q = useState(10), pageSize = _q[0], setPageSize = _q[1];
26840
+ var isEditing = function (record) { return record.id === editingKey; };
26841
+ var isMainActionInEditMode = function () {
26842
+ var unsavedMainActions = ndcMainDetailsForPeriod.filter(function (item) {
26843
+ return item.status === NdcDetailsActionStatus.New &&
26844
+ item.actionType === NdcDetailsActionType.MainAction;
26845
+ });
26846
+ return unsavedMainActions.length > 0 ? true : false;
26847
+ };
26810
26848
  var userInfoState = useUserContext().userInfoState;
26811
- var isAddRangeVisible = function () {
26812
- return (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY ||
26813
- (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT) &&
26849
+ useEffect(function () {
26850
+ if (expandedRowKeys && expandedRowKeys.length > 0) {
26851
+ var expandedKey = expandedRowKeys[0];
26852
+ setNdcSubActionsForMainAction(expandedKey);
26853
+ }
26854
+ }, ndcActionsList);
26855
+ var loginMinistry = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT
26856
+ ? process.env.REACT_APP_GOVERNMENT_MINISTRY
26857
+ ? process.env.REACT_APP_GOVERNMENT_MINISTRY
26858
+ : "Ministry Of Environment"
26859
+ : (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY
26860
+ ? userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyName
26861
+ : undefined;
26862
+ var isGovernmentUser = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT &&
26863
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly;
26864
+ var isMainNdcActionsEditable = !selectedPeriod.finalized &&
26865
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT &&
26866
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly;
26867
+ var isSubNdcActionsEditable = function (record) {
26868
+ return (!selectedPeriod.finalized &&
26869
+ record.status !== NdcDetailsActionStatus.Approved &&
26870
+ ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT ||
26871
+ ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY &&
26872
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyName) === record.ministryName)) &&
26814
26873
  (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly);
26815
26874
  };
26816
- var isAddNdcActionVisible = function () {
26817
- return ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT &&
26875
+ var checkSubNdcActionCreatePermission = function () {
26876
+ return (!selectedPeriod.finalized &&
26877
+ ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT ||
26878
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY) &&
26818
26879
  (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly);
26819
26880
  };
26881
+ var isNdcActionEditable = function (record) {
26882
+ if (record.actionType === NdcDetailsActionType.MainAction) {
26883
+ return isMainNdcActionsEditable;
26884
+ }
26885
+ else if (record.actionType === NdcDetailsActionType.SubAction) {
26886
+ return isSubNdcActionsEditable(record);
26887
+ }
26888
+ };
26889
+ var ndcMainDetailsForPeriod = selectedPeriod.key !== "add_new"
26890
+ ? ndcActionsList.filter(function (ndcDetail) {
26891
+ return (ndcDetail.periodId === parseInt(selectedPeriod.key) &&
26892
+ ndcDetail.actionType === NdcDetailsActionType.MainAction);
26893
+ })
26894
+ : [];
26895
+ var setNdcSubActionsForMainAction = function (mainActionId) {
26896
+ var subNdcDetails = ndcActionsList.filter(function (ndcDetail) {
26897
+ return (ndcDetail.parentActionId === mainActionId &&
26898
+ ndcDetail.actionType === NdcDetailsActionType.SubAction);
26899
+ });
26900
+ var emptySubNdcRow = {
26901
+ id: nextAvailableActionId,
26902
+ actionType: NdcDetailsActionType.SubAction,
26903
+ nationalPlanObjective: "",
26904
+ kpi: "",
26905
+ ministryName: loginMinistry,
26906
+ status: NdcDetailsActionStatus.New,
26907
+ parentActionId: mainActionId,
26908
+ };
26909
+ if (checkSubNdcActionCreatePermission()) {
26910
+ subNdcDetails = __spreadArray(__spreadArray([], subNdcDetails, true), [emptySubNdcRow], false);
26911
+ setEditingKey(nextAvailableActionId);
26912
+ setNextAvailableActionId(function (value) { return value + 1; });
26913
+ form.setFieldsValue({
26914
+ nationalPlanObjective: "",
26915
+ kpi: "",
26916
+ });
26917
+ }
26918
+ setSubNdcActionsForPeriod(subNdcDetails);
26919
+ };
26820
26920
  var inRange = function (num, min, max) {
26821
26921
  return num >= min && num <= max;
26822
26922
  };
26823
- function onAddNewSubNdcDetail() {
26824
- var range = selectedTab.split("-");
26825
- var ndcDetail = ndcDetailsData.find(function (item) { return item.key === selectedNdcDetail.current.key; });
26826
- var ndcDetailItemIndex = ndcDetailsData.findIndex(function (item) { return item.key === selectedNdcDetail.current.key; });
26827
- if (ndcDetail) {
26828
- addedNdcDetailId.current = addedNdcDetailId.current + 1;
26829
- var newData = {
26830
- key: addedNdcDetailId.current,
26831
- startDate: new Date("".concat(Number(range[0]), "-01-24 23:12:00")),
26832
- endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
26833
- ndcActionId: ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.key,
26834
- nationalPlanObj: "",
26835
- kpi: "",
26836
- ministry: "",
26837
- };
26838
- if (!ndcDetail.subNdcDetails) {
26839
- ndcDetail.subNdcDetails = [];
26840
- }
26841
- ndcDetail.subNdcDetails.push(newData);
26842
- }
26843
- ndcDetailsData[ndcDetailItemIndex] = ndcDetail;
26844
- setNdcDetailsData(ndcDetailsData);
26845
- setTableKey(function (key) { return key + 1; });
26846
- }
26847
- var handleSave = function (row) {
26848
- setNdcDetailsData(function (prevData) {
26849
- var newData = JSON.parse(JSON.stringify(prevData));
26850
- if (row.type === NdcActionType.main) {
26851
- var index = newData.findIndex(function (item) { return row.key === item.key; });
26852
- if (index !== -1) {
26853
- newData[index] = __assign(__assign({}, newData[index]), row);
26854
- }
26855
- }
26856
- else {
26857
- var parentIndex = newData.findIndex(function (item) { return row.ndcActionId === item.key; });
26858
- var parentItem = newData[parentIndex];
26859
- if (parentItem) {
26860
- if (parentItem.subNdcDetails) {
26861
- var itemIndex = parentItem.subNdcDetails.findIndex(function (item) { return row.key === item.key; });
26862
- if (itemIndex === -1) {
26863
- parentItem.subNdcDetails.push(row);
26864
- }
26865
- else {
26866
- parentItem.subNdcDetails[itemIndex] = __assign({}, row);
26867
- }
26923
+ var ClearEditMode = function () {
26924
+ var unsavedMainActions = ndcActionsList.filter(function (item) {
26925
+ return item.status === NdcDetailsActionStatus.New &&
26926
+ item.actionType === NdcDetailsActionType.MainAction;
26927
+ });
26928
+ if (unsavedMainActions && unsavedMainActions.length) {
26929
+ var updatedActions = ndcActionsList.filter(function (item) { return !unsavedMainActions.includes(item); });
26930
+ setNdcActionsList(updatedActions);
26931
+ }
26932
+ setEditingKey(null);
26933
+ };
26934
+ var handleSave = function (row) { return __awaiter(void 0, void 0, void 0, function () {
26935
+ var updatedFields, updatedItem, exception_2;
26936
+ return __generator(this, function (_a) {
26937
+ switch (_a.label) {
26938
+ case 0:
26939
+ _a.trys.push([0, 9, , 10]);
26940
+ updatedFields = void 0;
26941
+ _a.label = 1;
26942
+ case 1:
26943
+ _a.trys.push([1, 3, , 4]);
26944
+ return [4 /*yield*/, form.validateFields()];
26945
+ case 2:
26946
+ updatedFields = (_a.sent());
26947
+ return [3 /*break*/, 4];
26948
+ case 3:
26949
+ _a.sent();
26950
+ return [2 /*return*/];
26951
+ case 4:
26952
+ if (!updatedFields) {
26953
+ ClearEditMode();
26954
+ return [2 /*return*/];
26955
+ }
26956
+ else if (updatedFields.kpi === row.kpi &&
26957
+ updatedFields.nationalPlanObjective === row.nationalPlanObjective) {
26958
+ ClearEditMode();
26959
+ return [2 /*return*/];
26960
+ }
26961
+ updatedItem = __assign(__assign({}, row), updatedFields);
26962
+ if (!(updatedItem.status === NdcDetailsActionStatus.New)) return [3 /*break*/, 6];
26963
+ if (isGovernmentUser &&
26964
+ updatedItem.actionType === NdcDetailsActionType.SubAction) {
26965
+ updatedItem.status = NdcDetailsActionStatus.Approved;
26868
26966
  }
26869
26967
  else {
26870
- parentItem.subNdcDetails = [row];
26968
+ updatedItem.status = NdcDetailsActionStatus.Pending;
26871
26969
  }
26872
- }
26873
- newData[parentIndex] = __assign({}, parentItem);
26874
- setTableKey(function (key) { return key + 1; });
26970
+ return [4 /*yield*/, post("national/programme/addNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseInt(updatedItem.kpi.toString()) }))];
26971
+ case 5:
26972
+ _a.sent();
26973
+ return [3 /*break*/, 8];
26974
+ case 6:
26975
+ updatedItem.status = NdcDetailsActionStatus.Pending;
26976
+ return [4 /*yield*/, put("national/programme/updateNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseInt(updatedItem.kpi.toString()) }))];
26977
+ case 7:
26978
+ _a.sent();
26979
+ _a.label = 8;
26980
+ case 8:
26981
+ fetchNdcDetailActions();
26982
+ ClearEditMode();
26983
+ return [3 /*break*/, 10];
26984
+ case 9:
26985
+ exception_2 = _a.sent();
26986
+ ClearEditMode();
26987
+ message.open({
26988
+ type: "error",
26989
+ content: exception_2.message,
26990
+ duration: 3,
26991
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26992
+ });
26993
+ return [3 /*break*/, 10];
26994
+ case 10: return [2 /*return*/];
26875
26995
  }
26876
- return newData;
26877
26996
  });
26878
- };
26879
- var getNdcDetailsForPeriod = function () {
26880
- var range = selectedTab.split("-");
26881
- if (range.length > 1) {
26882
- var filteredData = ndcDetailsData.filter(function (item) {
26883
- return inRange(Number(moment(item.startDate).year()), Number(range[0]), Number(range[1]));
26884
- });
26885
- return filteredData;
26886
- }
26887
- else {
26888
- return [];
26889
- }
26890
- };
26891
- var getSubNdcDetails = function (key) {
26892
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
26893
- var ndcDetail = ndcDetailsData.find(function (item) { return item.key === key; });
26894
- if (ndcDetail) {
26895
- 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()) !== "" &&
26896
- ((_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) &&
26897
- ((_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()) !== "" &&
26898
- ((_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) &&
26899
- 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() !== "" &&
26900
- 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)) {
26901
- onAddNewSubNdcDetail();
26902
- }
26903
- return ndcDetail.subNdcDetails;
26997
+ }); };
26998
+ var actionMenu = function (record) {
26999
+ if (record.status === NdcDetailsActionStatus.Pending &&
27000
+ isGovernmentUser &&
27001
+ !selectedPeriod.finalized) {
27002
+ return (React.createElement(List, { className: "action-menu", size: "small", dataSource: [
27003
+ {
27004
+ text: t("ndc:approve"),
27005
+ icon: React.createElement(Icon.BoxArrowInDown, null),
27006
+ style: "color-primary",
27007
+ click: function () {
27008
+ setActionInfo({
27009
+ action: "Approve",
27010
+ headerText: t("ndc:actionApproveTitle"),
27011
+ type: "primary",
27012
+ icon: React.createElement(Icon.BoxArrowInDown, null),
27013
+ recordId: record.id,
27014
+ });
27015
+ setOpenConfirmationModal(true);
27016
+ },
27017
+ },
27018
+ {
27019
+ text: t("ndc:reject"),
27020
+ icon: React.createElement(Icon.XOctagon, null),
27021
+ style: "color-error",
27022
+ click: function () {
27023
+ setActionInfo({
27024
+ action: "Reject",
27025
+ headerText: t("ndc:rejectApproveTitle"),
27026
+ type: "danger",
27027
+ icon: React.createElement(Icon.XOctagon, null),
27028
+ recordId: record.id,
27029
+ });
27030
+ setOpenConfirmationModal(true);
27031
+ },
27032
+ },
27033
+ ], renderItem: function (item) { return (React.createElement(List.Item, { onClick: item.click },
27034
+ React.createElement(Typography.Text, { className: "action-icon ".concat(item.style) }, item.icon),
27035
+ React.createElement("span", null, item.text))); } }));
26904
27036
  }
26905
27037
  else {
26906
- return [];
27038
+ return null;
26907
27039
  }
26908
27040
  };
26909
27041
  var defaultColumns = [
26910
27042
  {
26911
27043
  title: t("ndc:ndcColumnsNationalPlanObj"),
26912
- dataIndex: "nationalPlanObj",
26913
- key: "nationalPlanObj",
27044
+ dataIndex: "nationalPlanObjective",
27045
+ key: "nationalPlanObjective",
26914
27046
  align: "left",
27047
+ width: 400,
26915
27048
  editable: true,
26916
- width: "50%",
26917
- render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(Space, { size: "middle" },
26918
- React.createElement("span", null, record.nationalPlanObj))) : (React.createElement("input", { placeholder: "Please add Programmes", className: "ant-input", type: "text" })))); },
27049
+ render: function (_, record) { return (React.createElement(Space, { size: "middle" }, record.nationalPlanObjective ? (React.createElement(Tooltip, { title: isNdcActionEditable(record) ? "" : t("ndc:ndcUnauthorisedMsg") },
27050
+ React.createElement("span", null, record.nationalPlanObjective))) : (React.createElement(Input, { placeholder: t("ndc:nationalPlanObjectivePlaceHolder") })))); },
26919
27051
  },
26920
27052
  {
26921
27053
  title: t("ndc:ndcColumnsKpi"),
26922
27054
  dataIndex: "kpi",
26923
27055
  key: "kpi",
26924
27056
  align: "left",
27057
+ width: 100,
26925
27058
  editable: true,
26926
- width: "10%",
26927
- render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(Space, { size: "middle" },
26928
- React.createElement("span", null, record.kpi))) : (React.createElement("input", { placeholder: "Enter Kpi", className: "ant-input", type: "text" })))); },
27059
+ render: function (_, record) { return (React.createElement(Space, { size: "middle" }, record.kpi ? (React.createElement(Tooltip, { title: isNdcActionEditable(record) ? "" : t("ndc:ndcUnauthorisedMsg") },
27060
+ React.createElement("span", null, record.kpi))) : (React.createElement(Input, { placeholder: "Enter Kpi" })))); },
26929
27061
  },
26930
27062
  {
26931
- title: "Government Department",
26932
- dataIndex: "ministry",
26933
- key: "ministry",
27063
+ title: t("ndc:ndcColumnsMinistry"),
27064
+ dataIndex: "ministryName",
27065
+ key: "ministryName",
26934
27066
  align: "left",
26935
- editable: true,
26936
- width: "40%",
26937
- render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(Space, { size: "middle" },
26938
- React.createElement("span", null, record.ministry))) : (React.createElement("input", { placeholder: "Please add the Government Department", className: "ant-input", type: "text" })))); },
27067
+ width: 300,
27068
+ editable: false,
27069
+ render: function (_, record) { return (React.createElement(Tooltip, { title: isSubNdcActionsEditable(record) ? "" : t("ndc:ndcUnauthorisedMsg") },
27070
+ React.createElement(Select, { disabled: !(isSubNdcActionsEditable(record) && isEditing(record)), defaultValue: record.ministryName ? record.ministryName : loginMinistry, style: { width: 220 }, onChange: function (value, option) {
27071
+ record.ministryName = option.label;
27072
+ handleSave(record);
27073
+ }, options: ministryOrgList }))); },
27074
+ },
27075
+ {
27076
+ title: t("ndc:ndcColumnsStatus"),
27077
+ dataIndex: "status",
27078
+ key: "status",
27079
+ align: "left",
27080
+ width: 200,
27081
+ editable: false,
27082
+ render: function (_, record) {
27083
+ var menu = actionMenu(record);
27084
+ return (React.createElement("div", { onClick: function (event) { return event.stopPropagation(); } },
27085
+ record.actionType === NdcDetailsActionType.SubAction &&
27086
+ record.status !== NdcDetailsActionStatus.New ? (React.createElement(Tooltip, { title: record.status, color: TooltipColor, key: TooltipColor },
27087
+ React.createElement(Tag, { className: "clickable", color: getNdcActionStatusTagType(record.status) }, addSpaces(record.status)))) : (""),
27088
+ record.actionType === NdcDetailsActionType.SubAction && menu ? (React.createElement(Popover, { placement: "bottomRight", content: menu, trigger: "click" },
27089
+ React.createElement(EllipsisOutlined, { rotate: 90, style: {
27090
+ fontWeight: 600,
27091
+ fontSize: "1rem",
27092
+ cursor: "pointer",
27093
+ } }))) : (React.createElement("span", null))));
27094
+ },
26939
27095
  },
26940
27096
  ];
26941
27097
  var columns = defaultColumns.map(function (col) {
26942
27098
  if (!col.editable) {
26943
27099
  return col;
26944
27100
  }
26945
- return __assign(__assign({}, col), { onCell: function (record) { return ({
26946
- record: record,
26947
- editable: col.editable,
26948
- dataIndex: col.dataIndex,
26949
- title: col.title,
26950
- handleSave: handleSave,
26951
- }); } });
27101
+ return __assign(__assign({}, col), { onCell: function (record) {
27102
+ return {
27103
+ record: record,
27104
+ editing: isEditing(record),
27105
+ dataIndex: col.dataIndex,
27106
+ title: col.title,
27107
+ onBlurHandler: function (record) {
27108
+ if (isEditing(record)) {
27109
+ handleSave(record);
27110
+ }
27111
+ },
27112
+ t: t,
27113
+ };
27114
+ } });
26952
27115
  });
26953
- function onAddNewNdcDetail() {
26954
- var range = selectedTab.split("-");
26955
- var ndcActionId = ++addedNdcDetailId.current;
26956
- var newData = {
26957
- key: ndcActionId,
26958
- type: NdcActionType.main,
26959
- startDate: new Date("".concat(Number(range[0]), "-01-24 23:12:00")),
26960
- endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
26961
- nationalPlanObj: "",
26962
- kpi: "",
26963
- ministry: "",
26964
- subNdcDetails: [
26965
- {
26966
- key: ++addedNdcDetailId.current,
26967
- ndcActionId: ndcActionId,
26968
- type: NdcActionType.sub,
26969
- startDate: new Date("2019-03-25"),
26970
- endDate: new Date("2020-03-25"),
26971
- nationalPlanObj: "",
26972
- kpi: "",
26973
- ministry: "",
26974
- },
26975
- ],
26976
- };
26977
- setNdcDetailsData(__spreadArray(__spreadArray([], ndcDetailsData, true), [newData], false));
27116
+ function onClickedAddNewNdcDetail() {
27117
+ return __awaiter(this, void 0, void 0, function () {
27118
+ var periodId, newData_1, lastPage;
27119
+ return __generator(this, function (_a) {
27120
+ if (selectedPeriod.key !== "add_new") {
27121
+ form.setFieldsValue({
27122
+ nationalPlanObjective: "",
27123
+ kpi: "",
27124
+ });
27125
+ periodId = parseInt(selectedPeriod.key);
27126
+ newData_1 = {
27127
+ id: nextAvailableActionId,
27128
+ actionType: NdcDetailsActionType.MainAction,
27129
+ nationalPlanObjective: "",
27130
+ kpi: "",
27131
+ ministryName: loginMinistry,
27132
+ periodId: periodId,
27133
+ status: NdcDetailsActionStatus.New,
27134
+ };
27135
+ setEditingKey(nextAvailableActionId);
27136
+ setNextAvailableActionId(function (value) { return value + 1; });
27137
+ setNdcActionsList(function (ndcActionsList) { return __spreadArray(__spreadArray([], ndcActionsList, true), [
27138
+ newData_1,
27139
+ ], false); });
27140
+ setTableKey(function (key) { return key + 1; });
27141
+ if (ndcMainDetailsForPeriod.length + 1 > pageSize) {
27142
+ lastPage = Math.ceil(ndcMainDetailsForPeriod.length / pageSize);
27143
+ setCurrentPage(lastPage);
27144
+ }
27145
+ }
27146
+ return [2 /*return*/];
27147
+ });
27148
+ });
26978
27149
  }
26979
27150
  var components = {
26980
27151
  body: {
26981
- row: EditableRow,
26982
27152
  cell: EditableCell,
26983
27153
  },
26984
27154
  };
26985
- //commented because rendering issue
26986
- function ndcDetailsTableContent() {
26987
- return (React.createElement("div", null)
26988
- // <div>
26989
- // <Button
26990
- // onClick={onAddNewNdcDetail}
26991
- // type="primary"
26992
- // style={{
26993
- // marginBottom: 16,
26994
- // }}
26995
- // >
26996
- // Add a row
26997
- // </Button>
26998
- // <Table
26999
- // components={components}
27000
- // rowClassName={() => 'editable-row'}
27001
- // bordered
27002
- // dataSource={ndcDetailsData}
27003
- // columns={columns}
27004
- // />
27005
- // </div>
27006
- );
27007
- }
27008
- var onCancelPeriod = function () { };
27009
- var onAddNewPeriod = function () {
27010
- if (selectedPeriod &&
27011
- selectedPeriod.current &&
27012
- selectedPeriod.current.start &&
27013
- selectedPeriod.current.end) {
27014
- var newPeriodItem_1 = {
27015
- key: "".concat(selectedPeriod.current.start, "-").concat(selectedPeriod.current.end),
27016
- label: "".concat(selectedPeriod.current.start, "-").concat(selectedPeriod.current.end),
27017
- start: selectedPeriod.current.start,
27018
- end: selectedPeriod.current.end,
27019
- children: ndcDetailsTableContent(),
27020
- };
27021
- var existingIndex = periodItemsRef.current.findIndex(function (item) {
27022
- return inRange(newPeriodItem_1.start, item.start, item.end) ||
27023
- inRange(newPeriodItem_1.end, item.start, item.end);
27155
+ var onClickedDeletePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
27156
+ return __generator(this, function (_a) {
27157
+ setActionInfo({
27158
+ action: "Delete",
27159
+ headerText: t("ndc:periodDeleteConfirmTitle"),
27160
+ type: "danger",
27161
+ icon: React.createElement(Icon.XCircle, null),
27162
+ recordId: selectedPeriod.key,
27024
27163
  });
27025
- if (existingIndex === -1) {
27026
- setPeriodItems(function (items) { return __spreadArray(__spreadArray([], items, true), [newPeriodItem_1], false); });
27027
- periodItemsRef.current = __spreadArray(__spreadArray([], periodItemsRef.current, true), [newPeriodItem_1], false);
27164
+ setOpenConfirmationModal(true);
27165
+ return [2 /*return*/];
27166
+ });
27167
+ }); };
27168
+ var onClickedFinalizePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
27169
+ var isPendingActionAvailable;
27170
+ return __generator(this, function (_a) {
27171
+ if (ndcMainDetailsForPeriod.length === 0) {
27172
+ message.open({
27173
+ type: "error",
27174
+ content: t("ndc:finalizeNdcEmptyErrorText"),
27175
+ duration: 3,
27176
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27177
+ });
27178
+ return [2 /*return*/];
27028
27179
  }
27029
- else {
27180
+ isPendingActionAvailable = false;
27181
+ ndcMainDetailsForPeriod.forEach(function (mainAction) {
27182
+ var pendingActions = ndcActionsList.filter(function (action) {
27183
+ return (action.status === NdcDetailsActionStatus.Pending &&
27184
+ action.actionType === NdcDetailsActionType.SubAction &&
27185
+ action.parentActionId === mainAction.id);
27186
+ });
27187
+ if (pendingActions && pendingActions.length > 0) {
27188
+ isPendingActionAvailable = true;
27189
+ return;
27190
+ }
27191
+ });
27192
+ if (isPendingActionAvailable) {
27030
27193
  message.open({
27031
27194
  type: "error",
27032
- content: t("ndc:rangeAlreadyExists"),
27195
+ content: t("ndc:finalizeErrorText"),
27033
27196
  duration: 3,
27034
27197
  style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27035
27198
  });
27036
27199
  }
27200
+ else {
27201
+ setActionInfo({
27202
+ action: "Finalize",
27203
+ headerText: t("ndc:finalizeApproveTitle"),
27204
+ text: t("ndc:finalizeApproveSubTitle"),
27205
+ type: "primary",
27206
+ icon: React.createElement(Icon.Clipboard2Check, null),
27207
+ recordId: selectedPeriod.key,
27208
+ });
27209
+ setOpenConfirmationModal(true);
27210
+ }
27211
+ return [2 /*return*/];
27212
+ });
27213
+ }); };
27214
+ var onMainTableRowExpand = function (expanded, record) {
27215
+ var keys = [];
27216
+ if (expanded) {
27217
+ keys.push(record.id);
27037
27218
  }
27038
- };
27039
- useEffect(function () {
27040
- if (periodItems && periodItems.length > 3) {
27041
- setSelectedTab(periodItems[periodItems.length - 1].key);
27042
- }
27043
- }, [periodItems]);
27044
- var onDateRangeChanged = function (range) {
27045
- var period = {
27046
- start: Number(moment(range[0]).year()),
27047
- end: Number(moment(range[1]).year()),
27048
- };
27049
- selectedPeriod.current = period;
27219
+ setExpandedRowKeys(keys);
27220
+ setNdcSubActionsForMainAction(record.id);
27050
27221
  };
27051
27222
  function addNewPeriodContent() {
27052
27223
  return (React.createElement("div", null,
27053
- React.createElement(Row, null,
27054
- React.createElement(RangePicker, { onChange: onDateRangeChanged, picker: "year" })),
27055
- React.createElement(Row, { className: "mg-top-1" },
27056
- React.createElement("div", { className: "ndc-steps-actions" },
27057
- React.createElement(Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit")),
27058
- React.createElement(Button, { className: "back-btn", onClick: onCancelPeriod, loading: loading }, t("ndc:back"))))));
27059
- }
27060
- function getSubNdcActionContent(record) {
27061
- selectedNdcDetail.current = record;
27062
- return (React.createElement(Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getSubNdcDetails(record.key), columns: columns, showHeader: false, pagination: false }));
27224
+ React.createElement(Row, { justify: "start", align: "middle", gutter: [16, 16] },
27225
+ React.createElement(Col, { flex: "340px" },
27226
+ React.createElement(RangePicker, { disabledDate: function (current) { return moment(current).year() < 1900; }, onChange: onDateRangeChanged, picker: "year" })),
27227
+ React.createElement(Col, { flex: "auto" },
27228
+ React.createElement(Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit"))))));
27063
27229
  }
27064
- var onTabChange = function (key) {
27065
- setSelectedTab(key);
27230
+ var onChange = function (page, size) {
27231
+ setCurrentPage(page);
27232
+ setPageSize(size);
27066
27233
  };
27067
- useEffect(function () {
27068
- var defaultNdcDetails = [
27069
- {
27070
- key: 1,
27071
- type: NdcActionType.main,
27072
- startDate: new Date("2019-03-25"),
27073
- endDate: new Date("2020-03-25"),
27074
- nationalPlanObj: "Enhance value addition in key growth opportunities",
27075
- kpi: 25,
27076
- ministry: "Ministry of Environment",
27077
- subNdcDetails: [
27078
- {
27079
- key: 6,
27080
- ndcActionId: 1,
27081
- type: NdcActionType.sub,
27082
- startDate: new Date("2019-03-25"),
27083
- endDate: new Date("2020-03-25"),
27084
- nationalPlanObj: "Enhance value addition in key growth opportunities sub details",
27085
- kpi: 25,
27086
- ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
27087
- },
27088
- {
27089
- key: 7,
27090
- ndcActionId: 1,
27091
- type: NdcActionType.sub,
27092
- startDate: new Date("2019-03-25"),
27093
- endDate: new Date("2020-03-25"),
27094
- nationalPlanObj: "",
27095
- kpi: "",
27096
- ministry: "",
27097
- },
27098
- ],
27099
- },
27100
- {
27101
- key: 2,
27102
- type: NdcActionType.main,
27103
- startDate: new Date("2019-03-25"),
27104
- endDate: new Date("2019-08-25"),
27105
- nationalPlanObj: "Strengthen the private sector to create 10,000 jobs",
27106
- kpi: 10500,
27107
- ministry: "Ministry of Environment",
27108
- subNdcDetails: [
27109
- {
27110
- key: 8,
27111
- ndcActionId: 2,
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: 12,
27123
- type: NdcActionType.main,
27124
- startDate: new Date("2019-03-25"),
27125
- endDate: new Date("2019-08-25"),
27126
- nationalPlanObj: "Other",
27127
- kpi: 10500,
27128
- ministry: "Ministry of Environment",
27129
- subNdcDetails: [
27130
- {
27131
- key: 8,
27132
- ndcActionId: 12,
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: 3,
27144
- type: NdcActionType.main,
27145
- startDate: new Date("2021-03-25"),
27146
- endDate: new Date("2022-03-25"),
27147
- nationalPlanObj: "Consolidate and increase the stock and quality of productive infrastructure by 50%",
27148
- kpi: 48,
27149
- ministry: "Ministry of Environment",
27150
- subNdcDetails: [
27151
- {
27152
- key: 9,
27153
- ndcActionId: 3,
27154
- type: NdcActionType.sub,
27155
- startDate: new Date("2019-03-25"),
27156
- endDate: new Date("2020-03-25"),
27157
- nationalPlanObj: "",
27158
- kpi: "",
27159
- ministry: "",
27160
- },
27161
- ],
27162
- },
27163
- {
27164
- key: 4,
27165
- type: NdcActionType.main,
27166
- startDate: new Date("2022-03-25"),
27167
- endDate: new Date("2022-05-25"),
27168
- nationalPlanObj: "Enhance the productivity and social wellbeing of the population",
27169
- kpi: 20,
27170
- ministry: "Ministry of Environment",
27171
- subNdcDetails: [
27172
- {
27173
- key: 10,
27174
- ndcActionId: 4,
27175
- type: NdcActionType.sub,
27176
- startDate: new Date("2019-03-25"),
27177
- endDate: new Date("2020-03-25"),
27178
- nationalPlanObj: "",
27179
- kpi: "",
27180
- ministry: "",
27181
- },
27182
- ],
27183
- },
27184
- {
27185
- key: 5,
27186
- type: NdcActionType.main,
27187
- startDate: new Date("2022-03-25"),
27188
- endDate: new Date("2023-03-25"),
27189
- nationalPlanObj: "Strengthen the role of the state in guiding and facilitating development",
27190
- kpi: 10,
27191
- ministry: "Ministry of Environment",
27192
- subNdcDetails: [
27193
- {
27194
- key: 11,
27195
- ndcActionId: 5,
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: 13,
27207
- type: NdcActionType.main,
27208
- startDate: new Date("2022-03-25"),
27209
- endDate: new Date("2023-03-25"),
27210
- nationalPlanObj: "Convert to solar energy",
27211
- kpi: 50000,
27212
- ministry: "Ministry of Environment",
27213
- subNdcDetails: [
27214
- {
27215
- key: 11,
27216
- ndcActionId: 13,
27217
- type: NdcActionType.sub,
27218
- startDate: new Date("2019-03-25"),
27219
- endDate: new Date("2020-03-25"),
27220
- nationalPlanObj: "Convert to solar energy",
27221
- kpi: "3000",
27222
- ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
27223
- },
27224
- {
27225
- key: 14,
27226
- ndcActionId: 13,
27227
- type: NdcActionType.sub,
27228
- startDate: new Date("2019-03-25"),
27229
- endDate: new Date("2020-03-25"),
27230
- nationalPlanObj: "",
27231
- kpi: "",
27232
- ministry: "",
27233
- },
27234
- ],
27235
- },
27236
- {
27237
- key: 15,
27238
- type: NdcActionType.main,
27239
- startDate: new Date("2022-03-25"),
27240
- endDate: new Date("2023-03-25"),
27241
- nationalPlanObj: "Strengthen the private sector to create jobs",
27242
- kpi: 10000,
27243
- ministry: "Ministry of Environment",
27244
- subNdcDetails: [
27245
- {
27246
- key: 16,
27247
- ndcActionId: 15,
27248
- type: NdcActionType.sub,
27249
- startDate: new Date("2019-03-25"),
27250
- endDate: new Date("2020-03-25"),
27251
- nationalPlanObj: "Strengthen the private sector to create jobs",
27252
- kpi: "7200",
27253
- ministry: "Ministry of Tourism (MoT)",
27254
- },
27255
- {
27256
- key: 17,
27257
- ndcActionId: 15,
27258
- type: NdcActionType.sub,
27259
- startDate: new Date("2019-03-25"),
27260
- endDate: new Date("2020-03-25"),
27261
- nationalPlanObj: "",
27262
- kpi: "",
27263
- ministry: "",
27264
- },
27265
- ],
27266
- },
27267
- {
27268
- key: 18,
27269
- type: NdcActionType.main,
27270
- startDate: new Date("2022-03-25"),
27271
- endDate: new Date("2023-03-25"),
27272
- nationalPlanObj: "Other",
27273
- kpi: "",
27274
- ministry: "Ministry of Environment",
27275
- subNdcDetails: [
27276
- {
27277
- key: 19,
27278
- ndcActionId: 18,
27279
- type: NdcActionType.sub,
27280
- startDate: new Date("2019-03-25"),
27281
- endDate: new Date("2020-03-25"),
27282
- nationalPlanObj: "Strengthen the private sector to create jobs",
27283
- kpi: "",
27284
- ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
27234
+ function mainNdcActionTableContent() {
27235
+ return (React.createElement("div", null,
27236
+ React.createElement(Row, null,
27237
+ React.createElement(Col, { span: 24 },
27238
+ React.createElement(Form, { form: form, component: false },
27239
+ React.createElement(Table, { tableLayout: "fixed", key: tableKey, className: "common-table-class", rowKey: "id", pagination: {
27240
+ current: currentPage,
27241
+ pageSize: pageSize,
27242
+ total: ndcMainDetailsForPeriod.length,
27243
+ showQuickJumper: true,
27244
+ showSizeChanger: true,
27245
+ onChange: onChange,
27246
+ }, components: components, rowClassName: function () { return "editable-row"; }, bordered: true, loading: loading, dataSource: ndcMainDetailsForPeriod, columns: columns, expandedRowKeys: expandedRowKeys, onExpand: onMainTableRowExpand, expandable: {
27247
+ expandedRowRender: function (record) {
27248
+ return subNdcActionTableContent();
27249
+ },
27250
+ columnWidth: 40,
27251
+ }, onRow: function (record, rowIndex) {
27252
+ return {
27253
+ onClick: function (event) {
27254
+ if (record.id &&
27255
+ isNdcActionEditable(record) &&
27256
+ !isEditing(record)) {
27257
+ form.setFieldsValue(__assign({}, record));
27258
+ setEditingKey(record.id);
27259
+ }
27260
+ },
27261
+ onMouseLeave: function () {
27262
+ if (isEditing(record)) {
27263
+ handleSave(record);
27264
+ }
27265
+ },
27266
+ };
27267
+ }, footer: function () {
27268
+ return isGovernmentUser &&
27269
+ !selectedPeriod.finalized && (React.createElement(Row, { justify: "center" },
27270
+ React.createElement(Button, { className: "btnAddNewMainAct", disabled: isMainActionInEditMode(), onClick: onClickedAddNewNdcDetail, type: "default" }, t("ndc:addNdcAction"))));
27271
+ } })))),
27272
+ isGovernmentUser && !selectedPeriod.finalized ? (React.createElement(Row, { justify: "end" }, isMainActionInEditMode() ? (React.createElement(React.Fragment, null,
27273
+ React.createElement(Button, { className: "mg-left-1", disabled: true }, t("ndc:delete")),
27274
+ React.createElement(Button, { className: "mg-left-1", disabled: true }, t("ndc:finalize")))) : (React.createElement(React.Fragment, null,
27275
+ React.createElement(Button, { className: "mg-left-1 btn-danger", onClick: onClickedDeletePeriod, htmlType: "submit", loading: loading }, t("ndc:delete")),
27276
+ React.createElement(Button, { className: "mg-left-1", type: "primary", onClick: onClickedFinalizePeriod, htmlType: "submit", loading: loading }, t("ndc:finalize")))))) : ("")));
27277
+ }
27278
+ function subNdcActionTableContent(record) {
27279
+ return (React.createElement(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) {
27280
+ return {
27281
+ onClick: function (event) {
27282
+ if (record.id &&
27283
+ isNdcActionEditable(record) &&
27284
+ !isEditing(record)) {
27285
+ form.setFieldsValue(__assign({}, record));
27286
+ setEditingKey(record.id);
27287
+ }
27285
27288
  },
27286
- {
27287
- key: 20,
27288
- ndcActionId: 18,
27289
- type: NdcActionType.sub,
27290
- startDate: new Date("2019-03-25"),
27291
- endDate: new Date("2020-03-25"),
27292
- nationalPlanObj: "",
27293
- kpi: "",
27294
- ministry: "",
27289
+ onMouseLeave: function () {
27290
+ if (isEditing(record)) {
27291
+ handleSave(record);
27292
+ }
27295
27293
  },
27296
- ],
27297
- },
27298
- ];
27299
- var initialPeriods = [
27300
- {
27301
- key: "2019-2020",
27302
- label: "2019-2020",
27303
- start: 2019,
27304
- end: 2020,
27305
- children: ndcDetailsTableContent(),
27306
- },
27307
- {
27308
- key: "2021-2023",
27309
- label: "2021-2023",
27310
- start: 2021,
27311
- end: 2021,
27312
- children: ndcDetailsTableContent(),
27313
- },
27314
- ];
27315
- if (isAddRangeVisible()) {
27316
- initialPeriods.unshift({
27317
- key: "add_new",
27318
- label: "Add New",
27319
- start: 0,
27320
- end: 0,
27321
- children: addNewPeriodContent(),
27322
- });
27294
+ };
27295
+ }, columns: columns, showHeader: false, pagination: false }));
27296
+ }
27297
+ var onAddNewPeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
27298
+ var periodItem_1, existingIndex, response, addedPeriodItem, updatedPeriodItem_1, exception_3;
27299
+ return __generator(this, function (_a) {
27300
+ switch (_a.label) {
27301
+ case 0:
27302
+ _a.trys.push([0, 4, , 5]);
27303
+ if (!(selectedDateRangeRef &&
27304
+ selectedDateRangeRef.current &&
27305
+ selectedDateRangeRef.current.startYear &&
27306
+ selectedDateRangeRef.current.endYear)) return [3 /*break*/, 3];
27307
+ periodItem_1 = {
27308
+ startYear: selectedDateRangeRef.current.startYear,
27309
+ endYear: selectedDateRangeRef.current.endYear,
27310
+ finalized: false,
27311
+ };
27312
+ existingIndex = periodItems.findIndex(function (item) {
27313
+ return inRange(periodItem_1.startYear, item.startYear, item.endYear) ||
27314
+ inRange(periodItem_1.endYear, item.startYear, item.endYear);
27315
+ });
27316
+ if (!(existingIndex === -1)) return [3 /*break*/, 2];
27317
+ return [4 /*yield*/, post("national/programme/addNdcDetailsPeriod", __assign({}, periodItem_1))];
27318
+ case 1:
27319
+ response = _a.sent();
27320
+ if (response && response.data) {
27321
+ addedPeriodItem = response.data;
27322
+ updatedPeriodItem_1 = __assign(__assign({}, addedPeriodItem), { key: addedPeriodItem.id, label: "".concat(addedPeriodItem.startYear, "-").concat(addedPeriodItem.endYear) });
27323
+ setPeriodItems(function (items) { return __spreadArray(__spreadArray([], items, true), [updatedPeriodItem_1], false); });
27324
+ setSelectedPeriod(updatedPeriodItem_1);
27325
+ }
27326
+ return [3 /*break*/, 3];
27327
+ case 2:
27328
+ message.open({
27329
+ type: "error",
27330
+ content: t("ndc:rangeAlreadyExists"),
27331
+ duration: 3,
27332
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27333
+ });
27334
+ _a.label = 3;
27335
+ case 3: return [3 /*break*/, 5];
27336
+ case 4:
27337
+ exception_3 = _a.sent();
27338
+ message.open({
27339
+ type: "error",
27340
+ content: exception_3.message,
27341
+ duration: 3,
27342
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27343
+ });
27344
+ return [3 /*break*/, 5];
27345
+ case 5: return [2 /*return*/];
27346
+ }
27347
+ });
27348
+ }); };
27349
+ var onDateRangeChanged = function (range) {
27350
+ if (range) {
27351
+ var period = {
27352
+ startYear: Number(moment(range[0]).year()),
27353
+ endYear: Number(moment(range[1]).year()),
27354
+ };
27355
+ if (period.startYear === period.endYear) {
27356
+ message.open({
27357
+ type: "error",
27358
+ content: t("ndc:sameStartEndDates"),
27359
+ duration: 3,
27360
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27361
+ });
27362
+ }
27363
+ else {
27364
+ selectedDateRangeRef.current = period;
27365
+ }
27366
+ }
27367
+ };
27368
+ var onTabChange = function (key) {
27369
+ var selectedPeriod = periodItems.find(function (item) { return item.key === key; });
27370
+ if (selectedPeriod) {
27371
+ setSelectedPeriod(selectedPeriod);
27323
27372
  }
27324
- addedNdcDetailId.current = 20;
27325
- setPeriodItems(initialPeriods);
27326
- periodItemsRef.current = initialPeriods;
27327
- setNdcDetailsData(defaultNdcDetails);
27373
+ };
27374
+ var onActionConfirmed = function () { return __awaiter(void 0, void 0, void 0, function () {
27375
+ var actionResponse, exception_4;
27376
+ return __generator(this, function (_a) {
27377
+ switch (_a.label) {
27378
+ case 0:
27379
+ setLoading(true);
27380
+ _a.label = 1;
27381
+ case 1:
27382
+ _a.trys.push([1, 10, , 11]);
27383
+ if (!(actionInfo.action === "Approve")) return [3 /*break*/, 3];
27384
+ return [4 /*yield*/, post("national/programme/approveNdcDetailsAction", {
27385
+ id: actionInfo.recordId,
27386
+ })];
27387
+ case 2:
27388
+ actionResponse = _a.sent();
27389
+ return [3 /*break*/, 9];
27390
+ case 3:
27391
+ if (!(actionInfo.action === "Reject")) return [3 /*break*/, 5];
27392
+ return [4 /*yield*/, post("national/programme/rejectNdcDetailsAction", {
27393
+ id: actionInfo.recordId,
27394
+ })];
27395
+ case 4:
27396
+ actionResponse = _a.sent();
27397
+ return [3 /*break*/, 9];
27398
+ case 5:
27399
+ if (!(actionInfo.action === "Finalize")) return [3 /*break*/, 7];
27400
+ return [4 /*yield*/, post("national/programme/finalizeNdcDetailsPeriod", {
27401
+ id: selectedPeriod.key,
27402
+ })];
27403
+ case 6:
27404
+ actionResponse = _a.sent();
27405
+ return [3 /*break*/, 9];
27406
+ case 7:
27407
+ if (!(actionInfo.action === "Delete")) return [3 /*break*/, 9];
27408
+ return [4 /*yield*/, post("national/programme/deleteNdcDetailsPeriod", {
27409
+ id: selectedPeriod.key,
27410
+ })];
27411
+ case 8:
27412
+ actionResponse = _a.sent();
27413
+ _a.label = 9;
27414
+ case 9: return [3 /*break*/, 11];
27415
+ case 10:
27416
+ exception_4 = _a.sent();
27417
+ message.open({
27418
+ type: "error",
27419
+ content: exception_4.message,
27420
+ duration: 3,
27421
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27422
+ });
27423
+ return [3 /*break*/, 11];
27424
+ case 11:
27425
+ if (actionResponse) {
27426
+ if (actionInfo.action === "Delete") {
27427
+ message.open({
27428
+ type: "success",
27429
+ content: t("ndc:deletePeriodSuccessMsg"),
27430
+ duration: 3,
27431
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27432
+ });
27433
+ fetchNdcDetailPeriods();
27434
+ }
27435
+ else if (actionInfo.action === "Finalize") {
27436
+ message.open({
27437
+ type: "success",
27438
+ content: t("ndc:finalizeSuccessMsg"),
27439
+ duration: 3,
27440
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27441
+ });
27442
+ fetchNdcDetailPeriods();
27443
+ setExpandedRowKeys([]);
27444
+ ClearEditMode();
27445
+ }
27446
+ else if (actionInfo.action === "Approve") {
27447
+ message.open({
27448
+ type: "success",
27449
+ content: t("ndc:approveSuccessMsg"),
27450
+ duration: 3,
27451
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27452
+ });
27453
+ fetchNdcDetailActions();
27454
+ }
27455
+ else if (actionInfo.action === "Reject") {
27456
+ message.open({
27457
+ type: "success",
27458
+ content: t("ndc:rejectSuccessMsg"),
27459
+ duration: 3,
27460
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27461
+ });
27462
+ fetchNdcDetailActions();
27463
+ }
27464
+ }
27465
+ setOpenConfirmationModal(false);
27466
+ setLoading(false);
27467
+ return [2 /*return*/];
27468
+ }
27469
+ });
27470
+ }); };
27471
+ var onActionCanceled = function () {
27472
+ setOpenConfirmationModal(false);
27473
+ };
27474
+ var fetchNdcDetailPeriods = function () { return __awaiter(void 0, void 0, void 0, function () {
27475
+ var periods, addNewTab, response, exception_5;
27476
+ return __generator(this, function (_a) {
27477
+ switch (_a.label) {
27478
+ case 0:
27479
+ setLoading(true);
27480
+ _a.label = 1;
27481
+ case 1:
27482
+ _a.trys.push([1, 3, 4, 5]);
27483
+ periods = [];
27484
+ addNewTab = {
27485
+ key: "add_new",
27486
+ label: "Add New",
27487
+ startYear: 0,
27488
+ endYear: 0,
27489
+ finalized: false,
27490
+ deleted: false,
27491
+ };
27492
+ return [4 /*yield*/, get("national/programme/queryNdcDetailsPeriod")];
27493
+ case 2:
27494
+ response = _a.sent();
27495
+ if (response && response.data) {
27496
+ periods = response.data.map(function (period) {
27497
+ return __assign(__assign({}, period), { key: period.id, label: period.finalized ? (React.createElement("span", null,
27498
+ React.createElement(LockOutlined, null),
27499
+ " ",
27500
+ period.startYear,
27501
+ "-",
27502
+ period.endYear,
27503
+ " ")) : ("".concat(period.startYear, "-").concat(period.endYear)) });
27504
+ });
27505
+ }
27506
+ if (isGovernmentUser) {
27507
+ periods.unshift(addNewTab);
27508
+ }
27509
+ setPeriodItems(periods);
27510
+ if (isGovernmentUser) {
27511
+ setSelectedPeriod(addNewTab);
27512
+ }
27513
+ else {
27514
+ setSelectedPeriod(periods[0]);
27515
+ }
27516
+ setLoading(false);
27517
+ return [3 /*break*/, 5];
27518
+ case 3:
27519
+ exception_5 = _a.sent();
27520
+ message.open({
27521
+ type: "error",
27522
+ content: exception_5.message,
27523
+ duration: 3,
27524
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27525
+ });
27526
+ return [3 /*break*/, 5];
27527
+ case 4:
27528
+ setLoading(false);
27529
+ return [7 /*endfinally*/];
27530
+ case 5: return [2 /*return*/];
27531
+ }
27532
+ });
27533
+ }); };
27534
+ var fetchNdcDetailActions = function () { return __awaiter(void 0, void 0, void 0, function () {
27535
+ var response, maxActionId, exception_6;
27536
+ return __generator(this, function (_a) {
27537
+ switch (_a.label) {
27538
+ case 0:
27539
+ setLoading(true);
27540
+ _a.label = 1;
27541
+ case 1:
27542
+ _a.trys.push([1, 3, 4, 5]);
27543
+ return [4 /*yield*/, get("national/programme/queryNdcDetailsAction")];
27544
+ case 2:
27545
+ response = _a.sent();
27546
+ if (response && response.data) {
27547
+ maxActionId = Math.max.apply(Math, response.data.map(function (item) { return item.id; }));
27548
+ setNextAvailableActionId(maxActionId + 1);
27549
+ setNdcActionsList(response.data);
27550
+ }
27551
+ setLoading(false);
27552
+ return [3 /*break*/, 5];
27553
+ case 3:
27554
+ exception_6 = _a.sent();
27555
+ message.open({
27556
+ type: "error",
27557
+ content: exception_6.message,
27558
+ duration: 3,
27559
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27560
+ });
27561
+ return [3 /*break*/, 5];
27562
+ case 4:
27563
+ setLoading(false);
27564
+ return [7 /*endfinally*/];
27565
+ case 5: return [2 /*return*/];
27566
+ }
27567
+ });
27568
+ }); };
27569
+ var fetchMinistries = function () { return __awaiter(void 0, void 0, void 0, function () {
27570
+ var response, ministryOrgDetails, exception_7;
27571
+ return __generator(this, function (_a) {
27572
+ switch (_a.label) {
27573
+ case 0:
27574
+ setLoading(true);
27575
+ _a.label = 1;
27576
+ case 1:
27577
+ _a.trys.push([1, 3, 4, 5]);
27578
+ return [4 /*yield*/, get("national/organisation/getMinistries")];
27579
+ case 2:
27580
+ response = _a.sent();
27581
+ if (response && response.data) {
27582
+ ministryOrgDetails = response.data.map(function (value) {
27583
+ return {
27584
+ value: value.company_companyId,
27585
+ label: value.company_name,
27586
+ };
27587
+ });
27588
+ setMinistryOrgList(ministryOrgDetails);
27589
+ }
27590
+ setLoading(false);
27591
+ return [3 /*break*/, 5];
27592
+ case 3:
27593
+ exception_7 = _a.sent();
27594
+ message.open({
27595
+ type: "error",
27596
+ content: exception_7.message,
27597
+ duration: 3,
27598
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
27599
+ });
27600
+ return [3 /*break*/, 5];
27601
+ case 4:
27602
+ setLoading(false);
27603
+ return [7 /*endfinally*/];
27604
+ case 5: return [2 /*return*/];
27605
+ }
27606
+ });
27607
+ }); };
27608
+ useEffect(function () {
27609
+ fetchNdcDetailPeriods();
27610
+ fetchNdcDetailActions();
27611
+ fetchMinistries();
27328
27612
  }, []);
27329
- return (React.createElement("div", { className: "ndc-management content-container" },
27613
+ return (React.createElement("div", { className: "ndc-details content-container" },
27330
27614
  React.createElement("div", { className: "title-bar" },
27331
27615
  React.createElement(Row, { justify: "space-between", align: "middle" },
27332
27616
  React.createElement(Col, { span: 20 },
27333
27617
  React.createElement("div", { className: "body-title" }, t("ndc:ndcTitle")),
27334
27618
  React.createElement("div", { className: "body-sub-title" }, t("ndc:ndcSubTitle"))))),
27335
27619
  React.createElement("div", null,
27336
- React.createElement(Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedTab, onChange: onTabChange })),
27337
- selectedTab !== "add_new" && (React.createElement("div", null,
27338
- React.createElement("div", null,
27339
- React.createElement(Table, { key: tableKey, components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getNdcDetailsForPeriod(), columns: columns, expandable: {
27340
- expandedRowRender: function (record) { return getSubNdcActionContent(record); },
27341
- indentSize: 0,
27342
- defaultExpandedRowKeys: [selectedNdcDetail.current.key],
27343
- }, footer: function () {
27344
- return isAddNdcActionVisible() && (React.createElement(Row, { justify: "center" },
27345
- React.createElement(Button, { onClick: onAddNewNdcDetail, type: "default", style: {
27346
- marginBottom: 16,
27347
- width: "100%",
27348
- } }, t("ndc:addNdcAction"))));
27349
- } }))))));
27620
+ React.createElement(Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedPeriod.key, onChange: onTabChange })),
27621
+ React.createElement("div", null, selectedPeriod.key === "add_new"
27622
+ ? addNewPeriodContent()
27623
+ : mainNdcActionTableContent()),
27624
+ React.createElement(UserActionConfirmationModel, { t: t, actionInfo: actionInfo, onActionConfirmed: onActionConfirmed, onActionCanceled: onActionCanceled, openModal: openConfirmationModal, errorMsg: "", loading: loading })));
27350
27625
  };
27351
27626
 
27352
27627
  var ImgWithFallback = function (_a) {
@@ -28121,7 +28396,7 @@ var RejectDocumentationConfirmationModel = function (props) {
28121
28396
  React.createElement(Button, { className: "mg-left-2", type: "primary", danger: true, htmlType: "submit", loading: loading, disabled: actionInfo.type === "reject" && comment === "" }, "REJECT")))));
28122
28397
  };
28123
28398
 
28124
- 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";
28399
+ 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";
28125
28400
  styleInject(css_248z$5);
28126
28401
 
28127
28402
  var NdcActionBody = function (props) {
@@ -28387,7 +28662,7 @@ var NdcActionBody = function (props) {
28387
28662
  React.createElement("div", { className: "icon" }, (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url) ? (monitoringReportPending ? ((companyRolePermission || ministryLevelPermission) && (React.createElement(React.Fragment, null,
28388
28663
  React.createElement(LikeOutlined, { onClick: function () {
28389
28664
  return docAction(monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.id, DocumentStatus.ACCEPTED, monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.actionId, monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.type);
28390
- }, className: "common-progress-icon", style: { color: "#976ED7" } }),
28665
+ }, className: "common-progress-icon", style: { color: "#976ED7", paddingTop: '3px' } }),
28391
28666
  React.createElement(DislikeOutlined, { onClick: function () {
28392
28667
  setRejectDocData({
28393
28668
  id: monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.id,
@@ -28402,8 +28677,8 @@ var NdcActionBody = function (props) {
28402
28677
  icon: React.createElement(DislikeOutlined, null),
28403
28678
  });
28404
28679
  setOpenRejectDocConfirmationModal(true);
28405
- }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70" } })))) : monitoringReportAccepted ? (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })) : (monitoringReportRejected && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
28406
- React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))))) : (React.createElement(React.Fragment, null,
28680
+ }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70", paddingTop: '3px' } })))) : monitoringReportAccepted ? (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380", paddingTop: '3px' } })) : (monitoringReportRejected && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
28681
+ React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70", paddingTop: '3px' } }))))) : (React.createElement(React.Fragment, null,
28407
28682
  React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly
28408
28683
  ? t("programme:notAuthToUploadDoc")
28409
28684
  : uploadDocUserPermission(userInfoState, DocType.MONITORING_REPORT, programmeOwnerId, ministryLevelPermission)
@@ -28434,7 +28709,7 @@ var NdcActionBody = function (props) {
28434
28709
  } }))))),
28435
28710
  (monitoringReportData === null || monitoringReportData === void 0 ? void 0 : monitoringReportData.url) && (React.createElement("div", { className: "report-link" },
28436
28711
  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 },
28437
- React.createElement(BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } })))),
28712
+ React.createElement(BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47", paddingTop: '3px' } })))),
28438
28713
  !monitoringReportAccepted && (React.createElement(React.Fragment, null,
28439
28714
  React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly
28440
28715
  ? t("programme:notAuthToUploadDoc")
@@ -28477,7 +28752,7 @@ var NdcActionBody = function (props) {
28477
28752
  ministryLevelPermission) && (React.createElement(React.Fragment, null,
28478
28753
  React.createElement(LikeOutlined, { onClick: function () {
28479
28754
  return docAction(verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.id, DocumentStatus.ACCEPTED, verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.actionId, verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.type);
28480
- }, className: "common-progress-icon", style: { color: "#976ED7" } }),
28755
+ }, className: "common-progress-icon", style: { color: "#976ED7", paddingTop: '3px' } }),
28481
28756
  React.createElement(DislikeOutlined, { onClick: function () {
28482
28757
  setRejectDocData({
28483
28758
  id: verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.id,
@@ -28492,8 +28767,8 @@ var NdcActionBody = function (props) {
28492
28767
  icon: React.createElement(DislikeOutlined, null),
28493
28768
  });
28494
28769
  setOpenRejectDocConfirmationModal(true);
28495
- }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70" } })))) : verificationReportAccepted ? (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })) : (verifcationReportRejected && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
28496
- React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))))) : (React.createElement(React.Fragment, null,
28770
+ }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70", paddingTop: '3px' } })))) : verificationReportAccepted ? (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380", paddingTop: '3px' } })) : (verifcationReportRejected && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
28771
+ React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70", paddingTop: '3px' } }))))) : (React.createElement(React.Fragment, null,
28497
28772
  React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly
28498
28773
  ? t("programme:notAuthToUploadDoc")
28499
28774
  : uploadDocUserPermission(userInfoState, DocType.VERIFICATION_REPORT, programmeOwnerId, ministryLevelPermission)
@@ -28524,7 +28799,7 @@ var NdcActionBody = function (props) {
28524
28799
  } })))))),
28525
28800
  (verificationReportData === null || verificationReportData === void 0 ? void 0 : verificationReportData.url) && (React.createElement("div", { className: "report-link" },
28526
28801
  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 },
28527
- React.createElement(BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } })))),
28802
+ React.createElement(BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47", paddingTop: '3px' } })))),
28528
28803
  !verificationReportAccepted && monitoringReportAccepted && (React.createElement(React.Fragment, null,
28529
28804
  React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly
28530
28805
  ? t("programme:notAuthToUploadDoc")
@@ -28557,7 +28832,7 @@ var NdcActionBody = function (props) {
28557
28832
  React.createElement(RejectDocumentationConfirmationModel, { actionInfo: actionInfo, onActionConfirmed: handleOk, onActionCanceled: handleCancel, openModal: openRejectDocConfirmationModal, errorMsg: "", loading: loading, translator: translator })));
28558
28833
  };
28559
28834
 
28560
- 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";
28835
+ 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";
28561
28836
  styleInject(css_248z$4);
28562
28837
 
28563
28838
  var ProgrammeDocuments = function (props) {
@@ -28804,7 +29079,7 @@ var ProgrammeDocuments = function (props) {
28804
29079
  (designDocActionPermission || ministryLevelPermission) && (React.createElement(React.Fragment, null,
28805
29080
  React.createElement(LikeOutlined, { onClick: function () {
28806
29081
  return docAction(designDocId, DocumentStatus.ACCEPTED);
28807
- }, className: "common-progress-icon", style: { color: "#976ED7" } }),
29082
+ }, className: "common-progress-icon", style: { color: "#976ED7", paddingTop: "3px" } }),
28808
29083
  React.createElement(DislikeOutlined, { onClick: function () {
28809
29084
  setRejectDocData({ id: designDocId });
28810
29085
  setActionInfo({
@@ -28815,8 +29090,8 @@ var ProgrammeDocuments = function (props) {
28815
29090
  icon: React.createElement(DislikeOutlined, null),
28816
29091
  });
28817
29092
  setOpenRejectDocConfirmationModal(true);
28818
- }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70" } }))),
28819
- designDocStatus === DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
29093
+ }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70", paddingTop: "3px" } }))),
29094
+ designDocStatus === DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380", paddingTop: "3px" } })),
28820
29095
  designDocStatus === DocumentStatus.REJECTED && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
28821
29096
  React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } })))),
28822
29097
  designDocUrl !== "" && (React.createElement("div", { className: "time" },
@@ -28824,15 +29099,23 @@ var ProgrammeDocuments = function (props) {
28824
29099
  " ~ " + designDocversion))),
28825
29100
  React.createElement(Col, { span: 6, className: "field-value" }, designDocUrl !== "" ? (React.createElement("div", { className: "link" },
28826
29101
  linkDocVisible(designDocStatus) && (React.createElement("a", { href: designDocUrl, target: "_blank", rel: "noopener noreferrer", download: true },
28827
- React.createElement(BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))),
29102
+ React.createElement(BookOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } }))),
28828
29103
  designDocStatus !== DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
28829
29104
  React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly ||
28830
29105
  (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.CERTIFIER
28831
29106
  ? t("programme:notAuthToUploadDoc")
28832
29107
  : !uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
28833
29108
  React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission)
28834
- ? { color: "#3F3A47", cursor: "pointer", margin: "0px 0px 2.5px 0px" }
28835
- : { color: "#cacaca", cursor: "default", margin: "0px 0px 2.5px 0px" }, onClick: function () {
29109
+ ? {
29110
+ color: "#3F3A47",
29111
+ cursor: "pointer",
29112
+ margin: "0px 0px 1.5px 0px",
29113
+ }
29114
+ : {
29115
+ color: "#cacaca",
29116
+ cursor: "default",
29117
+ margin: "0px 0px 1.5px 0px",
29118
+ }, onClick: function () {
28836
29119
  return uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && handleDesignDocFileUpload();
28837
29120
  } })),
28838
29121
  React.createElement("input", { type: "file", ref: fileInputRef, style: { display: "none" }, accept: ".xls, .xlsx, .ppt, .pptx, .csv, .doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
@@ -28845,8 +29128,16 @@ var ProgrammeDocuments = function (props) {
28845
29128
  ? t("programme:notAuthToUploadDoc")
28846
29129
  : !uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
28847
29130
  React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission)
28848
- ? { color: "#3F3A47", cursor: "pointer", margin: "0px 0px 2.5px 0px" }
28849
- : { color: "#cacaca", cursor: "default", margin: "0px 0px 2.5px 0px" }, onClick: function () {
29131
+ ? {
29132
+ color: "#3F3A47",
29133
+ cursor: "pointer",
29134
+ margin: "0px 0px 1.5px 0px",
29135
+ }
29136
+ : {
29137
+ color: "#cacaca",
29138
+ cursor: "default",
29139
+ margin: "0px 0px 1.5px 0px",
29140
+ }, onClick: function () {
28850
29141
  return uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && handleDesignDocFileUpload();
28851
29142
  } })),
28852
29143
  React.createElement("input", { type: "file", ref: fileInputRef, style: { display: "none" }, accept: ".xls, .xlsx, .ppt, .pptx, .csv, .doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
@@ -28872,7 +29163,7 @@ var ProgrammeDocuments = function (props) {
28872
29163
  (companyRolePermission || ministryLevelPermission) && (React.createElement(React.Fragment, null,
28873
29164
  React.createElement(LikeOutlined, { onClick: function () {
28874
29165
  return docAction(methDocId, DocumentStatus.ACCEPTED);
28875
- }, className: "common-progress-icon", style: { color: "#976ED7" } }),
29166
+ }, className: "common-progress-icon", style: { color: "#976ED7", paddingTop: "3px" } }),
28876
29167
  React.createElement(DislikeOutlined, { onClick: function () {
28877
29168
  setRejectDocData({ id: methDocId });
28878
29169
  setActionInfo({
@@ -28883,8 +29174,8 @@ var ProgrammeDocuments = function (props) {
28883
29174
  icon: React.createElement(DislikeOutlined, null),
28884
29175
  });
28885
29176
  setOpenRejectDocConfirmationModal(true);
28886
- }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70" } }))),
28887
- methodDocStatus === DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
29177
+ }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70", paddingTop: "3px" } }))),
29178
+ methodDocStatus === DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380", paddingTop: "3px" } })),
28888
29179
  methodDocStatus === DocumentStatus.REJECTED && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
28889
29180
  React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } })))),
28890
29181
  methodologyDocUrl !== "" && (React.createElement("div", { className: "time" },
@@ -28892,15 +29183,22 @@ var ProgrammeDocuments = function (props) {
28892
29183
  " ~ " + methDocversion))),
28893
29184
  React.createElement(Col, { span: 6, className: "field-value" }, methodologyDocUrl !== "" ? (React.createElement("div", { className: "link" },
28894
29185
  linkDocVisible(methodDocStatus) && (React.createElement("a", { href: methodologyDocUrl, target: "_blank", rel: "noopener noreferrer", download: true },
28895
- React.createElement(BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))),
29186
+ React.createElement(BookOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } }))),
28896
29187
  methodDocStatus !== DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
28897
29188
  React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly
28898
29189
  ? t("programme:notAuthToUploadDoc")
28899
29190
  : !uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
28900
29191
  React.createElement(FileAddOutlined, { className: "common-progress-icon", style: designDocStatus === DocumentStatus.ACCEPTED &&
28901
29192
  uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission)
28902
- ? { color: "#3F3A47", cursor: "pointer", margin: "0px 0px 2.5px 0px" }
28903
- : { color: "#cacaca", margin: "0px 0px 2.5px 0px" }, onClick: function () {
29193
+ ? {
29194
+ color: "#3F3A47",
29195
+ cursor: "pointer",
29196
+ margin: "0px 0px 1.5px 0px",
29197
+ }
29198
+ : {
29199
+ color: "#cacaca",
29200
+ margin: "0px 0px 1.5px 0px",
29201
+ }, onClick: function () {
28904
29202
  return designDocStatus === DocumentStatus.ACCEPTED &&
28905
29203
  uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission) &&
28906
29204
  handleMethodologyFileUpload();
@@ -28919,8 +29217,16 @@ var ProgrammeDocuments = function (props) {
28919
29217
  : t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
28920
29218
  React.createElement(FileAddOutlined, { className: "common-progress-icon", style: designDocStatus === DocumentStatus.ACCEPTED &&
28921
29219
  uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission)
28922
- ? { color: "#3F3A47", cursor: "pointer", margin: "0px 0px 2.5px 0px" }
28923
- : { color: "#cacaca", cursor: "default", margin: "0px 0px 2.5px 0px" }, onClick: function () {
29220
+ ? {
29221
+ color: "#3F3A47",
29222
+ cursor: "pointer",
29223
+ margin: "0px 0px 1.5px 0px",
29224
+ }
29225
+ : {
29226
+ color: "#cacaca",
29227
+ cursor: "default",
29228
+ margin: "0px 0px 1.5px 0px",
29229
+ }, onClick: function () {
28924
29230
  return designDocStatus === DocumentStatus.ACCEPTED &&
28925
29231
  uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission) &&
28926
29232
  handleMethodologyFileUpload();
@@ -28949,7 +29255,7 @@ var ProgrammeDocuments = function (props) {
28949
29255
  (ministryLevelPermission || companyRolePermission) && (React.createElement(React.Fragment, null,
28950
29256
  React.createElement(LikeOutlined, { onClick: function () {
28951
29257
  return docAction(impactAssessmentId, DocumentStatus.ACCEPTED);
28952
- }, className: "common-progress-icon", style: { color: "#976ED7" } }),
29258
+ }, className: "common-progress-icon", style: { color: "#976ED7", paddingTop: "3px" } }),
28953
29259
  React.createElement(DislikeOutlined, { onClick: function () {
28954
29260
  setRejectDocData({ id: impactAssessmentId });
28955
29261
  setActionInfo({
@@ -28960,8 +29266,8 @@ var ProgrammeDocuments = function (props) {
28960
29266
  icon: React.createElement(DislikeOutlined, null),
28961
29267
  });
28962
29268
  setOpenRejectDocConfirmationModal(true);
28963
- }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70" } }))),
28964
- impactAssessmentStatus === DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
29269
+ }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70", paddingTop: "3px" } }))),
29270
+ impactAssessmentStatus === DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380", paddingTop: "3px" } })),
28965
29271
  impactAssessmentStatus === DocumentStatus.REJECTED && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
28966
29272
  React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } })))),
28967
29273
  impactAssessmentUrl !== "" && (React.createElement("div", { className: "time" },
@@ -28969,13 +29275,22 @@ var ProgrammeDocuments = function (props) {
28969
29275
  " ~ " + impactAssessmentversion))),
28970
29276
  React.createElement(Col, { span: 6, className: "field-value" }, impactAssessmentUrl !== "" ? (React.createElement("div", { className: "link" },
28971
29277
  linkDocVisible(impactAssessmentStatus) && (React.createElement("a", { href: impactAssessmentUrl, target: "_blank", rel: "noopener noreferrer", download: true },
28972
- React.createElement(BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))),
29278
+ React.createElement("div", null,
29279
+ React.createElement(BookOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } })))),
28973
29280
  impactAssessmentStatus !== DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
28974
29281
  React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: impactAssessmentToolTipTitle, overlayClassName: "custom-tooltip" },
28975
29282
  React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadImpactAssessmentDocUserPermission &&
28976
29283
  !isProjectRejected
28977
- ? { color: "#3F3A47", cursor: "pointer", margin: "0px 0px 2.5px 0px" }
28978
- : { color: "#cacaca", cursor: "default", margin: "0px 0px 2.5px 0px" }, onClick: function () {
29284
+ ? {
29285
+ color: "#3F3A47",
29286
+ cursor: "pointer",
29287
+ margin: "0px 0px 1.5px 0px",
29288
+ }
29289
+ : {
29290
+ color: "#cacaca",
29291
+ cursor: "default",
29292
+ margin: "0px 0px 1.5px 0px",
29293
+ }, onClick: function () {
28979
29294
  return uploadImpactAssessmentDocUserPermission &&
28980
29295
  !isProjectRejected &&
28981
29296
  handleImpactAssessmentFileUpload();
@@ -28988,8 +29303,16 @@ var ProgrammeDocuments = function (props) {
28988
29303
  React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: impactAssessmentToolTipTitle, overlayClassName: "custom-tooltip" },
28989
29304
  React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadImpactAssessmentDocUserPermission &&
28990
29305
  !isProjectRejected
28991
- ? { color: "#3F3A47", cursor: "pointer", margin: "0px 0px 2.5px 0px" }
28992
- : { color: "#cacaca", cursor: "default", margin: "0px 0px 2.5px 0px" }, onClick: function () {
29306
+ ? {
29307
+ color: "#3F3A47",
29308
+ cursor: "pointer",
29309
+ margin: "0px 0px 1.5px 0px",
29310
+ }
29311
+ : {
29312
+ color: "#cacaca",
29313
+ cursor: "default",
29314
+ margin: "0px 0px 1.5px 0px",
29315
+ }, onClick: function () {
28993
29316
  return uploadImpactAssessmentDocUserPermission &&
28994
29317
  !isProjectRejected &&
28995
29318
  handleImpactAssessmentFileUpload();
@@ -33751,5 +34074,5 @@ var GHGDashboardComponent = function (props) {
33751
34074
  React.createElement(Row, { gutter: [40, 40], className: "statics-card-row" }, row.map(function (item, j) { return getWidgetJSX(item); })))); }))));
33752
34075
  };
33753
34076
 
33754
- export { Action, AddNdcActionComponent, AddNewCompanyComponent, AddNewUserComponent, AdminBGColor, AdminColor, BaseEntity, CarbonSystemType, CertBGColor, CertColor, CoBenifitsComponent, Company, CompanyManagementColumns, CompanyManagementComponent, CompanyProfileComponent, CompanyRole, CompanyState, ConfigurationSettingsType, CreditTransferComponent, CreditTransferStage, DevBGColor, DevColor, DocType, DocumentStatus, ESGType, Emission, EmissionGas, EmissionSector, EmissionSubSectors, EnergyGenerationUnits, FormElementType, GHGDashboardComponent, GHGEmissionsComponent, GHGProjectionsComponent, GhgStatCardTypes, GovBGColor, GovColor, ImgWithFallback, InfoView, Instrument, InvestmentBGColor, InvestmentBody, InvestmentColor, InvestmentCreationComponent, InvestmentCreationType, InvestmentLevel, InvestmentManagementComponent, InvestmentStatus, InvestmentStream, InvestmentType, LandAreaUnits, LegendItem, Loading, ManagerBGColor, ManagerColor, MapComponent, MapTypes, MapboxComponent, MinBGColor, MinColor, MitigationSubTypes, MitigationTypes, MrvDashboardComponent, MrvStatsCardsTypes, NdcActionBody, NdcActionManagementComponent, NdcActionStatus, NdcActionTypes, NdcActionViewComponent, NdcDetailsComponent, OrganisationStatus, ProfileIcon, ProgrammeCertify, ProgrammeCreationComponent, ProgrammeDocuments, ProgrammeEntity, ProgrammeIssueForm, ProgrammeManagementColumns, ProgrammeManagementComponent, ProgrammeRetireForm, ProgrammeRevokeForm, ProgrammeStageLegend, ProgrammeStageMRV, ProgrammeStageR, ProgrammeStageUnified, ProgrammeTransfer, ProgrammeTransferForm, Projection, ProjectionTypes$1 as ProjectionTypes, RadioButtonStatus, RadioButtonStatus2, RegistryDashboardComponent, RejectDocumentationConfirmationModel, RetireType, Role, RoleIcon, RootBGColor, RootColor, SdgGoals$1 as SdgGoals, Sector, SectoralScope, StasticCard, StatsCardsTypes, SubTypeOfMitigation, SupportCreationComponent, SupportManagementComponent, SystemNames, TimelineBody, Titles, TooltipColor, TransferActionModel, TxType, TypeOfMitigation, UnitField, User, UserManagementColumns, UserManagementComponent, UserProfileComponent, UserRoleIcon, ViewBGColor, ViewColor, WidgetType, addCommSep, addCommSepRound$1 as addCommSepRound, addNdcDesc, addRoundNumber, addSpaces, consumerGroupList, creditUnit, dateFormat, dateTimeFormat, energyGenerationUnitList, getBase64, getCompanyBgColor, getCreditStageVal, getFinancialFields, getGeneralFields, getInvestmentStatusEnumVal, getNdcActionStatusEnumVal, getNdcStatusTagType, getRetirementTypeString, getStageEnumVal, getStageTagType, getStageTagTypeMRV, getStageTransferEnumVal, getStatusTagType, getTransferStageTagType, getValidNdcActions, isBase64, landAreaUnitList, methodologyOptions, mitigationSubTypeList, mitigationSubTypesListMapped, mitigationTypeList, ndcActionTypeList, sectorMitigationTypesListMapped, sumArray, titleList };
34077
+ export { Action, AddNdcActionComponent, AddNewCompanyComponent, AddNewUserComponent, AdminBGColor, AdminColor, BaseEntity, CarbonSystemType, CertBGColor, CertColor, CoBenifitsComponent, Company, CompanyManagementColumns, CompanyManagementComponent, CompanyProfileComponent, CompanyRole, CompanyState, ConfigurationSettingsType, CreditTransferComponent, CreditTransferStage, DevBGColor, DevColor, DocType, DocumentStatus, ESGType, Emission, EmissionGas, EmissionSector, EmissionSubSectors, EnergyGenerationUnits, FormElementType, GHGDashboardComponent, GHGEmissionsComponent, GHGProjectionsComponent, GhgStatCardTypes, GovBGColor, GovColor, ImgWithFallback, InfoView, Instrument, InvestmentBGColor, InvestmentBody, InvestmentColor, InvestmentCreationComponent, InvestmentCreationType, InvestmentLevel, InvestmentManagementComponent, InvestmentStatus, InvestmentStream, InvestmentType, LandAreaUnits, LegendItem, Loading, ManagerBGColor, ManagerColor, MapComponent, MapTypes, MapboxComponent, MinBGColor, MinColor, MitigationSubTypes, MitigationTypes, MrvDashboardComponent, MrvStatsCardsTypes, NdcActionBody, NdcActionManagementComponent, NdcActionStatus, NdcActionTypes, NdcActionViewComponent, NdcDetailsComponent, OrganisationStatus, ProfileIcon, ProgrammeCertify, ProgrammeCreationComponent, ProgrammeDocuments, ProgrammeEntity, ProgrammeIssueForm, ProgrammeManagementColumns, ProgrammeManagementComponent, ProgrammeRetireForm, ProgrammeRevokeForm, ProgrammeStageLegend, ProgrammeStageMRV, ProgrammeStageR, ProgrammeStageUnified, ProgrammeTransfer, ProgrammeTransferForm, Projection, ProjectionTypes$1 as ProjectionTypes, RadioButtonStatus, RadioButtonStatus2, RegistryDashboardComponent, RejectDocumentationConfirmationModel, RetireType, Role, RoleIcon, RootBGColor, RootColor, SdgGoals$1 as SdgGoals, Sector, SectoralScope, StasticCard, StatsCardsTypes, SubTypeOfMitigation, SupportCreationComponent, SupportManagementComponent, SystemNames, TimelineBody, Titles, TooltipColor, TransferActionModel, TxType, TypeOfMitigation, UnitField, User, UserManagementColumns, UserManagementComponent, UserProfileComponent, UserRoleIcon, ViewBGColor, ViewColor, WidgetType, addCommSep, addCommSepRound$1 as addCommSepRound, addNdcDesc, addRoundNumber, addSpaces, consumerGroupList, creditUnit, dateFormat, dateTimeFormat, energyGenerationUnitList, getBase64, getCompanyBgColor, getCreditStageVal, getFinancialFields, getGeneralFields, getInvestmentStatusEnumVal, getNdcActionStatusEnumVal$1 as getNdcActionStatusEnumVal, getNdcStatusTagType, getRetirementTypeString, getStageEnumVal, getStageTagType, getStageTagTypeMRV, getStageTransferEnumVal, getStatusTagType, getTransferStageTagType, getValidNdcActions, isBase64, landAreaUnitList, methodologyOptions, mitigationSubTypeList, mitigationSubTypesListMapped, mitigationTypeList, ndcActionTypeList, sectorMitigationTypesListMapped, sumArray, titleList };
33755
34078
  //# sourceMappingURL=index.js.map