swoop-common 2.2.216 → 2.2.218
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/api/generated/swoop/exports.d.ts +4 -0
- package/dist/api/generated/swoop/index.d.ts +4 -0
- package/dist/api/generated/swoop/models/MediaAsset.d.ts +13 -0
- package/dist/api/generated/swoop/models/MediaAsset.js +1 -0
- package/dist/api/generated/swoop/models/MediaAsset_jsonld.d.ts +13 -0
- package/dist/api/generated/swoop/models/MediaAsset_jsonld.js +1 -0
- package/dist/api/generated/swoop/models/MediaTag.d.ts +6 -0
- package/dist/api/generated/swoop/models/MediaTag.js +1 -0
- package/dist/api/generated/swoop/models/MediaTag_jsonld.d.ts +6 -0
- package/dist/api/generated/swoop/models/MediaTag_jsonld.js +1 -0
- package/dist/api/generated/swoop/services/SwoopService.d.ts +24 -0
- package/dist/api/generated/swoop/services/SwoopService.js +40 -0
- package/dist/rendering/components/ComponentListItem.js +16 -20
- package/package.json +1 -1
|
@@ -56,6 +56,10 @@ export type { Itinerary_ItinerarySaveInputSwoop } from './index';
|
|
|
56
56
|
export type { Itinerary_ItinerarySaveInput_jsonldSwoop } from './index';
|
|
57
57
|
export type { Itinerary_ItinerarySaveOutputSwoop } from './index';
|
|
58
58
|
export type { Itinerary_ItinerarySaveOutput_jsonldSwoop } from './index';
|
|
59
|
+
export type { MediaAssetSwoop } from './index';
|
|
60
|
+
export type { MediaAsset_jsonldSwoop } from './index';
|
|
61
|
+
export type { MediaTagSwoop } from './index';
|
|
62
|
+
export type { MediaTag_jsonldSwoop } from './index';
|
|
59
63
|
export type { Note_jsonld_readSwoop } from './index';
|
|
60
64
|
export type { Note_jsonld_write_createSwoop } from './index';
|
|
61
65
|
export type { Note_jsonld_write_editSwoop } from './index';
|
|
@@ -60,6 +60,10 @@ export type { Itinerary_ItinerarySaveInput as Itinerary_ItinerarySaveInputSwoop
|
|
|
60
60
|
export type { Itinerary_ItinerarySaveInput_jsonld as Itinerary_ItinerarySaveInput_jsonldSwoop } from './models/Itinerary_ItinerarySaveInput_jsonld';
|
|
61
61
|
export type { Itinerary_ItinerarySaveOutput as Itinerary_ItinerarySaveOutputSwoop } from './models/Itinerary_ItinerarySaveOutput';
|
|
62
62
|
export type { Itinerary_ItinerarySaveOutput_jsonld as Itinerary_ItinerarySaveOutput_jsonldSwoop } from './models/Itinerary_ItinerarySaveOutput_jsonld';
|
|
63
|
+
export type { MediaAsset as MediaAssetSwoop } from './models/MediaAsset';
|
|
64
|
+
export type { MediaAsset_jsonld as MediaAsset_jsonldSwoop } from './models/MediaAsset_jsonld';
|
|
65
|
+
export type { MediaTag as MediaTagSwoop } from './models/MediaTag';
|
|
66
|
+
export type { MediaTag_jsonld as MediaTag_jsonldSwoop } from './models/MediaTag_jsonld';
|
|
63
67
|
export type { Note_jsonld_read as Note_jsonld_readSwoop } from './models/Note_jsonld_read';
|
|
64
68
|
export type { Note_jsonld_write_create as Note_jsonld_write_createSwoop } from './models/Note_jsonld_write_create';
|
|
65
69
|
export type { Note_jsonld_write_edit as Note_jsonld_write_editSwoop } from './models/Note_jsonld_write_edit';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type MediaAsset = {
|
|
2
|
+
id?: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
caption?: string | null;
|
|
6
|
+
filename?: string;
|
|
7
|
+
width?: number | null;
|
|
8
|
+
height?: number | null;
|
|
9
|
+
credit?: string | null;
|
|
10
|
+
copyright?: string | null;
|
|
11
|
+
qualityRating?: number | null;
|
|
12
|
+
resolutionRating?: number | null;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type MediaAsset_jsonld = {
|
|
2
|
+
id?: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
caption?: string | null;
|
|
6
|
+
filename?: string;
|
|
7
|
+
width?: number | null;
|
|
8
|
+
height?: number | null;
|
|
9
|
+
credit?: string | null;
|
|
10
|
+
copyright?: string | null;
|
|
11
|
+
qualityRating?: number | null;
|
|
12
|
+
resolutionRating?: number | null;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -16,6 +16,8 @@ import type { EnquiryStatus } from '../models/EnquiryStatus';
|
|
|
16
16
|
import type { ExchangeRate } from '../models/ExchangeRate';
|
|
17
17
|
import type { Itinerary_ItinerarySaveInput } from '../models/Itinerary_ItinerarySaveInput';
|
|
18
18
|
import type { Itinerary_ItinerarySaveOutput } from '../models/Itinerary_ItinerarySaveOutput';
|
|
19
|
+
import type { MediaAsset } from '../models/MediaAsset';
|
|
20
|
+
import type { MediaTag } from '../models/MediaTag';
|
|
19
21
|
import type { Note_read } from '../models/Note_read';
|
|
20
22
|
import type { Note_write_create } from '../models/Note_write_create';
|
|
21
23
|
import type { Note_write_edit } from '../models/Note_write_edit';
|
|
@@ -245,6 +247,28 @@ export declare class SwoopService {
|
|
|
245
247
|
* @throws ApiError
|
|
246
248
|
*/
|
|
247
249
|
saveItinerary(requestBody: Itinerary_ItinerarySaveInput): CancelablePromise<Itinerary_ItinerarySaveOutput>;
|
|
250
|
+
/**
|
|
251
|
+
* Retrieves the collection of MediaAsset resources.
|
|
252
|
+
* Retrieves the collection of MediaAsset resources.
|
|
253
|
+
* @param page The collection page number
|
|
254
|
+
* @param itemsPerPage The number of items per page
|
|
255
|
+
* @param region antarctica, arctic, patagonia
|
|
256
|
+
* @param q Keyword search on image title and filename
|
|
257
|
+
* @param tagId Filter to images tagged with this tag ID
|
|
258
|
+
* @returns MediaAsset MediaAsset collection
|
|
259
|
+
* @throws ApiError
|
|
260
|
+
*/
|
|
261
|
+
mediaAssetsGetCollection(page?: number, itemsPerPage?: number, region?: string, q?: string, tagId?: string): CancelablePromise<Array<MediaAsset>>;
|
|
262
|
+
/**
|
|
263
|
+
* Media Tag Collection
|
|
264
|
+
* Tags that are applied to at least one image, for filtering media assets
|
|
265
|
+
* @param region antarctica, arctic, patagonia
|
|
266
|
+
* @returns any Successful response
|
|
267
|
+
* @throws ApiError
|
|
268
|
+
*/
|
|
269
|
+
mediaTagsGetCollection(region?: string): CancelablePromise<{
|
|
270
|
+
mediaTags?: Array<MediaTag>;
|
|
271
|
+
}>;
|
|
248
272
|
/**
|
|
249
273
|
* Retrieves the collection of Note resources.
|
|
250
274
|
* Retrieves the collection of Note resources.
|
|
@@ -363,6 +363,46 @@ export class SwoopService {
|
|
|
363
363
|
},
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
|
+
/**
|
|
367
|
+
* Retrieves the collection of MediaAsset resources.
|
|
368
|
+
* Retrieves the collection of MediaAsset resources.
|
|
369
|
+
* @param page The collection page number
|
|
370
|
+
* @param itemsPerPage The number of items per page
|
|
371
|
+
* @param region antarctica, arctic, patagonia
|
|
372
|
+
* @param q Keyword search on image title and filename
|
|
373
|
+
* @param tagId Filter to images tagged with this tag ID
|
|
374
|
+
* @returns MediaAsset MediaAsset collection
|
|
375
|
+
* @throws ApiError
|
|
376
|
+
*/
|
|
377
|
+
mediaAssetsGetCollection(page = 1, itemsPerPage = 30, region, q, tagId) {
|
|
378
|
+
return __request(OpenAPI, {
|
|
379
|
+
method: 'GET',
|
|
380
|
+
url: '/api/media-assets',
|
|
381
|
+
query: {
|
|
382
|
+
'page': page,
|
|
383
|
+
'itemsPerPage': itemsPerPage,
|
|
384
|
+
'region': region,
|
|
385
|
+
'q': q,
|
|
386
|
+
'tagId': tagId,
|
|
387
|
+
},
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Media Tag Collection
|
|
392
|
+
* Tags that are applied to at least one image, for filtering media assets
|
|
393
|
+
* @param region antarctica, arctic, patagonia
|
|
394
|
+
* @returns any Successful response
|
|
395
|
+
* @throws ApiError
|
|
396
|
+
*/
|
|
397
|
+
mediaTagsGetCollection(region) {
|
|
398
|
+
return __request(OpenAPI, {
|
|
399
|
+
method: 'GET',
|
|
400
|
+
url: '/api/media-tags',
|
|
401
|
+
query: {
|
|
402
|
+
'region': region,
|
|
403
|
+
},
|
|
404
|
+
});
|
|
405
|
+
}
|
|
366
406
|
/**
|
|
367
407
|
* Retrieves the collection of Note resources.
|
|
368
408
|
* Retrieves the collection of Note resources.
|
|
@@ -4,26 +4,6 @@ import { getComponentDataByTemplateName, packagesTemplateStructure, templateStru
|
|
|
4
4
|
import { COMPONENT_SYSTEMS } from "../consts/system";
|
|
5
5
|
import { getTemplateChipStyle } from "../consts/templateChipStyles";
|
|
6
6
|
import { convertToTitleCase } from "../util/text";
|
|
7
|
-
/*
|
|
8
|
-
Content per item type from ticket:
|
|
9
|
-
Package: Trip ID (hide on IB), Start city, Private, Guided
|
|
10
|
-
|
|
11
|
-
Transfer: Private, Guided, Transfer type, Start location (from journey), End location (from journey)
|
|
12
|
-
// lookup journey from component.componentFields.0.data.journey which contains a componentID, e.g. component_5a51acc53ab0b16da19f875c8cc148f2
|
|
13
|
-
// journey will contain a couple more componentFields which are start and end locations. These will need looking up and outputting.
|
|
14
|
-
|
|
15
|
-
Activity: Start location, End location, Type, Guided
|
|
16
|
-
|
|
17
|
-
Cruise activity: Type
|
|
18
|
-
|
|
19
|
-
Ground accommodation: City
|
|
20
|
-
|
|
21
|
-
Ship accommodation: Vessel ID (hide on IB)
|
|
22
|
-
|
|
23
|
-
Private and Guided render as a tick (✓) when true
|
|
24
|
-
|
|
25
|
-
When Private or Guided is false or unpopulated, the field is omitted entirely
|
|
26
|
-
*/
|
|
27
7
|
// Shared by every child of Package (Cruise, Excursions, Guided Multiday Activity, All Inclusive
|
|
28
8
|
// Hotel, Private Tour, Group Tour - see packagesTemplateStructure) - they all surface the same
|
|
29
9
|
// Trip ID / Start City / Private / Guided fields, sourced from the Package componentFields entry
|
|
@@ -141,6 +121,22 @@ const INLINE_CONTENT_BY_TEMPLATE = Object.assign(Object.assign({ [templateStruct
|
|
|
141
121
|
"Type: ",
|
|
142
122
|
type));
|
|
143
123
|
},
|
|
124
|
+
}, [templateStructure[TEMPLATE_NAMES.GROUND_ACCOMMODATION]]: {
|
|
125
|
+
getRequiredComponentIds: (component) => {
|
|
126
|
+
var _a;
|
|
127
|
+
const cityId = (_a = getComponentDataByTemplateName(TEMPLATE_NAMES.GROUND_ACCOMMODATION, component.componentFields)) === null || _a === void 0 ? void 0 : _a.city;
|
|
128
|
+
return cityId ? [cityId] : [];
|
|
129
|
+
},
|
|
130
|
+
render: (component, lookups) => {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
const cityId = (_a = getComponentDataByTemplateName(TEMPLATE_NAMES.GROUND_ACCOMMODATION, component.componentFields)) === null || _a === void 0 ? void 0 : _a.city;
|
|
133
|
+
const city = cityId ? (_b = lookups[cityId]) === null || _b === void 0 ? void 0 : _b.name : undefined;
|
|
134
|
+
if (!city)
|
|
135
|
+
return null;
|
|
136
|
+
return (React.createElement(Typography, { variant: "body2", color: "text.secondary" },
|
|
137
|
+
"City: ",
|
|
138
|
+
city));
|
|
139
|
+
},
|
|
144
140
|
} });
|
|
145
141
|
export const getInlineContentDefinition = (templateId) => templateId ? INLINE_CONTENT_BY_TEMPLATE[templateId] : undefined;
|
|
146
142
|
const ComponentListItem = ({ component, isSelected, details, onSelect, showDivider, system, lookups, }) => {
|