TheDevPath / Navi

Open Source Project for Grow with Google Udacity Scholarship Challenge - Navigation app using offline first strategy and google maps api - To get started please refer to the README.md - CONTRIBUTING.md and the project Wiki
https://navi-rocks.herokuapp.com/
MIT License
53 stars 63 forks source link

Add delete to saved pins #258

Closed steveone closed 6 years ago

steveone commented 6 years ago

Issue Number: 257

Issue Description:

Add delete functionality to frontend savedpins

Summary of solution:

  1. Added option textbook to create a description when saving new pins (needs css work)
  2. Added display of description and delete button when saved pins showing on map are clicked on
  3. Added code to have the server delete the saved marker from the database and remove it from the map

Can this issue be closed?

Additional CSS work to prettify is needed but that can be in another issue if desired

Should any new issues be added as a result of this solution?

CSS work needed to prettify the input box on new markers and the description and delete button on the saved marker popups

Have you named your branch in a descriptive way? Remember to name your branch in a unique and descriptive manner in order to properly reflect the issue or feature.

Thanks for contributing!

steveone commented 6 years ago

No actual changes were made to the following files:

The changes shown are whitespace caused by debugging, I'm not sure how to remove those changes from being seen as changes by github.

Additional issue:

There is now two duplicated (createLabel and createButton) functions in

that can probably be moved to a utility file to avoid duplicate code.

steveone commented 6 years ago

@jkwening I hijacked "place_id" based on a "slack" conversation with @motosharpley. The idea is to automatically populate the places data as a future feature so maybe a rename to "Desc" should be held off or perhaps we should add a new "Desc" option to supplement the eventual "place_id"? I'm open to either.

jkwening commented 6 years ago

Adding a new "desc" field is fine with me instead of replacing "place_id" but we definitely shouldn't mislabel the data we're storing. That's bound to cause confusion later on, especially for others who aren't as familiar with the code base. Just my two cents.

steveone commented 6 years ago

@jkwening, I will try to work on that tomorrow if not in the next few days. Thanks for the pointers to what areas will need updating

steveone commented 6 years ago

@jkwening I've updated the code to use a "desc" field instead of "place_id" for the user descriptions. The mongoose model and route code have been updated as well. It tested well on my side. Let me know if you have any other thoughts (I know I still need to fix the CSS)