-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Feature/sc 27328/options popover component2 #2172
Open
stevekaplan123
wants to merge
85
commits into
feature/sc-27327/source-click-should-open-in-new-tab2
Choose a base branch
from
feature/sc-27328/options-popover-component2
base: feature/sc-27327/source-click-should-open-in-new-tab2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/sc 27328/options popover component2 #2172
stevekaplan123
wants to merge
85
commits into
feature/sc-27327/source-click-should-open-in-new-tab2
from
feature/sc-27328/options-popover-component2
Conversation
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
…etContentMetaDataBox
…-27328/options-popover-component
…-27328/options-popover-component
…-27328/options-popover-component
…-27328/options-popover-component
…-27328/options-popover-component
…-27328/options-popover-component
…-27328/options-popover-component
…-27328/options-popover-component
…-27328/options-popover-component
…-27328/options-popover-component
…-27328/options-popover-component
…hen set loaded occurs
…-27328/options-popover-component
…nto feature/sc-27328/options-popover-component
…nto feature/sc-27328/options-popover-component
…nto feature/sc-27328/options-popover-component
…nto feature/sc-27328/options-popover-component
…nto feature/sc-27328/options-popover-component
…nto feature/sc-27328/options-popover-component
…into feature/sc-27328/options-popover-component2
…into feature/sc-27328/options-popover-component2
…into feature/sc-27328/options-popover-component2
…into feature/sc-27328/options-popover-component2
…into feature/sc-27328/options-popover-component2
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.
Description
The 'options popover component' is a menu providing sheet viewers with the ability to save/remove the sheet (saved texts and sheets can be seen at /texts/saved), make a copy of the sheet, export the sheet to google docs, add the sheet to a collection, or share the sheet. Most of this functionality used to exist in AboutSheet.jsx which would show in the Connections Panel. It is now possible to open a dropdown menu and choose one of these options from the main panel of the sheets viewer. Depending on what option was chosen, the user is then shown a modal either showing the status of the action chosen or allowing the user to choose what to do next. For example, if the user copies the sheet, they will see a modal that says "Copying..." and once copied, will show a link to the copied sheet. Exporting to google docs and saving the sheet is similar and show the status of the exported/saved sheet. On the other hand, for adding to a collection, the user is presented with a modal allowing them to choose what collection(s) to add the sheet to, and allowing them to create a new collection. Likewise, for sharing the sheet, the user is presented with a modal allowing them to choose different ways of sharing the sheet (through different social media).
Code Changes
The core of the code for this set of features is in SheetOptions.jsx, which has two stages: (1) First, the user clicks on an ellipse to show a DropdownMenu with all of the options listed above. (2) Second, a modal appears showing the status of the action chosen or a menu, making heavy usage of a few new generic components, such as Modal and GenericSheetModal. The Modal I placed in the /common directory while the GenericSheetModal I implemented in SheetOptions. I had to make a few relatively minor changes to DropdownMenu to be able to pass down callback functions, for example. I also modified the generic sefaria.js apiRequestWithBody so that I could handle the errors directly instead of apiRequestWithBody handling the errors for me. This was necessary to implement Google Export as the API generates a 401 authentication error if the user hasn't setup their gauth credentials with Sefaria.