@undp/carbon-library 1.0.44 → 1.0.46

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ export declare enum ProgrammeStage {
6
6
  Rejected = "Rejected"
7
7
  }
8
8
  export declare enum ProgrammeStageMRV {
9
- AwaitingAuthorization = "AwaitingAuthorization",
9
+ AwaitingAuthorization = "Pending",
10
10
  Authorised = "Authorised",
11
11
  Approved = "Approved",
12
12
  Rejected = "Rejected"
@@ -66,7 +66,8 @@ export declare enum CompanyRole {
66
66
  CERTIFIER = "Certifier",
67
67
  PROGRAMME_DEVELOPER = "ProgrammeDeveloper",
68
68
  MRV = "MRV",
69
- GOVERNMENT = "Government"
69
+ GOVERNMENT = "Government",
70
+ API = "API"
70
71
  }
71
72
  export interface ProgrammeProperties {
72
73
  maxInternationalTransferAmount: string;
package/dist/esm/index.js CHANGED
@@ -157,7 +157,7 @@ var ProgrammeStage;
157
157
  })(ProgrammeStage || (ProgrammeStage = {}));
158
158
  var ProgrammeStageMRV;
159
159
  (function (ProgrammeStageMRV) {
160
- ProgrammeStageMRV["AwaitingAuthorization"] = "AwaitingAuthorization";
160
+ ProgrammeStageMRV["AwaitingAuthorization"] = "Pending";
161
161
  ProgrammeStageMRV["Authorised"] = "Authorised";
162
162
  ProgrammeStageMRV["Approved"] = "Approved";
163
163
  ProgrammeStageMRV["Rejected"] = "Rejected";
@@ -304,6 +304,7 @@ var CompanyRole$1;
304
304
  CompanyRole["PROGRAMME_DEVELOPER"] = "ProgrammeDeveloper";
305
305
  CompanyRole["MRV"] = "MRV";
306
306
  CompanyRole["GOVERNMENT"] = "Government";
307
+ CompanyRole["API"] = "API";
307
308
  })(CompanyRole$1 || (CompanyRole$1 = {}));
308
309
  var getGeneralFields = function (programme) {
309
310
  return {
@@ -614,23 +615,27 @@ var CompanyManagementComponent = function (props) {
614
615
  };
615
616
  };
616
617
  var getAllCompany = function () { return __awaiter(void 0, void 0, void 0, function () {
617
- var response, error_1;
618
- return __generator(this, function (_a) {
619
- switch (_a.label) {
618
+ var response, availableCompanies, error_1;
619
+ var _a, _b;
620
+ return __generator(this, function (_c) {
621
+ switch (_c.label) {
620
622
  case 0:
621
623
  setLoading(true);
622
- _a.label = 1;
624
+ _c.label = 1;
623
625
  case 1:
624
- _a.trys.push([1, 3, , 4]);
626
+ _c.trys.push([1, 3, , 4]);
625
627
  return [4 /*yield*/, post("national/organisation/query", getAllOrganisationParams())];
626
628
  case 2:
627
- response = _a.sent();
628
- setTableData(response.data);
629
- setTotalCompany(response.response.data.total);
629
+ response = _c.sent();
630
+ if (response && response.data) {
631
+ availableCompanies = response.data.filter(function (company) { return company.companyRole !== CompanyRole$1.API; });
632
+ setTableData(availableCompanies);
633
+ setTotalCompany((_b = (_a = response === null || response === void 0 ? void 0 : response.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.total);
634
+ }
630
635
  setLoading(false);
631
636
  return [3 /*break*/, 4];
632
637
  case 3:
633
- error_1 = _a.sent();
638
+ error_1 = _c.sent();
634
639
  message.open({
635
640
  type: "error",
636
641
  content: error_1.message,
@@ -1985,7 +1990,7 @@ var UserManagementComponent = function (props) {
1985
1990
  };
1986
1991
  };
1987
1992
  var getAllUser = function () { return __awaiter(void 0, void 0, void 0, function () {
1988
- var response, error_2;
1993
+ var response, availableUsers, error_2;
1989
1994
  var _a, _b;
1990
1995
  return __generator(this, function (_c) {
1991
1996
  switch (_c.label) {
@@ -1997,8 +2002,11 @@ var UserManagementComponent = function (props) {
1997
2002
  return [4 /*yield*/, post("national/user/query", getAllUserParams())];
1998
2003
  case 2:
1999
2004
  response = _c.sent();
2000
- setTableData(response === null || response === void 0 ? void 0 : response.data);
2001
- setTotalUser((_b = (_a = response === null || response === void 0 ? void 0 : response.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.total);
2005
+ if (response && response.data) {
2006
+ availableUsers = response.data.filter(function (user) { return user.companyRole !== CompanyRole$1.API; });
2007
+ setTableData(availableUsers);
2008
+ setTotalUser((_b = (_a = response === null || response === void 0 ? void 0 : response.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.total);
2009
+ }
2002
2010
  setLoading(false);
2003
2011
  return [3 /*break*/, 4];
2004
2012
  case 3: