@undp/carbon-library 1.0.150-CARBON-320.0 → 1.0.150-CARBON-343.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.js +70 -23
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +70 -23
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
@@ -19612,16 +19612,13 @@ var NdcActionViewComponent = function (props) {
|
|
19612
19612
|
}
|
19613
19613
|
});
|
19614
19614
|
}); };
|
19615
|
-
var getProjectReportActions = function (reportData
|
19615
|
+
var getProjectReportActions = function (reportData) {
|
19616
19616
|
return (React.createElement(antd.Row, null,
|
19617
19617
|
React.createElement("div", { className: "icon" },
|
19618
19618
|
(reportData === null || reportData === void 0 ? void 0 : reportData.status) === exports.DocumentStatus.ACCEPTED && (React.createElement(icons.CheckCircleOutlined, { className: "common-progress-icon", style: { color: "#5DC380" } })),
|
19619
19619
|
(reportData === null || reportData === void 0 ? void 0 : reportData.status) === exports.DocumentStatus.REJECTED && (React.createElement(icons.ExclamationCircleOutlined, { className: "common-progress-icon", style: { color: "#FD6F70" } }))),
|
19620
19620
|
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 },
|
19621
|
-
React.createElement(icons.BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))))
|
19622
|
-
(reportData === null || reportData === void 0 ? void 0 : reportData.txTime) && (React.createElement("div", { className: "time" },
|
19623
|
-
moment(parseInt(reportData === null || reportData === void 0 ? void 0 : reportData.txTime)).format("DD MMMM YYYY @ HH:mm"),
|
19624
|
-
" ~ " + reportVersion))));
|
19621
|
+
React.createElement(icons.BookOutlined, { className: "common-progress-icon margin-right-1", style: { color: "#3F3A47" } }))))));
|
19625
19622
|
};
|
19626
19623
|
var getProjectReports = function () { return __awaiter(void 0, void 0, void 0, function () {
|
19627
19624
|
var reportDetails, response, exception_1;
|
@@ -19669,20 +19666,12 @@ var NdcActionViewComponent = function (props) {
|
|
19669
19666
|
if ((item === null || item === void 0 ? void 0 : item.status) === exports.DocumentStatus.ACCEPTED) {
|
19670
19667
|
setMonitoringReportAccepted(true);
|
19671
19668
|
}
|
19672
|
-
var versionfull = (item === null || item === void 0 ? void 0 : item.url).split("_")[(item === null || item === void 0 ? void 0 : item.url).split("_").length - 1];
|
19673
|
-
var version = versionfull ? versionfull.split(".")[0] : "1";
|
19674
|
-
var moniteringVersion = version.startsWith("V") ? version : "V1";
|
19675
19669
|
reportDetails[t("ndcAction:viewMoniteringReport")] =
|
19676
|
-
getProjectReportActions(item
|
19670
|
+
getProjectReportActions(item);
|
19677
19671
|
}
|
19678
19672
|
else if ((_b = item === null || item === void 0 ? void 0 : item.url) === null || _b === void 0 ? void 0 : _b.includes("VERIFICATION_REPORT")) {
|
19679
|
-
var versionfull = (item === null || item === void 0 ? void 0 : item.url).split("_")[(item === null || item === void 0 ? void 0 : item.url).split("_").length - 1];
|
19680
|
-
var version = versionfull ? versionfull.split(".")[0] : "1";
|
19681
|
-
var verificationVersion = version.startsWith("V")
|
19682
|
-
? version
|
19683
|
-
: "V1";
|
19684
19673
|
reportDetails[t("ndcAction:viewVerificationReport")] =
|
19685
|
-
getProjectReportActions(item
|
19674
|
+
getProjectReportActions(item);
|
19686
19675
|
}
|
19687
19676
|
});
|
19688
19677
|
}
|
@@ -24538,6 +24527,8 @@ var NdcDetailsComponent = function (props) {
|
|
24538
24527
|
var _d = React.useState("add_new"), selectedTab = _d[0], setSelectedTab = _d[1];
|
24539
24528
|
var selectedPeriod = React.useRef({});
|
24540
24529
|
var addedNdcDetailId = React.useRef(0);
|
24530
|
+
var selectedNdcDetail = React.useRef({});
|
24531
|
+
var _e = React.useState(0), tableKey = _e[0], setTableKey = _e[1];
|
24541
24532
|
var userInfoState = useUserContext().userInfoState;
|
24542
24533
|
var isAddRangeVisible = function () {
|
24543
24534
|
return (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY ||
|
@@ -24570,6 +24561,15 @@ var NdcDetailsComponent = function (props) {
|
|
24570
24561
|
return [];
|
24571
24562
|
}
|
24572
24563
|
};
|
24564
|
+
var getSubNdcDetails = function (key) {
|
24565
|
+
var ndcDetail = ndcDetailsData.find(function (item) { return item.key === key; });
|
24566
|
+
if (ndcDetail) {
|
24567
|
+
return ndcDetail.subNdcDetails;
|
24568
|
+
}
|
24569
|
+
else {
|
24570
|
+
return [];
|
24571
|
+
}
|
24572
|
+
};
|
24573
24573
|
var defaultColumns = [
|
24574
24574
|
{
|
24575
24575
|
title: t("ndc:ndcColumnsNationalPlanObj"),
|
@@ -24586,7 +24586,7 @@ var NdcDetailsComponent = function (props) {
|
|
24586
24586
|
editable: true,
|
24587
24587
|
},
|
24588
24588
|
{
|
24589
|
-
title:
|
24589
|
+
title: "Ministry",
|
24590
24590
|
dataIndex: "ministry",
|
24591
24591
|
key: "ministry",
|
24592
24592
|
align: "left",
|
@@ -24614,10 +24614,33 @@ var NdcDetailsComponent = function (props) {
|
|
24614
24614
|
endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
|
24615
24615
|
nationalPlanObj: t("ndc:enterNewPlanTxt"),
|
24616
24616
|
kpi: 0,
|
24617
|
-
ministry: "Please add the Ministry name"
|
24617
|
+
ministry: "Please add the Ministry name",
|
24618
24618
|
};
|
24619
24619
|
setNdcDetailsData(__spreadArray(__spreadArray([], ndcDetailsData, true), [newData], false));
|
24620
24620
|
}
|
24621
|
+
function onAddNewSubNdcDetail() {
|
24622
|
+
var range = selectedTab.split("-");
|
24623
|
+
var ndcDetail = ndcDetailsData.find(function (item) { return item.key === selectedNdcDetail.current.key; });
|
24624
|
+
var ndcDetailItemIndex = ndcDetailsData.findIndex(function (item) { return item.key === selectedNdcDetail.current.key; });
|
24625
|
+
if (ndcDetail) {
|
24626
|
+
addedNdcDetailId.current = addedNdcDetailId.current + 1;
|
24627
|
+
var newData = {
|
24628
|
+
key: addedNdcDetailId.current,
|
24629
|
+
startDate: new Date("".concat(Number(range[0]), "-01-24 23:12:00")),
|
24630
|
+
endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
|
24631
|
+
nationalPlanObj: t("ndc:enterNewPlanTxt"),
|
24632
|
+
kpi: 0,
|
24633
|
+
ministry: "Please add the Ministry name",
|
24634
|
+
};
|
24635
|
+
if (!ndcDetail.subNdcDetails) {
|
24636
|
+
ndcDetail.subNdcDetails = [];
|
24637
|
+
}
|
24638
|
+
ndcDetail.subNdcDetails.push(newData);
|
24639
|
+
}
|
24640
|
+
ndcDetailsData[ndcDetailItemIndex] = ndcDetail;
|
24641
|
+
setNdcDetailsData(ndcDetailsData);
|
24642
|
+
setTableKey(function (key) { return key + 1; });
|
24643
|
+
}
|
24621
24644
|
var components = {
|
24622
24645
|
body: {
|
24623
24646
|
row: EditableRow,
|
@@ -24696,6 +24719,16 @@ var NdcDetailsComponent = function (props) {
|
|
24696
24719
|
React.createElement(antd.Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit")),
|
24697
24720
|
React.createElement(antd.Button, { className: "back-btn", onClick: onCancelPeriod, loading: loading }, t("ndc:back"))))));
|
24698
24721
|
}
|
24722
|
+
function getSubNdcActionContent(record) {
|
24723
|
+
selectedNdcDetail.current = record;
|
24724
|
+
return (React.createElement(antd.Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getSubNdcDetails(record.key), columns: columns, showHeader: false, pagination: false, footer: function () {
|
24725
|
+
return (React.createElement(antd.Row, { justify: "center" },
|
24726
|
+
React.createElement(antd.Button, { onClick: onAddNewSubNdcDetail, type: "default", style: {
|
24727
|
+
marginBottom: 16,
|
24728
|
+
width: "100%",
|
24729
|
+
} }, t("ndc:addSubNdcAction"))));
|
24730
|
+
} }));
|
24731
|
+
}
|
24699
24732
|
var onTabChange = function (key) {
|
24700
24733
|
setSelectedTab(key);
|
24701
24734
|
};
|
@@ -24707,7 +24740,17 @@ var NdcDetailsComponent = function (props) {
|
|
24707
24740
|
endDate: new Date("2020-03-25"),
|
24708
24741
|
nationalPlanObj: "Enhance value addition in key growth opportunities",
|
24709
24742
|
kpi: 25,
|
24710
|
-
ministry: "Ministry of Agriculture, Water and Forestry (MAWF)"
|
24743
|
+
ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
|
24744
|
+
subNdcDetails: [
|
24745
|
+
{
|
24746
|
+
key: 6,
|
24747
|
+
startDate: new Date("2019-03-25"),
|
24748
|
+
endDate: new Date("2020-03-25"),
|
24749
|
+
nationalPlanObj: "Enhance value addition in key growth opportunities sub details",
|
24750
|
+
kpi: 25,
|
24751
|
+
ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
|
24752
|
+
},
|
24753
|
+
],
|
24711
24754
|
},
|
24712
24755
|
{
|
24713
24756
|
key: 2,
|
@@ -24715,7 +24758,7 @@ var NdcDetailsComponent = function (props) {
|
|
24715
24758
|
endDate: new Date("2019-08-25"),
|
24716
24759
|
nationalPlanObj: "Strengthen the private sector to create 10,000 jobs",
|
24717
24760
|
kpi: 10500,
|
24718
|
-
ministry: "Ministry of Tourism (MoT)"
|
24761
|
+
ministry: "Ministry of Tourism (MoT)",
|
24719
24762
|
},
|
24720
24763
|
{
|
24721
24764
|
key: 3,
|
@@ -24723,7 +24766,7 @@ var NdcDetailsComponent = function (props) {
|
|
24723
24766
|
endDate: new Date("2022-03-25"),
|
24724
24767
|
nationalPlanObj: "Consolidate and increase the stock and quality of productive infrastructure by 50%",
|
24725
24768
|
kpi: 48,
|
24726
|
-
ministry: "Ministry of Education, Arts and Culture (MoE)"
|
24769
|
+
ministry: "Ministry of Education, Arts and Culture (MoE)",
|
24727
24770
|
},
|
24728
24771
|
{
|
24729
24772
|
key: 4,
|
@@ -24731,7 +24774,7 @@ var NdcDetailsComponent = function (props) {
|
|
24731
24774
|
endDate: new Date("2022-05-25"),
|
24732
24775
|
nationalPlanObj: "Enhance the productivity and social wellbeing of the population",
|
24733
24776
|
kpi: 20,
|
24734
|
-
ministry: "Ministry of Environment, Forestry and Tourism (MEFT)"
|
24777
|
+
ministry: "Ministry of Environment, Forestry and Tourism (MEFT)",
|
24735
24778
|
},
|
24736
24779
|
{
|
24737
24780
|
key: 5,
|
@@ -24739,7 +24782,7 @@ var NdcDetailsComponent = function (props) {
|
|
24739
24782
|
endDate: new Date("2023-03-25"),
|
24740
24783
|
nationalPlanObj: "Strengthen the role of the state in guiding and facilitating development",
|
24741
24784
|
kpi: 10,
|
24742
|
-
ministry: "Ministry of Tourism (MoT)"
|
24785
|
+
ministry: "Ministry of Tourism (MoT)",
|
24743
24786
|
},
|
24744
24787
|
];
|
24745
24788
|
var initialPeriods = [
|
@@ -24782,7 +24825,11 @@ var NdcDetailsComponent = function (props) {
|
|
24782
24825
|
React.createElement(antd.Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedTab, onChange: onTabChange })),
|
24783
24826
|
selectedTab !== "add_new" && (React.createElement("div", null,
|
24784
24827
|
React.createElement("div", null,
|
24785
|
-
React.createElement(antd.Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getNdcDetailsForPeriod(), columns: columns,
|
24828
|
+
React.createElement(antd.Table, { key: tableKey, components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getNdcDetailsForPeriod(), columns: columns, expandable: {
|
24829
|
+
expandedRowRender: function (record) { return getSubNdcActionContent(record); },
|
24830
|
+
indentSize: 0,
|
24831
|
+
defaultExpandedRowKeys: [selectedNdcDetail.current.key]
|
24832
|
+
}, footer: function () {
|
24786
24833
|
return isAddNdcActionVisible() && (React.createElement(antd.Row, { justify: "center" },
|
24787
24834
|
React.createElement(antd.Button, { onClick: onAddNewNdcDetail, type: "default", style: {
|
24788
24835
|
marginBottom: 16,
|