@undp/carbon-library 1.0.175-CARBON-363.72 → 1.0.175-CARBON-363.73

Sign up to get free protection for your applications and to get access to all the features.
package/dist/cjs/index.js CHANGED
@@ -26145,18 +26145,18 @@ var RegistryDashboardComponent = function (props) {
26145
26145
 
26146
26146
  React.createContext(null);
26147
26147
  var EditableCell = function (_a) {
26148
- var editing = _a.editing, dataIndex = _a.dataIndex, title = _a.title; _a.inputType; var record = _a.record; _a.index; var children = _a.children, onBlurHandler = _a.onBlurHandler, restProps = __rest(_a, ["editing", "dataIndex", "title", "inputType", "record", "index", "children", "onBlurHandler"]);
26148
+ var editing = _a.editing, dataIndex = _a.dataIndex, title = _a.title; _a.inputType; var record = _a.record; _a.index; var children = _a.children, onBlurHandler = _a.onBlurHandler, t = _a.t, restProps = __rest(_a, ["editing", "dataIndex", "title", "inputType", "record", "index", "children", "onBlurHandler", "t"]);
26149
26149
  var inputNode;
26150
26150
  if (dataIndex === "nationalPlanObjective") {
26151
- inputNode = (React.createElement(antd.Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: "Enter National Plan Objective" }));
26151
+ inputNode = (React.createElement(antd.Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:nationalPlanObjectivePlaceHolder") }));
26152
26152
  }
26153
26153
  else if (dataIndex === "kpi") {
26154
- inputNode = (React.createElement(antd.InputNumber, { onBlur: function () { return onBlurHandler(record); }, placeholder: "Enter Kpi" }));
26154
+ inputNode = (React.createElement(antd.InputNumber, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:kpiPlaceHolder") }));
26155
26155
  }
26156
26156
  return (React.createElement("td", __assign({}, restProps), editing ? (React.createElement(antd.Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [
26157
26157
  {
26158
26158
  required: true,
26159
- message: "Please Input ".concat(title, "!"),
26159
+ message: "".concat(title, " ").concat(t("ndc:isRequired")),
26160
26160
  },
26161
26161
  ] }, inputNode)) : (children)));
26162
26162
  };
@@ -26449,6 +26449,7 @@ var NdcDetailsComponent = function (props) {
26449
26449
  handleSave(record);
26450
26450
  }
26451
26451
  },
26452
+ t: t,
26452
26453
  };
26453
26454
  } });
26454
26455
  });
@@ -26503,6 +26504,15 @@ var NdcDetailsComponent = function (props) {
26503
26504
  var onClickedFinalizePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
26504
26505
  var pendingActions;
26505
26506
  return __generator(this, function (_a) {
26507
+ if (subNdcActionsForPeriod.length === 0) {
26508
+ antd.message.open({
26509
+ type: "error",
26510
+ content: t("ndc:finalizeNdcEmptyErrorText"),
26511
+ duration: 3,
26512
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26513
+ });
26514
+ return [2 /*return*/];
26515
+ }
26506
26516
  pendingActions = subNdcActionsForPeriod.filter(function (action) {
26507
26517
  return action.status === NdcDetailsActionStatus.Pending;
26508
26518
  });
@@ -26553,7 +26563,7 @@ var NdcDetailsComponent = function (props) {
26553
26563
  expandedRowRender: function (record) {
26554
26564
  return subNdcActionTableContent();
26555
26565
  },
26556
- columnWidth: 40
26566
+ columnWidth: 40,
26557
26567
  }, onRow: function (record, rowIndex) {
26558
26568
  return {
26559
26569
  onClick: function (event) {
@@ -26714,13 +26724,43 @@ var NdcDetailsComponent = function (props) {
26714
26724
  });
26715
26725
  return [3 /*break*/, 11];
26716
26726
  case 11:
26717
- if (actionResponse &&
26718
- (actionInfo.action === "Delete" || actionInfo.action === "Finalize")) {
26719
- fetchNdcDetailPeriods();
26720
- }
26721
- else if (actionResponse &&
26722
- (actionInfo.action === "Approve" || actionInfo.action === "Reject")) {
26723
- fetchNdcDetailActions();
26727
+ if (actionResponse) {
26728
+ if (actionInfo.action === "Delete") {
26729
+ antd.message.open({
26730
+ type: "success",
26731
+ content: t("ndc:deletePeriodSuccessMsg"),
26732
+ duration: 3,
26733
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26734
+ });
26735
+ fetchNdcDetailPeriods();
26736
+ }
26737
+ else if (actionInfo.action === "Finalize") {
26738
+ antd.message.open({
26739
+ type: "success",
26740
+ content: t("ndc:finalizeSuccessMsg"),
26741
+ duration: 3,
26742
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26743
+ });
26744
+ fetchNdcDetailPeriods();
26745
+ }
26746
+ else if (actionInfo.action === "Approve") {
26747
+ antd.message.open({
26748
+ type: "success",
26749
+ content: t("ndc:approveSuccessMsg"),
26750
+ duration: 3,
26751
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26752
+ });
26753
+ fetchNdcDetailActions();
26754
+ }
26755
+ else if (actionInfo.action === "Reject") {
26756
+ antd.message.open({
26757
+ type: "success",
26758
+ content: t("ndc:rejectSuccessMsg"),
26759
+ duration: 3,
26760
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26761
+ });
26762
+ fetchNdcDetailActions();
26763
+ }
26724
26764
  }
26725
26765
  setOpenConfirmationModal(false);
26726
26766
  setLoading(false);