@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.
- package/dist/cjs/index.js +318 -52
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/Components/Common/AntComponents/antTableComponents.d.ts +1 -1
- package/dist/cjs/types/Utils/documentsPermission.d.ts +1 -1
- package/dist/esm/index.js +318 -52
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Components/Common/AntComponents/antTableComponents.d.ts +1 -1
- package/dist/esm/types/Utils/documentsPermission.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
@@ -19510,11 +19510,8 @@ var linkDocVisible = function (docStatus) {
|
|
19510
19510
|
}
|
19511
19511
|
return visible;
|
19512
19512
|
};
|
19513
|
-
var uploadDocUserPermission = function (userInfoState, docType, programmeOwnerId, ministryLevelPermission
|
19513
|
+
var uploadDocUserPermission = function (userInfoState, docType, programmeOwnerId, ministryLevelPermission) {
|
19514
19514
|
var permission = false;
|
19515
|
-
if (programmeStatus && programmeStatus === exports.ProgrammeStageUnified.Rejected) {
|
19516
|
-
return false;
|
19517
|
-
}
|
19518
19515
|
if (docType === exports.DocType.DESIGN_DOCUMENT) {
|
19519
19516
|
if (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT ||
|
19520
19517
|
((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY && ministryLevelPermission)) &&
|
@@ -24495,7 +24492,7 @@ var EditableCell = function (_a) {
|
|
24495
24492
|
return [3 /*break*/, 3];
|
24496
24493
|
case 2:
|
24497
24494
|
errInfo_1 = _a.sent();
|
24498
|
-
console.log(
|
24495
|
+
console.log("Save failed:", errInfo_1);
|
24499
24496
|
return [3 /*break*/, 3];
|
24500
24497
|
case 3: return [2 /*return*/];
|
24501
24498
|
}
|
@@ -24509,7 +24506,7 @@ var EditableCell = function (_a) {
|
|
24509
24506
|
message: "".concat(title, " is required."),
|
24510
24507
|
},
|
24511
24508
|
] },
|
24512
|
-
React.createElement(antd.Input, { ref: inputRef, onPressEnter: save, onBlur: save }))) : (React.createElement("div", { className: "editable-cell-value-wrap", style: { paddingRight: 24 }, onClick: toggleEdit }, children));
|
24509
|
+
React.createElement(antd.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));
|
24513
24510
|
}
|
24514
24511
|
return React.createElement("td", __assign({}, restProps), childNode);
|
24515
24512
|
};
|
@@ -24517,6 +24514,11 @@ var EditableCell = function (_a) {
|
|
24517
24514
|
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";
|
24518
24515
|
styleInject(css_248z$4);
|
24519
24516
|
|
24517
|
+
var NdcActionType;
|
24518
|
+
(function (NdcActionType) {
|
24519
|
+
NdcActionType[NdcActionType["main"] = 0] = "main";
|
24520
|
+
NdcActionType[NdcActionType["sub"] = 1] = "sub";
|
24521
|
+
})(NdcActionType || (NdcActionType = {}));
|
24520
24522
|
var NdcDetailsComponent = function (props) {
|
24521
24523
|
var t = props.t; props.useConnection; var useUserContext = props.useUserContext;
|
24522
24524
|
var RangePicker = antd.DatePicker.RangePicker;
|
@@ -24527,6 +24529,8 @@ var NdcDetailsComponent = function (props) {
|
|
24527
24529
|
var _d = React.useState("add_new"), selectedTab = _d[0], setSelectedTab = _d[1];
|
24528
24530
|
var selectedPeriod = React.useRef({});
|
24529
24531
|
var addedNdcDetailId = React.useRef(0);
|
24532
|
+
var selectedNdcDetail = React.useRef({});
|
24533
|
+
var _e = React.useState(0), tableKey = _e[0], setTableKey = _e[1];
|
24530
24534
|
var userInfoState = useUserContext().userInfoState;
|
24531
24535
|
var isAddRangeVisible = function () {
|
24532
24536
|
return (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY ||
|
@@ -24541,11 +24545,35 @@ var NdcDetailsComponent = function (props) {
|
|
24541
24545
|
return num >= min && num <= max;
|
24542
24546
|
};
|
24543
24547
|
var handleSave = function (row) {
|
24544
|
-
|
24545
|
-
|
24546
|
-
|
24547
|
-
|
24548
|
-
|
24548
|
+
if (row.type === NdcActionType.main) {
|
24549
|
+
var newData = __spreadArray([], ndcDetailsData, true);
|
24550
|
+
var index = newData.findIndex(function (item) { return row.key === item.key; });
|
24551
|
+
var item = newData[index];
|
24552
|
+
newData.splice(index, 1, __assign(__assign({}, item), row));
|
24553
|
+
setNdcDetailsData(newData);
|
24554
|
+
}
|
24555
|
+
else {
|
24556
|
+
var newData = __spreadArray([], ndcDetailsData, true);
|
24557
|
+
var parentIndex = newData.findIndex(function (item) { return row.ndcActionId === item.key; });
|
24558
|
+
var parentItem = newData[parentIndex];
|
24559
|
+
if (parentItem) {
|
24560
|
+
if (parentItem.subNdcDetails) {
|
24561
|
+
var itemIndex = parentItem.subNdcDetails.findIndex(function (item) { return row.key === item.key; });
|
24562
|
+
if (itemIndex === -1) {
|
24563
|
+
parentItem.subNdcDetails.push(row);
|
24564
|
+
}
|
24565
|
+
else {
|
24566
|
+
parentItem.subNdcDetails.splice(itemIndex, 1, __assign({}, row));
|
24567
|
+
}
|
24568
|
+
}
|
24569
|
+
else {
|
24570
|
+
parentItem.subNdcDetails = [row];
|
24571
|
+
}
|
24572
|
+
}
|
24573
|
+
newData.splice(parentIndex, 1, __assign({}, parentItem));
|
24574
|
+
setNdcDetailsData(newData);
|
24575
|
+
setTableKey(function (key) { return key + 1; });
|
24576
|
+
}
|
24549
24577
|
};
|
24550
24578
|
var getNdcDetailsForPeriod = function () {
|
24551
24579
|
var range = selectedTab.split("-");
|
@@ -24559,6 +24587,15 @@ var NdcDetailsComponent = function (props) {
|
|
24559
24587
|
return [];
|
24560
24588
|
}
|
24561
24589
|
};
|
24590
|
+
var getSubNdcDetails = function (key) {
|
24591
|
+
var ndcDetail = ndcDetailsData.find(function (item) { return item.key === key; });
|
24592
|
+
if (ndcDetail) {
|
24593
|
+
return ndcDetail.subNdcDetails;
|
24594
|
+
}
|
24595
|
+
else {
|
24596
|
+
return [];
|
24597
|
+
}
|
24598
|
+
};
|
24562
24599
|
var defaultColumns = [
|
24563
24600
|
{
|
24564
24601
|
title: t("ndc:ndcColumnsNationalPlanObj"),
|
@@ -24566,6 +24603,9 @@ var NdcDetailsComponent = function (props) {
|
|
24566
24603
|
key: "nationalPlanObj",
|
24567
24604
|
align: "left",
|
24568
24605
|
editable: true,
|
24606
|
+
width: "50%",
|
24607
|
+
render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(antd.Space, { size: "middle" },
|
24608
|
+
React.createElement("span", null, record.nationalPlanObj))) : (React.createElement("input", { placeholder: "Please add the National Plan Objective", className: "ant-input", disabled: true, type: "text" })))); },
|
24569
24609
|
},
|
24570
24610
|
{
|
24571
24611
|
title: t("ndc:ndcColumnsKpi"),
|
@@ -24573,13 +24613,19 @@ var NdcDetailsComponent = function (props) {
|
|
24573
24613
|
key: "kpi",
|
24574
24614
|
align: "left",
|
24575
24615
|
editable: true,
|
24616
|
+
width: "10%",
|
24617
|
+
render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(antd.Space, { size: "middle" },
|
24618
|
+
React.createElement("span", null, record.kpi))) : (React.createElement("input", { placeholder: "Enter Kpi", className: "ant-input", disabled: true, type: "text" })))); },
|
24576
24619
|
},
|
24577
24620
|
{
|
24578
|
-
title:
|
24621
|
+
title: "Ministry",
|
24579
24622
|
dataIndex: "ministry",
|
24580
24623
|
key: "ministry",
|
24581
24624
|
align: "left",
|
24582
24625
|
editable: true,
|
24626
|
+
width: "40%",
|
24627
|
+
render: function (_, record) { return (React.createElement(React.Fragment, null, record.nationalPlanObj ? (React.createElement(antd.Space, { size: "middle" },
|
24628
|
+
React.createElement("span", null, record.ministry))) : (React.createElement("input", { placeholder: "Please add the Ministry name", className: "ant-input", disabled: true, type: "text" })))); },
|
24583
24629
|
},
|
24584
24630
|
];
|
24585
24631
|
var columns = defaultColumns.map(function (col) {
|
@@ -24596,14 +24642,27 @@ var NdcDetailsComponent = function (props) {
|
|
24596
24642
|
});
|
24597
24643
|
function onAddNewNdcDetail() {
|
24598
24644
|
var range = selectedTab.split("-");
|
24599
|
-
|
24645
|
+
var ndcActionId = ++addedNdcDetailId.current;
|
24600
24646
|
var newData = {
|
24601
|
-
key:
|
24647
|
+
key: ndcActionId,
|
24648
|
+
type: NdcActionType.main,
|
24602
24649
|
startDate: new Date("".concat(Number(range[0]), "-01-24 23:12:00")),
|
24603
24650
|
endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
|
24604
|
-
nationalPlanObj:
|
24605
|
-
kpi:
|
24606
|
-
ministry: "
|
24651
|
+
nationalPlanObj: "",
|
24652
|
+
kpi: "",
|
24653
|
+
ministry: "",
|
24654
|
+
subNdcDetails: [
|
24655
|
+
{
|
24656
|
+
key: ++addedNdcDetailId.current,
|
24657
|
+
ndcActionId: ndcActionId,
|
24658
|
+
type: NdcActionType.sub,
|
24659
|
+
startDate: new Date("2019-03-25"),
|
24660
|
+
endDate: new Date("2020-03-25"),
|
24661
|
+
nationalPlanObj: "",
|
24662
|
+
kpi: "",
|
24663
|
+
ministry: "",
|
24664
|
+
},
|
24665
|
+
],
|
24607
24666
|
};
|
24608
24667
|
setNdcDetailsData(__spreadArray(__spreadArray([], ndcDetailsData, true), [newData], false));
|
24609
24668
|
}
|
@@ -24685,6 +24744,10 @@ var NdcDetailsComponent = function (props) {
|
|
24685
24744
|
React.createElement(antd.Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit")),
|
24686
24745
|
React.createElement(antd.Button, { className: "back-btn", onClick: onCancelPeriod, loading: loading }, t("ndc:back"))))));
|
24687
24746
|
}
|
24747
|
+
function getSubNdcActionContent(record) {
|
24748
|
+
selectedNdcDetail.current = record;
|
24749
|
+
return (React.createElement(antd.Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getSubNdcDetails(record.key), columns: columns, showHeader: false, pagination: false }));
|
24750
|
+
}
|
24688
24751
|
var onTabChange = function (key) {
|
24689
24752
|
setSelectedTab(key);
|
24690
24753
|
};
|
@@ -24692,43 +24755,232 @@ var NdcDetailsComponent = function (props) {
|
|
24692
24755
|
var defaultNdcDetails = [
|
24693
24756
|
{
|
24694
24757
|
key: 1,
|
24758
|
+
type: NdcActionType.main,
|
24695
24759
|
startDate: new Date("2019-03-25"),
|
24696
24760
|
endDate: new Date("2020-03-25"),
|
24697
24761
|
nationalPlanObj: "Enhance value addition in key growth opportunities",
|
24698
24762
|
kpi: 25,
|
24699
|
-
ministry: "Ministry of
|
24763
|
+
ministry: "Ministry of Environment",
|
24764
|
+
subNdcDetails: [
|
24765
|
+
{
|
24766
|
+
key: 6,
|
24767
|
+
ndcActionId: 1,
|
24768
|
+
type: NdcActionType.sub,
|
24769
|
+
startDate: new Date("2019-03-25"),
|
24770
|
+
endDate: new Date("2020-03-25"),
|
24771
|
+
nationalPlanObj: "Enhance value addition in key growth opportunities sub details",
|
24772
|
+
kpi: 25,
|
24773
|
+
ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
|
24774
|
+
},
|
24775
|
+
{
|
24776
|
+
key: 7,
|
24777
|
+
ndcActionId: 1,
|
24778
|
+
type: NdcActionType.sub,
|
24779
|
+
startDate: new Date("2019-03-25"),
|
24780
|
+
endDate: new Date("2020-03-25"),
|
24781
|
+
nationalPlanObj: "",
|
24782
|
+
kpi: "",
|
24783
|
+
ministry: "",
|
24784
|
+
},
|
24785
|
+
],
|
24700
24786
|
},
|
24701
24787
|
{
|
24702
24788
|
key: 2,
|
24789
|
+
type: NdcActionType.main,
|
24703
24790
|
startDate: new Date("2019-03-25"),
|
24704
24791
|
endDate: new Date("2019-08-25"),
|
24705
24792
|
nationalPlanObj: "Strengthen the private sector to create 10,000 jobs",
|
24706
24793
|
kpi: 10500,
|
24707
|
-
ministry: "Ministry of
|
24794
|
+
ministry: "Ministry of Environment",
|
24795
|
+
subNdcDetails: [
|
24796
|
+
{
|
24797
|
+
key: 8,
|
24798
|
+
ndcActionId: 2,
|
24799
|
+
type: NdcActionType.sub,
|
24800
|
+
startDate: new Date("2019-03-25"),
|
24801
|
+
endDate: new Date("2020-03-25"),
|
24802
|
+
nationalPlanObj: "",
|
24803
|
+
kpi: "",
|
24804
|
+
ministry: "",
|
24805
|
+
},
|
24806
|
+
],
|
24807
|
+
},
|
24808
|
+
{
|
24809
|
+
key: 12,
|
24810
|
+
type: NdcActionType.main,
|
24811
|
+
startDate: new Date("2019-03-25"),
|
24812
|
+
endDate: new Date("2019-08-25"),
|
24813
|
+
nationalPlanObj: "Other",
|
24814
|
+
kpi: 10500,
|
24815
|
+
ministry: "Ministry of Environment",
|
24816
|
+
subNdcDetails: [
|
24817
|
+
{
|
24818
|
+
key: 8,
|
24819
|
+
ndcActionId: 12,
|
24820
|
+
type: NdcActionType.sub,
|
24821
|
+
startDate: new Date("2019-03-25"),
|
24822
|
+
endDate: new Date("2020-03-25"),
|
24823
|
+
nationalPlanObj: "",
|
24824
|
+
kpi: "",
|
24825
|
+
ministry: "",
|
24826
|
+
},
|
24827
|
+
],
|
24708
24828
|
},
|
24709
24829
|
{
|
24710
24830
|
key: 3,
|
24831
|
+
type: NdcActionType.main,
|
24711
24832
|
startDate: new Date("2021-03-25"),
|
24712
24833
|
endDate: new Date("2022-03-25"),
|
24713
24834
|
nationalPlanObj: "Consolidate and increase the stock and quality of productive infrastructure by 50%",
|
24714
24835
|
kpi: 48,
|
24715
|
-
ministry: "Ministry of
|
24836
|
+
ministry: "Ministry of Environment",
|
24837
|
+
subNdcDetails: [
|
24838
|
+
{
|
24839
|
+
key: 9,
|
24840
|
+
ndcActionId: 3,
|
24841
|
+
type: NdcActionType.sub,
|
24842
|
+
startDate: new Date("2019-03-25"),
|
24843
|
+
endDate: new Date("2020-03-25"),
|
24844
|
+
nationalPlanObj: "",
|
24845
|
+
kpi: "",
|
24846
|
+
ministry: "",
|
24847
|
+
},
|
24848
|
+
],
|
24716
24849
|
},
|
24717
24850
|
{
|
24718
24851
|
key: 4,
|
24852
|
+
type: NdcActionType.main,
|
24719
24853
|
startDate: new Date("2022-03-25"),
|
24720
24854
|
endDate: new Date("2022-05-25"),
|
24721
24855
|
nationalPlanObj: "Enhance the productivity and social wellbeing of the population",
|
24722
24856
|
kpi: 20,
|
24723
|
-
ministry: "Ministry of Environment,
|
24857
|
+
ministry: "Ministry of Environment",
|
24858
|
+
subNdcDetails: [
|
24859
|
+
{
|
24860
|
+
key: 10,
|
24861
|
+
ndcActionId: 4,
|
24862
|
+
type: NdcActionType.sub,
|
24863
|
+
startDate: new Date("2019-03-25"),
|
24864
|
+
endDate: new Date("2020-03-25"),
|
24865
|
+
nationalPlanObj: "",
|
24866
|
+
kpi: "",
|
24867
|
+
ministry: "",
|
24868
|
+
},
|
24869
|
+
],
|
24724
24870
|
},
|
24725
24871
|
{
|
24726
24872
|
key: 5,
|
24873
|
+
type: NdcActionType.main,
|
24727
24874
|
startDate: new Date("2022-03-25"),
|
24728
24875
|
endDate: new Date("2023-03-25"),
|
24729
24876
|
nationalPlanObj: "Strengthen the role of the state in guiding and facilitating development",
|
24730
24877
|
kpi: 10,
|
24731
|
-
ministry: "Ministry of
|
24878
|
+
ministry: "Ministry of Environment",
|
24879
|
+
subNdcDetails: [
|
24880
|
+
{
|
24881
|
+
key: 11,
|
24882
|
+
ndcActionId: 5,
|
24883
|
+
type: NdcActionType.sub,
|
24884
|
+
startDate: new Date("2019-03-25"),
|
24885
|
+
endDate: new Date("2020-03-25"),
|
24886
|
+
nationalPlanObj: "",
|
24887
|
+
kpi: "",
|
24888
|
+
ministry: "",
|
24889
|
+
},
|
24890
|
+
],
|
24891
|
+
},
|
24892
|
+
{
|
24893
|
+
key: 13,
|
24894
|
+
type: NdcActionType.main,
|
24895
|
+
startDate: new Date("2022-03-25"),
|
24896
|
+
endDate: new Date("2023-03-25"),
|
24897
|
+
nationalPlanObj: "Convert to solar energy",
|
24898
|
+
kpi: 50000,
|
24899
|
+
ministry: "Ministry of Environment",
|
24900
|
+
subNdcDetails: [
|
24901
|
+
{
|
24902
|
+
key: 11,
|
24903
|
+
ndcActionId: 13,
|
24904
|
+
type: NdcActionType.sub,
|
24905
|
+
startDate: new Date("2019-03-25"),
|
24906
|
+
endDate: new Date("2020-03-25"),
|
24907
|
+
nationalPlanObj: "Convert to solar energy",
|
24908
|
+
kpi: "3000",
|
24909
|
+
ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
|
24910
|
+
},
|
24911
|
+
{
|
24912
|
+
key: 14,
|
24913
|
+
ndcActionId: 13,
|
24914
|
+
type: NdcActionType.sub,
|
24915
|
+
startDate: new Date("2019-03-25"),
|
24916
|
+
endDate: new Date("2020-03-25"),
|
24917
|
+
nationalPlanObj: "",
|
24918
|
+
kpi: "",
|
24919
|
+
ministry: "",
|
24920
|
+
},
|
24921
|
+
],
|
24922
|
+
},
|
24923
|
+
{
|
24924
|
+
key: 15,
|
24925
|
+
type: NdcActionType.main,
|
24926
|
+
startDate: new Date("2022-03-25"),
|
24927
|
+
endDate: new Date("2023-03-25"),
|
24928
|
+
nationalPlanObj: "Strengthen the private sector to create jobs",
|
24929
|
+
kpi: 10000,
|
24930
|
+
ministry: "Ministry of Environment",
|
24931
|
+
subNdcDetails: [
|
24932
|
+
{
|
24933
|
+
key: 16,
|
24934
|
+
ndcActionId: 15,
|
24935
|
+
type: NdcActionType.sub,
|
24936
|
+
startDate: new Date("2019-03-25"),
|
24937
|
+
endDate: new Date("2020-03-25"),
|
24938
|
+
nationalPlanObj: "Strengthen the private sector to create jobs",
|
24939
|
+
kpi: "7200",
|
24940
|
+
ministry: "Ministry of Tourism (MoT)",
|
24941
|
+
},
|
24942
|
+
{
|
24943
|
+
key: 17,
|
24944
|
+
ndcActionId: 15,
|
24945
|
+
type: NdcActionType.sub,
|
24946
|
+
startDate: new Date("2019-03-25"),
|
24947
|
+
endDate: new Date("2020-03-25"),
|
24948
|
+
nationalPlanObj: "",
|
24949
|
+
kpi: "",
|
24950
|
+
ministry: "",
|
24951
|
+
},
|
24952
|
+
],
|
24953
|
+
},
|
24954
|
+
{
|
24955
|
+
key: 18,
|
24956
|
+
type: NdcActionType.main,
|
24957
|
+
startDate: new Date("2022-03-25"),
|
24958
|
+
endDate: new Date("2023-03-25"),
|
24959
|
+
nationalPlanObj: "Other",
|
24960
|
+
kpi: '',
|
24961
|
+
ministry: "Ministry of Environment",
|
24962
|
+
subNdcDetails: [
|
24963
|
+
{
|
24964
|
+
key: 19,
|
24965
|
+
ndcActionId: 18,
|
24966
|
+
type: NdcActionType.sub,
|
24967
|
+
startDate: new Date("2019-03-25"),
|
24968
|
+
endDate: new Date("2020-03-25"),
|
24969
|
+
nationalPlanObj: "Strengthen the private sector to create jobs",
|
24970
|
+
kpi: "",
|
24971
|
+
ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
|
24972
|
+
},
|
24973
|
+
{
|
24974
|
+
key: 20,
|
24975
|
+
ndcActionId: 18,
|
24976
|
+
type: NdcActionType.sub,
|
24977
|
+
startDate: new Date("2019-03-25"),
|
24978
|
+
endDate: new Date("2020-03-25"),
|
24979
|
+
nationalPlanObj: "",
|
24980
|
+
kpi: "",
|
24981
|
+
ministry: "",
|
24982
|
+
},
|
24983
|
+
],
|
24732
24984
|
},
|
24733
24985
|
];
|
24734
24986
|
var initialPeriods = [
|
@@ -24756,7 +25008,7 @@ var NdcDetailsComponent = function (props) {
|
|
24756
25008
|
children: addNewPeriodContent(),
|
24757
25009
|
});
|
24758
25010
|
}
|
24759
|
-
addedNdcDetailId.current =
|
25011
|
+
addedNdcDetailId.current = 20;
|
24760
25012
|
setPeriodItems(initialPeriods);
|
24761
25013
|
periodItemsRef.current = initialPeriods;
|
24762
25014
|
setNdcDetailsData(defaultNdcDetails);
|
@@ -24771,7 +25023,11 @@ var NdcDetailsComponent = function (props) {
|
|
24771
25023
|
React.createElement(antd.Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedTab, onChange: onTabChange })),
|
24772
25024
|
selectedTab !== "add_new" && (React.createElement("div", null,
|
24773
25025
|
React.createElement("div", null,
|
24774
|
-
React.createElement(antd.Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getNdcDetailsForPeriod(), columns: columns,
|
25026
|
+
React.createElement(antd.Table, { key: tableKey, components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getNdcDetailsForPeriod(), columns: columns, expandable: {
|
25027
|
+
expandedRowRender: function (record) { return getSubNdcActionContent(record); },
|
25028
|
+
indentSize: 0,
|
25029
|
+
defaultExpandedRowKeys: [selectedNdcDetail.current.key],
|
25030
|
+
}, footer: function () {
|
24775
25031
|
return isAddNdcActionVisible() && (React.createElement(antd.Row, { justify: "center" },
|
24776
25032
|
React.createElement(antd.Button, { onClick: onAddNewNdcDetail, type: "default", style: {
|
24777
25033
|
marginBottom: 16,
|
@@ -25917,6 +26173,13 @@ var ProgrammeDocuments = function (props) {
|
|
25917
26173
|
var maximumImageSize = process.env.REACT_APP_MAXIMUM_FILE_SIZE
|
25918
26174
|
? parseInt(process.env.REACT_APP_MAXIMUM_FILE_SIZE)
|
25919
26175
|
: 5000000;
|
26176
|
+
var isProjectRejected = programmeStatus && programmeStatus === exports.ProgrammeStageUnified.Rejected;
|
26177
|
+
var uploadImpactAssessmentDocUserPermission = uploadDocUserPermission(userInfoState, exports.DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission);
|
26178
|
+
var impactAssessmentToolTipTitle = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly
|
26179
|
+
? t("programme:notAuthToUploadDoc")
|
26180
|
+
: isProjectRejected
|
26181
|
+
? t("programme:docUploadProgrammeRejected")
|
26182
|
+
: !uploadImpactAssessmentDocUserPermission && t("programme:orgNotAuth");
|
25920
26183
|
var handleDesignDocFileUpload = function () {
|
25921
26184
|
var _a;
|
25922
26185
|
(_a = fileInputRef === null || fileInputRef === void 0 ? void 0 : fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
@@ -25941,8 +26204,8 @@ var ProgrammeDocuments = function (props) {
|
|
25941
26204
|
setDesignDocDate(item === null || item === void 0 ? void 0 : item.txTime);
|
25942
26205
|
setDesignDocStatus(item === null || item === void 0 ? void 0 : item.status);
|
25943
26206
|
setDesignDocId(item === null || item === void 0 ? void 0 : item.id);
|
25944
|
-
var versionfull = (item === null || item === void 0 ? void 0 : item.url).split("_")[(item === null || item === void 0 ? void 0 : item.url).split(
|
25945
|
-
var version = versionfull ? versionfull.split(
|
26207
|
+
var versionfull = (item === null || item === void 0 ? void 0 : item.url).split("_")[(item === null || item === void 0 ? void 0 : item.url).split("_").length - 1];
|
26208
|
+
var version = versionfull ? versionfull.split(".")[0] : "1";
|
25946
26209
|
setDesignDocversion(version.startsWith("V") ? version : "V1");
|
25947
26210
|
}
|
25948
26211
|
if ((_b = item === null || item === void 0 ? void 0 : item.url) === null || _b === void 0 ? void 0 : _b.includes("METHODOLOGY")) {
|
@@ -25950,8 +26213,8 @@ var ProgrammeDocuments = function (props) {
|
|
25950
26213
|
setMethodologyDate(item === null || item === void 0 ? void 0 : item.txTime);
|
25951
26214
|
setMethodDocStatus(item === null || item === void 0 ? void 0 : item.status);
|
25952
26215
|
setMethDocId(item === null || item === void 0 ? void 0 : item.id);
|
25953
|
-
var versionfull = (item === null || item === void 0 ? void 0 : item.url).split("_")[(item === null || item === void 0 ? void 0 : item.url).split(
|
25954
|
-
var version = versionfull ? versionfull.split(
|
26216
|
+
var versionfull = (item === null || item === void 0 ? void 0 : item.url).split("_")[(item === null || item === void 0 ? void 0 : item.url).split("_").length - 1];
|
26217
|
+
var version = versionfull ? versionfull.split(".")[0] : "1";
|
25955
26218
|
setMethDocversion(version.startsWith("V") ? version : "V1");
|
25956
26219
|
}
|
25957
26220
|
if ((_c = item === null || item === void 0 ? void 0 : item.url) === null || _c === void 0 ? void 0 : _c.includes("OBJECTION")) {
|
@@ -25968,7 +26231,7 @@ var ProgrammeDocuments = function (props) {
|
|
25968
26231
|
setImpactAssessmentStatus(item === null || item === void 0 ? void 0 : item.status);
|
25969
26232
|
setImpactAssessmentId(item === null || item === void 0 ? void 0 : item.id);
|
25970
26233
|
var versionfull = (item === null || item === void 0 ? void 0 : item.url).split("_")[(item === null || item === void 0 ? void 0 : item.url).split("_").length - 1];
|
25971
|
-
var version = versionfull ? versionfull.split(
|
26234
|
+
var version = versionfull ? versionfull.split(".")[0] : "1";
|
25972
26235
|
setImpactAssessmentversion(version.startsWith("V") ? version : "V1");
|
25973
26236
|
}
|
25974
26237
|
});
|
@@ -26144,11 +26407,11 @@ var ProgrammeDocuments = function (props) {
|
|
26144
26407
|
React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly ||
|
26145
26408
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.CERTIFIER
|
26146
26409
|
? t("programme:notAuthToUploadDoc")
|
26147
|
-
: !uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission
|
26148
|
-
React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission
|
26410
|
+
: !uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
|
26411
|
+
React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission)
|
26149
26412
|
? { color: "#3F3A47", cursor: "pointer" }
|
26150
26413
|
: { color: "#cacaca", cursor: "default" }, onClick: function () {
|
26151
|
-
return uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission
|
26414
|
+
return uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && handleDesignDocFileUpload();
|
26152
26415
|
} })),
|
26153
26416
|
React.createElement("input", { type: "file", ref: fileInputRef, style: { display: "none" }, accept: ".xls, .xlsx, .ppt, .pptx, .csv, .doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
|
26154
26417
|
var selectedFile = e.target.files[0];
|
@@ -26158,11 +26421,11 @@ var ProgrammeDocuments = function (props) {
|
|
26158
26421
|
React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly ||
|
26159
26422
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.CERTIFIER
|
26160
26423
|
? t("programme:notAuthToUploadDoc")
|
26161
|
-
: !uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission
|
26162
|
-
React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission
|
26424
|
+
: !uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
|
26425
|
+
React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission)
|
26163
26426
|
? { color: "#3F3A47", cursor: "pointer" }
|
26164
26427
|
: { color: "#cacaca", cursor: "default" }, onClick: function () {
|
26165
|
-
return uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission
|
26428
|
+
return uploadDocUserPermission(userInfoState, exports.DocType.DESIGN_DOCUMENT, programmeOwnerId, ministryLevelPermission) && handleDesignDocFileUpload();
|
26166
26429
|
} })),
|
26167
26430
|
React.createElement("input", { type: "file", ref: fileInputRef, style: { display: "none" }, accept: ".xls, .xlsx, .ppt, .pptx, .csv, .doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
|
26168
26431
|
var selectedFile = e.target.files[0];
|
@@ -26211,13 +26474,13 @@ var ProgrammeDocuments = function (props) {
|
|
26211
26474
|
methodDocStatus !== exports.DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
|
26212
26475
|
React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly
|
26213
26476
|
? t("programme:notAuthToUploadDoc")
|
26214
|
-
: !uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission
|
26477
|
+
: !uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission) && t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
|
26215
26478
|
React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: designDocStatus === exports.DocumentStatus.ACCEPTED &&
|
26216
|
-
uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission
|
26479
|
+
uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission)
|
26217
26480
|
? { color: "#3F3A47", cursor: "pointer" }
|
26218
26481
|
: { color: "#cacaca" }, onClick: function () {
|
26219
26482
|
return designDocStatus === exports.DocumentStatus.ACCEPTED &&
|
26220
|
-
uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission
|
26483
|
+
uploadDocUserPermission(userInfoState, exports.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) {
|
@@ -26228,16 +26491,16 @@ var ProgrammeDocuments = function (props) {
|
|
26228
26491
|
} }))))) : (React.createElement(React.Fragment, null,
|
26229
26492
|
React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) === exports.Role.ViewOnly
|
26230
26493
|
? t("programme:notAuthToUploadDoc")
|
26231
|
-
: uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission
|
26494
|
+
: uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission)
|
26232
26495
|
? designDocStatus !== exports.DocumentStatus.ACCEPTED &&
|
26233
26496
|
t("programme:designDocNotApproved")
|
26234
26497
|
: t("programme:orgNotAuth"), overlayClassName: "custom-tooltip" },
|
26235
26498
|
React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: designDocStatus === exports.DocumentStatus.ACCEPTED &&
|
26236
|
-
uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission
|
26499
|
+
uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission)
|
26237
26500
|
? { color: "#3F3A47", cursor: "pointer" }
|
26238
26501
|
: { color: "#cacaca", cursor: "default" }, onClick: function () {
|
26239
26502
|
return designDocStatus === exports.DocumentStatus.ACCEPTED &&
|
26240
|
-
uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission
|
26503
|
+
uploadDocUserPermission(userInfoState, exports.DocType.METHODOLOGY_DOCUMENT, programmeOwnerId, ministryLevelPermission) &&
|
26241
26504
|
handleMethodologyFileUpload();
|
26242
26505
|
} })),
|
26243
26506
|
React.createElement("input", { type: "file", ref: fileInputRefMeth, style: { display: "none" }, accept: ".xls, .xlsx, .ppt, .pptx, .csv, .doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
|
@@ -26260,7 +26523,8 @@ var ProgrammeDocuments = function (props) {
|
|
26260
26523
|
React.createElement(antd.Col, { span: 18, className: "field-key" },
|
26261
26524
|
React.createElement("div", { className: "label-container" },
|
26262
26525
|
React.createElement("div", { className: impactAssessmentUrl !== "" ? "label-uploaded" : "label" }, t("programme:environmentalImpactAssessment")),
|
26263
|
-
impactAssessmentStatus === exports.DocumentStatus.PENDING &&
|
26526
|
+
impactAssessmentStatus === exports.DocumentStatus.PENDING &&
|
26527
|
+
(ministryLevelPermission || companyRolePermission) && (React.createElement(React.Fragment, null,
|
26264
26528
|
React.createElement(icons.LikeOutlined, { onClick: function () {
|
26265
26529
|
return docAction(impactAssessmentId, exports.DocumentStatus.ACCEPTED);
|
26266
26530
|
}, className: "common-progress-icon", style: { color: "#976ED7" } }),
|
@@ -26285,26 +26549,28 @@ var ProgrammeDocuments = function (props) {
|
|
26285
26549
|
linkDocVisible(impactAssessmentStatus) && (React.createElement("a", { href: impactAssessmentUrl, target: "_blank", rel: "noopener noreferrer", download: true },
|
26286
26550
|
React.createElement(icons.BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))),
|
26287
26551
|
impactAssessmentStatus !== exports.DocumentStatus.ACCEPTED && (React.createElement(React.Fragment, null,
|
26288
|
-
React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title:
|
26289
|
-
|
26290
|
-
|
26291
|
-
React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, exports.DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission, programmeStatus)
|
26552
|
+
React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: impactAssessmentToolTipTitle, overlayClassName: "custom-tooltip" },
|
26553
|
+
React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: uploadImpactAssessmentDocUserPermission &&
|
26554
|
+
!isProjectRejected
|
26292
26555
|
? { color: "#3F3A47", cursor: "pointer" }
|
26293
26556
|
: { color: "#cacaca", cursor: "default" }, onClick: function () {
|
26294
|
-
return
|
26557
|
+
return uploadImpactAssessmentDocUserPermission &&
|
26558
|
+
!isProjectRejected &&
|
26559
|
+
handleImpactAssessmentFileUpload();
|
26295
26560
|
} })),
|
26296
26561
|
React.createElement("input", { type: "file", ref: fileInputRefImpactAssessment, style: { display: "none" }, accept: ".doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
|
26297
26562
|
var selectedFile = e.target.files[0];
|
26298
26563
|
e.target.value = null;
|
26299
26564
|
onUploadDocument(selectedFile, exports.DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT);
|
26300
26565
|
} }))))) : (React.createElement(React.Fragment, null,
|
26301
|
-
React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title:
|
26302
|
-
|
26303
|
-
|
26304
|
-
React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: uploadDocUserPermission(userInfoState, exports.DocType.ENVIRONMENTAL_IMPACT_ASSESSMENT, programmeOwnerId, ministryLevelPermission, programmeStatus)
|
26566
|
+
React.createElement(antd.Tooltip, { arrowPointAtCenter: true, placement: "top", trigger: "hover", title: impactAssessmentToolTipTitle, overlayClassName: "custom-tooltip" },
|
26567
|
+
React.createElement(icons.FileAddOutlined, { className: "common-progress-icon", style: uploadImpactAssessmentDocUserPermission &&
|
26568
|
+
!isProjectRejected
|
26305
26569
|
? { color: "#3F3A47", cursor: "pointer" }
|
26306
26570
|
: { color: "#cacaca", cursor: "default" }, onClick: function () {
|
26307
|
-
return
|
26571
|
+
return uploadImpactAssessmentDocUserPermission &&
|
26572
|
+
!isProjectRejected &&
|
26573
|
+
handleImpactAssessmentFileUpload();
|
26308
26574
|
} })),
|
26309
26575
|
React.createElement("input", { type: "file", ref: fileInputRefImpactAssessment, style: { display: "none" }, accept: ".doc, .docx, .pdf, .png, .jpg", onChange: function (e) {
|
26310
26576
|
var selectedFile = e.target.files[0];
|