@undp/carbon-library 1.0.122 → 1.0.124-CARBON-276.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,5 +2,6 @@ export declare enum DocType {
2
2
  DESIGN_DOCUMENT = "0",
3
3
  METHODOLOGY_DOCUMENT = "1",
4
4
  MONITORING_REPORT = "2",
5
- VERIFICATION_REPORT = "3"
5
+ VERIFICATION_REPORT = "3",
6
+ ENVIRONMENTAL_IMPACT_ASSESSMENT = "7"
6
7
  }
@@ -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 isValidateFileType = function (fileType) {
11827
- return allowedFileTypes.includes(fileType);
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 (_c) {
12119
- switch (_c.label) {
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 = _c.sent();
12134
- _c.label = 2;
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: [
@@ -19107,6 +19152,11 @@ var CreditTransferComponent = function (props) {
19107
19152
  }); };
19108
19153
  Form.useForm()[0];
19109
19154
  var Search = Input.Search;
19155
+ var ministryLevelPermission = function (sectoralScope) {
19156
+ return ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY &&
19157
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly &&
19158
+ ministrySectoralScope.includes(sectoralScope));
19159
+ };
19110
19160
  var onCheckAllChange = function (e) {
19111
19161
  var nw = e.target.checked ? statusOptions.map(function (el) { return el.value; }) : [];
19112
19162
  setSelectedStatus(nw);
@@ -19367,7 +19417,8 @@ var CreditTransferComponent = function (props) {
19367
19417
  ], renderItem: function (item) { return (React.createElement(List.Item, { onClick: item.click },
19368
19418
  React.createElement(Typography.Text, { className: "action-icon ".concat(item.style) }, item.icon),
19369
19419
  React.createElement("span", null, item.text))); } })) : record.isRetirement &&
19370
- (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT ? (React.createElement(List, { className: "action-menu", size: "small", dataSource: [
19420
+ ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT ||
19421
+ ministryLevelPermission(record.programmeSectoralScope)) ? (React.createElement(List, { className: "action-menu", size: "small", dataSource: [
19371
19422
  {
19372
19423
  text: t("creditTransfer:recognise"),
19373
19424
  icon: React.createElement(Icon.Save, null),
@@ -24410,6 +24461,7 @@ var ProgrammeDocuments = function (props) {
24410
24461
  var _a = useConnection(); _a.delete; var post = _a.post;
24411
24462
  var fileInputRef = useRef(null);
24412
24463
  var fileInputRefMeth = useRef(null);
24464
+ var fileInputRefImpactAssessment = useRef(null);
24413
24465
  var _b = useState(false), loading = _b[0], setLoading = _b[1];
24414
24466
  var _c = useState(""), designDocUrl = _c[0], setDesignDocUrl = _c[1];
24415
24467
  var _d = useState(""), noObjectionDocUrl = _d[0], setNoObjectionDocUrl = _d[1];
@@ -24427,6 +24479,10 @@ var ProgrammeDocuments = function (props) {
24427
24479
  var _r = useState(false), openRejectDocConfirmationModal = _r[0], setOpenRejectDocConfirmationModal = _r[1];
24428
24480
  var _s = useState({}), actionInfo = _s[0], setActionInfo = _s[1];
24429
24481
  var _t = useState({}), rejectDocData = _t[0], setRejectDocData = _t[1];
24482
+ var _u = useState(""), impactAssessmentUrl = _u[0], setImpactAssessmentUrl = _u[1];
24483
+ var _v = useState(""), impactAssessmentDate = _v[0], setImpactAssessmentDate = _v[1];
24484
+ var _w = useState(""), impactAssessmentStatus = _w[0], setImpactAssessmentStatus = _w[1];
24485
+ var _x = useState(""), impactAssessmentId = _x[0], setImpactAssessmentId = _x[1];
24430
24486
  var maximumImageSize = process.env.REACT_APP_MAXIMUM_FILE_SIZE
24431
24487
  ? parseInt(process.env.REACT_APP_MAXIMUM_FILE_SIZE)
24432
24488
  : 5000000;
@@ -24438,13 +24494,17 @@ var ProgrammeDocuments = function (props) {
24438
24494
  var _a;
24439
24495
  (_a = fileInputRefMeth === null || fileInputRefMeth === void 0 ? void 0 : fileInputRefMeth.current) === null || _a === void 0 ? void 0 : _a.click();
24440
24496
  };
24497
+ var handleImpactAssessmentFileUpload = function () {
24498
+ var _a;
24499
+ (_a = fileInputRefImpactAssessment === null || fileInputRefImpactAssessment === void 0 ? void 0 : fileInputRefImpactAssessment.current) === null || _a === void 0 ? void 0 : _a.click();
24500
+ };
24441
24501
  useEffect(function () {
24442
24502
  setDocData(data);
24443
24503
  }, [data]);
24444
24504
  useEffect(function () {
24445
24505
  if (docData === null || docData === void 0 ? void 0 : docData.length) {
24446
24506
  docData === null || docData === void 0 ? void 0 : docData.map(function (item) {
24447
- var _a, _b, _c, _d;
24507
+ var _a, _b, _c, _d, _e;
24448
24508
  if ((_a = item === null || item === void 0 ? void 0 : item.url) === null || _a === void 0 ? void 0 : _a.includes("DESIGN")) {
24449
24509
  setDesignDocUrl(item === null || item === void 0 ? void 0 : item.url);
24450
24510
  setDesignDocDate(item === null || item === void 0 ? void 0 : item.txTime);
@@ -24465,6 +24525,12 @@ var ProgrammeDocuments = function (props) {
24465
24525
  setAuthorisationDocUrl(item === null || item === void 0 ? void 0 : item.url);
24466
24526
  setAuthorisationDocDate(item === null || item === void 0 ? void 0 : item.txTime);
24467
24527
  }
24528
+ if ((_e = item === null || item === void 0 ? void 0 : item.url) === null || _e === void 0 ? void 0 : _e.includes("ENVIRONMENTAL_IMPACT_ASSESSMENT")) {
24529
+ setImpactAssessmentUrl(item === null || item === void 0 ? void 0 : item.url);
24530
+ setImpactAssessmentDate(item === null || item === void 0 ? void 0 : item.txTime);
24531
+ setImpactAssessmentStatus(item === null || item === void 0 ? void 0 : item.status);
24532
+ setImpactAssessmentId(item === null || item === void 0 ? void 0 : item.id);
24533
+ }
24468
24534
  });
24469
24535
  }
24470
24536
  }, [docData]);
@@ -24497,7 +24563,7 @@ var ProgrammeDocuments = function (props) {
24497
24563
  _a.label = 2;
24498
24564
  case 2:
24499
24565
  _a.trys.push([2, 6, 7, 8]);
24500
- if (!isValidateFileType(file === null || file === void 0 ? void 0 : file.type)) return [3 /*break*/, 4];
24566
+ if (!isValidateFileType(file === null || file === void 0 ? void 0 : file.type, type)) return [3 /*break*/, 4];
24501
24567
  return [4 /*yield*/, post("national/programme/addDocument", {
24502
24568
  type: type,
24503
24569
  data: logoBase64,
@@ -24606,7 +24672,7 @@ var ProgrammeDocuments = function (props) {
24606
24672
  React.createElement("span", { className: "title-text" }, title)),
24607
24673
  React.createElement("div", null,
24608
24674
  React.createElement(Row, { className: "field", key: "Design Document" },
24609
- React.createElement(Col, { span: 14, className: "field-key" },
24675
+ React.createElement(Col, { span: 18, className: "field-key" },
24610
24676
  React.createElement("div", { className: "label-container" },
24611
24677
  React.createElement("div", { className: designDocUrl !== "" ? "label-uploaded" : "label" }, t("programme:designDoc")),
24612
24678
  designDocPending &&
@@ -24629,7 +24695,7 @@ var ProgrammeDocuments = function (props) {
24629
24695
  designDocStatus === DocumentStatus.REJECTED && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
24630
24696
  React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } })))),
24631
24697
  designDocUrl !== "" && (React.createElement("div", { className: "time" }, moment(parseInt(designDocDate)).format("DD MMMM YYYY @ HH:mm")))),
24632
- React.createElement(Col, { span: 10, className: "field-value" }, designDocUrl !== "" ? (React.createElement("div", { className: "link" },
24698
+ React.createElement(Col, { span: 6, className: "field-value" }, designDocUrl !== "" ? (React.createElement("div", { className: "link" },
24633
24699
  linkDocVisible(designDocStatus) && (React.createElement("a", { href: designDocUrl, target: "_blank", rel: "noopener noreferrer", download: true },
24634
24700
  React.createElement(LinkOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))),
24635
24701
  designDocStatus !== DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
@@ -24662,15 +24728,15 @@ var ProgrammeDocuments = function (props) {
24662
24728
  onUploadDocument(selectedFile, DocType.DESIGN_DOCUMENT);
24663
24729
  } }))))),
24664
24730
  noObjectionDocUrl !== "" && (React.createElement(Row, { className: "field", key: "Objection Document" },
24665
- React.createElement(Col, { span: 14, className: "field-key" },
24731
+ React.createElement(Col, { span: 18, className: "field-key" },
24666
24732
  React.createElement("div", { className: "label-uploaded" }, t("programme:objectionLett")),
24667
24733
  React.createElement("div", { className: "time" }, moment(parseInt(noObjectionDate)).format("DD MMMM YYYY @ HH:mm"))),
24668
- React.createElement(Col, { span: 10, className: "field-value" },
24734
+ React.createElement(Col, { span: 6, className: "field-value" },
24669
24735
  React.createElement("div", { className: "link" },
24670
24736
  React.createElement("a", { href: noObjectionDocUrl, target: "_blank", rel: "noopener noreferrer", download: true },
24671
24737
  React.createElement(LinkOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } })))))),
24672
24738
  React.createElement(Row, { className: "field", key: "Methodology Document" },
24673
- React.createElement(Col, { span: 14, className: "field-key" },
24739
+ React.createElement(Col, { span: 18, className: "field-key" },
24674
24740
  React.createElement("div", { className: "label-container" },
24675
24741
  React.createElement("div", { className: methodologyDocUrl !== "" ? "label-uploaded" : "label" }, t("programme:methDoc")),
24676
24742
  methodDocStatus === DocumentStatus.PENDING &&
@@ -24693,7 +24759,7 @@ var ProgrammeDocuments = function (props) {
24693
24759
  methodDocStatus === DocumentStatus.REJECTED && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
24694
24760
  React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } })))),
24695
24761
  methodologyDocUrl !== "" && (React.createElement("div", { className: "time" }, moment(parseInt(methodologyDate)).format("DD MMMM YYYY @ HH:mm")))),
24696
- React.createElement(Col, { span: 10, className: "field-value" }, methodologyDocUrl !== "" ? (React.createElement("div", { className: "link" },
24762
+ React.createElement(Col, { span: 6, className: "field-value" }, methodologyDocUrl !== "" ? (React.createElement("div", { className: "link" },
24697
24763
  linkDocVisible(methodDocStatus) && (React.createElement("a", { href: methodologyDocUrl, target: "_blank", rel: "noopener noreferrer", download: true },
24698
24764
  React.createElement(LinkOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))),
24699
24765
  methodDocStatus !== DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
@@ -24735,13 +24801,68 @@ var ProgrammeDocuments = function (props) {
24735
24801
  onUploadDocument(selectedFile, DocType.METHODOLOGY_DOCUMENT);
24736
24802
  } }))))),
24737
24803
  authorisationDocUrl !== "" && (React.createElement(Row, { className: "field", key: "Authorisation Document" },
24738
- React.createElement(Col, { span: 14, className: "field-key" },
24804
+ React.createElement(Col, { span: 18, className: "field-key" },
24739
24805
  React.createElement("div", { className: "label-uploaded" }, t("programme:authLetterLabel")),
24740
24806
  React.createElement("div", { className: "time" }, moment(parseInt(authorisationDocDate)).format("DD MMMM YYYY @ HH:mm"))),
24741
- React.createElement(Col, { span: 10, className: "field-value" },
24807
+ React.createElement(Col, { span: 6, className: "field-value" },
24742
24808
  React.createElement("div", { className: "link" },
24743
24809
  React.createElement("a", { href: authorisationDocUrl, target: "_blank", rel: "noopener noreferrer", download: true },
24744
- React.createElement(LinkOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } })))))))),
24810
+ React.createElement(LinkOutlined, { className: "common-progress-icon", style: { color: "#3F3A47" } })))))),
24811
+ React.createElement(Row, { className: "field", key: "Environmental Impact Assessment" },
24812
+ React.createElement(Col, { span: 18, className: "field-key" },
24813
+ React.createElement("div", { className: "label-container" },
24814
+ React.createElement("div", { className: impactAssessmentUrl !== "" ? "label-uploaded" : "label" }, t("programme:environmentalImpactAssessment")),
24815
+ impactAssessmentStatus === DocumentStatus.PENDING && (ministryLevelPermission || companyRolePermission) && (React.createElement(React.Fragment, null,
24816
+ React.createElement(LikeOutlined, { onClick: function () {
24817
+ return docAction(impactAssessmentId, DocumentStatus.ACCEPTED);
24818
+ }, className: "common-progress-icon", style: { color: "#976ED7" } }),
24819
+ React.createElement(DislikeOutlined, { onClick: function () {
24820
+ setRejectDocData({ id: impactAssessmentId });
24821
+ setActionInfo({
24822
+ action: "Reject",
24823
+ headerText: "".concat(t("programme:rejectDocHeader")),
24824
+ text: "".concat(t("programme:rejectDocBody")),
24825
+ type: "reject",
24826
+ icon: React.createElement(DislikeOutlined, null),
24827
+ });
24828
+ setOpenRejectDocConfirmationModal(true);
24829
+ }, className: "common-progress-icon margin-left-1", style: { color: "#FD6F70" } }))),
24830
+ impactAssessmentStatus === DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
24831
+ impactAssessmentStatus === DocumentStatus.REJECTED && (React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: t("programme:rejectTip"), overlayClassName: "custom-tooltip" },
24832
+ React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } })))),
24833
+ impactAssessmentUrl !== "" && (React.createElement("div", { className: "time" }, moment(parseInt(impactAssessmentDate)).format("DD MMMM YYYY @ HH:mm")))),
24834
+ React.createElement(Col, { span: 6, className: "field-value" }, impactAssessmentUrl !== "" ? (React.createElement("div", { className: "link" },
24835
+ linkDocVisible(impactAssessmentStatus) && (React.createElement("a", { href: impactAssessmentUrl, target: "_blank", rel: "noopener noreferrer", download: true },
24836
+ React.createElement(LinkOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))),
24837
+ impactAssessmentStatus !== DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
24838
+ React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly ||
24839
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.CERTIFIER
24840
+ ? t("programme:notAuthToUploadDoc")
24841
+ : !uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
24842
+ React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission)
24843
+ ? { color: "#3F3A47", cursor: "pointer" }
24844
+ : { color: "#cacaca", cursor: "default" }, onClick: function () {
24845
+ return uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission) && handleImpactAssessmentFileUpload();
24846
+ } })),
24847
+ React.createElement("input", { type: "file", ref: fileInputRefImpactAssessment, style: { display: "none" }, accept: ".doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
24848
+ var selectedFile = e.target.files[0];
24849
+ e.target.value = null;
24850
+ onUploadDocument(selectedFile, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT);
24851
+ } }))))) : (React.createElement(React.Fragment, null,
24852
+ React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly ||
24853
+ (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.CERTIFIER
24854
+ ? t("programme:notAuthToUploadDoc")
24855
+ : !uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
24856
+ React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission)
24857
+ ? { color: "#3F3A47", cursor: "pointer" }
24858
+ : { color: "#cacaca", cursor: "default" }, onClick: function () {
24859
+ return uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission) && handleImpactAssessmentFileUpload();
24860
+ } })),
24861
+ React.createElement("input", { type: "file", ref: fileInputRefImpactAssessment, style: { display: "none" }, accept: ".doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
24862
+ var selectedFile = e.target.files[0];
24863
+ e.target.value = null;
24864
+ onUploadDocument(selectedFile, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT);
24865
+ } }))))))),
24745
24866
  React.createElement(RejectDocumentationConfirmationModel, { actionInfo: actionInfo, onActionConfirmed: handleOk, onActionCanceled: handleCancel, openModal: openRejectDocConfirmationModal, errorMsg: "", loading: loading, translator: translator })));
24746
24867
  };
24747
24868