feat(components/VirtualizedList): MappedCellData#3393
Merged
Conversation
Contributor
Contributor
|
Size Change: +795 B (0%) Total Size: 2.24 MB
ℹ️ View Unchanged
|
Contributor
jsomsanith-tlnd
left a comment
There was a problem hiding this comment.
Don't forget to update utils/dictionary.js
gjou-tlnd
reviewed
Aug 19, 2021
gjou-tlnd
approved these changes
Aug 19, 2021
| @@ -15,7 +15,7 @@ function CellMappedData(props) { | |||
| cellContent = cellData | |||
| .map(value => valuesMap[value] || value || null) | |||
| .filter(value => !!value) | |||
Contributor
There was a problem hiding this comment.
You filter 0 as number here
jmfrancois
approved these changes
Aug 20, 2021
Contributor
jmfrancois
left a comment
There was a problem hiding this comment.
interesting new cell. Just one question (that could change in the future)
jsomsanith-tlnd
approved these changes
Aug 20, 2021
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the problem this PR is trying to solve?
When, in a VirtualizedList, we need to transform a field in the objects of a collection to a human-readable name, we currently have only 2 options:
What is the chosen solution to this problem?
Create a new cell renderer
MappedCellData(couldn't come up with something nicer, open to suggestions) that accepts a map of values incolumnDataso that value conversion is done at render time.The cell also accepts arrays as values; in that case values are sorted.
Please check if the PR fulfills these requirements
[ ] This PR introduces a breaking change