Skip to content
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

Add location adding/editing/deleting capabilities to SMap #1475

Merged

Conversation

linzjax
Copy link
Contributor

@linzjax linzjax commented May 5, 2017

[NOTE: This is not going into master. It's going into feature/map-spa-router]
[NOTE #2: This will need to be rebased before pulling it in so I can put together a commit message that doesn't contain "omg I think it's working"]

Proposed changes in this pull request

When should this PR be merged

  • After someone breaks all of the things I thought I'd fixed
  • This is a water testing PR, I'm pretty sure there are going to be issues, I just need another set of eyes
  • Once it's merged into feature/map-spa-router, we can test that, clean it up, and then merge it into feature/map-spa, then... maybe... think about merging it into master? 🙀

Risks

  • We should discuss whether or not we want clicking on the big "save" button to cascade to clicking on the map "save" button when editing geometries.
  • Brian was right when he said there were a lot of "gotcha"s. When testing this, make sure you behave like a really obnoxious user and make your behavior as erratic as possible. For example: I found a bug when I started to add a location, clicked save on the map, changed my mind and canceled the whole form. I think added another location and saved it. Then decided I didn't want that either and tried to delete it. Glitch occurred.

Follow-up actions

  • Compare to master, making sure we integrated all changes that have occurred since we started out on this journey.
  • Remove any leftover comments, unnecessary/redundant code.
  • Me buying a beer for Brian in Madrid because I'm super glad I didn't have to do this bit 😸

Checklist (for reviewing)

General

  • Is this PR explained thoroughly? All code changes must be accounted for in the PR description.
  • Is the PR labeled correctly? It should have the migration label if a new migration is added.
  • Is the risk level assessment sufficient? The risks section should contain all risks that might be introduced with the PR and which actions we need to take to mitigate these risks. Possible risks are database migrations, new libraries that need to be installed or changes to deployment scripts.

Functionality

  • Are all requirements met? Compare implemented functionality with the requirements specification.
  • Does the UI work as expected? There should be no Javascript errors in the console; all resources should load. There should be no unexpected errors. Deliberately try to break the feature to find out if there are corner cases that are not handled.

Code

  • Do you fully understand the introduced changes to the code? If not ask for clarification, it might uncover ways to solve a problem in a more elegant and efficient way.
  • Does the PR introduce any inefficient database requests? Use the debug server to check for duplicate requests.
  • Are all necessary strings marked for translation? All strings that are exposed to users via the UI must be marked for translation.

Tests

  • Are there sufficient test cases? Ensure that all components are tested individually; models, forms, and serializers should be tested in isolation even if a test for a view covers these components.
  • If this is a bug fix, are tests for the issue in place? There must be a test case for the bug to ensure the issue won’t regress. Make sure that the tests break without the new code to fix the issue.
  • If this is a new feature or a significant change to an existing feature? has the manual testing spreadsheet been updated with instructions for manual testing?

Security

  • Confirm this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.
  • Are all UI and API inputs run through forms or serializers?
  • Are all external inputs validated and sanitized appropriately?
  • Does all branching logic have a default case?
  • Does this solution handle outliers and edge cases gracefully?
  • Are all external communications secured and restricted to SSL?

Documentation

  • Are changes to the UI documented in the platform docs? If this PR introduces new platform site functionality or changes existing ones, the changes must be documented in the Cadasta Platform Documentation.
  • Are changes to the API documented in the API docs? If this PR introduces new API functionality or changes existing ones, the changes must be documented in the API docs.
  • Are reusable components documented? If this PR introduces components that are relevant to other developers (for instance a mixin for a view or a generic form) they should be documented in the Wiki.

@linzjax linzjax requested review from oliverroick and bjohare May 5, 2017 20:51
Copy link
Member

@oliverroick oliverroick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two little things

}
},

// setCurrentLocationStyle: function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed I guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -10,7 +10,7 @@ django-parsley==0.6
django-formtools==1.0
django-countries==3.4.1
django-sass-processor==0.3.4
django-leaflet-cadasta==0.21.0
django-leaflet==0.22.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't fully removed django-leaflet, right? It's still used to edit project extents?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's right. We also use the leaflet_tags to load leaflet.js and related css for smap rather than pulling them in from a cdn since they're there locally anyway.

Copy link
Member

@oliverroick oliverroick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎖

@bjohare
Copy link
Contributor

bjohare commented May 11, 2017

Weird, weird, weird.. @linzjax have you ever seen these outsized vertex handles.. just noticed them yesterday? They appear in Chromium & Google Chrome 58 (ubuntu 14.04). Seem fine in FF 53.0 (ubuntu 14.04)
vertex_handles

@linzjax
Copy link
Contributor Author

linzjax commented May 11, 2017

@bjohare Yeah I noticed those, but I didn't realize it was a bug. Katrina was excited about them, so does that make it a "feature"?

@bjohare
Copy link
Contributor

bjohare commented May 11, 2017

feature/bug/bug/feature.. kinda ugly though and the more vertices a polygon has the uglier its going to get..

@linzjax
Copy link
Contributor Author

linzjax commented May 11, 2017

Alright, adjusted the map height in mobile and tested it on my phone. It does, in fact, work on mobile. 🥇

@bjohare
Copy link
Contributor

bjohare commented May 11, 2017

Yahoooo!

@linzjax linzjax force-pushed the feature/map-spa-router-locations-linz branch from a4443fd to f52db5b Compare May 12, 2017 13:32
@linzjax linzjax force-pushed the feature/map-spa-router branch from b3dbf5a to 5955e40 Compare May 12, 2017 13:32
@linzjax
Copy link
Contributor Author

linzjax commented May 12, 2017

Alright, I'm going to rebase/squash and then merge in into feature/map-spa-router unless anyone has any objection? Speak now or forever hold your peace

@wonderchook
Copy link
Contributor

@linzjax I think it is time to merge away!

- updated django-leaflet version.
- removed l.draw and switched to l.editable
- geometry styling moved to separate file
- added location editing forms to routes to allow for ajax interception
- removed location popups
@linzjax linzjax force-pushed the feature/map-spa-router-locations-linz branch from f52db5b to 4f54398 Compare May 12, 2017 19:47
@linzjax linzjax merged commit 23c5601 into feature/map-spa-router May 12, 2017
@linzjax linzjax deleted the feature/map-spa-router-locations-linz branch May 12, 2017 20:03
linzjax added a commit that referenced this pull request May 18, 2017
- updated django-leaflet version.
- removed l.draw and switched to l.editable
- geometry styling moved to separate file
- added location editing forms to routes to allow for ajax interception
- removed location popups
linzjax added a commit that referenced this pull request May 18, 2017
- updated django-leaflet version.
- removed l.draw and switched to l.editable
- geometry styling moved to separate file
- added location editing forms to routes to allow for ajax interception
- removed location popups

fixing things after rebase
linzjax added a commit that referenced this pull request May 23, 2017
- updated django-leaflet version.
- removed l.draw and switched to l.editable
- geometry styling moved to separate file
- added location editing forms to routes to allow for ajax interception
- removed location popups

fixing things after rebase
linzjax added a commit that referenced this pull request Jun 5, 2017
- updated django-leaflet version.
- removed l.draw and switched to l.editable
- geometry styling moved to separate file
- added location editing forms to routes to allow for ajax interception
- removed location popups

fixing things after rebase
linzjax added a commit that referenced this pull request Jun 13, 2017
- updated django-leaflet version.
- removed l.draw and switched to l.editable
- geometry styling moved to separate file
- added location editing forms to routes to allow for ajax interception
- removed location popups

fixing things after rebase
linzjax added a commit that referenced this pull request Jun 19, 2017
- updated django-leaflet version.
- removed l.draw and switched to l.editable
- geometry styling moved to separate file
- added location editing forms to routes to allow for ajax interception
- removed location popups

fixing things after rebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants