Saved collections#31
Open
cherylwu834 wants to merge 26 commits into
Open
Conversation
Co-authored-by: Joy Cheng <joycheng@ucla.edu>
Co-authored-by: Cheryl Wu <cherylwu834@gmail.com>
…o ID Co-authored-by: Cheryl Wu <cherylwu834@gmail.com>
Co-authored-by: Cheryl Wu <cherylwu834@gmail.com>
…raits, objects, settings)
…g to collections screen
Co-authored-by: Cheryl Wu <cherylwu834@gmail.com>
Co-authored-by: Cheryl Wu <cherylwu834@gmail.com>
…tem save in controller function
… remove functions, and integrate with front-end
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.
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 joycheng@g.ucla.edu
Bookmark Screen Overview
BookmarksScreenBookmarksScreenfrom theHomeScreen.SavedScreenfrom theBookmarksScreen.Save Screen Overview
SavedScreenViewAllSavedScreen, which displays all the saved items of the given type.SavedScreencan be navigated to from theBookmarksScreen.ViewAllSavedScreenfrom theSavedScreen.Methods
getIdretrieves 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,getSettingByIDare each used to get a specific saved item from the database by the item’s ID.getActivities,getTripleFlips,getPlotPoints,getTraits,getItems,getSettingsare 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
ViewAllSavedScreenViewAllSavedScreencan be navigated to from theSavedScreen.Props
subjectvariable is passed when navigating from theSavedScreen.subjectspecifies which type of item theViewAllSavedScreenshould display (e.g., Plot Points, Triple Flips).Methods
getIdretrieves 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,getSettingByIDare each used to get a specific saved item from the database by the item’s ID.getActivities,getTripleFlips,getPlotPoints,getTraits,getItems,getSettingsare 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,removeSettingare each used to remove a specific saved item from the user’s saved items by the item’s ID.changeSelectedis used to modify the list of items selected by the user for deletion.removeSelectedis used to remove the selected items by repeatedly calling one of the removal functions (removeActivity,removeTripleFlip,removePlot,removeTrait,removeItem, orremoveSettingdepending 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)savedstate accordingly. This is used whenever there might be a change in thesavedstate.saveItem()savePlot()saveSetting()saveTrait()saveTripleFlip()saveActivity()removeItem()removePlot()removeSetting()removeTrait()removeTripleFlip()removeActivity()saveButton()savedandresultShownso 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.jsanduserRoutes.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