propertly support null entries in the values array

This commit is contained in:
Mike Homol 2021-03-31 18:25:37 -04:00
parent 7d3feff3e5
commit fa67ac4be1
1 changed files with 56 additions and 52 deletions

View File

@ -125,6 +125,7 @@ const AdvancedPageProperties: React.FunctionComponent<IAdvancedPagePropertiesPro
const RenderPagePropValue = (prop: PageProperty) => { const RenderPagePropValue = (prop: PageProperty) => {
console.log(prop); console.log(prop);
var retVal = _.map(prop.values, (val) => { var retVal = _.map(prop.values, (val) => {
if (val !== null) {
switch (prop.info.TypeAsString) { switch (prop.info.TypeAsString) {
case "URL": case "URL":
return ( return (
@ -177,6 +178,9 @@ const AdvancedPageProperties: React.FunctionComponent<IAdvancedPagePropertiesPro
<span className={styles.standardCapsule} style={{backgroundColor: semanticColors.accentButtonBackground, color: semanticColors.accentButtonText}}>{val}</span> <span className={styles.standardCapsule} style={{backgroundColor: semanticColors.accentButtonBackground, color: semanticColors.accentButtonText}}>{val}</span>
); );
} }
} else {
return (<></>);
}
}); });
return retVal; return retVal;
}; };