forked from grommet/grommet
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(pinned items): Issue #6229 Adds pinned functionality to List Component #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
…P working for button clicks only.
* Fix Video Scrubber focus styles * Update snapshots Co-authored-by: Eric Soderberg <eric.soderberg@hpe.com>
* Fixed FileInput component cursor type behavior * Code review fix Co-authored-by: Eric Soderberg <eric.soderberg@hpe.com>
Co-authored-by: Eric Soderberg <eric.soderberg@hpe.com>
* Cancel debounce after formfield unmounts * remove console.log * use debounceDelay from theme * change debounce to be inside of a useEffect to handle cleanup on unmount * feedback from review * move hook outside component Co-authored-by: Eric Soderberg <eric.soderberg@hpe.com>
* Update Calendar to rely on Date object * Fix typo * Remove unnecessary useEffects * Fix reference causing date to select the first * Align reference logic with docs * standardize date and reference as Date objects * Update accessibility strings to use toLocaleDateString * Fix keyboard and remove comments * Convert date to ISOstring * fix single selection * Adjust DateInput to leverage new functionality * Add comment * normalization and progress on handling multiple dates bug * Update DateInput reference date * normalize date using supplied timestamp * preserve callers datetime format * handle multiple and range * consolidate onClick logic * fix adjust for timezone logic * normalize output, refactor selected and handleRange * Update calendar range * Add snapshot tests * Add DateInput fixes * Handle offset from user timezone * refactor handleRange * remove last references to date and dates * Add script to test across timezones * Leave stories untouched * Simplify test, remove unused functions * Add daylight savings test * Fix updating displayBounds Co-authored-by: Matt Glissmann <mdglissmann@gmail.com>
* Changed DataChart to fix an issue with detail padding. * Make Detail smarter about combining thickness and pad
Co-authored-by: Eric Soderberg <eric.soderberg@hpe.com>
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 does this PR do?
Adds functionality to provide a list of ItemKeys to be pinned in place within the list and will not change when the list is reordered.
Where should the reviewer start?
Please review the context provided in issue 6229 explaining why this feature was requested and the proposed change that was implemented. Then review Storybook and Jest tests for further context regarding functionality and implementation.
Finally a useMemo hook is used to derive the orderableItems from the pinnedItems which is used to replace the data object and the orderableIndex is found for each item. These replace the previously used data and index to find and set active items and updates from within the reorder function.
What testing has been done on this PR?
Tests have been written in Jest as well as a Storybook story. Tests verify that the pinned items are styled appropriately. Also, after a re-orderable item is moved that the pinned item does not change its position.
How should this be manually tested?
Do Jest tests follow these best practices?
screen
is used for querying.userEvent
is used in place offireEvent
.asFragment()
is used for snapshot testing.Any background context you want to provide?
Pleas see the context provided in Issue 6229.
What are the relevant issues?
Issue #6229
Screenshots (if appropriate)
Do the grommet docs need to be updated?
Yes
Should this PR be mentioned in the release notes?
Yes
Is this change backwards compatible or is it a breaking change?
The only minor change that might be breaking is regarding the ItemKey. If the PrimaryKey is provided and not the ItemKey for an object, the PrimaryKey will be set as the ItemKey. Line number is 175.