-
Notifications
You must be signed in to change notification settings - Fork 172
feat(google-docs): Selec entries to create [INTEG-3894] #10966
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
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
848f24f
Select entries to create
joaquincasal 41c7041
Move checkbox and update button text
joaquincasal 9428606
Merge branch 'master' into integ-3894
joaquincasal bb9df5e
Remove unnecessary stuff and update copies
joaquincasal c9803dc
fix(google-docs): namespace review selection keys
joaquincasal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import type { EntryBlockGraph, EntryBlockGraphEntry } from '../types/entryBlockGraph'; | ||
|
|
||
| export function getEntrySelectionKey(entry: EntryBlockGraphEntry, index: number): string { | ||
| return entry.tempId ?? String(index); | ||
| } | ||
|
|
||
| export function getAllEntrySelectionKeys(entries: EntryBlockGraphEntry[]): Set<string> { | ||
| return new Set(entries.map((entry, index) => getEntrySelectionKey(entry, index))); | ||
| } | ||
|
|
||
| export function countSelectedEntries( | ||
| entries: EntryBlockGraphEntry[], | ||
| selectedEntryKeys: ReadonlySet<string> | ||
| ): number { | ||
| return entries.reduce( | ||
| (count, entry, index) => | ||
| selectedEntryKeys.has(getEntrySelectionKey(entry, index)) ? count + 1 : count, | ||
| 0 | ||
| ); | ||
| } | ||
|
|
||
| export function filterEntryBlockGraphBySelection( | ||
| graph: EntryBlockGraph, | ||
| selectedEntryKeys: ReadonlySet<string> | ||
| ): EntryBlockGraph { | ||
| const selectedEntries = graph.entries.filter((entry, index) => | ||
| selectedEntryKeys.has(getEntrySelectionKey(entry, index)) | ||
| ); | ||
| const selectedTempIds = new Set( | ||
| selectedEntries | ||
| .map((entry) => entry.tempId) | ||
| .filter((tempId): tempId is string => typeof tempId === 'string') | ||
| ); | ||
|
|
||
| return { | ||
| ...graph, | ||
| entries: selectedEntries.map((entry) => ({ | ||
| ...entry, | ||
| fieldMappings: entry.fieldMappings.map((fieldMapping) => { | ||
| if (!fieldMapping.sourceEntryIds) { | ||
| return fieldMapping; | ||
| } | ||
|
|
||
| return { | ||
| ...fieldMapping, | ||
| sourceEntryIds: fieldMapping.sourceEntryIds.filter((id) => selectedTempIds.has(id)), | ||
| }; | ||
| }), | ||
| })), | ||
| }; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 There seem to be an issue with the checkbox (saw this on the video). Instead of showing the hand pointer (default from forma) is showing the arrow pointer. Perhaps it has to do with the missing props in Card component that were setting up the cursor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird, but that only happens when I record the video, when I use the app without recording, it shows the hand pointer. I cannot prove it as taking a screenshot also removes the cursor, but I checked and it works as expected