-
Notifications
You must be signed in to change notification settings - Fork 0
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
Saved collections #31
Open
cherylwu834
wants to merge
26
commits into
main
Choose a base branch
from
saved-collections
base: main
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
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
Co-authored-by: Joy Cheng <[email protected]>
Co-authored-by: Cheryl Wu <[email protected]>
…o ID Co-authored-by: Cheryl Wu <[email protected]>
Co-authored-by: Cheryl Wu <[email protected]>
…raits, objects, settings)
…g to collections screen
Co-authored-by: Cheryl Wu <[email protected]>
Co-authored-by: Cheryl Wu <[email protected]>
…tem save in controller function
… remove functions, and integrate with front-end
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.
Summary
Implement front-end and back-end for save screen to display the user's saved items, and add save/unsave functionality to writing activity pages.
Co-authored-by: Joy Cheng [email protected]
Bookmark Screen Overview
BookmarksScreen
BookmarksScreen
from theHomeScreen
.SavedScreen
from theBookmarksScreen
.Save Screen Overview
SavedScreen
ViewAllSavedScreen
, which displays all the saved items of the given type.SavedScreen
can be navigated to from theBookmarksScreen
.ViewAllSavedScreen
from theSavedScreen
.Methods
getId
retrieves the user ID belonging to the current user of the session, through Redux’s Secure Store, in order to retrieve user-specific data.getActivityByID
,getPlotPointByID
,getTraitByID
,getItemByID
,getSettingByID
are each used to get a specific saved item from the database by the item’s ID.getActivities
,getTripleFlips
,getPlotPoints
,getTraits
,getItems
,getSettings
are each used to get a specified number of the most recently saved items. Each of these functions sets a state variable to a list of these items in order from most recent to least recent.View All Screen Overview
ViewAllSavedScreen
ViewAllSavedScreen
can be navigated to from theSavedScreen
.Props
subject
variable is passed when navigating from theSavedScreen
.subject
specifies which type of item theViewAllSavedScreen
should display (e.g., Plot Points, Triple Flips).Methods
getId
retrieves the user ID belonging to the current user of the session, through Redux’s Secure Store, in order to retrieve user-specific data.getActivityByID
,getPlotPointByID
,getTraitByID
,getItemByID
,getSettingByID
are each used to get a specific saved item from the database by the item’s ID.getActivities
,getTripleFlips
,getPlotPoints
,getTraits
,getItems
,getSettings
are each used to get all items of the given type. Each of these functions sets a state variable to a list of these items along with the dates they were saved and their IDs in order from most recent to least recent.removeActivity
,removeTripleFlip
,removePlot
,removeTrait
,removeItem
,removeSetting
are each used to remove a specific saved item from the user’s saved items by the item’s ID.changeSelected
is used to modify the list of items selected by the user for deletion.removeSelected
is used to remove the selected items by repeatedly calling one of the removal functions (removeActivity
,removeTripleFlip
,removePlot
,removeTrait
,removeItem
, orremoveSetting
depending on the type of item displayed) once per selected item.Save Functionality Added to Story Starters, Triple Flip, and Progressive Writing Activities
Front-End Methods
These methods are all on Story Starters, Triple Flip, and Progressive Writing Activities. They have the same basic functionality but for their respective different screens.
checkIfSaved(value)
saved
state accordingly. This is used whenever there might be a change in thesaved
state.saveItem()
savePlot()
saveSetting()
saveTrait()
saveTripleFlip()
saveActivity()
removeItem()
removePlot()
removeSetting()
removeTrait()
removeTripleFlip()
removeActivity()
saveButton()
saved
andresultShown
so that is displays the correct button or doesn’t display a button.Back-End Methods
Back-end methods were written to support each of the front-end methods detailed above other than saveButton. They modify the user collection and are in the
userController.js
anduserRoutes.js
.checkIfSavedItem()
checkIfSavedSetting()
checkIfSavedPlot()
checkIfSavedTrait()
checkIfSavedTripleFlip()
checkIfSavedActivity()
Screen Recordings
Bookmark, Saved, and View All Saved Screen
bookmarks.mov
Save Functionality on Writing Activity Screen
Save.Shortened.mp4