@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 CHANGED
@@ -19612,13 +19612,16 @@ var NdcActionViewComponent = function (props) {
19612
19612
  }
19613
19613
  });
19614
19614
  }); };
19615
- var getProjectReportActions = function (reportData) {
19615
+ var getProjectReportActions = function (reportData, reportVersion) {
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" } }))))));
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))));
19622
19625
  };
19623
19626
  var getProjectReports = function () { return __awaiter(void 0, void 0, void 0, function () {
19624
19627
  var reportDetails, response, exception_1;
@@ -19666,12 +19669,20 @@ var NdcActionViewComponent = function (props) {
19666
19669
  if ((item === null || item === void 0 ? void 0 : item.status) === exports.DocumentStatus.ACCEPTED) {
19667
19670
  setMonitoringReportAccepted(true);
19668
19671
  }
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";
19669
19675
  reportDetails[t("ndcAction:viewMoniteringReport")] =
19670
- getProjectReportActions(item);
19676
+ getProjectReportActions(item, moniteringVersion);
19671
19677
  }
19672
19678
  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";
19673
19684
  reportDetails[t("ndcAction:viewVerificationReport")] =
19674
- getProjectReportActions(item);
19685
+ getProjectReportActions(item, verificationVersion);
19675
19686
  }
19676
19687
  });
19677
19688
  }
@@ -24527,7 +24538,6 @@ var NdcDetailsComponent = function (props) {
24527
24538
  var _d = React.useState("add_new"), selectedTab = _d[0], setSelectedTab = _d[1];
24528
24539
  var selectedPeriod = React.useRef({});
24529
24540
  var addedNdcDetailId = React.useRef(0);
24530
- var selectedNdcDetail = React.useRef({});
24531
24541
  var userInfoState = useUserContext().userInfoState;
24532
24542
  var isAddRangeVisible = function () {
24533
24543
  return (((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY ||
@@ -24560,15 +24570,6 @@ var NdcDetailsComponent = function (props) {
24560
24570
  return [];
24561
24571
  }
24562
24572
  };
24563
- var getSubNdcDetails = function (key) {
24564
- var ndcDetail = ndcDetailsData.find(function (item) { return item.key === key; });
24565
- if (ndcDetail) {
24566
- return ndcDetail.subNdcDetails;
24567
- }
24568
- else {
24569
- return [];
24570
- }
24571
- };
24572
24573
  var defaultColumns = [
24573
24574
  {
24574
24575
  title: t("ndc:ndcColumnsNationalPlanObj"),
@@ -24585,7 +24586,7 @@ var NdcDetailsComponent = function (props) {
24585
24586
  editable: true,
24586
24587
  },
24587
24588
  {
24588
- title: "Ministry",
24589
+ title: 'Ministry',
24589
24590
  dataIndex: "ministry",
24590
24591
  key: "ministry",
24591
24592
  align: "left",
@@ -24613,32 +24614,10 @@ var NdcDetailsComponent = function (props) {
24613
24614
  endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
24614
24615
  nationalPlanObj: t("ndc:enterNewPlanTxt"),
24615
24616
  kpi: 0,
24616
- ministry: "Please add the Ministry name",
24617
+ ministry: "Please add the Ministry name"
24617
24618
  };
24618
24619
  setNdcDetailsData(__spreadArray(__spreadArray([], ndcDetailsData, true), [newData], false));
24619
24620
  }
24620
- function onAddNewSubNdcDetail() {
24621
- var range = selectedTab.split("-");
24622
- var ndcDetail = ndcDetailsData.find(function (item) { return item.key === selectedNdcDetail.current.key; });
24623
- var ndcDetailItemIndex = ndcDetailsData.findIndex(function (item) { return item.key === selectedNdcDetail.current.key; });
24624
- if (ndcDetail) {
24625
- addedNdcDetailId.current = addedNdcDetailId.current + 1;
24626
- var newData = {
24627
- key: addedNdcDetailId.current,
24628
- startDate: new Date("".concat(Number(range[0]), "-01-24 23:12:00")),
24629
- endDate: new Date("".concat(Number(range[0]), "-12-24 23:12:00")),
24630
- nationalPlanObj: t("ndc:enterNewPlanTxt"),
24631
- kpi: 0,
24632
- ministry: "Please add the Ministry name",
24633
- };
24634
- if (!ndcDetail.subNdcDetails) {
24635
- ndcDetail.subNdcDetails = [];
24636
- }
24637
- ndcDetail.subNdcDetails.push(newData);
24638
- }
24639
- ndcDetailsData[ndcDetailItemIndex] = ndcDetail;
24640
- setNdcDetailsData(ndcDetailsData);
24641
- }
24642
24621
  var components = {
24643
24622
  body: {
24644
24623
  row: EditableRow,
@@ -24717,16 +24696,6 @@ var NdcDetailsComponent = function (props) {
24717
24696
  React.createElement(antd.Button, { type: "primary", onClick: onAddNewPeriod, htmlType: "submit", loading: loading }, t("ndc:submit")),
24718
24697
  React.createElement(antd.Button, { className: "back-btn", onClick: onCancelPeriod, loading: loading }, t("ndc:back"))))));
24719
24698
  }
24720
- function getSubNdcActionContent(record) {
24721
- selectedNdcDetail.current = record;
24722
- 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 () {
24723
- return (React.createElement(antd.Row, { justify: "center" },
24724
- React.createElement(antd.Button, { onClick: onAddNewSubNdcDetail, type: "default", style: {
24725
- marginBottom: 16,
24726
- width: "100%",
24727
- } }, t("ndc:addSubNdcAction"))));
24728
- } }));
24729
- }
24730
24699
  var onTabChange = function (key) {
24731
24700
  setSelectedTab(key);
24732
24701
  };
@@ -24738,17 +24707,7 @@ var NdcDetailsComponent = function (props) {
24738
24707
  endDate: new Date("2020-03-25"),
24739
24708
  nationalPlanObj: "Enhance value addition in key growth opportunities",
24740
24709
  kpi: 25,
24741
- ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
24742
- subNdcDetails: [
24743
- {
24744
- key: 6,
24745
- startDate: new Date("2019-03-25"),
24746
- endDate: new Date("2020-03-25"),
24747
- nationalPlanObj: "Enhance value addition in key growth opportunities sub details",
24748
- kpi: 25,
24749
- ministry: "Ministry of Agriculture, Water and Forestry (MAWF)",
24750
- },
24751
- ],
24710
+ ministry: "Ministry of Agriculture, Water and Forestry (MAWF)"
24752
24711
  },
24753
24712
  {
24754
24713
  key: 2,
@@ -24756,7 +24715,7 @@ var NdcDetailsComponent = function (props) {
24756
24715
  endDate: new Date("2019-08-25"),
24757
24716
  nationalPlanObj: "Strengthen the private sector to create 10,000 jobs",
24758
24717
  kpi: 10500,
24759
- ministry: "Ministry of Tourism (MoT)",
24718
+ ministry: "Ministry of Tourism (MoT)"
24760
24719
  },
24761
24720
  {
24762
24721
  key: 3,
@@ -24764,7 +24723,7 @@ var NdcDetailsComponent = function (props) {
24764
24723
  endDate: new Date("2022-03-25"),
24765
24724
  nationalPlanObj: "Consolidate and increase the stock and quality of productive infrastructure by 50%",
24766
24725
  kpi: 48,
24767
- ministry: "Ministry of Education, Arts and Culture (MoE)",
24726
+ ministry: "Ministry of Education, Arts and Culture (MoE)"
24768
24727
  },
24769
24728
  {
24770
24729
  key: 4,
@@ -24772,7 +24731,7 @@ var NdcDetailsComponent = function (props) {
24772
24731
  endDate: new Date("2022-05-25"),
24773
24732
  nationalPlanObj: "Enhance the productivity and social wellbeing of the population",
24774
24733
  kpi: 20,
24775
- ministry: "Ministry of Environment, Forestry and Tourism (MEFT)",
24734
+ ministry: "Ministry of Environment, Forestry and Tourism (MEFT)"
24776
24735
  },
24777
24736
  {
24778
24737
  key: 5,
@@ -24780,7 +24739,7 @@ var NdcDetailsComponent = function (props) {
24780
24739
  endDate: new Date("2023-03-25"),
24781
24740
  nationalPlanObj: "Strengthen the role of the state in guiding and facilitating development",
24782
24741
  kpi: 10,
24783
- ministry: "Ministry of Tourism (MoT)",
24742
+ ministry: "Ministry of Tourism (MoT)"
24784
24743
  },
24785
24744
  ];
24786
24745
  var initialPeriods = [
@@ -24823,9 +24782,7 @@ var NdcDetailsComponent = function (props) {
24823
24782
  React.createElement(antd.Tabs, { centered: false, defaultActiveKey: "1", items: periodItems, activeKey: selectedTab, onChange: onTabChange })),
24824
24783
  selectedTab !== "add_new" && (React.createElement("div", null,
24825
24784
  React.createElement("div", null,
24826
- React.createElement(antd.Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getNdcDetailsForPeriod(), columns: columns, expandable: {
24827
- expandedRowRender: function (record) { return getSubNdcActionContent(record); },
24828
- }, footer: function () {
24785
+ React.createElement(antd.Table, { components: components, rowClassName: function () { return "editable-row"; }, bordered: true, dataSource: getNdcDetailsForPeriod(), columns: columns, footer: function () {
24829
24786
  return isAddNdcActionVisible() && (React.createElement(antd.Row, { justify: "center" },
24830
24787
  React.createElement(antd.Button, { onClick: onAddNewNdcDetail, type: "default", style: {
24831
24788
  marginBottom: 16,