@undp/carbon-library 1.0.79 → 1.0.80

Sign up to get free protection for your applications and to get access to all the features.
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { PlusOutlined, FilterOutlined, BankOutlined, SafetyOutlined, AuditOutlined, ExperimentOutlined, UploadOutlined, BlockOutlined, BulbOutlined, ClockCircleOutlined, MinusCircleOutlined, StarOutlined, ToolOutlined, EyeOutlined, SearchOutlined, UserOutlined, EllipsisOutlined, EditOutlined, DeleteOutlined, FileAddOutlined, CheckCircleOutlined, ExclamationCircleOutlined, LinkOutlined } from '@ant-design/icons';
1
+ import { PlusOutlined, FilterOutlined, BankOutlined, SafetyOutlined, AuditOutlined, ExperimentOutlined, UploadOutlined, BlockOutlined, BulbOutlined, ClockCircleOutlined, MinusCircleOutlined, StarOutlined, ToolOutlined, EyeOutlined, SearchOutlined, UserOutlined, EllipsisOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons';
2
2
  import { Input, Radio, Space, Row, Col, Button, Dropdown, Table, Empty, message, Form, Steps, Upload, Tooltip, Select, Modal, Alert, Skeleton, Card, Tag, Checkbox, InputNumber, Spin, Progress, DatePicker, Popover, List, Typography, Tabs } from 'antd';
3
3
  import React, { useState, useEffect, useRef } from 'react';
4
4
  import { DateTime } from 'luxon';
@@ -20166,21 +20166,21 @@ styleInject(css_248z$2);
20166
20166
  var NdcActionViewComponent = function (props) {
20167
20167
  var _a;
20168
20168
  var _b, _c;
20169
- var useUserContext = props.useUserContext, linkDocVisible = props.linkDocVisible, uploadDocUserPermission = props.uploadDocUserPermission, useConnection = props.useConnection, useLocation = props.useLocation, onNavigateToNdcManagementView = props.onNavigateToNdcManagementView, translator = props.translator, sdgGoalImages = props.sdgGoalImages;
20169
+ var useUserContext = props.useUserContext; props.linkDocVisible; props.uploadDocUserPermission; var useConnection = props.useConnection, useLocation = props.useLocation, onNavigateToNdcManagementView = props.onNavigateToNdcManagementView, translator = props.translator, sdgGoalImages = props.sdgGoalImages;
20170
20170
  translator.setDefaultNamespace("ndcAction");
20171
20171
  var t = translator.t;
20172
- var userInfoState = useUserContext().userInfoState;
20172
+ useUserContext().userInfoState;
20173
20173
  var post = useConnection().post;
20174
20174
  var state = useLocation().state;
20175
- var _d = useState({}), ndcActionReportDetails = _d[0], setNdcActionReportDetails = _d[1];
20175
+ var _d = useState({}), ndcActionReportDetails = _d[0]; _d[1];
20176
20176
  var _e = useState(false), isLoading = _e[0], setIsLoading = _e[1];
20177
20177
  var _f = useState(), ndcActionDetails = _f[0], setNdcActionDetails = _f[1];
20178
20178
  var _g = useState(); _g[0]; var setCoBenifitsComponentnDetails = _g[1];
20179
20179
  var _h = useState(0), emissionsReductionExpected = _h[0], setEmissionsReductionExpected = _h[1];
20180
20180
  var _j = useState(0), emissionsReductionAchieved = _j[0], setEmissionsReductionAchieved = _j[1];
20181
- var _k = useState([]), programmeOwnerId = _k[0], setProgrammeOwnerId = _k[1];
20182
- var _l = useState(false), canUploadMonitorReport = _l[0], setCanUploadMonitorReport = _l[1];
20183
- var _m = useState(false), monitoringReportAccepted = _m[0], setMonitoringReportAccepted = _m[1];
20181
+ var _k = useState([]); _k[0]; var setProgrammeOwnerId = _k[1];
20182
+ var _l = useState(false); _l[0]; var setCanUploadMonitorReport = _l[1];
20183
+ var _m = useState(false); _m[0]; _m[1];
20184
20184
  var getProgrammeById = function (programmeId) { return __awaiter(void 0, void 0, void 0, function () {
20185
20185
  var response, error_1;
20186
20186
  var _a, _b, _c;
@@ -20223,92 +20223,11 @@ var NdcActionViewComponent = function (props) {
20223
20223
  }
20224
20224
  });
20225
20225
  }); };
20226
- var getProjectReportActions = function (reportData) {
20227
- return (React.createElement(Row, null,
20228
- React.createElement("div", { className: "icon" },
20229
- (reportData === null || reportData === void 0 ? void 0 : reportData.status) === DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
20230
- (reportData === null || reportData === void 0 ? void 0 : reportData.status) === DocumentStatus.REJECTED && (React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))),
20231
- 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 },
20232
- React.createElement(LinkOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))))));
20233
- };
20234
- var getProjectReports = function () { return __awaiter(void 0, void 0, void 0, function () {
20235
- var reportDetails, response, exception_1;
20236
- var _a;
20237
- var _b;
20238
- return __generator(this, function (_c) {
20239
- switch (_c.label) {
20240
- case 0:
20241
- setIsLoading(true);
20242
- reportDetails = (_a = {},
20243
- _a[t("ndcAction:viewMoniteringReport")] = (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly
20244
- ? t("programme:notAuthToUploadDoc")
20245
- : uploadDocUserPermission(userInfoState, DocType.MONITORING_REPORT, programmeOwnerId)
20246
- ? !canUploadMonitorReport && t("programme:programmeNotAuth")
20247
- : t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
20248
- React.createElement(FileAddOutlined, null))),
20249
- _a[t("ndcAction:viewVerificationReport")] = (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly
20250
- ? t("programme:notAuthToUploadDoc")
20251
- : uploadDocUserPermission(userInfoState, DocType.VERIFICATION_REPORT, programmeOwnerId)
20252
- ? !monitoringReportAccepted &&
20253
- t("programme:monitoringRepNotApproved")
20254
- : t("programme:notAuthToUploadDoc"), overlayClassName: "custom-tooltip" },
20255
- React.createElement(FileAddOutlined, null))),
20256
- _a);
20257
- _c.label = 1;
20258
- case 1:
20259
- _c.trys.push([1, 3, 4, 5]);
20260
- return [4 /*yield*/, post("national/programme/queryDocs", {
20261
- page: 1,
20262
- size: 100,
20263
- filterAnd: [
20264
- {
20265
- key: "actionId",
20266
- operation: "=",
20267
- value: ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.id,
20268
- },
20269
- ],
20270
- })];
20271
- case 2:
20272
- response = _c.sent();
20273
- if (((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.length) > 0) {
20274
- response.data.map(function (item) {
20275
- var _a, _b;
20276
- if ((_a = item === null || item === void 0 ? void 0 : item.url) === null || _a === void 0 ? void 0 : _a.includes("MONITORING_REPORT")) {
20277
- if ((item === null || item === void 0 ? void 0 : item.status) === DocumentStatus.ACCEPTED) {
20278
- setMonitoringReportAccepted(true);
20279
- }
20280
- reportDetails[t("ndcAction:viewMoniteringReport")] =
20281
- getProjectReportActions(item);
20282
- }
20283
- else if ((_b = item === null || item === void 0 ? void 0 : item.url) === null || _b === void 0 ? void 0 : _b.includes("VERIFICATION_REPORT")) {
20284
- reportDetails[t("ndcAction:viewVerificationReport")] =
20285
- getProjectReportActions(item);
20286
- }
20287
- });
20288
- }
20289
- return [3 /*break*/, 5];
20290
- case 3:
20291
- exception_1 = _c.sent();
20292
- message.open({
20293
- type: "error",
20294
- content: exception_1.message,
20295
- duration: 3,
20296
- style: { textAlign: "right", marginRight: 15, marginTop: 10 },
20297
- });
20298
- return [3 /*break*/, 5];
20299
- case 4:
20300
- setNdcActionReportDetails(reportDetails);
20301
- setIsLoading(false);
20302
- return [7 /*endfinally*/];
20303
- case 5: return [2 /*return*/];
20304
- }
20305
- });
20306
- }); };
20307
- useEffect(function () {
20308
- if (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.id) {
20309
- getProjectReports();
20310
- }
20311
- }, [ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.id, programmeOwnerId]);
20226
+ // useEffect(() => {
20227
+ // if (ndcActionDetails?.id) {
20228
+ // getProjectReports();
20229
+ // }
20230
+ // }, [ndcActionDetails?.id, programmeOwnerId]);
20312
20231
  useEffect(function () {
20313
20232
  var _a, _b, _c, _d, _e, _f, _g, _h;
20314
20233
  if (!state) {