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

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,7 @@ interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
18
18
  index: number;
19
19
  children: React.ReactNode;
20
20
  onBlurHandler: any;
21
+ t: any;
21
22
  }
22
23
  export declare const EditableCell: React.FC<EditableCellProps>;
23
24
  export {};
package/dist/esm/index.js CHANGED
@@ -26125,18 +26125,18 @@ var RegistryDashboardComponent = function (props) {
26125
26125
 
26126
26126
  React.createContext(null);
26127
26127
  var EditableCell = function (_a) {
26128
- 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"]);
26128
+ 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"]);
26129
26129
  var inputNode;
26130
26130
  if (dataIndex === "nationalPlanObjective") {
26131
- inputNode = (React.createElement(Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: "Enter National Plan Objective" }));
26131
+ inputNode = (React.createElement(Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:nationalPlanObjectivePlaceHolder") }));
26132
26132
  }
26133
26133
  else if (dataIndex === "kpi") {
26134
- inputNode = (React.createElement(InputNumber, { onBlur: function () { return onBlurHandler(record); }, placeholder: "Enter Kpi" }));
26134
+ inputNode = (React.createElement(InputNumber, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:kpiPlaceHolder") }));
26135
26135
  }
26136
26136
  return (React.createElement("td", __assign({}, restProps), editing ? (React.createElement(Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [
26137
26137
  {
26138
26138
  required: true,
26139
- message: "Please Input ".concat(title, "!"),
26139
+ message: "".concat(title, " ").concat(t("ndc:isRequired")),
26140
26140
  },
26141
26141
  ] }, inputNode)) : (children)));
26142
26142
  };
@@ -26205,7 +26205,7 @@ var NdcDetailsComponent = function (props) {
26205
26205
  var loginMinistry = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT
26206
26206
  ? process.env.REACT_APP_GOVERNMENT_MINISTRY
26207
26207
  ? process.env.REACT_APP_GOVERNMENT_MINISTRY
26208
- : "Test ministryName"
26208
+ : "Ministry Of Environment"
26209
26209
  : (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY
26210
26210
  ? userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyName
26211
26211
  : undefined;
@@ -26429,6 +26429,7 @@ var NdcDetailsComponent = function (props) {
26429
26429
  handleSave(record);
26430
26430
  }
26431
26431
  },
26432
+ t: t,
26432
26433
  };
26433
26434
  } });
26434
26435
  });
@@ -26483,6 +26484,15 @@ var NdcDetailsComponent = function (props) {
26483
26484
  var onClickedFinalizePeriod = function () { return __awaiter(void 0, void 0, void 0, function () {
26484
26485
  var pendingActions;
26485
26486
  return __generator(this, function (_a) {
26487
+ if (subNdcActionsForPeriod.length === 0) {
26488
+ message.open({
26489
+ type: "error",
26490
+ content: t("ndc:finalizeNdcEmptyErrorText"),
26491
+ duration: 3,
26492
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26493
+ });
26494
+ return [2 /*return*/];
26495
+ }
26486
26496
  pendingActions = subNdcActionsForPeriod.filter(function (action) {
26487
26497
  return action.status === NdcDetailsActionStatus.Pending;
26488
26498
  });
@@ -26533,7 +26543,7 @@ var NdcDetailsComponent = function (props) {
26533
26543
  expandedRowRender: function (record) {
26534
26544
  return subNdcActionTableContent();
26535
26545
  },
26536
- columnWidth: 40
26546
+ columnWidth: 40,
26537
26547
  }, onRow: function (record, rowIndex) {
26538
26548
  return {
26539
26549
  onClick: function (event) {
@@ -26694,13 +26704,43 @@ var NdcDetailsComponent = function (props) {
26694
26704
  });
26695
26705
  return [3 /*break*/, 11];
26696
26706
  case 11:
26697
- if (actionResponse &&
26698
- (actionInfo.action === "Delete" || actionInfo.action === "Finalize")) {
26699
- fetchNdcDetailPeriods();
26700
- }
26701
- else if (actionResponse &&
26702
- (actionInfo.action === "Approve" || actionInfo.action === "Reject")) {
26703
- fetchNdcDetailActions();
26707
+ if (actionResponse) {
26708
+ if (actionInfo.action === "Delete") {
26709
+ message.open({
26710
+ type: "success",
26711
+ content: t("ndc:deletePeriodSuccessMsg"),
26712
+ duration: 3,
26713
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26714
+ });
26715
+ fetchNdcDetailPeriods();
26716
+ }
26717
+ else if (actionInfo.action === "Finalize") {
26718
+ message.open({
26719
+ type: "success",
26720
+ content: t("ndc:finalizeSuccessMsg"),
26721
+ duration: 3,
26722
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26723
+ });
26724
+ fetchNdcDetailPeriods();
26725
+ }
26726
+ else if (actionInfo.action === "Approve") {
26727
+ message.open({
26728
+ type: "success",
26729
+ content: t("ndc:approveSuccessMsg"),
26730
+ duration: 3,
26731
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26732
+ });
26733
+ fetchNdcDetailActions();
26734
+ }
26735
+ else if (actionInfo.action === "Reject") {
26736
+ message.open({
26737
+ type: "success",
26738
+ content: t("ndc:rejectSuccessMsg"),
26739
+ duration: 3,
26740
+ style: { textAlign: "right", marginRight: 15, marginTop: 10 },
26741
+ });
26742
+ fetchNdcDetailActions();
26743
+ }
26704
26744
  }
26705
26745
  setOpenConfirmationModal(false);
26706
26746
  setLoading(false);