Skip to content

Instantly share code, notes, and snippets.

@yosevu
Last active June 13, 2019 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yosevu/40d0931d86fa4f0699cef2cbcc8a9eda to your computer and use it in GitHub Desktop.
Save yosevu/40d0931d86fa4f0699cef2cbcc8a9eda to your computer and use it in GitHub Desktop.
transformStyle
// transformStyle :: Object -> Object
const transformStyle = facet => {
result.facetSelected.style = [];
facetOptions.style = facet;
facetOptions.style.searchFacetName = 'Category';
facetOptions.style.facetType = 'multi-select';
facetOptions.style.facetLayout = 'list';
facetOptions.style.inputDisplayType = 'checkbox';
facet.searchFacetOptionGroupList &&
facet.searchFacetOptionGroupList.searchFacetOptionList.map(option => {
if (option.isSelected === 'true' && option.isActive === 'true') {
option.tagDisplayLabel = option.searchFacetOptionValue;
result.facetSelected.style.push(option);
result.hasTags = true;
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment