@undp/carbon-library 1.0.150-CARBON-343.1 → 1.0.150-CARBON-320.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.js +23 -66
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +23 -66
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
@@ -19592,13 +19592,16 @@ var NdcActionViewComponent = function (props) {
|
|
19592
19592
|
}
|
19593
19593
|
});
|
19594
19594
|
}); };
|
19595
|
-
var getProjectReportActions = function (reportData) {
|
19595
|
+
var getProjectReportActions = function (reportData, reportVersion) {
|
19596
19596
|
return (React.createElement(Row, null,
|
19597
19597
|
React.createElement("div", { className: "icon" },
|
19598
19598
|
(reportData === null || reportData === void 0 ? void 0 : reportData.status) === DocumentStatus.ACCEPTED && (React.createElement(CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
|
19599
19599
|
(reportData === null || reportData === void 0 ? void 0 : reportData.status) === DocumentStatus.REJECTED && (React.createElement(ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))),
|
19600
19600
|
React.createElement("div", { className: "link mg-left-1" }, (reportData === null || reportData === void 0 ? void 0 : reportData.url) && linkDocVisible(reportData === null || reportData === void 0 ? void 0 : reportData.status) && (React.createElement("a", { href: reportData === null || reportData === void 0 ? void 0 : reportData.url, target: "_blank", rel: "noopener noreferrer", download: true },
|
19601
|
-
React.createElement(BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))))
|
19601
|
+
React.createElement(BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } })))),
|
19602
|
+
(reportData === null || reportData === void 0 ? void 0 : reportData.txTime) && (React.createElement("div", { className: "time" },
|
19603
|
+
moment(parseInt(reportData === null || reportData === void 0 ? void 0 : reportData.txTime)).format("DD MMMM YYYY @ HH:mm"),
|
19604
|
+
" ~ " + reportVersion))));
|
19602
19605
|
};
|
19603
19606
|
var getProjectReports = function () { return __awaiter(void 0, void 0, void 0, function () {
|
19604
19607
|
var reportDetails, response, exception_1;
|
@@ -19646,12 +19649,20 @@ var NdcActionViewComponent = function (props) {
|
|
19646
19649
|
if ((item === null || item === void 0 ? void 0 : item.status) === DocumentStatus.ACCEPTED) {
|
19647
19650
|
setMonitoringReportAccepted(true);
|
19648
19651
|
}
|
19652
|
+
var versionfull = (item === null || item === void 0 ? void 0 : item.url).split("_")[(item === null || item === void 0 ? void 0 : item.url).split("_").length - 1];
|
19653
|
+
var version = versionfull ? versionfull.split(".")[0] : "1";
|
19654
|
+
var moniteringVersion = version.startsWith("V") ? version : "V1";
|
19649
19655
|
reportDetails[t("ndcAction:viewMoniteringReport")] =
|
19650
|
-
getProjectReportActions(item);
|
19656
|
+
getProjectReportActions(item, moniteringVersion);
|
19651
19657
|
}
|
19652
19658
|
else if ((_b = item === null || item === void 0 ? void 0 : item.url) === null || _b === void 0 ? void 0 : _b.includes("VERIFICATION_REPORT")) {
|
19659
|
+
var versionfull = (item === null || item === void 0 ? void 0 : item.url).split("_")[(item === null || item === void 0 ? void 0 : item.url).split("_").length - 1];
|
19660
|
+
var version = versionfull ? versionfull.split(".")[0] : "1";
|
19661
|
+
var verificationVersion = version.startsWith("V")
|
19662
|
+
? version
|
19663
|
+
: "V1";
|
19653
19664
|
reportDetails[t("ndcAction:viewVerificationReport")] =
|
19654
|
-
getProjectReportActions(item);
|
19665
|
+
getProjectReportActions(item, verificationVersion);
|
19655
19666
|
}
|
19656
19667
|
});
|
19657
19668
|
}
|
@@ -24507,7 +24518,6 @@ var NdcDetailsComponent = function (props) {
|
|
24507
24518
|
var _d = useState("add_new"), selectedTab = _d[0], setSelectedTab = _d[1];
|
24508
24519
|
var selectedPeriod = useRef({});
|
24509
24520
|
var addedNdcDetailId = useRef(0);
|
24510
|
-
var selectedNdcDetail = useRef({});
|
24511
24521
|
var userInfoState = useUserContext().userInfoState;
|
24512
24522
|
var isAddRangeVisible = function () {
|
24513
24523
|
return (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY ||
|
@@ -24540,15 +24550,6 @@ var NdcDetailsComponent = function (props) {
|
|
24540
24550
|
return [];
|
24541
24551
|
}
|
24542
24552
|
};
|
24543
|
-
var getSubNdcDetails = function (key) {
|
24544
|
-
var ndcDetail = ndcDetailsData.find(function (item) { return item.key === key; });
|
24545
|
-
if (ndcDetail) {
|
24546
|
-
return ndcDetail.subNdcDetails;
|
24547
|
-
}
|
24548
|
-
else {
|
24549
|
-
return [];
|
24550
|
-
}
|
24551
|
-
};
|
24552
24553
|
var defaultColumns = [
|
24553
24554
|
{
|
24554
24555
|
title: t("ndc:ndcColumnsNationalPlanObj"),
|
@@ -24565,7 +24566,7 @@ var NdcDetailsComponent = function (props) {
|
|
24565
24566
|
editable: true,
|
24566
24567
|
},
|
24567
24568
|
{
|
24568
|
-
title:
|
24569
|
+
title: 'Ministry',
|
24569
24570
|
dataIndex: "ministry",
|
24570
24571
|
key: "ministry",
|
24571
24572
|
align: "left",
|
@@ -24593,32 +24594,10 @@ var NdcDetailsComponent = function (props) {
|
|
24593
24594
|
endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
|
24594
24595
|
nationalPlanObj: t("ndc:enterNewPlanTxt"),
|
24595
24596
|
kpi: 0,
|
24596
|
-
ministry: "Please add the Ministry name"
|
24597
|
+
ministry: "Please add the Ministry name"
|
24597
24598
|
};
|
24598
24599
|
setNdcDetailsData(__spreadArray(__spreadArray([], ndcDetailsData, true), [newData], false));
|
24599
24600
|
}
|
24600
|
-
function onAddNewSubNdcDetail() {
|
24601
|
-
var range = selectedTab.split("-");
|
24602
|
-
var ndcDetail = ndcDetailsData.find(function (item) { return item.key === selectedNdcDetail.current.key; });
|
24603
|
-
var ndcDetailItemIndex = ndcDetailsData.findIndex(function (item) { return item.key === selectedNdcDetail.current.key; });
|
24604
|
-
if (ndcDetail) {
|
24605
|
-
addedNdcDetailId.current = addedNdcDetailId.current + 1;
|
24606
|
-
var newData = {
|
24607
|
-
key: addedNdcDetailId.current,
|
24608
|
-
startDate: new Date("".concat(Number(range[0]), "-01-24 23:12:00")),
|
24609
|
-
endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
|
24610
|
-
nationalPlanObj: t("ndc:enterNewPlanTxt"),
|
24611
|
-
kpi: 0,
|
24612
|
-
ministry: "Please add the Ministry name",
|
24613
|
-
};
|
24614
|
-
if (!ndcDetail.subNdcDetails) {
|
24615
|
-
ndcDetail.subNdcDetails = [];
|
24616
|
-
}
|
24617
|
-
ndcDetail.subNdcDetails.push(newData);
|
24618
|
-
}
|
24619
|
-
ndcDetailsData[ndcDetailItemIndex] = ndcDetail;
|
24620
|
-
setNdcDetailsData(ndcDetailsData);
|
24621
|
-
}
|
24622
24601
|
var components = {
|
24623
24602
|
body: {
|
24624
24603
|
row: EditableRow,
|
@@ -24697,16 +24676,6 @@ var NdcDetailsComponent = function (props) {
|
|
24697
24676
|
React.createElement(Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit")),
|
24698
24677
|
React.createElement(Button, { className: "back-btn", onClick: onCancelPeriod, loading: loading }, t("ndc:back"))))));
|
24699
24678
|
}
|
24700
|
-
function getSubNdcActionContent(record) {
|
24701
|
-
selectedNdcDetail.current = record;
|
24702
|
-
return (React.createElement(Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getSubNdcDetails(record.key), columns: columns, showHeader: false, pagination: false, footer: function () {
|
24703
|
-
return (React.createElement(Row, { justify: "center" },
|
24704
|
-
React.createElement(Button, { onClick: onAddNewSubNdcDetail, type: "default", style: {
|
24705
|
-
marginBottom: 16,
|
24706
|
-
width: "100%",
|
24707
|
-
} }, t("ndc:addSubNdcAction"))));
|
24708
|
-
} }));
|
24709
|
-
}
|
24710
24679
|
var onTabChange = function (key) {
|
24711
24680
|
setSelectedTab(key);
|
24712
24681
|
};
|
@@ -24718,17 +24687,7 @@ var NdcDetailsComponent = function (props) {
|
|
24718
24687
|
endDate: new Date("2020-03-25"),
|
24719
24688
|
nationalPlanObj: "Enhance value addition in key growth opportunities",
|
24720
24689
|
kpi: 25,
|
24721
|
-
ministry: "Ministry of Agriculture, Water and Forestry (MAWF)"
|
24722
|
-
subNdcDetails: [
|
24723
|
-
{
|
24724
|
-
key: 6,
|
24725
|
-
startDate: new Date("2019-03-25"),
|
24726
|
-
endDate: new Date("2020-03-25"),
|
24727
|
-
nationalPlanObj: "Enhance value addition in key growth opportunities sub details",
|
24728
|
-
kpi: 25,
|
24729
|
-
ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
|
24730
|
-
},
|
24731
|
-
],
|
24690
|
+
ministry: "Ministry of Agriculture, Water and Forestry (MAWF)"
|
24732
24691
|
},
|
24733
24692
|
{
|
24734
24693
|
key: 2,
|
@@ -24736,7 +24695,7 @@ var NdcDetailsComponent = function (props) {
|
|
24736
24695
|
endDate: new Date("2019-08-25"),
|
24737
24696
|
nationalPlanObj: "Strengthen the private sector to create 10,000 jobs",
|
24738
24697
|
kpi: 10500,
|
24739
|
-
ministry: "Ministry of Tourism (MoT)"
|
24698
|
+
ministry: "Ministry of Tourism (MoT)"
|
24740
24699
|
},
|
24741
24700
|
{
|
24742
24701
|
key: 3,
|
@@ -24744,7 +24703,7 @@ var NdcDetailsComponent = function (props) {
|
|
24744
24703
|
endDate: new Date("2022-03-25"),
|
24745
24704
|
nationalPlanObj: "Consolidate and increase the stock and quality of productive infrastructure by 50%",
|
24746
24705
|
kpi: 48,
|
24747
|
-
ministry: "Ministry of Education, Arts and Culture (MoE)"
|
24706
|
+
ministry: "Ministry of Education, Arts and Culture (MoE)"
|
24748
24707
|
},
|
24749
24708
|
{
|
24750
24709
|
key: 4,
|
@@ -24752,7 +24711,7 @@ var NdcDetailsComponent = function (props) {
|
|
24752
24711
|
endDate: new Date("2022-05-25"),
|
24753
24712
|
nationalPlanObj: "Enhance the productivity and social wellbeing of the population",
|
24754
24713
|
kpi: 20,
|
24755
|
-
ministry: "Ministry of Environment, Forestry and Tourism (MEFT)"
|
24714
|
+
ministry: "Ministry of Environment, Forestry and Tourism (MEFT)"
|
24756
24715
|
},
|
24757
24716
|
{
|
24758
24717
|
key: 5,
|
@@ -24760,7 +24719,7 @@ var NdcDetailsComponent = function (props) {
|
|
24760
24719
|
endDate: new Date("2023-03-25"),
|
24761
24720
|
nationalPlanObj: "Strengthen the role of the state in guiding and facilitating development",
|
24762
24721
|
kpi: 10,
|
24763
|
-
ministry: "Ministry of Tourism (MoT)"
|
24722
|
+
ministry: "Ministry of Tourism (MoT)"
|
24764
24723
|
},
|
24765
24724
|
];
|
24766
24725
|
var initialPeriods = [
|
@@ -24803,9 +24762,7 @@ var NdcDetailsComponent = function (props) {
|
|
24803
24762
|
React.createElement(Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedTab, onChange: onTabChange })),
|
24804
24763
|
selectedTab !== "add_new" && (React.createElement("div", null,
|
24805
24764
|
React.createElement("div", null,
|
24806
|
-
React.createElement(Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getNdcDetailsForPeriod(), columns: columns,
|
24807
|
-
expandedRowRender: function (record) { return getSubNdcActionContent(record); },
|
24808
|
-
}, footer: function () {
|
24765
|
+
React.createElement(Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getNdcDetailsForPeriod(), columns: columns, footer: function () {
|
24809
24766
|
return isAddNdcActionVisible() && (React.createElement(Row, { justify: "center" },
|
24810
24767
|
React.createElement(Button, { onClick: onAddNewNdcDetail, type: "default", style: {
|
24811
24768
|
marginBottom: 16,
|