@undp/carbon-library 1.0.284-CARBON-425.0 → 1.0.284-CARBON-406.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,7 @@ export type NdcDetail = {
11
11
  actionType: NdcDetailsActionType;
12
12
  nationalPlanObjective: string;
13
13
  kpi: number | string;
14
+ kpiUnit: string;
14
15
  ministryName: string;
15
16
  periodId?: number;
16
17
  status: NdcDetailsActionStatus;
package/dist/esm/index.js CHANGED
@@ -26754,7 +26754,21 @@ var EditableCell = function (_a) {
26754
26754
  }); },
26755
26755
  },
26756
26756
  ] },
26757
- React.createElement(Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:nationalPlanObjectivePlaceHolder") }))) : editing && dataIndex === "kpi" ? (React.createElement(Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [
26757
+ React.createElement(Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:nationalPlanObjectivePlaceHolder") }))) : editing && dataIndex === "kpiUnit" ? (React.createElement(Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [
26758
+ {
26759
+ validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
26760
+ var trimValue;
26761
+ return __generator(this, function (_a) {
26762
+ trimValue = typeof value === "string" ? value.trim() : value;
26763
+ if (!trimValue) {
26764
+ throw new Error("".concat(title, " ").concat(t("ndc:isRequired")));
26765
+ }
26766
+ return [2 /*return*/];
26767
+ });
26768
+ }); },
26769
+ },
26770
+ ] },
26771
+ React.createElement(Input, { onBlur: function () { return onBlurHandler(record); }, placeholder: t("ndc:kpiUnitPlaceHolder") }))) : editing && dataIndex === "kpi" ? (React.createElement(Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [
26758
26772
  {
26759
26773
  validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
26760
26774
  var trimValue;
@@ -26902,6 +26916,7 @@ var NdcDetailsComponent = function (props) {
26902
26916
  actionType: NdcDetailsActionType.SubAction,
26903
26917
  nationalPlanObjective: "",
26904
26918
  kpi: "",
26919
+ kpiUnit: "",
26905
26920
  ministryName: loginMinistry,
26906
26921
  status: NdcDetailsActionStatus.New,
26907
26922
  parentActionId: mainActionId,
@@ -26913,6 +26928,7 @@ var NdcDetailsComponent = function (props) {
26913
26928
  form.setFieldsValue({
26914
26929
  nationalPlanObjective: "",
26915
26930
  kpi: "",
26931
+ kpiUnit: "",
26916
26932
  });
26917
26933
  }
26918
26934
  setSubNdcActionsForPeriod(subNdcDetails);
@@ -26954,6 +26970,7 @@ var NdcDetailsComponent = function (props) {
26954
26970
  return [2 /*return*/];
26955
26971
  }
26956
26972
  else if (updatedFields.kpi === row.kpi &&
26973
+ updatedFields.kpiUnit === row.kpiUnit &&
26957
26974
  updatedFields.nationalPlanObjective === row.nationalPlanObjective) {
26958
26975
  ClearEditMode();
26959
26976
  return [2 /*return*/];
@@ -26967,13 +26984,13 @@ var NdcDetailsComponent = function (props) {
26967
26984
  else {
26968
26985
  updatedItem.status = NdcDetailsActionStatus.Pending;
26969
26986
  }
26970
- return [4 /*yield*/, post("national/programme/addNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseInt(updatedItem.kpi.toString()) }))];
26987
+ return [4 /*yield*/, post("national/programme/addNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseFloat(updatedItem.kpi.toString()) }))];
26971
26988
  case 5:
26972
26989
  _a.sent();
26973
26990
  return [3 /*break*/, 8];
26974
26991
  case 6:
26975
26992
  updatedItem.status = NdcDetailsActionStatus.Pending;
26976
- return [4 /*yield*/, put("national/programme/updateNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseInt(updatedItem.kpi.toString()) }))];
26993
+ return [4 /*yield*/, put("national/programme/updateNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseFloat(updatedItem.kpi.toString()) }))];
26977
26994
  case 7:
26978
26995
  _a.sent();
26979
26996
  _a.label = 8;
@@ -27057,7 +27074,17 @@ var NdcDetailsComponent = function (props) {
27057
27074
  width: 100,
27058
27075
  editable: true,
27059
27076
  render: function (_, record) { return (React.createElement(Space, { size: "middle" }, record.kpi ? (React.createElement(Tooltip, { title: isNdcActionEditable(record) ? "" : t("ndc:ndcUnauthorisedMsg") },
27060
- React.createElement("span", null, record.kpi))) : (React.createElement(Input, { placeholder: "Enter Kpi" })))); },
27077
+ React.createElement("span", null, record.kpi))) : (React.createElement(Input, { placeholder: t("ndc:kpiPlaceHolder") })))); },
27078
+ },
27079
+ {
27080
+ title: t("ndc:ndcColumnsKpiUnit"),
27081
+ dataIndex: "kpiUnit",
27082
+ key: "kpiUnit",
27083
+ align: "left",
27084
+ width: 100,
27085
+ editable: true,
27086
+ render: function (_, record) { return (React.createElement(Space, { size: "middle" }, record.kpiUnit ? (React.createElement(Tooltip, { title: isNdcActionEditable(record) ? "" : t("ndc:ndcUnauthorisedMsg") },
27087
+ React.createElement("span", null, record.kpiUnit))) : (React.createElement(Input, { placeholder: t("ndc:kpiUnitPlaceHolder") })))); },
27061
27088
  },
27062
27089
  {
27063
27090
  title: t("ndc:ndcColumnsMinistry"),
@@ -27121,6 +27148,7 @@ var NdcDetailsComponent = function (props) {
27121
27148
  form.setFieldsValue({
27122
27149
  nationalPlanObjective: "",
27123
27150
  kpi: "",
27151
+ kpiUnit: "",
27124
27152
  });
27125
27153
  periodId = parseInt(selectedPeriod.key);
27126
27154
  newData_1 = {
@@ -27128,6 +27156,7 @@ var NdcDetailsComponent = function (props) {
27128
27156
  actionType: NdcDetailsActionType.MainAction,
27129
27157
  nationalPlanObjective: "",
27130
27158
  kpi: "",
27159
+ kpiUnit: "",
27131
27160
  ministryName: loginMinistry,
27132
27161
  periodId: periodId,
27133
27162
  status: NdcDetailsActionStatus.New,