@undp/carbon-library 1.0.122 → 1.0.123
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.js +135 -20
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/Definitions/Enums/document.type.d.ts +2 -1
- package/dist/cjs/types/Utils/DocumentValidator.d.ts +1 -1
- package/dist/esm/index.js +135 -20
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Definitions/Enums/document.type.d.ts +2 -1
- package/dist/esm/types/Utils/DocumentValidator.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
export declare const isValidateFileType: (fileType: string) => boolean;
|
1
|
+
export declare const isValidateFileType: (fileType: string, docType?: string) => boolean;
|
package/dist/esm/index.js
CHANGED
@@ -4427,6 +4427,7 @@ var DocType;
|
|
4427
4427
|
DocType["METHODOLOGY_DOCUMENT"] = "1";
|
4428
4428
|
DocType["MONITORING_REPORT"] = "2";
|
4429
4429
|
DocType["VERIFICATION_REPORT"] = "3";
|
4430
|
+
DocType["ENVIRONMENTAL_IMPACT_ASSESSMENT"] = "7";
|
4430
4431
|
})(DocType || (DocType = {}));
|
4431
4432
|
|
4432
4433
|
var DocumentStatus;
|
@@ -11823,8 +11824,19 @@ var allowedFileTypes = [
|
|
11823
11824
|
"image/png",
|
11824
11825
|
"image/jpeg"
|
11825
11826
|
];
|
11826
|
-
var
|
11827
|
-
|
11827
|
+
var environmentalImpactAssessmentAllowedTypes = [
|
11828
|
+
"application/pdf",
|
11829
|
+
"application/msword",
|
11830
|
+
"image/png",
|
11831
|
+
"image/jpeg"
|
11832
|
+
];
|
11833
|
+
var isValidateFileType = function (fileType, docType) {
|
11834
|
+
if (docType === DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT) {
|
11835
|
+
return environmentalImpactAssessmentAllowedTypes.includes(fileType);
|
11836
|
+
}
|
11837
|
+
else {
|
11838
|
+
return allowedFileTypes.includes(fileType);
|
11839
|
+
}
|
11828
11840
|
};
|
11829
11841
|
|
11830
11842
|
var maximumImageSize = process.env.REACT_APP_MAXIMUM_FILE_SIZE
|
@@ -12113,10 +12125,10 @@ var ProgrammeCreationComponent = function (props) {
|
|
12113
12125
|
setCurrent(current - 1);
|
12114
12126
|
};
|
12115
12127
|
var onFinishStepOne = function (values) { return __awaiter(void 0, void 0, void 0, function () {
|
12116
|
-
var programmeDetails, ownershipPercentage, totalPercentage, proponentPercentages, proponentTxIds, logoBase64, propTaxIds, duplicateIds;
|
12117
|
-
var _a, _b;
|
12118
|
-
return __generator(this, function (
|
12119
|
-
switch (
|
12128
|
+
var programmeDetails, ownershipPercentage, totalPercentage, proponentPercentages, proponentTxIds, logoBase64, environmentalImpactAssessmentData, propTaxIds, duplicateIds;
|
12129
|
+
var _a, _b, _c, _d;
|
12130
|
+
return __generator(this, function (_e) {
|
12131
|
+
switch (_e.label) {
|
12120
12132
|
case 0:
|
12121
12133
|
setLoading(true);
|
12122
12134
|
ownershipPercentage = values === null || values === void 0 ? void 0 : values.ownershipPercentage;
|
@@ -12130,9 +12142,16 @@ var ProgrammeCreationComponent = function (props) {
|
|
12130
12142
|
if (!(((_a = values === null || values === void 0 ? void 0 : values.designDocument) === null || _a === void 0 ? void 0 : _a.length) > 0)) return [3 /*break*/, 2];
|
12131
12143
|
return [4 /*yield*/, getBase64((_b = values === null || values === void 0 ? void 0 : values.designDocument[0]) === null || _b === void 0 ? void 0 : _b.originFileObj)];
|
12132
12144
|
case 1:
|
12133
|
-
logoBase64 =
|
12134
|
-
|
12145
|
+
logoBase64 = _e.sent();
|
12146
|
+
_e.label = 2;
|
12135
12147
|
case 2:
|
12148
|
+
environmentalImpactAssessmentData = "";
|
12149
|
+
if (!(((_c = values === null || values === void 0 ? void 0 : values.environmentalImpactAssessment) === null || _c === void 0 ? void 0 : _c.length) > 0)) return [3 /*break*/, 4];
|
12150
|
+
return [4 /*yield*/, getBase64((_d = values === null || values === void 0 ? void 0 : values.environmentalImpactAssessment[0]) === null || _d === void 0 ? void 0 : _d.originFileObj)];
|
12151
|
+
case 3:
|
12152
|
+
environmentalImpactAssessmentData = _e.sent();
|
12153
|
+
_e.label = 4;
|
12154
|
+
case 4:
|
12136
12155
|
propTaxIds = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) !== CompanyRole.GOVERNMENT &&
|
12137
12156
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) !== CompanyRole.MINISTRY
|
12138
12157
|
? __spreadArray([userOrgTaxId], proponentTxIds, true) : proponentTxIds;
|
@@ -12177,6 +12196,9 @@ var ProgrammeCreationComponent = function (props) {
|
|
12177
12196
|
if ((logoBase64 === null || logoBase64 === void 0 ? void 0 : logoBase64.length) > 0) {
|
12178
12197
|
programmeDetails.designDocument = logoBase64;
|
12179
12198
|
}
|
12199
|
+
if ((environmentalImpactAssessmentData === null || environmentalImpactAssessmentData === void 0 ? void 0 : environmentalImpactAssessmentData.length) > 0) {
|
12200
|
+
programmeDetails.environmentalImpactAssessment = environmentalImpactAssessmentData;
|
12201
|
+
}
|
12180
12202
|
setLoading(false);
|
12181
12203
|
console.log(programmeDetails);
|
12182
12204
|
nextOne(programmeDetails);
|
@@ -12566,7 +12588,30 @@ var ProgrammeCreationComponent = function (props) {
|
|
12566
12588
|
}); },
|
12567
12589
|
},
|
12568
12590
|
] },
|
12569
|
-
React.createElement(Input, { size: "large" }))
|
12591
|
+
React.createElement(Input, { size: "large" })),
|
12592
|
+
React.createElement(Form.Item, { label: t("addProgramme:environmentalImpactAssessment"), name: "environmentalImpactAssessment", valuePropName: "fileList", getValueFromEvent: normFile, required: false, rules: [
|
12593
|
+
{
|
12594
|
+
validator: function (rule, file) { return __awaiter(void 0, void 0, void 0, function () {
|
12595
|
+
var _a, _b;
|
12596
|
+
return __generator(this, function (_c) {
|
12597
|
+
if ((file === null || file === void 0 ? void 0 : file.length) > 0) {
|
12598
|
+
if (!isValidateFileType((_a = file[0]) === null || _a === void 0 ? void 0 : _a.type, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT)) {
|
12599
|
+
throw new Error("".concat(t("addProgramme:invalidFileFormat")));
|
12600
|
+
}
|
12601
|
+
else if (((_b = file[0]) === null || _b === void 0 ? void 0 : _b.size) > maximumImageSize) {
|
12602
|
+
// default size format of files would be in bytes -> 1MB = 1000000bytes
|
12603
|
+
throw new Error("".concat(t("common:maxSizeVal")));
|
12604
|
+
}
|
12605
|
+
}
|
12606
|
+
return [2 /*return*/];
|
12607
|
+
});
|
12608
|
+
}); },
|
12609
|
+
},
|
12610
|
+
] },
|
12611
|
+
React.createElement(Upload, { accept: ".doc, .docx, .pdf, .png, .jpg", beforeUpload: function (file) {
|
12612
|
+
return false;
|
12613
|
+
}, className: "design-upload-section", name: "design", action: "/upload.do", listType: "picture", multiple: false, maxCount: 1 },
|
12614
|
+
React.createElement(Button, { className: "upload-doc", size: "large", icon: React.createElement(UploadOutlined, null) }, "Upload"))))),
|
12570
12615
|
React.createElement(Col, { xl: 12, md: 24 },
|
12571
12616
|
React.createElement("div", { className: "details-part-two" },
|
12572
12617
|
React.createElement(Form.Item, { label: t("addProgramme:externalId"), name: "externalId", rules: [
|
@@ -24410,6 +24455,7 @@ var ProgrammeDocuments = function (props) {
|
|
24410
24455
|
var _a = useConnection(); _a.delete; var post = _a.post;
|
24411
24456
|
var fileInputRef = useRef(null);
|
24412
24457
|
var fileInputRefMeth = useRef(null);
|
24458
|
+
var fileInputRefImpactAssessment = useRef(null);
|
24413
24459
|
var _b = useState(false), loading = _b[0], setLoading = _b[1];
|
24414
24460
|
var _c = useState(""), designDocUrl = _c[0], setDesignDocUrl = _c[1];
|
24415
24461
|
var _d = useState(""), noObjectionDocUrl = _d[0], setNoObjectionDocUrl = _d[1];
|
@@ -24427,6 +24473,10 @@ var ProgrammeDocuments = function (props) {
|
|
24427
24473
|
var _r = useState(false), openRejectDocConfirmationModal = _r[0], setOpenRejectDocConfirmationModal = _r[1];
|
24428
24474
|
var _s = useState({}), actionInfo = _s[0], setActionInfo = _s[1];
|
24429
24475
|
var _t = useState({}), rejectDocData = _t[0], setRejectDocData = _t[1];
|
24476
|
+
var _u = useState(""), impactAssessmentUrl = _u[0], setImpactAssessmentUrl = _u[1];
|
24477
|
+
var _v = useState(""), impactAssessmentDate = _v[0], setImpactAssessmentDate = _v[1];
|
24478
|
+
var _w = useState(""), impactAssessmentStatus = _w[0], setImpactAssessmentStatus = _w[1];
|
24479
|
+
var _x = useState(""), impactAssessmentId = _x[0], setImpactAssessmentId = _x[1];
|
24430
24480
|
var maximumImageSize = process.env.REACT_APP_MAXIMUM_FILE_SIZE
|
24431
24481
|
? parseInt(process.env.REACT_APP_MAXIMUM_FILE_SIZE)
|
24432
24482
|
: 5000000;
|
@@ -24438,13 +24488,17 @@ var ProgrammeDocuments = function (props) {
|
|
24438
24488
|
var _a;
|
24439
24489
|
(_a = fileInputRefMeth === null || fileInputRefMeth === void 0 ? void 0 : fileInputRefMeth.current) === null || _a === void 0 ? void 0 : _a.click();
|
24440
24490
|
};
|
24491
|
+
var handleImpactAssessmentFileUpload = function () {
|
24492
|
+
var _a;
|
24493
|
+
(_a = fileInputRefImpactAssessment === null || fileInputRefImpactAssessment === void 0 ? void 0 : fileInputRefImpactAssessment.current) === null || _a === void 0 ? void 0 : _a.click();
|
24494
|
+
};
|
24441
24495
|
useEffect(function () {
|
24442
24496
|
setDocData(data);
|
24443
24497
|
}, [data]);
|
24444
24498
|
useEffect(function () {
|
24445
24499
|
if (docData === null || docData === void 0 ? void 0 : docData.length) {
|
24446
24500
|
docData === null || docData === void 0 ? void 0 : docData.map(function (item) {
|
24447
|
-
var _a, _b, _c, _d;
|
24501
|
+
var _a, _b, _c, _d, _e;
|
24448
24502
|
if ((_a = item === null || item === void 0 ? void 0 : item.url) === null || _a === void 0 ? void 0 : _a.includes("DESIGN")) {
|
24449
24503
|
setDesignDocUrl(item === null || item === void 0 ? void 0 : item.url);
|
24450
24504
|
setDesignDocDate(item === null || item === void 0 ? void 0 : item.txTime);
|
@@ -24465,6 +24519,12 @@ var ProgrammeDocuments = function (props) {
|
|
24465
24519
|
setAuthorisationDocUrl(item === null || item === void 0 ? void 0 : item.url);
|
24466
24520
|
setAuthorisationDocDate(item === null || item === void 0 ? void 0 : item.txTime);
|
24467
24521
|
}
|
24522
|
+
if ((_e = item === null || item === void 0 ? void 0 : item.url) === null || _e === void 0 ? void 0 : _e.includes("ENVIRONMENTAL_IMPACT_ASSESSMENT")) {
|
24523
|
+
setImpactAssessmentUrl(item === null || item === void 0 ? void 0 : item.url);
|
24524
|
+
setImpactAssessmentDate(item === null || item === void 0 ? void 0 : item.txTime);
|
24525
|
+
setImpactAssessmentStatus(item === null || item === void 0 ? void 0 : item.status);
|
24526
|
+
setImpactAssessmentId(item === null || item === void 0 ? void 0 : item.id);
|
24527
|
+
}
|
24468
24528
|
});
|
24469
24529
|
}
|
24470
24530
|
}, [docData]);
|
@@ -24497,7 +24557,7 @@ var ProgrammeDocuments = function (props) {
|
|
24497
24557
|
_a.label = 2;
|
24498
24558
|
case 2:
|
24499
24559
|
_a.trys.push([2, 6, 7, 8]);
|
24500
|
-
if (!isValidateFileType(file === null || file === void 0 ? void 0 : file.type)) return [3 /*break*/, 4];
|
24560
|
+
if (!isValidateFileType(file === null || file === void 0 ? void 0 : file.type, type)) return [3 /*break*/, 4];
|
24501
24561
|
return [4 /*yield*/, post("national/programme/addDocument", {
|
24502
24562
|
type: type,
|
24503
24563
|
data: logoBase64,
|
@@ -24606,7 +24666,7 @@ var ProgrammeDocuments = function (props) {
|
|
24606
24666
|
React.createElement("span", { className: "title-text" }, title)),
|
24607
24667
|
React.createElement("div", null,
|
24608
24668
|
React.createElement(Row, { className: "field", key: "Design Document" },
|
24609
|
-
React.createElement(Col, { span:
|
24669
|
+
React.createElement(Col, { span: 18, className: "field-key" },
|
24610
24670
|
React.createElement("div", { className: "label-container" },
|
24611
24671
|
React.createElement("div", { className: designDocUrl !== "" ? "label-uploaded" : "label" }, t("programme:designDoc")),
|
24612
24672
|
designDocPending &&
|
@@ -24629,7 +24689,7 @@ var ProgrammeDocuments = function (props) {
|
|
24629
24689
|
designDocStatus === DocumentStatus.REJECTED && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
|
24630
24690
|
React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } })))),
|
24631
24691
|
designDocUrl !== "" && (React.createElement("div", { className: "time" }, moment(parseInt(designDocDate)).format("DD MMMM YYYY @ HH:mm")))),
|
24632
|
-
React.createElement(Col, { span:
|
24692
|
+
React.createElement(Col, { span: 6, className: "field-value" }, designDocUrl !== "" ? (React.createElement("div", { className: "link" },
|
24633
24693
|
linkDocVisible(designDocStatus) && (React.createElement("a", { href: designDocUrl, target: "_blank", rel: "noopener noreferrer", download: true },
|
24634
24694
|
React.createElement(LinkOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))),
|
24635
24695
|
designDocStatus !== DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
|
@@ -24662,15 +24722,15 @@ var ProgrammeDocuments = function (props) {
|
|
24662
24722
|
onUploadDocument(selectedFile, DocType.DESIGN_DOCUMENT);
|
24663
24723
|
} }))))),
|
24664
24724
|
noObjectionDocUrl !== "" && (React.createElement(Row, { className: "field", key: "Objection Document" },
|
24665
|
-
React.createElement(Col, { span:
|
24725
|
+
React.createElement(Col, { span: 18, className: "field-key" },
|
24666
24726
|
React.createElement("div", { className: "label-uploaded" }, t("programme:objectionLett")),
|
24667
24727
|
React.createElement("div", { className: "time" }, moment(parseInt(noObjectionDate)).format("DD MMMM YYYY @ HH:mm"))),
|
24668
|
-
React.createElement(Col, { span:
|
24728
|
+
React.createElement(Col, { span: 6, className: "field-value" },
|
24669
24729
|
React.createElement("div", { className: "link" },
|
24670
24730
|
React.createElement("a", { href: noObjectionDocUrl, target: "_blank", rel: "noopener noreferrer", download: true },
|
24671
24731
|
React.createElement(LinkOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } })))))),
|
24672
24732
|
React.createElement(Row, { className: "field", key: "Methodology Document" },
|
24673
|
-
React.createElement(Col, { span:
|
24733
|
+
React.createElement(Col, { span: 18, className: "field-key" },
|
24674
24734
|
React.createElement("div", { className: "label-container" },
|
24675
24735
|
React.createElement("div", { className: methodologyDocUrl !== "" ? "label-uploaded" : "label" }, t("programme:methDoc")),
|
24676
24736
|
methodDocStatus === DocumentStatus.PENDING &&
|
@@ -24693,7 +24753,7 @@ var ProgrammeDocuments = function (props) {
|
|
24693
24753
|
methodDocStatus === DocumentStatus.REJECTED && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
|
24694
24754
|
React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } })))),
|
24695
24755
|
methodologyDocUrl !== "" && (React.createElement("div", { className: "time" }, moment(parseInt(methodologyDate)).format("DD MMMM YYYY @ HH:mm")))),
|
24696
|
-
React.createElement(Col, { span:
|
24756
|
+
React.createElement(Col, { span: 6, className: "field-value" }, methodologyDocUrl !== "" ? (React.createElement("div", { className: "link" },
|
24697
24757
|
linkDocVisible(methodDocStatus) && (React.createElement("a", { href: methodologyDocUrl, target: "_blank", rel: "noopener noreferrer", download: true },
|
24698
24758
|
React.createElement(LinkOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))),
|
24699
24759
|
methodDocStatus !== DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
|
@@ -24735,13 +24795,68 @@ var ProgrammeDocuments = function (props) {
|
|
24735
24795
|
onUploadDocument(selectedFile, DocType.METHODOLOGY_DOCUMENT);
|
24736
24796
|
} }))))),
|
24737
24797
|
authorisationDocUrl !== "" && (React.createElement(Row, { className: "field", key: "Authorisation Document" },
|
24738
|
-
React.createElement(Col, { span:
|
24798
|
+
React.createElement(Col, { span: 18, className: "field-key" },
|
24739
24799
|
React.createElement("div", { className: "label-uploaded" }, t("programme:authLetterLabel")),
|
24740
24800
|
React.createElement("div", { className: "time" }, moment(parseInt(authorisationDocDate)).format("DD MMMM YYYY @ HH:mm"))),
|
24741
|
-
React.createElement(Col, { span:
|
24801
|
+
React.createElement(Col, { span: 6, className: "field-value" },
|
24742
24802
|
React.createElement("div", { className: "link" },
|
24743
24803
|
React.createElement("a", { href: authorisationDocUrl, target: "_blank", rel: "noopener noreferrer", download: true },
|
24744
|
-
React.createElement(LinkOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } }))))))
|
24804
|
+
React.createElement(LinkOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } })))))),
|
24805
|
+
React.createElement(Row, { className: "field", key: "Environmental Impact Assessment" },
|
24806
|
+
React.createElement(Col, { span: 18, className: "field-key" },
|
24807
|
+
React.createElement("div", { className: "label-container" },
|
24808
|
+
React.createElement("div", { className: impactAssessmentUrl !== "" ? "label-uploaded" : "label" }, t("programme:environmentalImpactAssessment")),
|
24809
|
+
impactAssessmentStatus === DocumentStatus.PENDING && (ministryLevelPermission || companyRolePermission) && (React.createElement(React.Fragment, null,
|
24810
|
+
React.createElement(LikeOutlined, { onClick: function () {
|
24811
|
+
return docAction(impactAssessmentId, DocumentStatus.ACCEPTED);
|
24812
|
+
}, className: "common-progress-icon", style: { color: "#976ED7" } }),
|
24813
|
+
React.createElement(DislikeOutlined, { onClick: function () {
|
24814
|
+
setRejectDocData({ id: impactAssessmentId });
|
24815
|
+
setActionInfo({
|
24816
|
+
action: "Reject",
|
24817
|
+
headerText: "".concat(t("programme:rejectDocHeader")),
|
24818
|
+
text: "".concat(t("programme:rejectDocBody")),
|
24819
|
+
type: "reject",
|
24820
|
+
icon: React.createElement(DislikeOutlined, null),
|
24821
|
+
});
|
24822
|
+
setOpenRejectDocConfirmationModal(true);
|
24823
|
+
}, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70" } }))),
|
24824
|
+
impactAssessmentStatus === DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
|
24825
|
+
impactAssessmentStatus === DocumentStatus.REJECTED && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
|
24826
|
+
React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } })))),
|
24827
|
+
impactAssessmentUrl !== "" && (React.createElement("div", { className: "time" }, moment(parseInt(impactAssessmentDate)).format("DD MMMM YYYY @ HH:mm")))),
|
24828
|
+
React.createElement(Col, { span: 6, className: "field-value" }, impactAssessmentUrl !== "" ? (React.createElement("div", { className: "link" },
|
24829
|
+
linkDocVisible(impactAssessmentStatus) && (React.createElement("a", { href: impactAssessmentUrl, target: "_blank", rel: "noopener noreferrer", download: true },
|
24830
|
+
React.createElement(LinkOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))),
|
24831
|
+
impactAssessmentStatus !== DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
|
24832
|
+
React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly ||
|
24833
|
+
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.CERTIFIER
|
24834
|
+
? t("programme:notAuthToUploadDoc")
|
24835
|
+
: !uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
|
24836
|
+
React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission)
|
24837
|
+
? { color: "#3F3A47", cursor: "pointer" }
|
24838
|
+
: { color: "#cacaca", cursor: "default" }, onClick: function () {
|
24839
|
+
return uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission) && handleImpactAssessmentFileUpload();
|
24840
|
+
} })),
|
24841
|
+
React.createElement("input", { type: "file", ref: fileInputRefImpactAssessment, style: { display: "none" }, accept: ".doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
|
24842
|
+
var selectedFile = e.target.files[0];
|
24843
|
+
e.target.value = null;
|
24844
|
+
onUploadDocument(selectedFile, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT);
|
24845
|
+
} }))))) : (React.createElement(React.Fragment, null,
|
24846
|
+
React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly ||
|
24847
|
+
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.CERTIFIER
|
24848
|
+
? t("programme:notAuthToUploadDoc")
|
24849
|
+
: !uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
|
24850
|
+
React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission)
|
24851
|
+
? { color: "#3F3A47", cursor: "pointer" }
|
24852
|
+
: { color: "#cacaca", cursor: "default" }, onClick: function () {
|
24853
|
+
return uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission) && handleImpactAssessmentFileUpload();
|
24854
|
+
} })),
|
24855
|
+
React.createElement("input", { type: "file", ref: fileInputRefImpactAssessment, style: { display: "none" }, accept: ".doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
|
24856
|
+
var selectedFile = e.target.files[0];
|
24857
|
+
e.target.value = null;
|
24858
|
+
onUploadDocument(selectedFile, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT);
|
24859
|
+
} }))))))),
|
24745
24860
|
React.createElement(RejectDocumentationConfirmationModel, { actionInfo: actionInfo, onActionConfirmed: handleOk, onActionCanceled: handleCancel, openModal: openRejectDocConfirmationModal, errorMsg: "", loading: loading, translator: translator })));
|
24746
24861
|
};
|
24747
24862
|
|