swoop-common 2.2.216 → 2.2.217

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.
@@ -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, }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swoop-common",
3
- "version": "2.2.216",
3
+ "version": "2.2.217",
4
4
  "main": "dist/api/index.js",
5
5
  "types": "dist/api/index.d.ts",
6
6
  "exports": {