@lighthouse/common
Advanced tools
Comparing version 4.25.0 to 4.25.1-canary.1464
@@ -232,3 +232,4 @@ "use strict"; | ||
const is24HourTimeField = fieldtype === 'time' && options.format === 'HH:mm'; | ||
const isDisplayImageField = fieldtype === 'image-display' && showOnRead; // NOTE: only show field when show on read is true | ||
const isDisplayImageField = fieldtype === 'image-display' && showOnRead; | ||
const isReferenceField = fieldtype === 'reference'; // NOTE: only show field when show on read is true | ||
@@ -323,2 +324,12 @@ if (!showOnRead) return null; | ||
if (isReferenceField) { | ||
const parsedValue = (0, _.parseValue)(value.label); | ||
const displayValue = (0, _lodash.isArray)(parsedValue) ? { | ||
text: (0, _lodash.join)(parsedValue, ', ') | ||
} : { | ||
text: parsedValue | ||
}; | ||
return [labelText, displayValue]; | ||
} | ||
if (isStarField) { | ||
@@ -325,0 +336,0 @@ if (!value) return [labelText, '']; |
@@ -214,3 +214,4 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray"; | ||
var is24HourTimeField = fieldtype === 'time' && options.format === 'HH:mm'; | ||
var isDisplayImageField = fieldtype === 'image-display' && showOnRead; // NOTE: only show field when show on read is true | ||
var isDisplayImageField = fieldtype === 'image-display' && showOnRead; | ||
var isReferenceField = fieldtype === 'reference'; // NOTE: only show field when show on read is true | ||
@@ -327,8 +328,20 @@ if (!showOnRead) return null; | ||
if (isReferenceField) { | ||
var _parsedValue = parseValue(value.label); | ||
var _displayValue3 = isArray(_parsedValue) ? { | ||
text: join(_parsedValue, ', ') | ||
} : { | ||
text: _parsedValue | ||
}; | ||
return [labelText, _displayValue3]; | ||
} | ||
if (isStarField) { | ||
if (!value) return [labelText, '']; | ||
var _displayValue3 = value === '1' ? "".concat(value, " star") : "".concat(value, " stars"); | ||
var _displayValue4 = value === '1' ? "".concat(value, " star") : "".concat(value, " stars"); | ||
return [labelText, _displayValue3]; | ||
return [labelText, _displayValue4]; | ||
} | ||
@@ -339,5 +352,5 @@ | ||
var _displayValue4 = value ? moment(value).tz(timezone).format(format) : ''; | ||
var _displayValue5 = value ? moment(value).tz(timezone).format(format) : ''; | ||
return [labelText, _displayValue4]; | ||
return [labelText, _displayValue5]; | ||
} // NOTE: if no match above null values will be stripped within calling fn | ||
@@ -344,0 +357,0 @@ |
{ | ||
"name": "@lighthouse/common", | ||
"version": "4.25.0", | ||
"version": "4.25.1-canary.1464", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1240520
11943
2