@undp/carbon-library 1.0.41-CARBON-329.10 → 1.0.41-CARBON-329.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React from "react";
2
2
  interface Item {
3
3
  key: string;
4
4
  name: string;
@@ -1,3 +1,3 @@
1
1
  import { DocType, DocumentStatus } from "../Definitions";
2
2
  export declare const linkDocVisible: (docStatus: DocumentStatus) => boolean;
3
- export declare const uploadDocUserPermission: (userInfoState: any, docType: DocType, programmeOwnerId: any[], ministryLevelPermission?: boolean, programmeStatus?: any) => boolean;
3
+ export declare const uploadDocUserPermission: (userInfoState: any, docType: DocType, programmeOwnerId: any[], ministryLevelPermission?: boolean) => boolean;
package/dist/esm/index.js CHANGED
@@ -19490,11 +19490,8 @@ var linkDocVisible = function (docStatus) {
19490
19490
  }
19491
19491
  return visible;
19492
19492
  };
19493
- var uploadDocUserPermission = function (userInfoState, docType, programmeOwnerId, ministryLevelPermission, programmeStatus) {
19493
+ var uploadDocUserPermission = function (userInfoState, docType, programmeOwnerId, ministryLevelPermission) {
19494
19494
  var permission = false;
19495
- if (programmeStatus && programmeStatus === ProgrammeStageUnified.Rejected) {
19496
- return false;
19497
- }
19498
19495
  if (docType === DocType.DESIGN_DOCUMENT) {
19499
19496
  if (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT ||
19500
19497
  ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY && ministryLevelPermission)) &&
@@ -24475,7 +24472,7 @@ var EditableCell = function (_a) {
24475
24472
  return [3 /*break*/, 3];
24476
24473
  case 2:
24477
24474
  errInfo_1 = _a.sent();
24478
- console.log('Save failed:', errInfo_1);
24475
+ console.log("Save failed:", errInfo_1);
24479
24476
  return [3 /*break*/, 3];
24480
24477
  case 3: return [2 /*return*/];
24481
24478
  }
@@ -24489,7 +24486,7 @@ var EditableCell = function (_a) {
24489
24486
  message: "".concat(title, " is required."),
24490
24487
  },
24491
24488
  ] },
24492
- React.createElement(Input, { ref: inputRef, onPressEnter: save, onBlur: save }))) : (React.createElement("div", { className: "editable-cell-value-wrap", style: { paddingRight: 24 }, onClick: toggleEdit }, children));
24489
+ 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));
24493
24490
  }
24494
24491
  return React.createElement("td", __assign({}, restProps), childNode);
24495
24492
  };
@@ -24497,6 +24494,11 @@ var EditableCell = function (_a) {
24497
24494
  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";
24498
24495
  styleInject(css_248z$4);
24499
24496
 
24497
+ var NdcActionType;
24498
+ (function (NdcActionType) {
24499
+ NdcActionType[NdcActionType["main"] = 0] = "main";
24500
+ NdcActionType[NdcActionType["sub"] = 1] = "sub";
24501
+ })(NdcActionType || (NdcActionType = {}));
24500
24502
  var NdcDetailsComponent = function (props) {
24501
24503
  var t = props.t; props.useConnection; var useUserContext = props.useUserContext;
24502
24504
  var RangePicker = DatePicker.RangePicker;
@@ -24507,6 +24509,8 @@ var NdcDetailsComponent = function (props) {
24507
24509
  var _d = useState("add_new"), selectedTab = _d[0], setSelectedTab = _d[1];
24508
24510
  var selectedPeriod = useRef({});
24509
24511
  var addedNdcDetailId = useRef(0);
24512
+ var selectedNdcDetail = useRef({});
24513
+ var _e = useState(0), tableKey = _e[0], setTableKey = _e[1];
24510
24514
  var userInfoState = useUserContext().userInfoState;
24511
24515
  var isAddRangeVisible = function () {
24512
24516
  return (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY ||
@@ -24521,11 +24525,35 @@ var NdcDetailsComponent = function (props) {
24521
24525
  return num >= min && num <= max;
24522
24526
  };
24523
24527
  var handleSave = function (row) {
24524
- var newData = __spreadArray([], ndcDetailsData, true);
24525
- var index = newData.findIndex(function (item) { return row.key === item.key; });
24526
- var item = newData[index];
24527
- newData.splice(index, 1, __assign(__assign({}, item), row));
24528
- setNdcDetailsData(newData);
24528
+ if (row.type === NdcActionType.main) {
24529
+ var newData = __spreadArray([], ndcDetailsData, true);
24530
+ var index = newData.findIndex(function (item) { return row.key === item.key; });
24531
+ var item = newData[index];
24532
+ newData.splice(index, 1, __assign(__assign({}, item), row));
24533
+ setNdcDetailsData(newData);
24534
+ }
24535
+ else {
24536
+ var newData = __spreadArray([], ndcDetailsData, true);
24537
+ var parentIndex = newData.findIndex(function (item) { return row.ndcActionId === item.key; });
24538
+ var parentItem = newData[parentIndex];
24539
+ if (parentItem) {
24540
+ if (parentItem.subNdcDetails) {
24541
+ var itemIndex = parentItem.subNdcDetails.findIndex(function (item) { return row.key === item.key; });
24542
+ if (itemIndex === -1) {
24543
+ parentItem.subNdcDetails.push(row);
24544
+ }
24545
+ else {
24546
+ parentItem.subNdcDetails.splice(itemIndex, 1, __assign({}, row));
24547
+ }
24548
+ }
24549
+ else {
24550
+ parentItem.subNdcDetails = [row];
24551
+ }
24552
+ }
24553
+ newData.splice(parentIndex, 1, __assign({}, parentItem));
24554
+ setNdcDetailsData(newData);
24555
+ setTableKey(function (key) { return key + 1; });
24556
+ }
24529
24557
  };
24530
24558
  var getNdcDetailsForPeriod = function () {
24531
24559
  var range = selectedTab.split("-");
@@ -24539,6 +24567,15 @@ var NdcDetailsComponent = function (props) {
24539
24567
  return [];
24540
24568
  }
24541
24569
  };
24570
+ var getSubNdcDetails = function (key) {
24571
+ var ndcDetail = ndcDetailsData.find(function (item) { return item.key === key; });
24572
+ if (ndcDetail) {
24573
+ return ndcDetail.subNdcDetails;
24574
+ }
24575
+ else {
24576
+ return [];
24577
+ }
24578
+ };
24542
24579
  var defaultColumns = [
24543
24580
  {
24544
24581
  title: t("ndc:ndcColumnsNationalPlanObj"),
@@ -24546,6 +24583,9 @@ var NdcDetailsComponent = function (props) {
24546
24583
  key: "nationalPlanObj",
24547
24584
  align: "left",
24548
24585
  editable: true,
24586
+ width: "50%",
24587
+ render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(Space, { size: "middle" },
24588
+ React.createElement("span", null, record.nationalPlanObj))) : (React.createElement("input", { placeholder: "Please add the National Plan Objective", className: "ant-input", disabled: true, type: "text" })))); },
24549
24589
  },
24550
24590
  {
24551
24591
  title: t("ndc:ndcColumnsKpi"),
@@ -24553,13 +24593,19 @@ var NdcDetailsComponent = function (props) {
24553
24593
  key: "kpi",
24554
24594
  align: "left",
24555
24595
  editable: true,
24596
+ width: "10%",
24597
+ render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(Space, { size: "middle" },
24598
+ React.createElement("span", null, record.kpi))) : (React.createElement("input", { placeholder: "Enter Kpi", className: "ant-input", disabled: true, type: "text" })))); },
24556
24599
  },
24557
24600
  {
24558
- title: 'Ministry',
24601
+ title: "Ministry",
24559
24602
  dataIndex: "ministry",
24560
24603
  key: "ministry",
24561
24604
  align: "left",
24562
24605
  editable: true,
24606
+ width: "40%",
24607
+ render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(Space, { size: "middle" },
24608
+ React.createElement("span", null, record.ministry))) : (React.createElement("input", { placeholder: "Please add the Ministry name", className: "ant-input", disabled: true, type: "text" })))); },
24563
24609
  },
24564
24610
  ];
24565
24611
  var columns = defaultColumns.map(function (col) {
@@ -24576,14 +24622,27 @@ var NdcDetailsComponent = function (props) {
24576
24622
  });
24577
24623
  function onAddNewNdcDetail() {
24578
24624
  var range = selectedTab.split("-");
24579
- addedNdcDetailId.current = addedNdcDetailId.current + 1;
24625
+ var ndcActionId = ++addedNdcDetailId.current;
24580
24626
  var newData = {
24581
- key: addedNdcDetailId.current,
24627
+ key: ndcActionId,
24628
+ type: NdcActionType.main,
24582
24629
  startDate: new Date("".concat(Number(range[0]), "-01-24 23:12:00")),
24583
24630
  endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
24584
- nationalPlanObj: t("ndc:enterNewPlanTxt"),
24585
- kpi: 0,
24586
- ministry: "Please add the Ministry name"
24631
+ nationalPlanObj: "",
24632
+ kpi: "",
24633
+ ministry: "",
24634
+ subNdcDetails: [
24635
+ {
24636
+ key: ++addedNdcDetailId.current,
24637
+ ndcActionId: ndcActionId,
24638
+ type: NdcActionType.sub,
24639
+ startDate: new Date("2019-03-25"),
24640
+ endDate: new Date("2020-03-25"),
24641
+ nationalPlanObj: "",
24642
+ kpi: "",
24643
+ ministry: "",
24644
+ },
24645
+ ],
24587
24646
  };
24588
24647
  setNdcDetailsData(__spreadArray(__spreadArray([], ndcDetailsData, true), [newData], false));
24589
24648
  }
@@ -24665,6 +24724,10 @@ var NdcDetailsComponent = function (props) {
24665
24724
  React.createElement(Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit")),
24666
24725
  React.createElement(Button, { className: "back-btn", onClick: onCancelPeriod, loading: loading }, t("ndc:back"))))));
24667
24726
  }
24727
+ function getSubNdcActionContent(record) {
24728
+ selectedNdcDetail.current = record;
24729
+ return (React.createElement(Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getSubNdcDetails(record.key), columns: columns, showHeader: false, pagination: false }));
24730
+ }
24668
24731
  var onTabChange = function (key) {
24669
24732
  setSelectedTab(key);
24670
24733
  };
@@ -24672,43 +24735,232 @@ var NdcDetailsComponent = function (props) {
24672
24735
  var defaultNdcDetails = [
24673
24736
  {
24674
24737
  key: 1,
24738
+ type: NdcActionType.main,
24675
24739
  startDate: new Date("2019-03-25"),
24676
24740
  endDate: new Date("2020-03-25"),
24677
24741
  nationalPlanObj: "Enhance value addition in key growth opportunities",
24678
24742
  kpi: 25,
24679
- ministry: "Ministry of Agriculture, Water and Forestry (MAWF)"
24743
+ ministry: "Ministry of Environment",
24744
+ subNdcDetails: [
24745
+ {
24746
+ key: 6,
24747
+ ndcActionId: 1,
24748
+ type: NdcActionType.sub,
24749
+ startDate: new Date("2019-03-25"),
24750
+ endDate: new Date("2020-03-25"),
24751
+ nationalPlanObj: "Enhance value addition in key growth opportunities sub details",
24752
+ kpi: 25,
24753
+ ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
24754
+ },
24755
+ {
24756
+ key: 7,
24757
+ ndcActionId: 1,
24758
+ type: NdcActionType.sub,
24759
+ startDate: new Date("2019-03-25"),
24760
+ endDate: new Date("2020-03-25"),
24761
+ nationalPlanObj: "",
24762
+ kpi: "",
24763
+ ministry: "",
24764
+ },
24765
+ ],
24680
24766
  },
24681
24767
  {
24682
24768
  key: 2,
24769
+ type: NdcActionType.main,
24683
24770
  startDate: new Date("2019-03-25"),
24684
24771
  endDate: new Date("2019-08-25"),
24685
24772
  nationalPlanObj: "Strengthen the private sector to create 10,000 jobs",
24686
24773
  kpi: 10500,
24687
- ministry: "Ministry of Tourism (MoT)"
24774
+ ministry: "Ministry of Environment",
24775
+ subNdcDetails: [
24776
+ {
24777
+ key: 8,
24778
+ ndcActionId: 2,
24779
+ type: NdcActionType.sub,
24780
+ startDate: new Date("2019-03-25"),
24781
+ endDate: new Date("2020-03-25"),
24782
+ nationalPlanObj: "",
24783
+ kpi: "",
24784
+ ministry: "",
24785
+ },
24786
+ ],
24787
+ },
24788
+ {
24789
+ key: 12,
24790
+ type: NdcActionType.main,
24791
+ startDate: new Date("2019-03-25"),
24792
+ endDate: new Date("2019-08-25"),
24793
+ nationalPlanObj: "Other",
24794
+ kpi: 10500,
24795
+ ministry: "Ministry of Environment",
24796
+ subNdcDetails: [
24797
+ {
24798
+ key: 8,
24799
+ ndcActionId: 12,
24800
+ type: NdcActionType.sub,
24801
+ startDate: new Date("2019-03-25"),
24802
+ endDate: new Date("2020-03-25"),
24803
+ nationalPlanObj: "",
24804
+ kpi: "",
24805
+ ministry: "",
24806
+ },
24807
+ ],
24688
24808
  },
24689
24809
  {
24690
24810
  key: 3,
24811
+ type: NdcActionType.main,
24691
24812
  startDate: new Date("2021-03-25"),
24692
24813
  endDate: new Date("2022-03-25"),
24693
24814
  nationalPlanObj: "Consolidate and increase the stock and quality of productive infrastructure by 50%",
24694
24815
  kpi: 48,
24695
- ministry: "Ministry of Education, Arts and Culture (MoE)"
24816
+ ministry: "Ministry of Environment",
24817
+ subNdcDetails: [
24818
+ {
24819
+ key: 9,
24820
+ ndcActionId: 3,
24821
+ type: NdcActionType.sub,
24822
+ startDate: new Date("2019-03-25"),
24823
+ endDate: new Date("2020-03-25"),
24824
+ nationalPlanObj: "",
24825
+ kpi: "",
24826
+ ministry: "",
24827
+ },
24828
+ ],
24696
24829
  },
24697
24830
  {
24698
24831
  key: 4,
24832
+ type: NdcActionType.main,
24699
24833
  startDate: new Date("2022-03-25"),
24700
24834
  endDate: new Date("2022-05-25"),
24701
24835
  nationalPlanObj: "Enhance the productivity and social wellbeing of the population",
24702
24836
  kpi: 20,
24703
- ministry: "Ministry of Environment, Forestry and Tourism (MEFT)"
24837
+ ministry: "Ministry of Environment",
24838
+ subNdcDetails: [
24839
+ {
24840
+ key: 10,
24841
+ ndcActionId: 4,
24842
+ type: NdcActionType.sub,
24843
+ startDate: new Date("2019-03-25"),
24844
+ endDate: new Date("2020-03-25"),
24845
+ nationalPlanObj: "",
24846
+ kpi: "",
24847
+ ministry: "",
24848
+ },
24849
+ ],
24704
24850
  },
24705
24851
  {
24706
24852
  key: 5,
24853
+ type: NdcActionType.main,
24707
24854
  startDate: new Date("2022-03-25"),
24708
24855
  endDate: new Date("2023-03-25"),
24709
24856
  nationalPlanObj: "Strengthen the role of the state in guiding and facilitating development",
24710
24857
  kpi: 10,
24711
- ministry: "Ministry of Tourism (MoT)"
24858
+ ministry: "Ministry of Environment",
24859
+ subNdcDetails: [
24860
+ {
24861
+ key: 11,
24862
+ ndcActionId: 5,
24863
+ type: NdcActionType.sub,
24864
+ startDate: new Date("2019-03-25"),
24865
+ endDate: new Date("2020-03-25"),
24866
+ nationalPlanObj: "",
24867
+ kpi: "",
24868
+ ministry: "",
24869
+ },
24870
+ ],
24871
+ },
24872
+ {
24873
+ key: 13,
24874
+ type: NdcActionType.main,
24875
+ startDate: new Date("2022-03-25"),
24876
+ endDate: new Date("2023-03-25"),
24877
+ nationalPlanObj: "Convert to solar energy",
24878
+ kpi: 50000,
24879
+ ministry: "Ministry of Environment",
24880
+ subNdcDetails: [
24881
+ {
24882
+ key: 11,
24883
+ ndcActionId: 13,
24884
+ type: NdcActionType.sub,
24885
+ startDate: new Date("2019-03-25"),
24886
+ endDate: new Date("2020-03-25"),
24887
+ nationalPlanObj: "Convert to solar energy",
24888
+ kpi: "3000",
24889
+ ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
24890
+ },
24891
+ {
24892
+ key: 14,
24893
+ ndcActionId: 13,
24894
+ type: NdcActionType.sub,
24895
+ startDate: new Date("2019-03-25"),
24896
+ endDate: new Date("2020-03-25"),
24897
+ nationalPlanObj: "",
24898
+ kpi: "",
24899
+ ministry: "",
24900
+ },
24901
+ ],
24902
+ },
24903
+ {
24904
+ key: 15,
24905
+ type: NdcActionType.main,
24906
+ startDate: new Date("2022-03-25"),
24907
+ endDate: new Date("2023-03-25"),
24908
+ nationalPlanObj: "Strengthen the private sector to create jobs",
24909
+ kpi: 10000,
24910
+ ministry: "Ministry of Environment",
24911
+ subNdcDetails: [
24912
+ {
24913
+ key: 16,
24914
+ ndcActionId: 15,
24915
+ type: NdcActionType.sub,
24916
+ startDate: new Date("2019-03-25"),
24917
+ endDate: new Date("2020-03-25"),
24918
+ nationalPlanObj: "Strengthen the private sector to create jobs",
24919
+ kpi: "7200",
24920
+ ministry: "Ministry of Tourism (MoT)",
24921
+ },
24922
+ {
24923
+ key: 17,
24924
+ ndcActionId: 15,
24925
+ type: NdcActionType.sub,
24926
+ startDate: new Date("2019-03-25"),
24927
+ endDate: new Date("2020-03-25"),
24928
+ nationalPlanObj: "",
24929
+ kpi: "",
24930
+ ministry: "",
24931
+ },
24932
+ ],
24933
+ },
24934
+ {
24935
+ key: 18,
24936
+ type: NdcActionType.main,
24937
+ startDate: new Date("2022-03-25"),
24938
+ endDate: new Date("2023-03-25"),
24939
+ nationalPlanObj: "Other",
24940
+ kpi: '',
24941
+ ministry: "Ministry of Environment",
24942
+ subNdcDetails: [
24943
+ {
24944
+ key: 19,
24945
+ ndcActionId: 18,
24946
+ type: NdcActionType.sub,
24947
+ startDate: new Date("2019-03-25"),
24948
+ endDate: new Date("2020-03-25"),
24949
+ nationalPlanObj: "Strengthen the private sector to create jobs",
24950
+ kpi: "",
24951
+ ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
24952
+ },
24953
+ {
24954
+ key: 20,
24955
+ ndcActionId: 18,
24956
+ type: NdcActionType.sub,
24957
+ startDate: new Date("2019-03-25"),
24958
+ endDate: new Date("2020-03-25"),
24959
+ nationalPlanObj: "",
24960
+ kpi: "",
24961
+ ministry: "",
24962
+ },
24963
+ ],
24712
24964
  },
24713
24965
  ];
24714
24966
  var initialPeriods = [
@@ -24736,7 +24988,7 @@ var NdcDetailsComponent = function (props) {
24736
24988
  children: addNewPeriodContent(),
24737
24989
  });
24738
24990
  }
24739
- addedNdcDetailId.current = 5;
24991
+ addedNdcDetailId.current = 20;
24740
24992
  setPeriodItems(initialPeriods);
24741
24993
  periodItemsRef.current = initialPeriods;
24742
24994
  setNdcDetailsData(defaultNdcDetails);
@@ -24751,7 +25003,11 @@ var NdcDetailsComponent = function (props) {
24751
25003
  React.createElement(Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedTab, onChange: onTabChange })),
24752
25004
  selectedTab !== "add_new" && (React.createElement("div", null,
24753
25005
  React.createElement("div", null,
24754
- React.createElement(Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getNdcDetailsForPeriod(), columns: columns, footer: function () {
25006
+ React.createElement(Table, { key: tableKey, components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getNdcDetailsForPeriod(), columns: columns, expandable: {
25007
+ expandedRowRender: function (record) { return getSubNdcActionContent(record); },
25008
+ indentSize: 0,
25009
+ defaultExpandedRowKeys: [selectedNdcDetail.current.key],
25010
+ }, footer: function () {
24755
25011
  return isAddNdcActionVisible() && (React.createElement(Row, { justify: "center" },
24756
25012
  React.createElement(Button, { onClick: onAddNewNdcDetail, type: "default", style: {
24757
25013
  marginBottom: 16,
@@ -25897,6 +26153,13 @@ var ProgrammeDocuments = function (props) {
25897
26153
  var maximumImageSize = process.env.REACT_APP_MAXIMUM_FILE_SIZE
25898
26154
  ? parseInt(process.env.REACT_APP_MAXIMUM_FILE_SIZE)
25899
26155
  : 5000000;
26156
+ var isProjectRejected = programmeStatus && programmeStatus === ProgrammeStageUnified.Rejected;
26157
+ var uploadImpactAssessmentDocUserPermission = uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission);
26158
+ var impactAssessmentToolTipTitle = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly
26159
+ ? t("programme:notAuthToUploadDoc")
26160
+ : isProjectRejected
26161
+ ? t("programme:docUploadProgrammeRejected")
26162
+ : !uploadImpactAssessmentDocUserPermission && t("programme:orgNotAuth");
25900
26163
  var handleDesignDocFileUpload = function () {
25901
26164
  var _a;
25902
26165
  (_a = fileInputRef === null || fileInputRef === void 0 ? void 0 : fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click();
@@ -25921,8 +26184,8 @@ var ProgrammeDocuments = function (props) {
25921
26184
  setDesignDocDate(item === null || item === void 0 ? void 0 : item.txTime);
25922
26185
  setDesignDocStatus(item === null || item === void 0 ? void 0 : item.status);
25923
26186
  setDesignDocId(item === null || item === void 0 ? void 0 : item.id);
25924
- var versionfull = (item === null || item === void 0 ? void 0 : item.url).split("_")[(item === null || item === void 0 ? void 0 : item.url).split('_').length - 1];
25925
- var version = versionfull ? versionfull.split('.')[0] : "1";
26187
+ var versionfull = (item === null || item === void 0 ? void 0 : item.url).split("_")[(item === null || item === void 0 ? void 0 : item.url).split("_").length - 1];
26188
+ var version = versionfull ? versionfull.split(".")[0] : "1";
25926
26189
  setDesignDocversion(version.startsWith("V") ? version : "V1");
25927
26190
  }
25928
26191
  if ((_b = item === null || item === void 0 ? void 0 : item.url) === null || _b === void 0 ? void 0 : _b.includes("METHODOLOGY")) {
@@ -25930,8 +26193,8 @@ var ProgrammeDocuments = function (props) {
25930
26193
  setMethodologyDate(item === null || item === void 0 ? void 0 : item.txTime);
25931
26194
  setMethodDocStatus(item === null || item === void 0 ? void 0 : item.status);
25932
26195
  setMethDocId(item === null || item === void 0 ? void 0 : item.id);
25933
- var versionfull = (item === null || item === void 0 ? void 0 : item.url).split("_")[(item === null || item === void 0 ? void 0 : item.url).split('_').length - 1];
25934
- var version = versionfull ? versionfull.split('.')[0] : "1";
26196
+ var versionfull = (item === null || item === void 0 ? void 0 : item.url).split("_")[(item === null || item === void 0 ? void 0 : item.url).split("_").length - 1];
26197
+ var version = versionfull ? versionfull.split(".")[0] : "1";
25935
26198
  setMethDocversion(version.startsWith("V") ? version : "V1");
25936
26199
  }
25937
26200
  if ((_c = item === null || item === void 0 ? void 0 : item.url) === null || _c === void 0 ? void 0 : _c.includes("OBJECTION")) {
@@ -25948,7 +26211,7 @@ var ProgrammeDocuments = function (props) {
25948
26211
  setImpactAssessmentStatus(item === null || item === void 0 ? void 0 : item.status);
25949
26212
  setImpactAssessmentId(item === null || item === void 0 ? void 0 : item.id);
25950
26213
  var versionfull = (item === null || item === void 0 ? void 0 : item.url).split("_")[(item === null || item === void 0 ? void 0 : item.url).split("_").length - 1];
25951
- var version = versionfull ? versionfull.split('.')[0] : "1";
26214
+ var version = versionfull ? versionfull.split(".")[0] : "1";
25952
26215
  setImpactAssessmentversion(version.startsWith("V") ? version : "V1");
25953
26216
  }
25954
26217
  });
@@ -26124,11 +26387,11 @@ var ProgrammeDocuments = function (props) {
26124
26387
  React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly ||
26125
26388
  (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.CERTIFIER
26126
26389
  ? t("programme:notAuthToUploadDoc")
26127
- : !uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission, programmeStatus) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
26128
- React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission, programmeStatus)
26390
+ : !uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
26391
+ React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission)
26129
26392
  ? { color: "#3F3A47", cursor: "pointer" }
26130
26393
  : { color: "#cacaca", cursor: "default" }, onClick: function () {
26131
- return uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission, programmeStatus) && handleDesignDocFileUpload();
26394
+ return uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && handleDesignDocFileUpload();
26132
26395
  } })),
26133
26396
  React.createElement("input", { type: "file", ref: fileInputRef, style: { display: "none" }, accept: ".xls, .xlsx, .ppt, .pptx, .csv, .doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
26134
26397
  var selectedFile = e.target.files[0];
@@ -26138,11 +26401,11 @@ var ProgrammeDocuments = function (props) {
26138
26401
  React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly ||
26139
26402
  (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.CERTIFIER
26140
26403
  ? t("programme:notAuthToUploadDoc")
26141
- : !uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission, programmeStatus) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
26142
- React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission, programmeStatus)
26404
+ : !uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
26405
+ React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission)
26143
26406
  ? { color: "#3F3A47", cursor: "pointer" }
26144
26407
  : { color: "#cacaca", cursor: "default" }, onClick: function () {
26145
- return uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission, programmeStatus) && handleDesignDocFileUpload();
26408
+ return uploadDocUserPermission(userInfoState, DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && handleDesignDocFileUpload();
26146
26409
  } })),
26147
26410
  React.createElement("input", { type: "file", ref: fileInputRef, style: { display: "none" }, accept: ".xls, .xlsx, .ppt, .pptx, .csv, .doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
26148
26411
  var selectedFile = e.target.files[0];
@@ -26191,13 +26454,13 @@ var ProgrammeDocuments = function (props) {
26191
26454
  methodDocStatus !== DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
26192
26455
  React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly
26193
26456
  ? t("programme:notAuthToUploadDoc")
26194
- : !uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission, programmeStatus) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
26457
+ : !uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
26195
26458
  React.createElement(FileAddOutlined, { className: "common-progress-icon", style: designDocStatus === DocumentStatus.ACCEPTED &&
26196
- uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission, programmeStatus)
26459
+ uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission)
26197
26460
  ? { color: "#3F3A47", cursor: "pointer" }
26198
26461
  : { color: "#cacaca" }, onClick: function () {
26199
26462
  return designDocStatus === DocumentStatus.ACCEPTED &&
26200
- uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission, programmeStatus) &&
26463
+ uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission) &&
26201
26464
  handleMethodologyFileUpload();
26202
26465
  } })),
26203
26466
  React.createElement("input", { type: "file", ref: fileInputRefMeth, style: { display: "none" }, accept: ".xls, .xlsx, .ppt, .pptx, .csv, .doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
@@ -26208,16 +26471,16 @@ var ProgrammeDocuments = function (props) {
26208
26471
  } }))))) : (React.createElement(React.Fragment, null,
26209
26472
  React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly
26210
26473
  ? t("programme:notAuthToUploadDoc")
26211
- : uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission, programmeStatus)
26474
+ : uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission)
26212
26475
  ? designDocStatus !== DocumentStatus.ACCEPTED &&
26213
26476
  t("programme:designDocNotApproved")
26214
26477
  : t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
26215
26478
  React.createElement(FileAddOutlined, { className: "common-progress-icon", style: designDocStatus === DocumentStatus.ACCEPTED &&
26216
- uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission, programmeStatus)
26479
+ uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission)
26217
26480
  ? { color: "#3F3A47", cursor: "pointer" }
26218
26481
  : { color: "#cacaca", cursor: "default" }, onClick: function () {
26219
26482
  return designDocStatus === DocumentStatus.ACCEPTED &&
26220
- uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission, programmeStatus) &&
26483
+ uploadDocUserPermission(userInfoState, DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission) &&
26221
26484
  handleMethodologyFileUpload();
26222
26485
  } })),
26223
26486
  React.createElement("input", { type: "file", ref: fileInputRefMeth, style: { display: "none" }, accept: ".xls, .xlsx, .ppt, .pptx, .csv, .doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
@@ -26240,7 +26503,8 @@ var ProgrammeDocuments = function (props) {
26240
26503
  React.createElement(Col, { span: 18, className: "field-key" },
26241
26504
  React.createElement("div", { className: "label-container" },
26242
26505
  React.createElement("div", { className: impactAssessmentUrl !== "" ? "label-uploaded" : "label" }, t("programme:environmentalImpactAssessment")),
26243
- impactAssessmentStatus === DocumentStatus.PENDING && (ministryLevelPermission || companyRolePermission) && (React.createElement(React.Fragment, null,
26506
+ impactAssessmentStatus === DocumentStatus.PENDING &&
26507
+ (ministryLevelPermission || companyRolePermission) && (React.createElement(React.Fragment, null,
26244
26508
  React.createElement(LikeOutlined, { onClick: function () {
26245
26509
  return docAction(impactAssessmentId, DocumentStatus.ACCEPTED);
26246
26510
  }, className: "common-progress-icon", style: { color: "#976ED7" } }),
@@ -26265,26 +26529,28 @@ var ProgrammeDocuments = function (props) {
26265
26529
  linkDocVisible(impactAssessmentStatus) && (React.createElement("a", { href: impactAssessmentUrl, target: "_blank", rel: "noopener noreferrer", download: true },
26266
26530
  React.createElement(BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))),
26267
26531
  impactAssessmentStatus !== DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
26268
- React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly
26269
- ? t("programme:notAuthToUploadDoc")
26270
- : !uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission, programmeStatus) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
26271
- React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission, programmeStatus)
26532
+ React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: impactAssessmentToolTipTitle, overlayClassName: "custom-tooltip" },
26533
+ React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadImpactAssessmentDocUserPermission &&
26534
+ !isProjectRejected
26272
26535
  ? { color: "#3F3A47", cursor: "pointer" }
26273
26536
  : { color: "#cacaca", cursor: "default" }, onClick: function () {
26274
- return uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission, programmeStatus) && handleImpactAssessmentFileUpload();
26537
+ return uploadImpactAssessmentDocUserPermission &&
26538
+ !isProjectRejected &&
26539
+ handleImpactAssessmentFileUpload();
26275
26540
  } })),
26276
26541
  React.createElement("input", { type: "file", ref: fileInputRefImpactAssessment, style: { display: "none" }, accept: ".doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
26277
26542
  var selectedFile = e.target.files[0];
26278
26543
  e.target.value = null;
26279
26544
  onUploadDocument(selectedFile, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT);
26280
26545
  } }))))) : (React.createElement(React.Fragment, null,
26281
- React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === Role.ViewOnly
26282
- ? t("programme:notAuthToUploadDoc")
26283
- : !uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission, programmeStatus) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
26284
- React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission, programmeStatus)
26546
+ React.createElement(Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: impactAssessmentToolTipTitle, overlayClassName: "custom-tooltip" },
26547
+ React.createElement(FileAddOutlined, { className: "common-progress-icon", style: uploadImpactAssessmentDocUserPermission &&
26548
+ !isProjectRejected
26285
26549
  ? { color: "#3F3A47", cursor: "pointer" }
26286
26550
  : { color: "#cacaca", cursor: "default" }, onClick: function () {
26287
- return uploadDocUserPermission(userInfoState, DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission, programmeStatus) && handleImpactAssessmentFileUpload();
26551
+ return uploadImpactAssessmentDocUserPermission &&
26552
+ !isProjectRejected &&
26553
+ handleImpactAssessmentFileUpload();
26288
26554
  } })),
26289
26555
  React.createElement("input", { type: "file", ref: fileInputRefImpactAssessment, style: { display: "none" }, accept: ".doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
26290
26556
  var selectedFile = e.target.files[0];