swoop-common 2.2.200 → 2.2.202

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.
@@ -310,10 +310,11 @@ export declare class SwoopService {
310
310
  * @param region antarctica, arctic, patagonia
311
311
  * @param all 1,0 - include all records or just the active ones - default 0
312
312
  * @param groupsArray Filter by group names, e.g. groups[]=manager&groups[]=sales. Valid values: superadmin, admin, sales, customer, partner, flight-specialist, bookings, accounts, other, has-sales-targets, manager, avatar-content-enabled
313
+ * @param email Filter by exact email address
313
314
  * @returns any Successful response
314
315
  * @throws ApiError
315
316
  */
316
- peopleGetCollection(region?: string, all?: string, groupsArray?: string): CancelablePromise<{
317
+ peopleGetCollection(region?: string, all?: string, groupsArray?: string, email?: string): CancelablePromise<{
317
318
  people?: Array<Person>;
318
319
  }>;
319
320
  /**
@@ -495,10 +495,11 @@ export class SwoopService {
495
495
  * @param region antarctica, arctic, patagonia
496
496
  * @param all 1,0 - include all records or just the active ones - default 0
497
497
  * @param groupsArray Filter by group names, e.g. groups[]=manager&groups[]=sales. Valid values: superadmin, admin, sales, customer, partner, flight-specialist, bookings, accounts, other, has-sales-targets, manager, avatar-content-enabled
498
+ * @param email Filter by exact email address
498
499
  * @returns any Successful response
499
500
  * @throws ApiError
500
501
  */
501
- peopleGetCollection(region, all, groupsArray) {
502
+ peopleGetCollection(region, all, groupsArray, email) {
502
503
  return __request(OpenAPI, {
503
504
  method: 'GET',
504
505
  url: '/api/people',
@@ -506,6 +507,7 @@ export class SwoopService {
506
507
  'region': region,
507
508
  'all': all,
508
509
  'groups[]': groupsArray,
510
+ 'email': email,
509
511
  },
510
512
  });
511
513
  }
@@ -30,7 +30,7 @@ const ComponentListItem = ({ component, isSelected, details, onSelect, showDivid
30
30
  details.regions.map((region) => (React.createElement(Chip, { key: region.id, label: region.name, size: "small", variant: "outlined" }))))),
31
31
  details.partners.length > 0 && (React.createElement(Box, { display: "flex", alignItems: "center", gap: 1, mt: 0.5 },
32
32
  React.createElement(Typography, { variant: "body2", color: "text.secondary" }, "Partners:"),
33
- details.partners.slice(0, 3).map((partner) => (React.createElement(Chip, { key: partner.id, label: `${partner.name} - ${PARTNER_REGION_READABLE[partner.id || "".split("-")[0]]}`, size: "small", variant: "outlined", color: "secondary" }))),
33
+ details.partners.slice(0, 3).map((partner) => (React.createElement(Chip, { key: partner.id, label: `${partner.title} (${PARTNER_REGION_READABLE[(partner.id || "").split("-")[0]]})`, size: "small", variant: "outlined", color: "secondary" }))),
34
34
  details.partners.length > 3 && (React.createElement(Typography, { variant: "body2", color: "text.secondary" },
35
35
  "+",
36
36
  details.partners.length - 3,
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import React, { useState, useEffect, useMemo } from "react";
11
11
  import { Dialog, DialogTitle, DialogContent, DialogActions, Button, TextField, MenuItem, Box, List, Typography, InputAdornment, IconButton, CircularProgress, Pagination, Autocomplete, Checkbox, FormControlLabel, } from "@mui/material";
12
12
  import { Search as SearchIcon, Clear as ClearIcon, FilterList as FilterIcon, } from "@mui/icons-material";
13
+ import { PARTNER_REGION_READABLE } from "../consts/region";
13
14
  import { fetchComponents, getAllPartners } from "../util/api";
14
15
  import { InternalServices } from "../../api/init";
15
16
  import ComponentListItem from "./ComponentListItem";
@@ -152,7 +153,9 @@ export default function ComponentPickerModal({ open, onClose, onSelect, selected
152
153
  }
153
154
  });
154
155
  const usedRegions = regions;
155
- const usedPartners = partners;
156
+ const usedPartners = useMemo(() => partners
157
+ .filter((partner) => !/inactive/i.test(partner.title || ""))
158
+ .sort((a, b) => (a.title || "").localeCompare(b.title || "")), [partners]);
156
159
  const usedTemplates = templates;
157
160
  const handleClearFilters = () => {
158
161
  setSelectedRegion("");
@@ -205,7 +208,11 @@ export default function ComponentPickerModal({ open, onClose, onSelect, selected
205
208
  React.createElement(Autocomplete, { size: "small", options: usedRegions, getOptionLabel: (option) => option.name, value: usedRegions.find((r) => r.id === selectedRegion) || null, onChange: (_, newValue) => setSelectedRegion((newValue === null || newValue === void 0 ? void 0 : newValue.id) || ""), renderInput: (params) => React.createElement(TextField, Object.assign({}, params, { label: "Region" })), sx: { minWidth: 160 }, isOptionEqualToValue: (option, value) => option.id === value.id }),
206
209
  React.createElement(TextField, { select: true, size: "small", label: "Partner", value: selectedPartner, onChange: (e) => setSelectedPartner(e.target.value), sx: { minWidth: 160 } },
207
210
  React.createElement(MenuItem, { value: "" }, "All Partners"),
208
- usedPartners.map((partner) => (React.createElement(MenuItem, { key: partner.id, value: partner.id }, partner.name)))),
211
+ usedPartners.map((partner) => (React.createElement(MenuItem, { key: partner.id, value: partner.id },
212
+ partner.title,
213
+ " (",
214
+ PARTNER_REGION_READABLE[(partner.id || "").split("-")[0]],
215
+ ")")))),
209
216
  !(parentIdsFilter === null || parentIdsFilter === void 0 ? void 0 : parentIdsFilter.length) && (React.createElement(TextField, { select: true, size: "small", label: "Type", value: selectedTemplate, onChange: (e) => setSelectedTemplate(e.target.value), sx: { minWidth: 160 } },
210
217
  React.createElement(MenuItem, { value: "" }, "All Types"),
211
218
  usedTemplates.map((template) => (React.createElement(MenuItem, { key: template.id, value: template.id },
@@ -1,5 +1,5 @@
1
1
  export const PARTNER_REGION_READABLE = {
2
2
  "ARC": "Arctic",
3
3
  "PAT": "Patagonia",
4
- "ANT": "Antarctic"
4
+ "ANT": "Antarctica"
5
5
  };
@@ -16,10 +16,8 @@ export const getAllPartners = () => __awaiter(void 0, void 0, void 0, function*
16
16
  for (let index = 0; index < Regions.length; index++) {
17
17
  const region = Regions[index];
18
18
  const partners = yield InternalServices.SwoopService.partnersGetCollection(1, 500, region);
19
- // @ts-expect-error
20
- if (partners === null || partners === void 0 ? void 0 : partners.member) {
21
- // @ts-expect-error
22
- finalData.push(...partners.member);
19
+ if (partners) {
20
+ finalData.push(...partners);
23
21
  }
24
22
  }
25
23
  return finalData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swoop-common",
3
- "version": "2.2.200",
3
+ "version": "2.2.202",
4
4
  "main": "dist/api/index.js",
5
5
  "types": "dist/api/index.d.ts",
6
6
  "exports": {