@undp/carbon-library 1.0.103 → 1.0.106

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.
package/dist/cjs/index.js CHANGED
@@ -4732,6 +4732,7 @@ var AddNewCompanyComponent = function (props) {
4732
4732
  if (((_e = state === null || state === void 0 ? void 0 : state.record) === null || _e === void 0 ? void 0 : _e.companyRole) !== exports.CompanyRole.GOVERNMENT &&
4733
4733
  ((_f = state === null || state === void 0 ? void 0 : state.record) === null || _f === void 0 ? void 0 : _f.companyRole) !== exports.CompanyRole.MINISTRY) {
4734
4734
  values.taxId = formOneValues.taxId;
4735
+ values.paymentId = formOneValues.paymentId;
4735
4736
  }
4736
4737
  if (((_g = state === null || state === void 0 ? void 0 : state.record) === null || _g === void 0 ? void 0 : _g.companyRole) === exports.CompanyRole.MINISTRY) {
4737
4738
  values.sectoralScope = formOneValues.sectoralScope;
@@ -4848,26 +4849,30 @@ var AddNewCompanyComponent = function (props) {
4848
4849
  ] },
4849
4850
  React.createElement(antd.Input, { size: "large" })))
4850
4851
  : null,
4851
- React.createElement(antd.Form.Item, { label: "Registration Payment ID", initialValue: (_c = state === null || state === void 0 ? void 0 : state.record) === null || _c === void 0 ? void 0 : _c.paymentId, name: "paymentId", rules: [
4852
- {
4853
- required: true,
4854
- message: "",
4855
- },
4856
- {
4857
- validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
4858
- return __generator(this, function (_a) {
4859
- if (String(value).trim() === "" ||
4860
- String(value).trim() === undefined ||
4861
- value === null ||
4862
- value === undefined) {
4863
- throw new Error("Registration Payment ID ".concat(t("isRequired")));
4864
- }
4865
- return [2 /*return*/];
4866
- });
4867
- }); },
4868
- },
4869
- ] },
4870
- React.createElement(antd.Input, { size: "large" })),
4852
+ companyRole !== exports.CompanyRole.MINISTRY
4853
+ ? (!isUpdate ||
4854
+ (isUpdate &&
4855
+ companyRole !== exports.CompanyRole.GOVERNMENT)) && (React.createElement(antd.Form.Item, { label: "Registration Payment ID", initialValue: (_c = state === null || state === void 0 ? void 0 : state.record) === null || _c === void 0 ? void 0 : _c.paymentId, name: "paymentId", rules: [
4856
+ {
4857
+ required: true,
4858
+ message: "",
4859
+ },
4860
+ {
4861
+ validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
4862
+ return __generator(this, function (_a) {
4863
+ if (String(value).trim() === "" ||
4864
+ String(value).trim() === undefined ||
4865
+ value === null ||
4866
+ value === undefined) {
4867
+ throw new Error("Registration Payment ID ".concat(t("isRequired")));
4868
+ }
4869
+ return [2 /*return*/];
4870
+ });
4871
+ }); },
4872
+ },
4873
+ ] },
4874
+ React.createElement(antd.Input, { size: "large" })))
4875
+ : null,
4871
4876
  React.createElement(antd.Form.Item, { label: "Email", name: "email", initialValue: (_d = state === null || state === void 0 ? void 0 : state.record) === null || _d === void 0 ? void 0 : _d.email, rules: [
4872
4877
  {
4873
4878
  required: true,
@@ -13106,6 +13111,11 @@ var UserProfileComponent = function (props) {
13106
13111
  React.createElement(antd.Col, { span: 12, className: "field-value" }, organisationDetails.taxId
13107
13112
  ? organisationDetails.taxId
13108
13113
  : "-")),
13114
+ React.createElement(antd.Row, { className: "field" },
13115
+ React.createElement(antd.Col, { span: 12, className: "field-key" }, t("userProfile:paymentId")),
13116
+ React.createElement(antd.Col, { span: 12, className: "field-value" }, organisationDetails.paymentId
13117
+ ? organisationDetails.paymentId
13118
+ : "-")),
13109
13119
  React.createElement(antd.Row, { className: "field" },
13110
13120
  React.createElement(antd.Col, { span: 12, className: "field-key" }, t("userProfile:companyRole")),
13111
13121
  React.createElement(antd.Col, { span: 12, className: "field-value" },
@@ -23628,14 +23638,14 @@ var ProgrammeRevokeForm = function (props) {
23628
23638
  };
23629
23639
 
23630
23640
  var ProgrammeTransferForm = function (props) {
23631
- var programme = props.programme, onFinish = props.onFinish, onCancel = props.onCancel, actionBtnText = props.actionBtnText; props.subText; var toCompanyDefault = props.toCompanyDefault, disableToCompany = props.disableToCompany, receiverLabelText = props.receiverLabelText, userCompanyId = props.userCompanyId, companyRole = props.companyRole, translator = props.translator, useConnection = props.useConnection;
23641
+ var programme = props.programme, onFinish = props.onFinish, onCancel = props.onCancel, actionBtnText = props.actionBtnText; props.subText; var toCompanyDefault = props.toCompanyDefault, disableToCompany = props.disableToCompany, receiverLabelText = props.receiverLabelText, userCompanyId = props.userCompanyId, companyRole = props.companyRole, translator = props.translator, useConnection = props.useConnection, _a = props.ministryLevelPermission, ministryLevelPermission = _a === void 0 ? false : _a;
23632
23642
  var t = translator.t;
23633
- var _a = React.useState(undefined), popupError = _a[0], setPopupError = _a[1];
23634
- var _b = React.useState(false), loading = _b[0], setLoading = _b[1];
23635
- var _c = React.useState(0), currentSum = _c[0], setCurrentSum = _c[1];
23636
- var _d = React.useState(toCompanyDefault ? [toCompanyDefault] : []), companyList = _d[0], setCompanyList = _d[1];
23637
- var _e = React.useState(), value = _e[0], setValue = _e[1];
23638
- var _f = useConnection(); _f.get; _f.delete; var post = _f.post;
23643
+ var _b = React.useState(undefined), popupError = _b[0], setPopupError = _b[1];
23644
+ var _c = React.useState(false), loading = _c[0], setLoading = _c[1];
23645
+ var _d = React.useState(0), currentSum = _d[0], setCurrentSum = _d[1];
23646
+ var _e = React.useState(toCompanyDefault ? [toCompanyDefault] : []), companyList = _e[0], setCompanyList = _e[1];
23647
+ var _f = React.useState(), value = _f[0], setValue = _f[1];
23648
+ var _g = useConnection(); _g.get; _g.delete; var post = _g.post;
23639
23649
  var handleSearch = function (newValue) { return __awaiter(void 0, void 0, void 0, function () {
23640
23650
  var resp;
23641
23651
  return __generator(this, function (_a) {
@@ -23696,8 +23706,8 @@ var ProgrammeTransferForm = function (props) {
23696
23706
  programme.creditOwnerPercentage = [100];
23697
23707
  }
23698
23708
  var companies = {};
23699
- for (var _i = 0, _g = programme.company; _i < _g.length; _i++) {
23700
- var c = _g[_i];
23709
+ for (var _i = 0, _h = programme.company; _i < _h.length; _i++) {
23710
+ var c = _h[_i];
23701
23711
  companies[c.companyId] = c;
23702
23712
  }
23703
23713
  var validCompanies = [];
@@ -23707,7 +23717,8 @@ var ProgrammeTransferForm = function (props) {
23707
23717
  userCompanyId !== Number(programme.companyId[index])) ||
23708
23718
  (!toCompanyDefault &&
23709
23719
  (userCompanyId === Number(programme.companyId[index]) ||
23710
- companyRole === exports.CompanyRole.GOVERNMENT))) &&
23720
+ companyRole === exports.CompanyRole.GOVERNMENT ||
23721
+ ministryLevelPermission))) &&
23711
23722
  parseInt(companies[Number(programme.companyId[index])].state) ===
23712
23723
  exports.CompanyState.ACTIVE.valueOf()) {
23713
23724
  var companyAvailableTotal = ((programme.creditBalance -