Last active
June 13, 2019 12:53
-
-
Save yosevu/40d0931d86fa4f0699cef2cbcc8a9eda to your computer and use it in GitHub Desktop.
transformStyle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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