@undp/carbon-library 1.0.56 → 1.0.57

Sign up to get free protection for your applications and to get access to all the features.
package/dist/cjs/index.js CHANGED
@@ -985,16 +985,16 @@ var AddNewCompanyComponent = function (props) {
985
985
  }); };
986
986
  var onUpdateCompany = function () { return __awaiter(void 0, void 0, void 0, function () {
987
987
  var formOneValues, values, logoBase64, logoUrls, response, error_3;
988
- var _a, _b, _c, _d, _e, _f;
989
- return __generator(this, function (_g) {
990
- switch (_g.label) {
988
+ var _a, _b, _c, _d, _e, _f, _g, _h;
989
+ return __generator(this, function (_j) {
990
+ switch (_j.label) {
991
991
  case 0:
992
992
  setLoading(true);
993
993
  formOneValues = formOne.getFieldsValue();
994
994
  formOneValues.phoneNo = PhoneInput.formatPhoneNumberIntl(formOneValues.phoneNo);
995
- _g.label = 1;
995
+ _j.label = 1;
996
996
  case 1:
997
- _g.trys.push([1, 5, , 6]);
997
+ _j.trys.push([1, 5, , 6]);
998
998
  values = {};
999
999
  if (regionField) {
1000
1000
  values = {
@@ -1017,9 +1017,14 @@ var AddNewCompanyComponent = function (props) {
1017
1017
  companyRole: (_d = state === null || state === void 0 ? void 0 : state.record) === null || _d === void 0 ? void 0 : _d.companyRole,
1018
1018
  };
1019
1019
  }
1020
- if (((_e = state === null || state === void 0 ? void 0 : state.record) === null || _e === void 0 ? void 0 : _e.companyRole) !== exports.CompanyRole.GOVERNMENT) {
1020
+ if (((_e = state === null || state === void 0 ? void 0 : state.record) === null || _e === void 0 ? void 0 : _e.companyRole) !== exports.CompanyRole.GOVERNMENT &&
1021
+ ((_f = state === null || state === void 0 ? void 0 : state.record) === null || _f === void 0 ? void 0 : _f.companyRole) !== exports.CompanyRole.MINISTRY) {
1021
1022
  values.taxId = formOneValues.taxId;
1022
1023
  }
1024
+ if (((_g = state === null || state === void 0 ? void 0 : state.record) === null || _g === void 0 ? void 0 : _g.companyRole) === exports.CompanyRole.MINISTRY) {
1025
+ values.sectoralScope = formOneValues.sectoralScope;
1026
+ values.nameOfMinister = formOneValues.nameOfMinister;
1027
+ }
1023
1028
  if (formOneValues.website) {
1024
1029
  values.website = 'https://' + formOneValues.website;
1025
1030
  }
@@ -1028,15 +1033,15 @@ var AddNewCompanyComponent = function (props) {
1028
1033
  }
1029
1034
  if (!formOneValues.logo) return [3 /*break*/, 3];
1030
1035
  if (!(formOneValues.logo.length !== 0)) return [3 /*break*/, 3];
1031
- return [4 /*yield*/, getBase64((_f = formOneValues.logo[0]) === null || _f === void 0 ? void 0 : _f.originFileObj)];
1036
+ return [4 /*yield*/, getBase64((_h = formOneValues.logo[0]) === null || _h === void 0 ? void 0 : _h.originFileObj)];
1032
1037
  case 2:
1033
- logoBase64 = _g.sent();
1038
+ logoBase64 = _j.sent();
1034
1039
  logoUrls = logoBase64.split(',');
1035
1040
  values.logo = logoUrls[1];
1036
- _g.label = 3;
1041
+ _j.label = 3;
1037
1042
  case 3: return [4 /*yield*/, put('national/organisation/update', values)];
1038
1043
  case 4:
1039
- response = _g.sent();
1044
+ response = _j.sent();
1040
1045
  if (response.status === 200 || response.status === 201) {
1041
1046
  setUserInfo({
1042
1047
  companyLogo: response.data.logo,
@@ -1052,7 +1057,7 @@ var AddNewCompanyComponent = function (props) {
1052
1057
  setLoading(false);
1053
1058
  return [3 /*break*/, 6];
1054
1059
  case 5:
1055
- error_3 = _g.sent();
1060
+ error_3 = _j.sent();
1056
1061
  antd.message.open({
1057
1062
  type: 'error',
1058
1063
  content: "".concat(t('errorInUpdatingCompany'), " ").concat(error_3.message),
@@ -2702,11 +2707,11 @@ var ProgrammeManagementComponent = function (props) {
2702
2707
  React.createElement(antd.Button, { type: "primary", size: "large", block: true, icon: React.createElement(icons.PlusOutlined, null), onClick: onClickAddProgramme }, t("programme:addProgramme")))))),
2703
2708
  React.createElement("div", { className: "content-card" },
2704
2709
  React.createElement(antd.Row, { className: "table-actions-section" },
2705
- React.createElement(antd.Col, { lg: { span: 16 }, md: { span: 16 } },
2710
+ React.createElement(antd.Col, { lg: { span: 15 }, md: { span: 14 } },
2706
2711
  React.createElement("div", { className: "action-bar" },
2707
2712
  React.createElement(antd.Checkbox, { className: "all-check", disabled: loading, indeterminate: indeterminate, onChange: onCheckAllChange, checked: checkAll, defaultChecked: true }, t("programme:all")),
2708
2713
  React.createElement(antd.Checkbox.Group, { disabled: loading, options: statusOptions, defaultValue: statusOptions.map(function (e) { return e.value; }), value: selectedStatus, onChange: onStatusQuery }))),
2709
- React.createElement(antd.Col, { lg: { span: 8 }, md: { span: 8 } },
2714
+ React.createElement(antd.Col, { lg: { span: 9 }, md: { span: 10 } },
2710
2715
  React.createElement("div", { className: "filter-section" },
2711
2716
  React.createElement("div", { className: "search-filter" },
2712
2717
  React.createElement(antd.Checkbox, { className: "label", onChange: function (v) {