@undp/carbon-library 1.0.284-CARBON-234.13 → 1.0.284-CARBON-406.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.js +42 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/Definitions/Definitions/ndcDetails.definitions.d.ts +1 -0
- package/dist/esm/index.js +42 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Definitions/Definitions/ndcDetails.definitions.d.ts +1 -0
- package/dist/locales/i18n/ndc/en.json +2 -0
- package/package.json +1 -1
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 === "
|
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;
|
@@ -26861,11 +26875,13 @@ var NdcDetailsComponent = function (props) {
|
|
26861
26875
|
: undefined;
|
26862
26876
|
var isGovernmentUser = (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT &&
|
26863
26877
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly;
|
26864
|
-
var isMainNdcActionsEditable =
|
26878
|
+
var isMainNdcActionsEditable = selectedPeriod &&
|
26879
|
+
!selectedPeriod.finalized &&
|
26865
26880
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT &&
|
26866
26881
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly;
|
26867
26882
|
var isSubNdcActionsEditable = function (record) {
|
26868
|
-
return (
|
26883
|
+
return (selectedPeriod &&
|
26884
|
+
!selectedPeriod.finalized &&
|
26869
26885
|
record.status !== NdcDetailsActionStatus.Approved &&
|
26870
26886
|
((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT ||
|
26871
26887
|
((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY &&
|
@@ -26873,7 +26889,8 @@ var NdcDetailsComponent = function (props) {
|
|
26873
26889
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly);
|
26874
26890
|
};
|
26875
26891
|
var checkSubNdcActionCreatePermission = function () {
|
26876
|
-
return (
|
26892
|
+
return (selectedPeriod &&
|
26893
|
+
!selectedPeriod.finalized &&
|
26877
26894
|
((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT ||
|
26878
26895
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY) &&
|
26879
26896
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== Role.ViewOnly);
|
@@ -26902,6 +26919,7 @@ var NdcDetailsComponent = function (props) {
|
|
26902
26919
|
actionType: NdcDetailsActionType.SubAction,
|
26903
26920
|
nationalPlanObjective: "",
|
26904
26921
|
kpi: "",
|
26922
|
+
kpiUnit: "",
|
26905
26923
|
ministryName: loginMinistry,
|
26906
26924
|
status: NdcDetailsActionStatus.New,
|
26907
26925
|
parentActionId: mainActionId,
|
@@ -26913,6 +26931,7 @@ var NdcDetailsComponent = function (props) {
|
|
26913
26931
|
form.setFieldsValue({
|
26914
26932
|
nationalPlanObjective: "",
|
26915
26933
|
kpi: "",
|
26934
|
+
kpiUnit: "",
|
26916
26935
|
});
|
26917
26936
|
}
|
26918
26937
|
setSubNdcActionsForPeriod(subNdcDetails);
|
@@ -26954,6 +26973,7 @@ var NdcDetailsComponent = function (props) {
|
|
26954
26973
|
return [2 /*return*/];
|
26955
26974
|
}
|
26956
26975
|
else if (updatedFields.kpi === row.kpi &&
|
26976
|
+
updatedFields.kpiUnit === row.kpiUnit &&
|
26957
26977
|
updatedFields.nationalPlanObjective === row.nationalPlanObjective) {
|
26958
26978
|
ClearEditMode();
|
26959
26979
|
return [2 /*return*/];
|
@@ -26967,13 +26987,13 @@ var NdcDetailsComponent = function (props) {
|
|
26967
26987
|
else {
|
26968
26988
|
updatedItem.status = NdcDetailsActionStatus.Pending;
|
26969
26989
|
}
|
26970
|
-
return [4 /*yield*/, post("national/programme/addNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi:
|
26990
|
+
return [4 /*yield*/, post("national/programme/addNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseFloat(updatedItem.kpi.toString()) }))];
|
26971
26991
|
case 5:
|
26972
26992
|
_a.sent();
|
26973
26993
|
return [3 /*break*/, 8];
|
26974
26994
|
case 6:
|
26975
26995
|
updatedItem.status = NdcDetailsActionStatus.Pending;
|
26976
|
-
return [4 /*yield*/, put("national/programme/updateNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi:
|
26996
|
+
return [4 /*yield*/, put("national/programme/updateNdcDetailsAction", __assign(__assign({}, updatedItem), { kpi: parseFloat(updatedItem.kpi.toString()) }))];
|
26977
26997
|
case 7:
|
26978
26998
|
_a.sent();
|
26979
26999
|
_a.label = 8;
|
@@ -26998,6 +27018,7 @@ var NdcDetailsComponent = function (props) {
|
|
26998
27018
|
var actionMenu = function (record) {
|
26999
27019
|
if (record.status === NdcDetailsActionStatus.Pending &&
|
27000
27020
|
isGovernmentUser &&
|
27021
|
+
selectedPeriod &&
|
27001
27022
|
!selectedPeriod.finalized) {
|
27002
27023
|
return (React.createElement(List, { className: "action-menu", size: "small", dataSource: [
|
27003
27024
|
{
|
@@ -27057,7 +27078,17 @@ var NdcDetailsComponent = function (props) {
|
|
27057
27078
|
width: 100,
|
27058
27079
|
editable: true,
|
27059
27080
|
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: "
|
27081
|
+
React.createElement("span", null, record.kpi))) : (React.createElement(Input, { placeholder: t("ndc:kpiPlaceHolder") })))); },
|
27082
|
+
},
|
27083
|
+
{
|
27084
|
+
title: t("ndc:ndcColumnsKpiUnit"),
|
27085
|
+
dataIndex: "kpiUnit",
|
27086
|
+
key: "kpiUnit",
|
27087
|
+
align: "left",
|
27088
|
+
width: 100,
|
27089
|
+
editable: true,
|
27090
|
+
render: function (_, record) { return (React.createElement(Space, { size: "middle" }, record.kpiUnit ? (React.createElement(Tooltip, { title: isNdcActionEditable(record) ? "" : t("ndc:ndcUnauthorisedMsg") },
|
27091
|
+
React.createElement("span", null, record.kpiUnit))) : (React.createElement(Input, { placeholder: t("ndc:kpiUnitPlaceHolder") })))); },
|
27061
27092
|
},
|
27062
27093
|
{
|
27063
27094
|
title: t("ndc:ndcColumnsMinistry"),
|
@@ -27121,6 +27152,7 @@ var NdcDetailsComponent = function (props) {
|
|
27121
27152
|
form.setFieldsValue({
|
27122
27153
|
nationalPlanObjective: "",
|
27123
27154
|
kpi: "",
|
27155
|
+
kpiUnit: "",
|
27124
27156
|
});
|
27125
27157
|
periodId = parseInt(selectedPeriod.key);
|
27126
27158
|
newData_1 = {
|
@@ -27128,6 +27160,7 @@ var NdcDetailsComponent = function (props) {
|
|
27128
27160
|
actionType: NdcDetailsActionType.MainAction,
|
27129
27161
|
nationalPlanObjective: "",
|
27130
27162
|
kpi: "",
|
27163
|
+
kpiUnit: "",
|
27131
27164
|
ministryName: loginMinistry,
|
27132
27165
|
periodId: periodId,
|
27133
27166
|
status: NdcDetailsActionStatus.New,
|
@@ -27266,10 +27299,11 @@ var NdcDetailsComponent = function (props) {
|
|
27266
27299
|
};
|
27267
27300
|
}, footer: function () {
|
27268
27301
|
return isGovernmentUser &&
|
27302
|
+
selectedPeriod &&
|
27269
27303
|
!selectedPeriod.finalized && (React.createElement(Row, { justify: "center" },
|
27270
27304
|
React.createElement(Button, { className: "btnAddNewMainAct", disabled: isMainActionInEditMode(), onClick: onClickedAddNewNdcDetail, type: "default" }, t("ndc:addNdcAction"))));
|
27271
27305
|
} })))),
|
27272
|
-
isGovernmentUser && !selectedPeriod.finalized ? (React.createElement(Row, { justify: "end" }, isMainActionInEditMode() ? (React.createElement(React.Fragment, null,
|
27306
|
+
isGovernmentUser && selectedPeriod && !selectedPeriod.finalized ? (React.createElement(Row, { justify: "end" }, isMainActionInEditMode() ? (React.createElement(React.Fragment, null,
|
27273
27307
|
React.createElement(Button, { className: "mg-left-1", disabled: true }, t("ndc:delete")),
|
27274
27308
|
React.createElement(Button, { className: "mg-left-1", disabled: true }, t("ndc:finalize")))) : (React.createElement(React.Fragment, null,
|
27275
27309
|
React.createElement(Button, { className: "mg-left-1 btn-danger", onClick: onClickedDeletePeriod, htmlType: "submit", loading: loading }, t("ndc:delete")),
|