@undp/carbon-library 1.0.175-CARBON-363.74 → 1.0.175-CARBON-347.3

Sign up to get free protection for your applications and to get access to all the features.
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, LockOutlined, EyeInvisibleOutlined, GlobalOutlined, FlagOutlined, LineChartOutlined, LikeOutlined, DislikeOutlined } 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, EyeInvisibleOutlined, GlobalOutlined, FlagOutlined, LineChartOutlined, LikeOutlined, DislikeOutlined } 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 } from 'antd';
3
- import React, { useState, useEffect, useRef } from 'react';
3
+ import React, { useState, useEffect, useRef, useContext } 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';
@@ -2027,7 +2027,7 @@ var NdcActionStatus;
2027
2027
  NdcActionStatus["PENDING"] = "Pending";
2028
2028
  NdcActionStatus["APPROVED"] = "Approved";
2029
2029
  })(NdcActionStatus || (NdcActionStatus = {}));
2030
- var getNdcActionStatusEnumVal$1 = function (value) {
2030
+ var getNdcActionStatusEnumVal = function (value) {
2031
2031
  var index = Object.keys(NdcActionStatus).indexOf(value);
2032
2032
  if (index < 0) {
2033
2033
  return value;
@@ -2035,7 +2035,7 @@ var getNdcActionStatusEnumVal$1 = function (value) {
2035
2035
  return Object.values(NdcActionStatus)[index];
2036
2036
  };
2037
2037
  var getNdcStatusTagType = function (status) {
2038
- switch (getNdcActionStatusEnumVal$1(status)) {
2038
+ switch (getNdcActionStatusEnumVal(status)) {
2039
2039
  case NdcActionStatus.PENDING:
2040
2040
  return "processing";
2041
2041
  case NdcActionStatus.APPROVED:
@@ -26123,785 +26123,620 @@ var RegistryDashboardComponent = function (props) {
26123
26123
  lastUpdateTransferLocations))))))))) : ("")));
26124
26124
  };
26125
26125
 
26126
- React.createContext(null);
26126
+ var EditableContext = React.createContext(null);
26127
+ var EditableRow = function (_a) {
26128
+ _a.index; var props = __rest(_a, ["index"]);
26129
+ var form = Form.useForm()[0];
26130
+ return (React.createElement(Form, { form: form, component: false },
26131
+ React.createElement(EditableContext.Provider, { value: form },
26132
+ React.createElement("tr", __assign({}, props)))));
26133
+ };
26127
26134
  var EditableCell = function (_a) {
26128
- 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"]);
26129
- var inputNode;
26130
- if (dataIndex === "nationalPlanObjective") {
26131
- inputNode = (React.createElement(Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:nationalPlanObjectivePlaceHolder") }));
26132
- }
26133
- else if (dataIndex === "kpi") {
26134
- inputNode = (React.createElement(InputNumber, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:kpiPlaceHolder") }));
26135
+ 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"]);
26136
+ var _b = useState(false), editing = _b[0], setEditing = _b[1];
26137
+ var inputRef = useRef(null);
26138
+ var form = useContext(EditableContext);
26139
+ useEffect(function () {
26140
+ if (editing) {
26141
+ inputRef.current.focus();
26142
+ }
26143
+ }, [editing]);
26144
+ var toggleEdit = function () {
26145
+ var _a;
26146
+ setEditing(!editing);
26147
+ form.setFieldsValue((_a = {}, _a[dataIndex] = record[dataIndex], _a));
26148
+ };
26149
+ var save = function () { return __awaiter(void 0, void 0, void 0, function () {
26150
+ var values, errInfo_1;
26151
+ return __generator(this, function (_a) {
26152
+ switch (_a.label) {
26153
+ case 0:
26154
+ _a.trys.push([0, 2, , 3]);
26155
+ return [4 /*yield*/, form.validateFields()];
26156
+ case 1:
26157
+ values = _a.sent();
26158
+ toggleEdit();
26159
+ handleSave(__assign(__assign({}, record), values));
26160
+ return [3 /*break*/, 3];
26161
+ case 2:
26162
+ errInfo_1 = _a.sent();
26163
+ console.log("Save failed:", errInfo_1);
26164
+ return [3 /*break*/, 3];
26165
+ case 3: return [2 /*return*/];
26166
+ }
26167
+ });
26168
+ }); };
26169
+ var childNode = children;
26170
+ if (editable) {
26171
+ childNode = editing ? (React.createElement(Form.Item, { style: { margin: 0 }, name: dataIndex, rules: [
26172
+ {
26173
+ required: true,
26174
+ message: "".concat(title, " is required."),
26175
+ },
26176
+ ] },
26177
+ 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));
26135
26178
  }
26136
- return (React.createElement("td", __assign({}, restProps), editing ? (React.createElement(Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [
26137
- {
26138
- required: true,
26139
- message: "".concat(title, " ").concat(t("ndc:isRequired")),
26140
- },
26141
- ] }, inputNode)) : (children)));
26179
+ return React.createElement("td", __assign({}, restProps), childNode);
26142
26180
  };
26143
26181
 
26144
- var css_248z$4 = ".ndc-steps-actions {\n display: flex;\n flex-direction: row-reverse;\n margin-right: 1rem;\n justify-content: center; }\n .ndc-steps-actions .action-btn {\n border: 1px solid #16b1ff;\n color: #16b1ff;\n margin-right: 1rem; }\n .ndc-steps-actions .back-btn {\n border: 1px solid rgba(140, 140, 140, 0.7);\n color: rgba(140, 140, 140, 0.7);\n margin-right: 1rem; }\n .ndc-steps-actions .mg-left-1 {\n margin-left: 1rem; }\n\n.ndc-details .ant-input-number-input-wrap {\n margin-right: 10px; }\n";
26182
+ var css_248z$4 = ".ndc-steps-actions {\n display: flex;\n flex-direction: row-reverse;\n margin-right: 1rem;\n justify-content: center; }\n .ndc-steps-actions .action-btn {\n border: 1px solid #16b1ff;\n color: #16b1ff;\n margin-right: 1rem; }\n .ndc-steps-actions .back-btn {\n border: 1px solid rgba(140, 140, 140, 0.7);\n color: rgba(140, 140, 140, 0.7);\n margin-right: 1rem; }\n .ndc-steps-actions .mg-left-1 {\n margin-left: 1rem; }\n";
26145
26183
  styleInject(css_248z$4);
26146
26184
 
26147
- var NdcDetailsActionType;
26148
- (function (NdcDetailsActionType) {
26149
- NdcDetailsActionType["MainAction"] = "MainAction";
26150
- NdcDetailsActionType["SubAction"] = "SubAction";
26151
- })(NdcDetailsActionType || (NdcDetailsActionType = {}));
26152
- var NdcDetailsActionStatus;
26153
- (function (NdcDetailsActionStatus) {
26154
- NdcDetailsActionStatus["New"] = "New";
26155
- NdcDetailsActionStatus["Pending"] = "Pending";
26156
- NdcDetailsActionStatus["Approved"] = "Approved";
26157
- NdcDetailsActionStatus["Rejected"] = "Rejected";
26158
- })(NdcDetailsActionStatus || (NdcDetailsActionStatus = {}));
26159
- var getNdcActionStatusEnumVal = function (value) {
26160
- var index = Object.keys(NdcDetailsActionStatus).indexOf(value);
26161
- if (index < 0) {
26162
- return value;
26163
- }
26164
- return Object.values(NdcDetailsActionStatus)[index];
26165
- };
26166
- var getNdcActionStatusTagType = function (status) {
26167
- switch (getNdcActionStatusEnumVal(status)) {
26168
- case NdcDetailsActionStatus.Rejected:
26169
- return "error";
26170
- case NdcDetailsActionStatus.Pending:
26171
- return "processing";
26172
- case NdcDetailsActionStatus.Approved:
26173
- return "success";
26174
- default:
26175
- return "default";
26176
- }
26177
- };
26178
-
26185
+ var NdcActionType;
26186
+ (function (NdcActionType) {
26187
+ NdcActionType[NdcActionType["main"] = 0] = "main";
26188
+ NdcActionType[NdcActionType["sub"] = 1] = "sub";
26189
+ })(NdcActionType || (NdcActionType = {}));
26179
26190
  var NdcDetailsComponent = function (props) {
26180
- var t = props.t, useConnection = props.useConnection, useUserContext = props.useUserContext;
26191
+ var t = props.t; props.useConnection; var useUserContext = props.useUserContext;
26181
26192
  var RangePicker = DatePicker.RangePicker;
26182
- var _a = useState([]), ndcActionsList = _a[0], setNdcActionsList = _a[1];
26183
- var _b = useState(false), loading = _b[0], setLoading = _b[1];
26193
+ var _a = useState([]), ndcDetailsData = _a[0], setNdcDetailsData = _a[1];
26194
+ var _b = useState(false), loading = _b[0]; _b[1];
26195
+ var periodItemsRef = useRef([]);
26184
26196
  var _c = useState([]), periodItems = _c[0], setPeriodItems = _c[1];
26185
- var _d = useState({}), selectedPeriod = _d[0], setSelectedPeriod = _d[1];
26186
- var selectedDateRangeRef = useRef({});
26197
+ var _d = useState("add_new"), selectedTab = _d[0], setSelectedTab = _d[1];
26198
+ var selectedPeriod = useRef({});
26199
+ var addedNdcDetailId = useRef(0);
26200
+ var selectedNdcDetail = useRef({});
26187
26201
  var _e = useState(0), tableKey = _e[0], setTableKey = _e[1];
26188
- var _f = useConnection(), get = _f.get, post = _f.post, put = _f.put;
26189
- var _g = useState([]), ministryOrgList = _g[0], setMinistryOrgList = _g[1];
26190
- var _h = useState({}), actionInfo = _h[0], setActionInfo = _h[1];
26191
- var _j = useState(false), openConfirmationModal = _j[0], setOpenConfirmationModal = _j[1];
26192
- var form = Form.useForm()[0];
26193
- var _k = useState(-1), editingKey = _k[0], setEditingKey = _k[1];
26194
- var _l = useState(0), nextAvailableActionId = _l[0], setNextAvailableActionId = _l[1];
26195
- var _m = useState([]), expandedRowKeys = _m[0], setExpandedRowKeys = _m[1];
26196
- var _o = useState([]), subNdcActionsForPeriod = _o[0], setSubNdcActionsForPeriod = _o[1];
26197
- var isEditing = function (record) { return record.id === editingKey; };
26198
26202
  var userInfoState = useUserContext().userInfoState;
26199
- useEffect(function () {
26200
- if (expandedRowKeys && expandedRowKeys.length > 0) {
26201
- var expandedKey = expandedRowKeys[0];
26202
- setNdcSubActionsForMainAction(expandedKey);
26203
- }
26204
- }, ndcActionsList);
26205
- var loginMinistry = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT
26206
- ? process.env.REACT_APP_GOVERNMENT_MINISTRY
26207
- ? process.env.REACT_APP_GOVERNMENT_MINISTRY
26208
- : "Ministry Of Environment"
26209
- : (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY
26210
- ? userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyName
26211
- : undefined;
26212
- var isGovernmentUser = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT &&
26213
- (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly;
26214
- var isMainNdcActionsEditable = !selectedPeriod.finalized &&
26215
- (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT &&
26216
- (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly;
26217
- var isSubNdcActionsEditable = function (record) {
26218
- return (!selectedPeriod.finalized &&
26219
- record.status !== NdcDetailsActionStatus.Approved &&
26220
- ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT ||
26221
- ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY &&
26222
- (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyName) === record.ministryName)) &&
26203
+ var isAddRangeVisible = function () {
26204
+ return (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY ||
26205
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT) &&
26223
26206
  (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly);
26224
26207
  };
26225
- var isNdcActionEditable = function (record) {
26226
- if (record.actionType === NdcDetailsActionType.MainAction) {
26227
- return isMainNdcActionsEditable;
26228
- }
26229
- else if (record.actionType === NdcDetailsActionType.SubAction) {
26230
- return isSubNdcActionsEditable(record);
26231
- }
26232
- };
26233
- var ndcMainDetailsForPeriod = selectedPeriod.key !== "add_new"
26234
- ? ndcActionsList.filter(function (ndcDetail) {
26235
- return (ndcDetail.periodId === parseInt(selectedPeriod.key) &&
26236
- ndcDetail.actionType === NdcDetailsActionType.MainAction);
26237
- })
26238
- : [];
26239
- var setNdcSubActionsForMainAction = function (mainActionId) {
26240
- var subNdcDetails = ndcActionsList.filter(function (ndcDetail) {
26241
- return (ndcDetail.parentActionId === mainActionId &&
26242
- ndcDetail.actionType === NdcDetailsActionType.SubAction);
26243
- });
26244
- var emptySubNdcRow = {
26245
- id: nextAvailableActionId,
26246
- actionType: NdcDetailsActionType.SubAction,
26247
- nationalPlanObjective: "",
26248
- kpi: "",
26249
- ministryName: loginMinistry,
26250
- status: NdcDetailsActionStatus.New,
26251
- parentActionId: mainActionId,
26252
- };
26253
- if (!selectedPeriod.finalized) {
26254
- subNdcDetails = __spreadArray(__spreadArray([], subNdcDetails, true), [emptySubNdcRow], false);
26255
- setEditingKey(nextAvailableActionId);
26256
- setNextAvailableActionId(function (value) { return value + 1; });
26257
- form.setFieldsValue({
26258
- nationalPlanObjective: "",
26259
- kpi: "",
26260
- });
26261
- }
26262
- setSubNdcActionsForPeriod(subNdcDetails);
26208
+ var isAddNdcActionVisible = function () {
26209
+ return ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT &&
26210
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly);
26263
26211
  };
26264
26212
  var inRange = function (num, min, max) {
26265
26213
  return num >= min && num <= max;
26266
26214
  };
26267
- var handleSave = function (row) { return __awaiter(void 0, void 0, void 0, function () {
26268
- var updatedFields, updatedItem, exception_2;
26269
- return __generator(this, function (_a) {
26270
- switch (_a.label) {
26271
- case 0:
26272
- _a.trys.push([0, 9, , 10]);
26273
- updatedFields = void 0;
26274
- _a.label = 1;
26275
- case 1:
26276
- _a.trys.push([1, 3, , 4]);
26277
- return [4 /*yield*/, form.validateFields()];
26278
- case 2:
26279
- updatedFields = (_a.sent());
26280
- return [3 /*break*/, 4];
26281
- case 3:
26282
- _a.sent();
26283
- return [2 /*return*/];
26284
- case 4:
26285
- updatedItem = __assign(__assign({}, row), updatedFields);
26286
- if (!(updatedItem.status === NdcDetailsActionStatus.New)) return [3 /*break*/, 6];
26287
- if (isGovernmentUser &&
26288
- updatedItem.actionType === NdcDetailsActionType.SubAction) {
26289
- updatedItem.status = NdcDetailsActionStatus.Approved;
26215
+ function onAddNewSubNdcDetail() {
26216
+ var range = selectedTab.split('-');
26217
+ var ndcDetail = ndcDetailsData.find(function (item) { return item.key === selectedNdcDetail.current.key; });
26218
+ var ndcDetailItemIndex = ndcDetailsData.findIndex(function (item) { return item.key === selectedNdcDetail.current.key; });
26219
+ if (ndcDetail) {
26220
+ addedNdcDetailId.current = addedNdcDetailId.current + 1;
26221
+ var newData = {
26222
+ key: addedNdcDetailId.current,
26223
+ startDate: new Date("".concat(Number(range[0]), "-01-24 23:12:00")),
26224
+ endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
26225
+ ndcActionId: ndcDetail === null || ndcDetail === void 0 ? void 0 : ndcDetail.key,
26226
+ nationalPlanObj: '',
26227
+ kpi: '',
26228
+ ministry: '',
26229
+ };
26230
+ if (!ndcDetail.subNdcDetails) {
26231
+ ndcDetail.subNdcDetails = [];
26232
+ }
26233
+ ndcDetail.subNdcDetails.push(newData);
26234
+ }
26235
+ ndcDetailsData[ndcDetailItemIndex] = ndcDetail;
26236
+ setNdcDetailsData(ndcDetailsData);
26237
+ setTableKey(function (key) { return key + 1; });
26238
+ }
26239
+ var handleSave = function (row) {
26240
+ setNdcDetailsData(function (prevData) {
26241
+ var newData = JSON.parse(JSON.stringify(prevData));
26242
+ if (row.type === NdcActionType.main) {
26243
+ var index = newData.findIndex(function (item) { return row.key === item.key; });
26244
+ if (index !== -1) {
26245
+ newData[index] = __assign(__assign({}, newData[index]), row);
26246
+ }
26247
+ }
26248
+ else {
26249
+ var parentIndex = newData.findIndex(function (item) { return row.ndcActionId === item.key; });
26250
+ var parentItem = newData[parentIndex];
26251
+ if (parentItem) {
26252
+ if (parentItem.subNdcDetails) {
26253
+ var itemIndex = parentItem.subNdcDetails.findIndex(function (item) { return row.key === item.key; });
26254
+ if (itemIndex === -1) {
26255
+ parentItem.subNdcDetails.push(row);
26256
+ }
26257
+ else {
26258
+ parentItem.subNdcDetails[itemIndex] = __assign({}, row);
26259
+ }
26290
26260
  }
26291
26261
  else {
26292
- updatedItem.status = NdcDetailsActionStatus.Pending;
26262
+ parentItem.subNdcDetails = [row];
26293
26263
  }
26294
- return [4 /*yield*/, post("national/programme/addNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseInt(updatedItem.kpi.toString()) }))];
26295
- case 5:
26296
- _a.sent();
26297
- return [3 /*break*/, 8];
26298
- case 6:
26299
- updatedItem.status = NdcDetailsActionStatus.Pending;
26300
- return [4 /*yield*/, put("national/programme/updateNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseInt(updatedItem.kpi.toString()) }))];
26301
- case 7:
26302
- _a.sent();
26303
- _a.label = 8;
26304
- case 8:
26305
- fetchNdcDetailActions();
26306
- setEditingKey(-1);
26307
- return [3 /*break*/, 10];
26308
- case 9:
26309
- exception_2 = _a.sent();
26310
- setEditingKey(-1);
26311
- message.open({
26312
- type: "error",
26313
- content: exception_2.message,
26314
- duration: 3,
26315
- style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26316
- });
26317
- return [3 /*break*/, 10];
26318
- case 10: return [2 /*return*/];
26264
+ }
26265
+ newData[parentIndex] = __assign({}, parentItem);
26266
+ setTableKey(function (key) { return key + 1; });
26319
26267
  }
26268
+ return newData;
26320
26269
  });
26321
- }); };
26322
- var actionMenu = function (record) {
26323
- if (record.status === NdcDetailsActionStatus.Pending &&
26324
- isGovernmentUser &&
26325
- !selectedPeriod.finalized) {
26326
- return (React.createElement(List, { className: "action-menu", size: "small", dataSource: [
26327
- {
26328
- text: t("ndc:approve"),
26329
- icon: React.createElement(Icon.BoxArrowInDown, null),
26330
- click: function () {
26331
- setActionInfo({
26332
- action: "Approve",
26333
- headerText: t("ndc:actionApproveTitle"),
26334
- type: "primary",
26335
- icon: React.createElement(Icon.BoxArrowInDown, null),
26336
- recordId: record.id,
26337
- });
26338
- setOpenConfirmationModal(true);
26339
- },
26340
- },
26341
- {
26342
- text: t("ndc:reject"),
26343
- icon: React.createElement(Icon.XOctagon, null),
26344
- click: function () {
26345
- setActionInfo({
26346
- action: "Reject",
26347
- headerText: t("ndc:rejectApproveTitle"),
26348
- type: "danger",
26349
- icon: React.createElement(Icon.BoxArrowInDown, null),
26350
- recordId: record.id,
26351
- });
26352
- setOpenConfirmationModal(true);
26353
- },
26354
- },
26355
- ], renderItem: function (item) { return (React.createElement(List.Item, { onClick: item.click },
26356
- React.createElement(Typography.Text, { className: "action-icon color-error" }, item.icon),
26357
- React.createElement("span", null, item.text))); } }));
26270
+ };
26271
+ var getNdcDetailsForPeriod = function () {
26272
+ var range = selectedTab.split("-");
26273
+ if (range.length > 1) {
26274
+ var filteredData = ndcDetailsData.filter(function (item) {
26275
+ return inRange(Number(moment(item.startDate).year()), Number(range[0]), Number(range[1]));
26276
+ });
26277
+ return filteredData;
26278
+ }
26279
+ else {
26280
+ return [];
26281
+ }
26282
+ };
26283
+ var getSubNdcDetails = function (key) {
26284
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
26285
+ var ndcDetail = ndcDetailsData.find(function (item) { return item.key === key; });
26286
+ if (ndcDetail) {
26287
+ 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()) !== '' &&
26288
+ ((_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) &&
26289
+ ((_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()) !==
26290
+ '' &&
26291
+ ((_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) &&
26292
+ 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() !== '' &&
26293
+ 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)) {
26294
+ onAddNewSubNdcDetail();
26295
+ }
26296
+ return ndcDetail.subNdcDetails;
26358
26297
  }
26359
26298
  else {
26360
- return null;
26299
+ return [];
26361
26300
  }
26362
26301
  };
26363
26302
  var defaultColumns = [
26364
26303
  {
26365
26304
  title: t("ndc:ndcColumnsNationalPlanObj"),
26366
- dataIndex: "nationalPlanObjective",
26367
- key: "nationalPlanObjective",
26305
+ dataIndex: "nationalPlanObj",
26306
+ key: "nationalPlanObj",
26368
26307
  align: "left",
26369
- width: 400,
26370
26308
  editable: true,
26371
- render: function (_, record) { return (React.createElement(Space, { size: "middle" }, record.nationalPlanObjective ? (React.createElement("span", null, record.nationalPlanObjective)) : (React.createElement(Input, { placeholder: "Enter National Plan Objective" })))); },
26309
+ width: "50%",
26310
+ render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(Space, { size: "middle" },
26311
+ React.createElement("span", null, record.nationalPlanObj))) : (React.createElement("input", { placeholder: "Please add the National Plan Objective", className: "ant-input", type: "text" })))); },
26372
26312
  },
26373
26313
  {
26374
26314
  title: t("ndc:ndcColumnsKpi"),
26375
26315
  dataIndex: "kpi",
26376
26316
  key: "kpi",
26377
26317
  align: "left",
26378
- width: 100,
26379
26318
  editable: true,
26380
- render: function (_, record) { return (React.createElement(Space, { size: "middle" }, record.kpi ? (React.createElement("span", null, record.kpi)) : (React.createElement(Input, { placeholder: "Enter Kpi" })))); },
26319
+ width: "10%",
26320
+ render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(Space, { size: "middle" },
26321
+ React.createElement("span", null, record.kpi))) : (React.createElement("input", { placeholder: "Enter Kpi", className: "ant-input", type: "text" })))); },
26381
26322
  },
26382
26323
  {
26383
- title: t("ndc:ndcColumnsMinistry"),
26384
- dataIndex: "ministryName",
26385
- key: "ministryName",
26324
+ title: "Ministry",
26325
+ dataIndex: "ministry",
26326
+ key: "ministry",
26386
26327
  align: "left",
26387
- width: 300,
26388
- editable: false,
26389
- render: function (_, record) { return (React.createElement(React.Fragment, null,
26390
- React.createElement(Select, { disabled: !(isSubNdcActionsEditable(record) && isEditing(record)), defaultValue: record.ministryName ? record.ministryName : loginMinistry, style: { width: 220 }, onChange: function (value, option) {
26391
- record.ministryName = option.label;
26392
- handleSave(record);
26393
- }, options: ministryOrgList }))); },
26394
- },
26395
- {
26396
- title: t("ndc:ndcColumnsStatus"),
26397
- dataIndex: "status",
26398
- key: "status",
26399
- align: "left",
26400
- width: 200,
26401
- editable: false,
26402
- render: function (_, record) {
26403
- var menu = actionMenu(record);
26404
- return (React.createElement("div", { onClick: function (event) { return event.stopPropagation(); } },
26405
- record.actionType === NdcDetailsActionType.SubAction &&
26406
- record.status !== NdcDetailsActionStatus.New ? (React.createElement(Tooltip, { title: record.status, color: TooltipColor, key: TooltipColor },
26407
- React.createElement(Tag, { className: "clickable", color: getNdcActionStatusTagType(record.status) }, addSpaces(record.status)))) : (""),
26408
- record.actionType === NdcDetailsActionType.SubAction && menu ? (React.createElement(Popover, { placement: "bottomRight", content: menu, trigger: "click" },
26409
- React.createElement(EllipsisOutlined, { rotate: 90, style: {
26410
- fontWeight: 600,
26411
- fontSize: "1rem",
26412
- cursor: "pointer",
26413
- } }))) : (React.createElement("span", null))));
26414
- },
26328
+ editable: true,
26329
+ width: "40%",
26330
+ render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(Space, { size: "middle" },
26331
+ React.createElement("span", null, record.ministry))) : (React.createElement("input", { placeholder: "Please add the Ministry name", className: "ant-input", type: "text" })))); },
26415
26332
  },
26416
26333
  ];
26417
26334
  var columns = defaultColumns.map(function (col) {
26418
26335
  if (!col.editable) {
26419
26336
  return col;
26420
26337
  }
26421
- return __assign(__assign({}, col), { onCell: function (record) {
26422
- return {
26423
- record: record,
26424
- editing: isEditing(record),
26425
- dataIndex: col.dataIndex,
26426
- title: col.title,
26427
- onBlurHandler: function (record) {
26428
- if (isEditing(record)) {
26429
- handleSave(record);
26430
- }
26431
- },
26432
- t: t,
26433
- };
26434
- } });
26338
+ return __assign(__assign({}, col), { onCell: function (record) { return ({
26339
+ record: record,
26340
+ editable: col.editable,
26341
+ dataIndex: col.dataIndex,
26342
+ title: col.title,
26343
+ handleSave: handleSave,
26344
+ }); } });
26435
26345
  });
26436
- function onClickedAddNewNdcDetail() {
26437
- return __awaiter(this, void 0, void 0, function () {
26438
- var periodId, newData_1;
26439
- return __generator(this, function (_a) {
26440
- if (selectedPeriod.key !== "add_new") {
26441
- form.setFieldsValue({
26442
- nationalPlanObjective: "",
26443
- kpi: "",
26444
- });
26445
- periodId = parseInt(selectedPeriod.key);
26446
- newData_1 = {
26447
- id: nextAvailableActionId,
26448
- actionType: NdcDetailsActionType.MainAction,
26449
- nationalPlanObjective: "",
26450
- kpi: "",
26451
- ministryName: loginMinistry,
26452
- periodId: periodId,
26453
- status: NdcDetailsActionStatus.New,
26454
- };
26455
- setEditingKey(nextAvailableActionId);
26456
- setNextAvailableActionId(function (value) { return value + 1; });
26457
- setNdcActionsList(function (ndcActionsList) { return __spreadArray(__spreadArray([], ndcActionsList, true), [
26458
- newData_1,
26459
- ], false); });
26460
- setTableKey(function (key) { return key + 1; });
26461
- }
26462
- return [2 /*return*/];
26463
- });
26464
- });
26346
+ function onAddNewNdcDetail() {
26347
+ var range = selectedTab.split("-");
26348
+ var ndcActionId = ++addedNdcDetailId.current;
26349
+ var newData = {
26350
+ key: ndcActionId,
26351
+ type: NdcActionType.main,
26352
+ startDate: new Date("".concat(Number(range[0]), "-01-24 23:12:00")),
26353
+ endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
26354
+ nationalPlanObj: "",
26355
+ kpi: "",
26356
+ ministry: "",
26357
+ subNdcDetails: [
26358
+ {
26359
+ key: ++addedNdcDetailId.current,
26360
+ ndcActionId: ndcActionId,
26361
+ type: NdcActionType.sub,
26362
+ startDate: new Date("2019-03-25"),
26363
+ endDate: new Date("2020-03-25"),
26364
+ nationalPlanObj: "",
26365
+ kpi: "",
26366
+ ministry: "",
26367
+ },
26368
+ ],
26369
+ };
26370
+ setNdcDetailsData(__spreadArray(__spreadArray([], ndcDetailsData, true), [newData], false));
26465
26371
  }
26466
26372
  var components = {
26467
26373
  body: {
26374
+ row: EditableRow,
26468
26375
  cell: EditableCell,
26469
26376
  },
26470
26377
  };
26471
- var onClickedDeletePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
26472
- return __generator(this, function (_a) {
26473
- setActionInfo({
26474
- action: "Delete",
26475
- headerText: t("ndc:periodDeleteConfirmTitle"),
26476
- type: "danger",
26477
- icon: React.createElement(Icon.XCircle, null),
26478
- recordId: selectedPeriod.key,
26378
+ //commented because rendering issue
26379
+ function ndcDetailsTableContent() {
26380
+ return (React.createElement("div", null)
26381
+ // <div>
26382
+ // <Button
26383
+ // onClick={onAddNewNdcDetail}
26384
+ // type="primary"
26385
+ // style={{
26386
+ // marginBottom: 16,
26387
+ // }}
26388
+ // >
26389
+ // Add a row
26390
+ // </Button>
26391
+ // <Table
26392
+ // components={components}
26393
+ // rowClassName={() => 'editable-row'}
26394
+ // bordered
26395
+ // dataSource={ndcDetailsData}
26396
+ // columns={columns}
26397
+ // />
26398
+ // </div>
26399
+ );
26400
+ }
26401
+ var onCancelPeriod = function () { };
26402
+ var onAddNewPeriod = function () {
26403
+ if (selectedPeriod && selectedPeriod.current) {
26404
+ var newPeriodItem_1 = {
26405
+ key: "".concat(selectedPeriod.current.start, "-").concat(selectedPeriod.current.end),
26406
+ label: "".concat(selectedPeriod.current.start, "-").concat(selectedPeriod.current.end),
26407
+ start: selectedPeriod.current.start,
26408
+ end: selectedPeriod.current.end,
26409
+ children: ndcDetailsTableContent(),
26410
+ };
26411
+ var existingIndex = periodItemsRef.current.findIndex(function (item) {
26412
+ return inRange(newPeriodItem_1.start, item.start, item.end) ||
26413
+ inRange(newPeriodItem_1.end, item.start, item.end);
26479
26414
  });
26480
- setOpenConfirmationModal(true);
26481
- return [2 /*return*/];
26482
- });
26483
- }); };
26484
- var onClickedFinalizePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
26485
- var pendingActions;
26486
- return __generator(this, function (_a) {
26487
- if (subNdcActionsForPeriod.length === 0) {
26488
- message.open({
26489
- type: "error",
26490
- content: t("ndc:finalizeNdcEmptyErrorText"),
26491
- duration: 3,
26492
- style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26493
- });
26494
- return [2 /*return*/];
26415
+ if (existingIndex === -1) {
26416
+ setPeriodItems(function (items) { return __spreadArray(__spreadArray([], items, true), [newPeriodItem_1], false); });
26417
+ periodItemsRef.current = __spreadArray(__spreadArray([], periodItemsRef.current, true), [newPeriodItem_1], false);
26495
26418
  }
26496
- pendingActions = subNdcActionsForPeriod.filter(function (action) {
26497
- return action.status === NdcDetailsActionStatus.Pending;
26498
- });
26499
- if (pendingActions && pendingActions.length > 0) {
26419
+ else {
26500
26420
  message.open({
26501
26421
  type: "error",
26502
- content: t("ndc:finalizeErrorText"),
26422
+ content: t("ndc:rangeAlreadyExists"),
26503
26423
  duration: 3,
26504
26424
  style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26505
26425
  });
26506
26426
  }
26507
- else {
26508
- setActionInfo({
26509
- action: "Finalize",
26510
- headerText: t("ndc:finalizeApproveTitle"),
26511
- text: t("ndc:finalizeApproveSubTitle"),
26512
- type: "primary",
26513
- icon: React.createElement(Icon.Clipboard2Check, null),
26514
- recordId: selectedPeriod.key,
26515
- });
26516
- setOpenConfirmationModal(true);
26517
- }
26518
- return [2 /*return*/];
26519
- });
26520
- }); };
26521
- var onMainTableRowExpand = function (expanded, record) {
26522
- var keys = [];
26523
- if (expanded) {
26524
- keys.push(record.id);
26525
26427
  }
26526
- setExpandedRowKeys(keys);
26527
- setNdcSubActionsForMainAction(record.id);
26528
26428
  };
26529
- function addNewPeriodContent() {
26530
- return (React.createElement("div", null,
26531
- React.createElement(Row, { justify: "start", align: "middle", gutter: [16, 16] },
26532
- React.createElement(Col, { flex: "340px" },
26533
- React.createElement(RangePicker, { onChange: onDateRangeChanged, picker: "year" })),
26534
- React.createElement(Col, { flex: "auto" },
26535
- React.createElement(Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit"))))));
26536
- }
26537
- function mainNdcActionTableContent() {
26538
- return (React.createElement("div", null,
26539
- React.createElement(Row, null,
26540
- React.createElement(Col, { span: 24 },
26541
- React.createElement(Form, { form: form, component: false },
26542
- React.createElement(Table, { tableLayout: "fixed", key: tableKey, rowKey: "id", components: components, rowClassName: function () { return "editable-row"; }, bordered: true, loading: loading, dataSource: ndcMainDetailsForPeriod, columns: columns, expandedRowKeys: expandedRowKeys, onExpand: onMainTableRowExpand, expandable: {
26543
- expandedRowRender: function (record) {
26544
- return subNdcActionTableContent();
26545
- },
26546
- columnWidth: 40,
26547
- }, onRow: function (record, rowIndex) {
26548
- return {
26549
- onClick: function (event) {
26550
- if (record.id &&
26551
- isNdcActionEditable(record) &&
26552
- !isEditing(record)) {
26553
- form.setFieldsValue(__assign({}, record));
26554
- setEditingKey(record.id);
26555
- }
26556
- },
26557
- onMouseLeave: function () {
26558
- if (isEditing(record)) {
26559
- handleSave(record);
26560
- }
26561
- },
26562
- };
26563
- }, footer: function () {
26564
- return isGovernmentUser &&
26565
- !selectedPeriod.finalized && (React.createElement(Row, { justify: "center" },
26566
- React.createElement(Button, { onClick: onClickedAddNewNdcDetail, type: "default", style: {
26567
- marginBottom: 16,
26568
- width: "100%",
26569
- } }, t("ndc:addNdcAction"))));
26570
- } })))),
26571
- isGovernmentUser && !selectedPeriod.finalized ? (React.createElement(Row, { justify: "end" },
26572
- React.createElement(Button, { className: "mg-left-1", type: "primary", onClick: onClickedDeletePeriod, htmlType: "submit", loading: loading }, t("ndc:delete")),
26573
- React.createElement(Button, { className: "mg-left-1", type: "primary", onClick: onClickedFinalizePeriod, htmlType: "submit", loading: loading }, t("ndc:finalize")))) : ("")));
26574
- }
26575
- function subNdcActionTableContent(record) {
26576
- return (React.createElement(Table, { tableLayout: "fixed", rowKey: "id", components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: subNdcActionsForPeriod, loading: loading, onRow: function (record, rowIndex) {
26577
- return {
26578
- onClick: function (event) {
26579
- if (record.id &&
26580
- isNdcActionEditable(record) &&
26581
- !isEditing(record)) {
26582
- form.setFieldsValue(__assign({}, record));
26583
- setEditingKey(record.id);
26584
- }
26585
- },
26586
- onMouseLeave: function () {
26587
- if (isEditing(record)) {
26588
- handleSave(record);
26589
- }
26590
- },
26591
- };
26592
- }, columns: columns, showHeader: false, pagination: false }));
26593
- }
26594
- var onAddNewPeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
26595
- var periodItem_1, existingIndex, response, addedPeriodItem, updatedPeriodItem_1, exception_3;
26596
- return __generator(this, function (_a) {
26597
- switch (_a.label) {
26598
- case 0:
26599
- _a.trys.push([0, 4, , 5]);
26600
- if (!(selectedDateRangeRef && selectedDateRangeRef.current)) return [3 /*break*/, 3];
26601
- periodItem_1 = {
26602
- startYear: selectedDateRangeRef.current.startYear,
26603
- endYear: selectedDateRangeRef.current.endYear,
26604
- finalized: false,
26605
- };
26606
- existingIndex = periodItems.findIndex(function (item) {
26607
- return inRange(periodItem_1.startYear, item.startYear, item.endYear) ||
26608
- inRange(periodItem_1.endYear, item.startYear, item.endYear);
26609
- });
26610
- if (!(existingIndex === -1)) return [3 /*break*/, 2];
26611
- return [4 /*yield*/, post("national/programme/addNdcDetailsPeriod", __assign({}, periodItem_1))];
26612
- case 1:
26613
- response = _a.sent();
26614
- if (response && response.data) {
26615
- addedPeriodItem = response.data;
26616
- updatedPeriodItem_1 = __assign(__assign({}, addedPeriodItem), { key: addedPeriodItem.id, label: "".concat(addedPeriodItem.startYear, "-").concat(addedPeriodItem.endYear) });
26617
- setPeriodItems(function (items) { return __spreadArray(__spreadArray([], items, true), [updatedPeriodItem_1], false); });
26618
- setSelectedPeriod(updatedPeriodItem_1);
26619
- }
26620
- return [3 /*break*/, 3];
26621
- case 2:
26622
- message.open({
26623
- type: "error",
26624
- content: t("ndc:rangeAlreadyExists"),
26625
- duration: 3,
26626
- style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26627
- });
26628
- _a.label = 3;
26629
- case 3: return [3 /*break*/, 5];
26630
- case 4:
26631
- exception_3 = _a.sent();
26632
- message.open({
26633
- type: "error",
26634
- content: exception_3.message,
26635
- duration: 3,
26636
- style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26637
- });
26638
- return [3 /*break*/, 5];
26639
- case 5: return [2 /*return*/];
26640
- }
26641
- });
26642
- }); };
26429
+ useEffect(function () {
26430
+ if (periodItems && periodItems.length > 3) {
26431
+ setSelectedTab(periodItems[periodItems.length - 1].key);
26432
+ }
26433
+ }, [periodItems]);
26643
26434
  var onDateRangeChanged = function (range) {
26644
26435
  var period = {
26645
- startYear: Number(moment(range[0]).year()),
26646
- endYear: Number(moment(range[1]).year()),
26436
+ start: Number(moment(range[0]).year()),
26437
+ end: Number(moment(range[1]).year()),
26647
26438
  };
26648
- selectedDateRangeRef.current = period;
26439
+ selectedPeriod.current = period;
26649
26440
  };
26441
+ function addNewPeriodContent() {
26442
+ return (React.createElement("div", null,
26443
+ React.createElement(Row, null,
26444
+ React.createElement(RangePicker, { onChange: onDateRangeChanged, picker: "year" })),
26445
+ React.createElement(Row, { className: "mg-top-1" },
26446
+ React.createElement("div", { className: "ndc-steps-actions" },
26447
+ React.createElement(Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit")),
26448
+ React.createElement(Button, { className: "back-btn", onClick: onCancelPeriod, loading: loading }, t("ndc:back"))))));
26449
+ }
26450
+ function getSubNdcActionContent(record) {
26451
+ selectedNdcDetail.current = record;
26452
+ return (React.createElement(Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getSubNdcDetails(record.key), columns: columns, showHeader: false, pagination: false }));
26453
+ }
26650
26454
  var onTabChange = function (key) {
26651
- var selectedPeriod = periodItems.find(function (item) { return item.key === key; });
26652
- if (selectedPeriod) {
26653
- setSelectedPeriod(selectedPeriod);
26654
- }
26655
- };
26656
- var onActionConfirmed = function () { return __awaiter(void 0, void 0, void 0, function () {
26657
- var actionResponse, exception_4;
26658
- return __generator(this, function (_a) {
26659
- switch (_a.label) {
26660
- case 0:
26661
- setLoading(true);
26662
- _a.label = 1;
26663
- case 1:
26664
- _a.trys.push([1, 10, , 11]);
26665
- if (!(actionInfo.action === "Approve")) return [3 /*break*/, 3];
26666
- return [4 /*yield*/, post("national/programme/approveNdcDetailsAction", {
26667
- id: actionInfo.recordId,
26668
- })];
26669
- case 2:
26670
- actionResponse = _a.sent();
26671
- return [3 /*break*/, 9];
26672
- case 3:
26673
- if (!(actionInfo.action === "Reject")) return [3 /*break*/, 5];
26674
- return [4 /*yield*/, post("national/programme/rejectNdcDetailsAction", {
26675
- id: actionInfo.recordId,
26676
- })];
26677
- case 4:
26678
- actionResponse = _a.sent();
26679
- return [3 /*break*/, 9];
26680
- case 5:
26681
- if (!(actionInfo.action === "Finalize")) return [3 /*break*/, 7];
26682
- return [4 /*yield*/, post("national/programme/finalizeNdcDetailsPeriod", {
26683
- id: selectedPeriod.key,
26684
- })];
26685
- case 6:
26686
- actionResponse = _a.sent();
26687
- return [3 /*break*/, 9];
26688
- case 7:
26689
- if (!(actionInfo.action === "Delete")) return [3 /*break*/, 9];
26690
- return [4 /*yield*/, post("national/programme/deleteNdcDetailsPeriod", {
26691
- id: selectedPeriod.key,
26692
- })];
26693
- case 8:
26694
- actionResponse = _a.sent();
26695
- _a.label = 9;
26696
- case 9: return [3 /*break*/, 11];
26697
- case 10:
26698
- exception_4 = _a.sent();
26699
- message.open({
26700
- type: "error",
26701
- content: exception_4.message,
26702
- duration: 3,
26703
- style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26704
- });
26705
- return [3 /*break*/, 11];
26706
- case 11:
26707
- if (actionResponse) {
26708
- if (actionInfo.action === "Delete") {
26709
- message.open({
26710
- type: "success",
26711
- content: t("ndc:deletePeriodSuccessMsg"),
26712
- duration: 3,
26713
- style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26714
- });
26715
- fetchNdcDetailPeriods();
26716
- }
26717
- else if (actionInfo.action === "Finalize") {
26718
- message.open({
26719
- type: "success",
26720
- content: t("ndc:finalizeSuccessMsg"),
26721
- duration: 3,
26722
- style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26723
- });
26724
- fetchNdcDetailPeriods();
26725
- }
26726
- else if (actionInfo.action === "Approve") {
26727
- message.open({
26728
- type: "success",
26729
- content: t("ndc:approveSuccessMsg"),
26730
- duration: 3,
26731
- style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26732
- });
26733
- fetchNdcDetailActions();
26734
- }
26735
- else if (actionInfo.action === "Reject") {
26736
- message.open({
26737
- type: "success",
26738
- content: t("ndc:rejectSuccessMsg"),
26739
- duration: 3,
26740
- style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26741
- });
26742
- fetchNdcDetailActions();
26743
- }
26744
- }
26745
- setOpenConfirmationModal(false);
26746
- setLoading(false);
26747
- return [2 /*return*/];
26748
- }
26749
- });
26750
- }); };
26751
- var onActionCanceled = function () {
26752
- setOpenConfirmationModal(false);
26455
+ setSelectedTab(key);
26753
26456
  };
26754
- var fetchNdcDetailPeriods = function () { return __awaiter(void 0, void 0, void 0, function () {
26755
- var periods, addNewTab, response, exception_5;
26756
- return __generator(this, function (_a) {
26757
- switch (_a.label) {
26758
- case 0:
26759
- setLoading(true);
26760
- _a.label = 1;
26761
- case 1:
26762
- _a.trys.push([1, 3, 4, 5]);
26763
- periods = [];
26764
- addNewTab = {
26765
- key: "add_new",
26766
- label: "Add New",
26767
- startYear: 0,
26768
- endYear: 0,
26769
- finalized: false,
26770
- deleted: false,
26771
- };
26772
- return [4 /*yield*/, get("national/programme/queryNdcDetailsPeriod")];
26773
- case 2:
26774
- response = _a.sent();
26775
- if (response && response.data) {
26776
- periods = response.data.map(function (period) {
26777
- return __assign(__assign({}, period), { key: period.id, label: period.finalized ? (React.createElement("span", null,
26778
- React.createElement(LockOutlined, null),
26779
- " ",
26780
- period.startYear,
26781
- "-",
26782
- period.endYear,
26783
- " ")) : ("".concat(period.startYear, "-").concat(period.endYear)) });
26784
- });
26785
- }
26786
- if (isGovernmentUser) {
26787
- periods.unshift(addNewTab);
26788
- }
26789
- setPeriodItems(periods);
26790
- if (isGovernmentUser) {
26791
- setSelectedPeriod(addNewTab);
26792
- }
26793
- else {
26794
- setSelectedPeriod(periods[0]);
26795
- }
26796
- setLoading(false);
26797
- return [3 /*break*/, 5];
26798
- case 3:
26799
- exception_5 = _a.sent();
26800
- message.open({
26801
- type: "error",
26802
- content: exception_5.message,
26803
- duration: 3,
26804
- style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26805
- });
26806
- return [3 /*break*/, 5];
26807
- case 4:
26808
- setLoading(false);
26809
- return [7 /*endfinally*/];
26810
- case 5: return [2 /*return*/];
26811
- }
26812
- });
26813
- }); };
26814
- var fetchNdcDetailActions = function () { return __awaiter(void 0, void 0, void 0, function () {
26815
- var response, maxActionId, exception_6;
26816
- return __generator(this, function (_a) {
26817
- switch (_a.label) {
26818
- case 0:
26819
- setLoading(true);
26820
- _a.label = 1;
26821
- case 1:
26822
- _a.trys.push([1, 3, 4, 5]);
26823
- return [4 /*yield*/, get("national/programme/queryNdcDetailsAction")];
26824
- case 2:
26825
- response = _a.sent();
26826
- if (response && response.data) {
26827
- maxActionId = Math.max.apply(Math, response.data.map(function (item) { return item.id; }));
26828
- setNextAvailableActionId(maxActionId + 1);
26829
- setNdcActionsList(response.data);
26830
- }
26831
- setLoading(false);
26832
- return [3 /*break*/, 5];
26833
- case 3:
26834
- exception_6 = _a.sent();
26835
- message.open({
26836
- type: "error",
26837
- content: exception_6.message,
26838
- duration: 3,
26839
- style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26840
- });
26841
- return [3 /*break*/, 5];
26842
- case 4:
26843
- setLoading(false);
26844
- return [7 /*endfinally*/];
26845
- case 5: return [2 /*return*/];
26846
- }
26847
- });
26848
- }); };
26849
- var fetchMinistries = function () { return __awaiter(void 0, void 0, void 0, function () {
26850
- var response, ministryOrgDetails, exception_7;
26851
- return __generator(this, function (_a) {
26852
- switch (_a.label) {
26853
- case 0:
26854
- setLoading(true);
26855
- _a.label = 1;
26856
- case 1:
26857
- _a.trys.push([1, 3, 4, 5]);
26858
- return [4 /*yield*/, get("national/organisation/getMinistries")];
26859
- case 2:
26860
- response = _a.sent();
26861
- if (response && response.data) {
26862
- ministryOrgDetails = response.data.map(function (value) {
26863
- return {
26864
- value: value.company_companyId,
26865
- label: value.company_name,
26866
- };
26867
- });
26868
- setMinistryOrgList(ministryOrgDetails);
26869
- }
26870
- setLoading(false);
26871
- return [3 /*break*/, 5];
26872
- case 3:
26873
- exception_7 = _a.sent();
26874
- message.open({
26875
- type: "error",
26876
- content: exception_7.message,
26877
- duration: 3,
26878
- style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26879
- });
26880
- return [3 /*break*/, 5];
26881
- case 4:
26882
- setLoading(false);
26883
- return [7 /*endfinally*/];
26884
- case 5: return [2 /*return*/];
26885
- }
26886
- });
26887
- }); };
26888
26457
  useEffect(function () {
26889
- fetchNdcDetailPeriods();
26890
- fetchNdcDetailActions();
26891
- fetchMinistries();
26458
+ var defaultNdcDetails = [
26459
+ {
26460
+ key: 1,
26461
+ type: NdcActionType.main,
26462
+ startDate: new Date("2019-03-25"),
26463
+ endDate: new Date("2020-03-25"),
26464
+ nationalPlanObj: "Enhance value addition in key growth opportunities",
26465
+ kpi: 25,
26466
+ ministry: "Ministry of Environment",
26467
+ subNdcDetails: [
26468
+ {
26469
+ key: 6,
26470
+ ndcActionId: 1,
26471
+ type: NdcActionType.sub,
26472
+ startDate: new Date("2019-03-25"),
26473
+ endDate: new Date("2020-03-25"),
26474
+ nationalPlanObj: "Enhance value addition in key growth opportunities sub details",
26475
+ kpi: 25,
26476
+ ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
26477
+ },
26478
+ {
26479
+ key: 7,
26480
+ ndcActionId: 1,
26481
+ type: NdcActionType.sub,
26482
+ startDate: new Date("2019-03-25"),
26483
+ endDate: new Date("2020-03-25"),
26484
+ nationalPlanObj: "",
26485
+ kpi: "",
26486
+ ministry: "",
26487
+ },
26488
+ ],
26489
+ },
26490
+ {
26491
+ key: 2,
26492
+ type: NdcActionType.main,
26493
+ startDate: new Date("2019-03-25"),
26494
+ endDate: new Date("2019-08-25"),
26495
+ nationalPlanObj: "Strengthen the private sector to create 10,000 jobs",
26496
+ kpi: 10500,
26497
+ ministry: "Ministry of Environment",
26498
+ subNdcDetails: [
26499
+ {
26500
+ key: 8,
26501
+ ndcActionId: 2,
26502
+ type: NdcActionType.sub,
26503
+ startDate: new Date("2019-03-25"),
26504
+ endDate: new Date("2020-03-25"),
26505
+ nationalPlanObj: "",
26506
+ kpi: "",
26507
+ ministry: "",
26508
+ },
26509
+ ],
26510
+ },
26511
+ {
26512
+ key: 12,
26513
+ type: NdcActionType.main,
26514
+ startDate: new Date("2019-03-25"),
26515
+ endDate: new Date("2019-08-25"),
26516
+ nationalPlanObj: "Other",
26517
+ kpi: 10500,
26518
+ ministry: "Ministry of Environment",
26519
+ subNdcDetails: [
26520
+ {
26521
+ key: 8,
26522
+ ndcActionId: 12,
26523
+ type: NdcActionType.sub,
26524
+ startDate: new Date("2019-03-25"),
26525
+ endDate: new Date("2020-03-25"),
26526
+ nationalPlanObj: "",
26527
+ kpi: "",
26528
+ ministry: "",
26529
+ },
26530
+ ],
26531
+ },
26532
+ {
26533
+ key: 3,
26534
+ type: NdcActionType.main,
26535
+ startDate: new Date("2021-03-25"),
26536
+ endDate: new Date("2022-03-25"),
26537
+ nationalPlanObj: "Consolidate and increase the stock and quality of productive infrastructure by 50%",
26538
+ kpi: 48,
26539
+ ministry: "Ministry of Environment",
26540
+ subNdcDetails: [
26541
+ {
26542
+ key: 9,
26543
+ ndcActionId: 3,
26544
+ type: NdcActionType.sub,
26545
+ startDate: new Date("2019-03-25"),
26546
+ endDate: new Date("2020-03-25"),
26547
+ nationalPlanObj: "",
26548
+ kpi: "",
26549
+ ministry: "",
26550
+ },
26551
+ ],
26552
+ },
26553
+ {
26554
+ key: 4,
26555
+ type: NdcActionType.main,
26556
+ startDate: new Date("2022-03-25"),
26557
+ endDate: new Date("2022-05-25"),
26558
+ nationalPlanObj: "Enhance the productivity and social wellbeing of the population",
26559
+ kpi: 20,
26560
+ ministry: "Ministry of Environment",
26561
+ subNdcDetails: [
26562
+ {
26563
+ key: 10,
26564
+ ndcActionId: 4,
26565
+ type: NdcActionType.sub,
26566
+ startDate: new Date("2019-03-25"),
26567
+ endDate: new Date("2020-03-25"),
26568
+ nationalPlanObj: "",
26569
+ kpi: "",
26570
+ ministry: "",
26571
+ },
26572
+ ],
26573
+ },
26574
+ {
26575
+ key: 5,
26576
+ type: NdcActionType.main,
26577
+ startDate: new Date("2022-03-25"),
26578
+ endDate: new Date("2023-03-25"),
26579
+ nationalPlanObj: "Strengthen the role of the state in guiding and facilitating development",
26580
+ kpi: 10,
26581
+ ministry: "Ministry of Environment",
26582
+ subNdcDetails: [
26583
+ {
26584
+ key: 11,
26585
+ ndcActionId: 5,
26586
+ type: NdcActionType.sub,
26587
+ startDate: new Date("2019-03-25"),
26588
+ endDate: new Date("2020-03-25"),
26589
+ nationalPlanObj: "",
26590
+ kpi: "",
26591
+ ministry: "",
26592
+ },
26593
+ ],
26594
+ },
26595
+ {
26596
+ key: 13,
26597
+ type: NdcActionType.main,
26598
+ startDate: new Date("2022-03-25"),
26599
+ endDate: new Date("2023-03-25"),
26600
+ nationalPlanObj: "Convert to solar energy",
26601
+ kpi: 50000,
26602
+ ministry: "Ministry of Environment",
26603
+ subNdcDetails: [
26604
+ {
26605
+ key: 11,
26606
+ ndcActionId: 13,
26607
+ type: NdcActionType.sub,
26608
+ startDate: new Date("2019-03-25"),
26609
+ endDate: new Date("2020-03-25"),
26610
+ nationalPlanObj: "Convert to solar energy",
26611
+ kpi: "3000",
26612
+ ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
26613
+ },
26614
+ {
26615
+ key: 14,
26616
+ ndcActionId: 13,
26617
+ type: NdcActionType.sub,
26618
+ startDate: new Date("2019-03-25"),
26619
+ endDate: new Date("2020-03-25"),
26620
+ nationalPlanObj: "",
26621
+ kpi: "",
26622
+ ministry: "",
26623
+ },
26624
+ ],
26625
+ },
26626
+ {
26627
+ key: 15,
26628
+ type: NdcActionType.main,
26629
+ startDate: new Date("2022-03-25"),
26630
+ endDate: new Date("2023-03-25"),
26631
+ nationalPlanObj: "Strengthen the private sector to create jobs",
26632
+ kpi: 10000,
26633
+ ministry: "Ministry of Environment",
26634
+ subNdcDetails: [
26635
+ {
26636
+ key: 16,
26637
+ ndcActionId: 15,
26638
+ type: NdcActionType.sub,
26639
+ startDate: new Date("2019-03-25"),
26640
+ endDate: new Date("2020-03-25"),
26641
+ nationalPlanObj: "Strengthen the private sector to create jobs",
26642
+ kpi: "7200",
26643
+ ministry: "Ministry of Tourism (MoT)",
26644
+ },
26645
+ {
26646
+ key: 17,
26647
+ ndcActionId: 15,
26648
+ type: NdcActionType.sub,
26649
+ startDate: new Date("2019-03-25"),
26650
+ endDate: new Date("2020-03-25"),
26651
+ nationalPlanObj: "",
26652
+ kpi: "",
26653
+ ministry: "",
26654
+ },
26655
+ ],
26656
+ },
26657
+ {
26658
+ key: 18,
26659
+ type: NdcActionType.main,
26660
+ startDate: new Date("2022-03-25"),
26661
+ endDate: new Date("2023-03-25"),
26662
+ nationalPlanObj: "Other",
26663
+ kpi: '',
26664
+ ministry: "Ministry of Environment",
26665
+ subNdcDetails: [
26666
+ {
26667
+ key: 19,
26668
+ ndcActionId: 18,
26669
+ type: NdcActionType.sub,
26670
+ startDate: new Date("2019-03-25"),
26671
+ endDate: new Date("2020-03-25"),
26672
+ nationalPlanObj: "Strengthen the private sector to create jobs",
26673
+ kpi: "",
26674
+ ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
26675
+ },
26676
+ {
26677
+ key: 20,
26678
+ ndcActionId: 18,
26679
+ type: NdcActionType.sub,
26680
+ startDate: new Date("2019-03-25"),
26681
+ endDate: new Date("2020-03-25"),
26682
+ nationalPlanObj: "",
26683
+ kpi: "",
26684
+ ministry: "",
26685
+ },
26686
+ ],
26687
+ },
26688
+ ];
26689
+ var initialPeriods = [
26690
+ {
26691
+ key: "2019-2020",
26692
+ label: "2019-2020",
26693
+ start: 2019,
26694
+ end: 2020,
26695
+ children: ndcDetailsTableContent(),
26696
+ },
26697
+ {
26698
+ key: "2021-2023",
26699
+ label: "2021-2023",
26700
+ start: 2021,
26701
+ end: 2021,
26702
+ children: ndcDetailsTableContent(),
26703
+ },
26704
+ ];
26705
+ if (isAddRangeVisible()) {
26706
+ initialPeriods.unshift({
26707
+ key: "add_new",
26708
+ label: "Add New",
26709
+ start: 0,
26710
+ end: 0,
26711
+ children: addNewPeriodContent(),
26712
+ });
26713
+ }
26714
+ addedNdcDetailId.current = 20;
26715
+ setPeriodItems(initialPeriods);
26716
+ periodItemsRef.current = initialPeriods;
26717
+ setNdcDetailsData(defaultNdcDetails);
26892
26718
  }, []);
26893
- return (React.createElement("div", { className: "ndc-details content-container" },
26719
+ return (React.createElement("div", { className: "ndc-management content-container" },
26894
26720
  React.createElement("div", { className: "title-bar" },
26895
26721
  React.createElement(Row, { justify: "space-between", align: "middle" },
26896
26722
  React.createElement(Col, { span: 20 },
26897
26723
  React.createElement("div", { className: "body-title" }, t("ndc:ndcTitle")),
26898
26724
  React.createElement("div", { className: "body-sub-title" }, t("ndc:ndcSubTitle"))))),
26899
26725
  React.createElement("div", null,
26900
- React.createElement(Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedPeriod.key, onChange: onTabChange })),
26901
- React.createElement("div", null, selectedPeriod.key === "add_new"
26902
- ? addNewPeriodContent()
26903
- : mainNdcActionTableContent()),
26904
- React.createElement(UserActionConfirmationModel, { t: t, actionInfo: actionInfo, onActionConfirmed: onActionConfirmed, onActionCanceled: onActionCanceled, openModal: openConfirmationModal, errorMsg: "", loading: loading })));
26726
+ React.createElement(Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedTab, onChange: onTabChange })),
26727
+ selectedTab !== "add_new" && (React.createElement("div", null,
26728
+ React.createElement("div", null,
26729
+ React.createElement(Table, { key: tableKey, components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getNdcDetailsForPeriod(), columns: columns, expandable: {
26730
+ expandedRowRender: function (record) { return getSubNdcActionContent(record); },
26731
+ indentSize: 0,
26732
+ defaultExpandedRowKeys: [selectedNdcDetail.current.key],
26733
+ }, footer: function () {
26734
+ return isAddNdcActionVisible() && (React.createElement(Row, { justify: "center" },
26735
+ React.createElement(Button, { onClick: onAddNewNdcDetail, type: "default", style: {
26736
+ marginBottom: 16,
26737
+ width: "100%",
26738
+ } }, t("ndc:addNdcAction"))));
26739
+ } }))))));
26905
26740
  };
26906
26741
 
26907
26742
  var ImgWithFallback = function (_a) {
@@ -28503,5 +28338,5 @@ var TimelineBody = function (props) {
28503
28338
  React.createElement("div", { className: "remark-body" }, remark)))));
28504
28339
  };
28505
28340
 
28506
- 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, EnergyGenerationUnits, FormElementType, 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, 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, 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 };
28341
+ 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, EnergyGenerationUnits, FormElementType, 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, 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, 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 };
28507
28342
  //# sourceMappingURL=index.js.map