@lighthouse/common 4.27.6 → 4.28.0
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.
|
@@ -38,9 +38,7 @@ function getLocationReference(data = {}) {
|
|
|
38
38
|
// locations legacyId reference as a key which will match a legacy location id on the entity
|
|
39
39
|
|
|
40
40
|
const areaLocationMap = (0, _lodash.reduce)(areaLocations, (memo, location) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const legacyId = location === null || location === void 0 ? void 0 : (_location$legacyId = location.legacyId) === null || _location$legacyId === void 0 ? void 0 : _location$legacyId.toString();
|
|
41
|
+
const legacyId = location?.legacyId?.toString();
|
|
44
42
|
if (!legacyId) return memo;
|
|
45
43
|
memo[legacyId] = location;
|
|
46
44
|
return memo;
|
|
@@ -48,17 +46,13 @@ function getLocationReference(data = {}) {
|
|
|
48
46
|
// format before running through
|
|
49
47
|
|
|
50
48
|
const locationMap = (0, _lodash.isArray)(locations) ? (0, _lodash.reduce)(locations, (memo, location) => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const locationId = location === null || location === void 0 ? void 0 : (_location$_id = location._id) === null || _location$_id === void 0 ? void 0 : _location$_id.toString();
|
|
49
|
+
const locationId = location?._id?.toString();
|
|
54
50
|
if (!locationId) return memo;
|
|
55
51
|
memo[locationId] = location;
|
|
56
52
|
return memo;
|
|
57
53
|
}, {}) : locations;
|
|
58
54
|
const zoneMap = (0, _lodash.isArray)(zones) ? (0, _lodash.reduce)(zones, (memo, zone) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const zoneId = zone === null || zone === void 0 ? void 0 : (_zone$_id = zone._id) === null || _zone$_id === void 0 ? void 0 : _zone$_id.toString();
|
|
55
|
+
const zoneId = zone?._id?.toString();
|
|
62
56
|
if (!zoneId) return memo;
|
|
63
57
|
memo[zoneId] = zone;
|
|
64
58
|
return memo;
|
|
@@ -9,6 +9,14 @@ var _lodash = require("lodash");
|
|
|
9
9
|
|
|
10
10
|
const getStatusDetails = (0, _lodash.memoize)(status => {
|
|
11
11
|
switch (status) {
|
|
12
|
+
case 'cancelled':
|
|
13
|
+
return {
|
|
14
|
+
style: {
|
|
15
|
+
color: '#AAA'
|
|
16
|
+
},
|
|
17
|
+
text: 'Cancelled'
|
|
18
|
+
};
|
|
19
|
+
|
|
12
20
|
case 'closed':
|
|
13
21
|
return {
|
|
14
22
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/helpers/get-status-details/index.js"],"names":["memoize","getStatusDetails","status","style","color","text"],"mappings":"AAAA,SAASA,OAAT,QAAwB,QAAxB;AAEA,OAAO,IAAMC,gBAAgB,GAAGD,OAAO,CAAC,UAAAE,MAAM,EAAI;AAChD,UAAQA,MAAR;AACE,SAAK,
|
|
1
|
+
{"version":3,"sources":["../../../src/helpers/get-status-details/index.js"],"names":["memoize","getStatusDetails","status","style","color","text"],"mappings":"AAAA,SAASA,OAAT,QAAwB,QAAxB;AAEA,OAAO,IAAMC,gBAAgB,GAAGD,OAAO,CAAC,UAAAE,MAAM,EAAI;AAChD,UAAQA,MAAR;AACE,SAAK,WAAL;AACE,aAAO;AACLC,QAAAA,KAAK,EAAE;AACLC,UAAAA,KAAK,EAAE;AADF,SADF;AAILC,QAAAA,IAAI,EAAE;AAJD,OAAP;;AAMF,SAAK,QAAL;AACE,aAAO;AACLF,QAAAA,KAAK,EAAE;AACLC,UAAAA,KAAK,EAAE;AADF,SADF;AAILC,QAAAA,IAAI,EAAE;AAJD,OAAP;;AAMF,SAAK,aAAL;AACE,aAAO;AACLF,QAAAA,KAAK,EAAE;AACLC,UAAAA,KAAK,EAAE;AADF,SADF;AAILC,QAAAA,IAAI,EAAE;AAJD,OAAP;;AAMF,SAAK,MAAL;AACE,aAAO;AACLF,QAAAA,KAAK,EAAE;AACLC,UAAAA,KAAK,EAAE;AADF,SADF;AAILC,QAAAA,IAAI,EAAE;AAJD,OAAP;;AAMF;AACE,aAAO;AACLF,QAAAA,KAAK,EAAE;AACLC,UAAAA,KAAK,EAAE;AADF,SADF;AAILC,QAAAA,IAAI,EAAE;AAJD,OAAP;AA9BJ;AAqCD,CAtCsC,CAAhC","sourcesContent":["import { memoize } from 'lodash'\n\nexport const getStatusDetails = memoize(status => {\n switch (status) {\n case 'cancelled':\n return {\n style: {\n color: '#AAA',\n },\n text: 'Cancelled',\n }\n case 'closed':\n return {\n style: {\n color: '#D0021B',\n },\n text: 'Closed',\n }\n case 'in-progress':\n return {\n style: {\n color: '#00AAE4',\n },\n text: 'In Progress',\n }\n case 'open':\n return {\n style: {\n color: '#FF8C2F',\n },\n text: 'Open',\n }\n default:\n return {\n style: {\n color: '#666666',\n },\n text: 'Unknown',\n }\n }\n})\n"],"file":"index.js"}
|