add campsite database and map #7241
We're currently moving to Redux, so this PR will need to be refactored once #7214 is merged in.
@geoff616 You'll need to rebase instead of merging. And it should probably wait until that pr is merged into staging as there may still be changes.
Thanks @BerkeleyTrue, just rebased against latest staging. Will start moving over to redux.
Moved over to redux, and have most of the functionality working again. Still need to add input validation, implement the user related requirements and clean things up.
Currently a little stuck on keeping redux and the DB in sync on update operations, and haven't found a way to get this working yet.
Have all the functionality working again in redux, and added in the user features.
Wrote some scripts to migrate the MD file with the campsites into the DB. After uploading the 1,100+ campsites, the responsiveness of the app dropped significantly, and I'm looking into ways of making it less janky with that much data.
Also working through a bug, where edits to existing campsites are not re-rendering correctly. Asked for some help on SO, and waiting to see what they think.
Going to fix the above issues and will rewrite the info at the top to reflect the changes to the PR.
@@ -0,0 +1,21 @@ | ||
+#campsite-buttons { | ||
+ padding-top: 25px; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
|
Thanks for the PR. I'm doing a lot of work on moving over the rest of the site to React so I've not been able to give this PR the attention it deserves. From a cursory examination, the code looks solid, but those issue you described will definitely need to be tackled.
Thanks @BerkeleyTrue. Made some progress on resolving those issues, but still working through a few bugs. Should have the PR updated by the end of the week, and happy to revisit when it makes sense.
Summary:
Users can view a list of all campsites and submit new campsites for approval.
This pull request currently fulfills most of the features described in issue 5358 to simplify the management of campsites, but the features related to
user
data have not been implemented yet.A few outstanding questions are listed in the
Questions
section.Implementation:
The implementation is a React app and is modeled after the
Jobs
andHikes
apps. The main changes outside thecommon/app/routes/Campsites
app are:Two new routes were added:
/campsites
- campsite list and map/campsites/new-campsite
- add a new campsiteOne model was added:
campsite
One service was added:
campsites
- withread
,create
, andupdate
methodsOne dependency was added to
package.json
:react-google-maps
- This library takes care of asynchronously loading and rendering the maps used to display and search for campsites.Security:
Jobs
app.campsites
model to allow update operations, but could be scoped to the specific update requests coming from thecampsites
service if this is a concern.maps.googleapis.com
to trusted script soucesState:
App state are all observables in the
appStore
.I had some issues with successive navigations between the
campsites
andcampsites/new-campite
pages (Campsites
andCreateCampsite
containers) using the<LinkContainer>
'sto
property that I believe were related to state management, and it ended up being simpler to trigger a refresh between these pages witha
tags.Questions:
user service
the best way to access this data?/campsites
)? Is there anything in the code base currently doing similar notifications?user service
, but not the ID of the Mongo record. Which makes more sense to store in the campsite object?Display Name
they want to use for their campsite instead of the relying on thecity
?updateService
and added one toFreeCodeCamp/common/app/Cat.js
for update operations. Is this a reasonable approach?closes #5358