@undp/carbon-library 1.0.91 → 1.0.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +119 -22
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/Definitions/Definitions/programme.definitions.d.ts +2 -12
- package/dist/cjs/types/Definitions/Enums/programme.management.columns.enum.d.ts +2 -1
- package/dist/esm/index.js +120 -23
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Definitions/Definitions/programme.definitions.d.ts +2 -12
- package/dist/esm/types/Definitions/Enums/programme.management.columns.enum.d.ts +2 -1
- package/dist/index.d.ts +9 -19
- package/package.json +1 -1
- package/dist/cjs/types/Components/Programme/ProgrammeView/programmeViewComponent.d.ts +0 -3
- package/dist/esm/types/Components/Programme/ProgrammeView/programmeViewComponent.d.ts +0 -3
@@ -1,9 +1,9 @@
|
|
1
|
-
import { DateTime } from "luxon";
|
2
1
|
import { ProgrammeTransfer } from "../Entities/programmeTransfer";
|
3
2
|
import { ProgrammeStageR, ProgrammeStageMRV, ProgrammeStageUnified } from "../Enums/programmeStage.enum";
|
4
3
|
import { TypeOfMitigation } from "../Enums/typeOfMitigation.enum";
|
5
4
|
import { CreditTransferStage } from "../Enums/creditTransferStage.enum";
|
6
5
|
import { RcFile } from "rc-upload/lib/interface";
|
6
|
+
import { CarbonSystemType } from "../Enums/carbonSystemType.enum";
|
7
7
|
export declare const getStageEnumVal: (value: string) => string;
|
8
8
|
export declare const getCreditStageVal: (value: string) => string;
|
9
9
|
export declare const getStageTransferEnumVal: (value: string, transfer: ProgrammeTransfer) => string;
|
@@ -91,17 +91,7 @@ export interface ProgrammeU extends Programme {
|
|
91
91
|
emissionReductionExpected: number;
|
92
92
|
emissionReductionAchieved: number;
|
93
93
|
}
|
94
|
-
export declare const getGeneralFields: (programme: Programme) =>
|
95
|
-
title: string;
|
96
|
-
serialNo: string;
|
97
|
-
currentStatus: ProgrammeStageR | ProgrammeStageUnified | ProgrammeStageMRV;
|
98
|
-
applicationType: string;
|
99
|
-
sector: string;
|
100
|
-
sectoralScope: string;
|
101
|
-
startDate: DateTime;
|
102
|
-
endDate: DateTime;
|
103
|
-
buyerCountry: string;
|
104
|
-
};
|
94
|
+
export declare const getGeneralFields: (programme: Programme | ProgrammeU | ProgrammeR | ProgrammeT, system?: CarbonSystemType) => Record<string, any>;
|
105
95
|
export declare const addCommSep: (value: any) => string;
|
106
96
|
export declare const addCommSepRound: (value: any) => string;
|
107
97
|
export declare const addRoundNumber: (value: any) => number;
|
@@ -9,5 +9,6 @@ export declare enum ProgrammeManagementColumns {
|
|
9
9
|
certifierId = "certifierId",
|
10
10
|
serialNo = "serialNo",
|
11
11
|
emissionReductionExpected = "emissionReductionExpected",
|
12
|
-
emissionReductionAchieved = "emissionReductionAchieved"
|
12
|
+
emissionReductionAchieved = "emissionReductionAchieved",
|
13
|
+
emissionReductionAchievedandCreditIssued = "emissionReductionAchievedandCreditIssued"
|
13
14
|
}
|
package/dist/esm/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { PlusOutlined, FilterOutlined, BankOutlined, SafetyOutlined, AuditOutlined, ExperimentOutlined, UploadOutlined, MinusCircleOutlined, StarOutlined, ToolOutlined, EyeOutlined, SearchOutlined, UserOutlined, EllipsisOutlined, EditOutlined, DeleteOutlined, CheckCircleOutlined, EyeInvisibleOutlined, GlobalOutlined, FlagOutlined, LineChartOutlined, LikeOutlined, DislikeOutlined
|
1
|
+
import { PlusOutlined, FilterOutlined, BankOutlined, SafetyOutlined, AuditOutlined, ExperimentOutlined, UploadOutlined, MinusCircleOutlined, StarOutlined, ToolOutlined, EyeOutlined, SearchOutlined, UserOutlined, EllipsisOutlined, EditOutlined, DeleteOutlined, FileAddOutlined, CheckCircleOutlined, ExclamationCircleOutlined, LinkOutlined, 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, Tooltip, Select, Modal, Alert, Skeleton, Card, Tag, Checkbox, DatePicker, InputNumber, Popover, List, Typography, Spin, Tabs, Progress } from 'antd';
|
3
3
|
import React, { useState, useEffect, useRef } from 'react';
|
4
4
|
import { DateTime } from 'luxon';
|
@@ -217,6 +217,13 @@ var SectoralScope;
|
|
217
217
|
SectoralScope["Agriculture"] = "15";
|
218
218
|
})(SectoralScope || (SectoralScope = {}));
|
219
219
|
|
220
|
+
var CarbonSystemType;
|
221
|
+
(function (CarbonSystemType) {
|
222
|
+
CarbonSystemType[CarbonSystemType["REGISTRY"] = 0] = "REGISTRY";
|
223
|
+
CarbonSystemType[CarbonSystemType["MRV"] = 1] = "MRV";
|
224
|
+
CarbonSystemType[CarbonSystemType["UNIFIED"] = 2] = "UNIFIED";
|
225
|
+
})(CarbonSystemType || (CarbonSystemType = {}));
|
226
|
+
|
220
227
|
var getStageEnumVal = function (value) {
|
221
228
|
var index = Object.keys(ProgrammeStageUnified).indexOf(value);
|
222
229
|
if (index < 0) {
|
@@ -301,8 +308,8 @@ var UnitField = /** @class */ (function () {
|
|
301
308
|
}
|
302
309
|
return UnitField;
|
303
310
|
}());
|
304
|
-
var getGeneralFields = function (programme) {
|
305
|
-
|
311
|
+
var getGeneralFields = function (programme, system) {
|
312
|
+
var res = {
|
306
313
|
title: programme.title,
|
307
314
|
serialNo: programme.serialNo,
|
308
315
|
currentStatus: programme.currentStage,
|
@@ -313,6 +320,12 @@ var getGeneralFields = function (programme) {
|
|
313
320
|
endDate: DateTime.fromSeconds(Number(programme.endTime)),
|
314
321
|
buyerCountry: programme.programmeProperties.buyerCountryEligibility,
|
315
322
|
};
|
323
|
+
if (system === CarbonSystemType.UNIFIED || system === CarbonSystemType.MRV) {
|
324
|
+
var prog = programme;
|
325
|
+
res.emissionsReductionExpected = prog.emissionReductionExpected;
|
326
|
+
res.emissionsReductionAchieved = prog.emissionReductionAchieved;
|
327
|
+
}
|
328
|
+
return res;
|
316
329
|
};
|
317
330
|
var addCommSep = function (value) {
|
318
331
|
return (Number(value)
|
@@ -813,6 +826,7 @@ var ProgrammeManagementColumns;
|
|
813
826
|
ProgrammeManagementColumns["serialNo"] = "serialNo";
|
814
827
|
ProgrammeManagementColumns["emissionReductionExpected"] = "emissionReductionExpected";
|
815
828
|
ProgrammeManagementColumns["emissionReductionAchieved"] = "emissionReductionAchieved";
|
829
|
+
ProgrammeManagementColumns["emissionReductionAchievedandCreditIssued"] = "emissionReductionAchievedandCreditIssued";
|
816
830
|
})(ProgrammeManagementColumns || (ProgrammeManagementColumns = {}));
|
817
831
|
|
818
832
|
var InvestmentLevel;
|
@@ -4368,13 +4382,6 @@ var SdgGoals$1;
|
|
4368
4382
|
SdgGoals["partnership"] = "Partnerships for the Goals";
|
4369
4383
|
})(SdgGoals$1 || (SdgGoals$1 = {}));
|
4370
4384
|
|
4371
|
-
var CarbonSystemType;
|
4372
|
-
(function (CarbonSystemType) {
|
4373
|
-
CarbonSystemType[CarbonSystemType["REGISTRY"] = 0] = "REGISTRY";
|
4374
|
-
CarbonSystemType[CarbonSystemType["MRV"] = 1] = "MRV";
|
4375
|
-
CarbonSystemType[CarbonSystemType["UNIFIED"] = 2] = "UNIFIED";
|
4376
|
-
})(CarbonSystemType || (CarbonSystemType = {}));
|
4377
|
-
|
4378
4385
|
var DocType;
|
4379
4386
|
(function (DocType) {
|
4380
4387
|
DocType["DESIGN_DOCUMENT"] = "0";
|
@@ -5434,7 +5441,7 @@ var CompanyProfileComponent = function (props) {
|
|
5434
5441
|
React.createElement(UserActionConfirmationModel, { t: t, actionInfo: actionInfo, onActionConfirmed: onReactivateOrgConfirmed, onActionCanceled: onReactivateOrgCanceled, openModal: openReactivateModal, errorMsg: errorMsg, loading: isLoading })));
|
5435
5442
|
};
|
5436
5443
|
|
5437
|
-
var css_248z$n = ".programme-management .programme-title-bar {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 0px 0px 30px 0px; }\n .programme-management .programme-title-bar .title {\n display: flex;\n flex-direction: column;\n justify-content: space-between; }\n .programme-management .programme-title-bar .actions {\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n .programme-management .programme-title-bar .flex-display {\n margin-left: 15px; }\n\n.programme-management .certify-list {\n width:
|
5444
|
+
var css_248z$n = ".programme-management .programme-title-bar {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 0px 0px 30px 0px; }\n .programme-management .programme-title-bar .title {\n display: flex;\n flex-direction: column;\n justify-content: space-between; }\n .programme-management .programme-title-bar .actions {\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n .programme-management .programme-title-bar .flex-display {\n margin-left: 15px; }\n\n.programme-management .certify-list {\n width: 88px;\n display: flex;\n align-items: center;\n flex-wrap: wrap; }\n .programme-management .certify-list .profile-icon {\n margin-bottom: 4px;\n margin-right: 4px; }\n\n.programme-management .org-list {\n width: 88px;\n display: flex;\n align-items: center;\n flex-wrap: wrap; }\n .programme-management .org-list .profile-icon {\n margin-bottom: 4px;\n margin-right: 4px; }\n\n.programme-management .table-actions-section {\n margin-bottom: 0px; }\n .programme-management .table-actions-section input {\n font-family: \"Inter\";\n font-size: 0.8rem; }\n\n.programme-management .all-check {\n margin-right: 10px; }\n .programme-management .all-check .ant-checkbox-inner::after {\n background-color: rgba(58, 53, 65, 0.5); }\n .programme-management .all-check .ant-checkbox-checked .ant-checkbox-inner::after {\n background-color: transparent; }\n .programme-management .all-check .ant-checkbox-checked .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.5);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Retired\"] + .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.4);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"AwaitingAuthorization\"] + .ant-checkbox-inner {\n background-color: rgba(237, 77, 71, 0.6);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Rejected\"] + .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.4);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Authorised\"] + .ant-checkbox-inner {\n background-color: #16b1ff;\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Approved\"] + .ant-checkbox-inner {\n background-color: rgba(145, 85, 253, 0.6);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Transferred\"] + .ant-checkbox-inner {\n background-color: rgba(118, 195, 39, 0.6);\n border: none; }\n";
|
5438
5445
|
styleInject(css_248z$n);
|
5439
5446
|
|
5440
5447
|
var Search$1 = Input.Search;
|
@@ -5529,7 +5536,7 @@ var ProgrammeManagementComponent = function (props) {
|
|
5529
5536
|
React.createElement("div", null,
|
5530
5537
|
React.createElement(ProfileIcon, { icon: obj.logo, bg: getCompanyBgColor(obj.companyRole), name: obj.name }))));
|
5531
5538
|
});
|
5532
|
-
return
|
5539
|
+
return React.createElement("div", { className: "org-list" }, elements);
|
5533
5540
|
},
|
5534
5541
|
},
|
5535
5542
|
{
|
@@ -5605,6 +5612,15 @@ var ProgrammeManagementComponent = function (props) {
|
|
5605
5612
|
return item ? addCommSep(item) : "-";
|
5606
5613
|
},
|
5607
5614
|
},
|
5615
|
+
{
|
5616
|
+
title: t("programme:emissionReductionAchievedandCreditIssued"),
|
5617
|
+
dataIndex: "emissionReductionAchieved",
|
5618
|
+
key: ProgrammeManagementColumns.emissionReductionAchievedandCreditIssued,
|
5619
|
+
align: "right",
|
5620
|
+
render: function (item) {
|
5621
|
+
return item ? addCommSep(item) : "-";
|
5622
|
+
},
|
5623
|
+
},
|
5608
5624
|
{
|
5609
5625
|
title: t("programme:certifiers"),
|
5610
5626
|
dataIndex: "certifierId",
|
@@ -18265,21 +18281,21 @@ InfoView.defaultProps = {
|
|
18265
18281
|
var NdcActionViewComponent = function (props) {
|
18266
18282
|
var _a;
|
18267
18283
|
var _b, _c;
|
18268
|
-
var useUserContext = props.useUserContext
|
18284
|
+
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, Chart = props.Chart;
|
18269
18285
|
translator.setDefaultNamespace("ndcAction");
|
18270
18286
|
var t = translator.t;
|
18271
|
-
useUserContext().userInfoState;
|
18287
|
+
var userInfoState = useUserContext().userInfoState;
|
18272
18288
|
var post = useConnection().post;
|
18273
18289
|
var state = useLocation().state;
|
18274
|
-
var _d = useState({}), ndcActionReportDetails = _d[0]
|
18290
|
+
var _d = useState({}), ndcActionReportDetails = _d[0], setNdcActionReportDetails = _d[1];
|
18275
18291
|
var _e = useState(false), isLoading = _e[0], setIsLoading = _e[1];
|
18276
18292
|
var _f = useState(), ndcActionDetails = _f[0], setNdcActionDetails = _f[1];
|
18277
18293
|
var _g = useState(); _g[0]; var setCoBenifitsComponentnDetails = _g[1];
|
18278
18294
|
var _h = useState(0), emissionsReductionExpected = _h[0], setEmissionsReductionExpected = _h[1];
|
18279
18295
|
var _j = useState(0), emissionsReductionAchieved = _j[0], setEmissionsReductionAchieved = _j[1];
|
18280
|
-
var _k = useState([])
|
18281
|
-
var _l = useState(false)
|
18282
|
-
var _m = useState(false)
|
18296
|
+
var _k = useState([]), programmeOwnerId = _k[0], setProgrammeOwnerId = _k[1];
|
18297
|
+
var _l = useState(false), canUploadMonitorReport = _l[0], setCanUploadMonitorReport = _l[1];
|
18298
|
+
var _m = useState(false), monitoringReportAccepted = _m[0], setMonitoringReportAccepted = _m[1];
|
18283
18299
|
var getProgrammeById = function (programmeId) { return __awaiter(void 0, void 0, void 0, function () {
|
18284
18300
|
var response, error_1;
|
18285
18301
|
var _a, _b, _c;
|
@@ -18321,11 +18337,92 @@ var NdcActionViewComponent = function (props) {
|
|
18321
18337
|
}
|
18322
18338
|
});
|
18323
18339
|
}); };
|
18324
|
-
|
18325
|
-
|
18326
|
-
|
18327
|
-
|
18328
|
-
|
18340
|
+
var getProjectReportActions = function (reportData) {
|
18341
|
+
return (React.createElement(Row, null,
|
18342
|
+
React.createElement("div", { className: "icon" },
|
18343
|
+
(reportData === null || reportData === void 0 ? void 0 : reportData.status) === DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
|
18344
|
+
(reportData === null || reportData === void 0 ? void 0 : reportData.status) === DocumentStatus.REJECTED && (React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))),
|
18345
|
+
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 },
|
18346
|
+
React.createElement(LinkOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))))));
|
18347
|
+
};
|
18348
|
+
var getProjectReports = function () { return __awaiter(void 0, void 0, void 0, function () {
|
18349
|
+
var reportDetails, response, exception_1;
|
18350
|
+
var _a;
|
18351
|
+
var _b;
|
18352
|
+
return __generator(this, function (_c) {
|
18353
|
+
switch (_c.label) {
|
18354
|
+
case 0:
|
18355
|
+
setIsLoading(true);
|
18356
|
+
reportDetails = (_a = {},
|
18357
|
+
_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
|
18358
|
+
? t("programme:notAuthToUploadDoc")
|
18359
|
+
: uploadDocUserPermission(userInfoState, DocType.MONITORING_REPORT, programmeOwnerId)
|
18360
|
+
? !canUploadMonitorReport && t("programme:programmeNotAuth")
|
18361
|
+
: t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
|
18362
|
+
React.createElement(FileAddOutlined, null))),
|
18363
|
+
_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
|
18364
|
+
? t("programme:notAuthToUploadDoc")
|
18365
|
+
: uploadDocUserPermission(userInfoState, DocType.VERIFICATION_REPORT, programmeOwnerId)
|
18366
|
+
? !monitoringReportAccepted &&
|
18367
|
+
t("programme:monitoringRepNotApproved")
|
18368
|
+
: t("programme:notAuthToUploadDoc"), overlayClassName: "custom-tooltip" },
|
18369
|
+
React.createElement(FileAddOutlined, null))),
|
18370
|
+
_a);
|
18371
|
+
_c.label = 1;
|
18372
|
+
case 1:
|
18373
|
+
_c.trys.push([1, 3, 4, 5]);
|
18374
|
+
return [4 /*yield*/, post("national/programme/queryDocs", {
|
18375
|
+
page: 1,
|
18376
|
+
size: 100,
|
18377
|
+
filterAnd: [
|
18378
|
+
{
|
18379
|
+
key: "actionId",
|
18380
|
+
operation: "=",
|
18381
|
+
value: ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.id,
|
18382
|
+
},
|
18383
|
+
],
|
18384
|
+
})];
|
18385
|
+
case 2:
|
18386
|
+
response = _c.sent();
|
18387
|
+
if (((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
18388
|
+
response.data.map(function (item) {
|
18389
|
+
var _a, _b;
|
18390
|
+
if ((_a = item === null || item === void 0 ? void 0 : item.url) === null || _a === void 0 ? void 0 : _a.includes("MONITORING_REPORT")) {
|
18391
|
+
if ((item === null || item === void 0 ? void 0 : item.status) === DocumentStatus.ACCEPTED) {
|
18392
|
+
setMonitoringReportAccepted(true);
|
18393
|
+
}
|
18394
|
+
reportDetails[t("ndcAction:viewMoniteringReport")] =
|
18395
|
+
getProjectReportActions(item);
|
18396
|
+
}
|
18397
|
+
else if ((_b = item === null || item === void 0 ? void 0 : item.url) === null || _b === void 0 ? void 0 : _b.includes("VERIFICATION_REPORT")) {
|
18398
|
+
reportDetails[t("ndcAction:viewVerificationReport")] =
|
18399
|
+
getProjectReportActions(item);
|
18400
|
+
}
|
18401
|
+
});
|
18402
|
+
}
|
18403
|
+
return [3 /*break*/, 5];
|
18404
|
+
case 3:
|
18405
|
+
exception_1 = _c.sent();
|
18406
|
+
message.open({
|
18407
|
+
type: "error",
|
18408
|
+
content: exception_1.message,
|
18409
|
+
duration: 3,
|
18410
|
+
style: { textAlign: "right", marginRight: 15, marginTop: 10 },
|
18411
|
+
});
|
18412
|
+
return [3 /*break*/, 5];
|
18413
|
+
case 4:
|
18414
|
+
setNdcActionReportDetails(reportDetails);
|
18415
|
+
setIsLoading(false);
|
18416
|
+
return [7 /*endfinally*/];
|
18417
|
+
case 5: return [2 /*return*/];
|
18418
|
+
}
|
18419
|
+
});
|
18420
|
+
}); };
|
18421
|
+
useEffect(function () {
|
18422
|
+
if (ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.id) {
|
18423
|
+
getProjectReports();
|
18424
|
+
}
|
18425
|
+
}, [ndcActionDetails === null || ndcActionDetails === void 0 ? void 0 : ndcActionDetails.id, programmeOwnerId]);
|
18329
18426
|
useEffect(function () {
|
18330
18427
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
18331
18428
|
if (!state) {
|