@undp/carbon-library 1.0.31 → 1.0.32

Sign up to get free protection for your applications and to get access to all the features.
package/dist/cjs/index.js CHANGED
@@ -175,6 +175,13 @@ exports.ProgrammeStage = void 0;
175
175
  ProgrammeStage["Rejected"] = "Rejected";
176
176
  // Frozen = 'Frozen',
177
177
  })(exports.ProgrammeStage || (exports.ProgrammeStage = {}));
178
+ exports.ProgrammeStageMRV = void 0;
179
+ (function (ProgrammeStageMRV) {
180
+ ProgrammeStageMRV["AwaitingAuthorization"] = "Pending";
181
+ ProgrammeStageMRV["Authorised"] = "Authorised";
182
+ ProgrammeStageMRV["Approved"] = "Approved";
183
+ ProgrammeStageMRV["Rejected"] = "Rejected";
184
+ })(exports.ProgrammeStageMRV || (exports.ProgrammeStageMRV = {}));
178
185
  // export enum ProgrammeTransferStage {
179
186
  // APPROVED = 'Approved',
180
187
  // REJECTED = 'Rejected',
@@ -268,6 +275,18 @@ var getStageTagType = function (stage) {
268
275
  return "default";
269
276
  }
270
277
  };
278
+ var getStageTagTypeMRV = function (stage) {
279
+ switch (getStageEnumVal(stage)) {
280
+ case exports.ProgrammeStageMRV.AwaitingAuthorization:
281
+ return "error";
282
+ case exports.ProgrammeStageMRV.Authorised:
283
+ return "processing";
284
+ case exports.ProgrammeStageMRV.Approved:
285
+ return "purple";
286
+ default:
287
+ return "default";
288
+ }
289
+ };
271
290
  var getTransferStageTagType = function (stage, transfer) {
272
291
  // if (transfer.isRetirement) {
273
292
  // switch (getStageEnumVal(stage)) {
@@ -803,12 +822,19 @@ var AddNewCompanyComponent = function (props) {
803
822
  return [4 /*yield*/, post("national/organisation/regions", {
804
823
  page: 1,
805
824
  size: 100,
825
+ filterAnd: [
826
+ {
827
+ key: "lang",
828
+ operation: "=",
829
+ value: "en",
830
+ },
831
+ ],
806
832
  })];
807
833
  case 2:
808
834
  response = _a.sent();
809
835
  if (response.data) {
810
836
  regionNames = response.data.map(function (item) { return item.regionName; });
811
- setRegionsList(__spreadArray(["National"], regionNames, true));
837
+ setRegionsList(__spreadArray([t("national")], regionNames, true));
812
838
  }
813
839
  return [3 /*break*/, 5];
814
840
  case 3:
@@ -856,9 +882,9 @@ var AddNewCompanyComponent = function (props) {
856
882
  nextOne(values);
857
883
  };
858
884
  var onChangeRegion = function (values) {
859
- if (values.includes("National")) {
885
+ if (values.includes(t("national"))) {
860
886
  var buyerCountryValues = regionsList;
861
- var newBuyerValues = buyerCountryValues === null || buyerCountryValues === void 0 ? void 0 : buyerCountryValues.filter(function (item) { return item !== "National"; });
887
+ var newBuyerValues = buyerCountryValues === null || buyerCountryValues === void 0 ? void 0 : buyerCountryValues.filter(function (item) { return item !== t("national"); });
862
888
  formOne.setFieldValue("regions", __spreadArray([], newBuyerValues, true));
863
889
  }
864
890
  };
@@ -2134,7 +2160,7 @@ var UserManagementComponent = function (props) {
2134
2160
  React.createElement(UserActionConfirmationModel, { t: t, actionInfo: actionInfo, onActionConfirmed: handleOk, onActionCanceled: handleCancel, openModal: openDeleteConfirmationModal, errorMsg: errorMsg, loading: loading })));
2135
2161
  };
2136
2162
 
2137
- var css_248z$9 = ".programme-management .programme-title-bar {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 0px 0px 30px 0px; }\n .programme-management .programme-title-bar .title {\n display: flex;\n flex-direction: column;\n justify-content: space-between; }\n .programme-management .programme-title-bar .actions {\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n .programme-management .programme-title-bar .flex-display {\n margin-left: 15px; }\n\n.programme-management .certify-list {\n width: 110px;\n display: flex;\n align-items: center;\n flex-wrap: wrap; }\n .programme-management .certify-list .profile-icon {\n margin-bottom: 4px; }\n\n.programme-management .table-actions-section {\n margin-bottom: 0px; }\n .programme-management .table-actions-section input {\n font-family: \"Inter\";\n font-size: 0.8rem; }\n\n.programme-management .all-check {\n margin-right: 10px; }\n .programme-management .all-check .ant-checkbox-inner::after {\n background-color: rgba(58, 53, 65, 0.5); }\n .programme-management .all-check .ant-checkbox-checked .ant-checkbox-inner::after {\n background-color: transparent; }\n .programme-management .all-check .ant-checkbox-checked .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.5);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Retired\"] + .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.4);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"AwaitingAuthorization\"] + .ant-checkbox-inner {\n background-color: rgba(237, 77, 71, 0.6);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Rejected\"] + .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.4);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Issued\"] + .ant-checkbox-inner {\n background-color: #16b1ff;\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Transferred\"] + .ant-checkbox-inner {\n background-color: rgba(118, 195, 39, 0.6);\n border: none; }\n";
2163
+ var css_248z$9 = ".programme-management .programme-title-bar {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 0px 0px 30px 0px; }\n .programme-management .programme-title-bar .title {\n display: flex;\n flex-direction: column;\n justify-content: space-between; }\n .programme-management .programme-title-bar .actions {\n display: flex;\n align-items: center;\n justify-content: flex-end; }\n .programme-management .programme-title-bar .flex-display {\n margin-left: 15px; }\n\n.programme-management .certify-list {\n width: 110px;\n display: flex;\n align-items: center;\n flex-wrap: wrap; }\n .programme-management .certify-list .profile-icon {\n margin-bottom: 4px; }\n\n.programme-management .table-actions-section {\n margin-bottom: 0px; }\n .programme-management .table-actions-section input {\n font-family: \"Inter\";\n font-size: 0.8rem; }\n\n.programme-management .all-check {\n margin-right: 10px; }\n .programme-management .all-check .ant-checkbox-inner::after {\n background-color: rgba(58, 53, 65, 0.5); }\n .programme-management .all-check .ant-checkbox-checked .ant-checkbox-inner::after {\n background-color: transparent; }\n .programme-management .all-check .ant-checkbox-checked .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.5);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Retired\"] + .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.4);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"AwaitingAuthorization\"] + .ant-checkbox-inner {\n background-color: rgba(237, 77, 71, 0.6);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Rejected\"] + .ant-checkbox-inner {\n background-color: rgba(58, 53, 65, 0.4);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Authorised\"] + .ant-checkbox-inner {\n background-color: #16b1ff;\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Approved\"] + .ant-checkbox-inner {\n background-color: rgba(145, 85, 253, 0.6);\n border: none; }\n\n.programme-management .ant-checkbox-checked .ant-checkbox-input[value=\"Transferred\"] + .ant-checkbox-inner {\n background-color: rgba(118, 195, 39, 0.6);\n border: none; }\n";
2138
2164
  styleInject(css_248z$9);
2139
2165
 
2140
2166
  exports.ProgrammeManagementColumns = void 0;
@@ -2154,7 +2180,7 @@ exports.ProgrammeManagementColumns = void 0;
2154
2180
 
2155
2181
  var Search = antd.Input.Search;
2156
2182
  var ProgrammeManagementComponent = function (props) {
2157
- var t = props.t, visibleColumns = props.visibleColumns, useUserContext = props.useUserContext, useConnection = props.useConnection, onNavigateToProgrammeView = props.onNavigateToProgrammeView, onClickAddProgramme = props.onClickAddProgramme;
2183
+ var t = props.t, visibleColumns = props.visibleColumns, useUserContext = props.useUserContext, useConnection = props.useConnection, onNavigateToProgrammeView = props.onNavigateToProgrammeView, onClickAddProgramme = props.onClickAddProgramme, enableAddProgramme = props.enableAddProgramme;
2158
2184
  var _a = useConnection(); _a.get; _a.delete; var post = _a.post;
2159
2185
  var _b = React.useState(), totalProgramme = _b[0], setTotalProgramme = _b[1];
2160
2186
  var _c = React.useState(false), loading = _c[0], setLoading = _c[1];
@@ -2168,8 +2194,9 @@ var ProgrammeManagementComponent = function (props) {
2168
2194
  var _l = React.useState(), sortOrder = _l[0], setSortOrder = _l[1];
2169
2195
  var _m = React.useState(), sortField = _m[0], setSortField = _m[1];
2170
2196
  var userInfoState = useUserContext().userInfoState;
2171
- var statusOptions = Object.keys(exports.ProgrammeStage).map(function (k, index) { return ({
2172
- label: Object.values(exports.ProgrammeStage)[index],
2197
+ var stageObject = enableAddProgramme ? exports.ProgrammeStageMRV : exports.ProgrammeStage;
2198
+ var statusOptions = Object.keys(stageObject).map(function (k, index) { return ({
2199
+ label: Object.values(stageObject)[index],
2173
2200
  value: k,
2174
2201
  }); });
2175
2202
  var _o = React.useState(statusOptions.map(function (e) { return e.value; })), selectedStatus = _o[0], setSelectedStatus = _o[1];
@@ -2257,7 +2284,7 @@ var ProgrammeManagementComponent = function (props) {
2257
2284
  sorter: true,
2258
2285
  align: "center",
2259
2286
  render: function (item) {
2260
- return (React.createElement(antd.Tag, { className: "clickable", color: getStageTagType(item) }, getStageEnumVal(item)));
2287
+ return (React.createElement(antd.Tag, { className: "clickable", color: getStageTagTypeMRV(item) }, getStageEnumVal(item)));
2261
2288
  },
2262
2289
  onCell: function (record, rowIndex) {
2263
2290
  return {
@@ -5392,6 +5419,7 @@ exports.getGeneralFields = getGeneralFields;
5392
5419
  exports.getRetirementTypeString = getRetirementTypeString;
5393
5420
  exports.getStageEnumVal = getStageEnumVal;
5394
5421
  exports.getStageTagType = getStageTagType;
5422
+ exports.getStageTagTypeMRV = getStageTagTypeMRV;
5395
5423
  exports.getStageTransferEnumVal = getStageTransferEnumVal;
5396
5424
  exports.getTransferStageTagType = getTransferStageTagType;
5397
5425
  exports.isBase64 = isBase64;