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

Refactor maps code #416

Merged
merged 12 commits into from
Nov 17, 2016
Merged

Refactor maps code #416

merged 12 commits into from
Nov 17, 2016

Conversation

rjmackay
Copy link
Contributor

@rjmackay rjmackay commented Nov 14, 2016

This pull request makes the following changes:

  • Rewrite post-view-map
  • Rewrite post detail maps
  • Vastly simplify Maps helper
  • Remove angular-leaflet-directive
  • Rewrite location editor
  • Rewrite map settings

Test these changes by:

  • Load the map view, check it all works fine
  • Check map popups work
  • Check it works with clustering disabled
  • Edit a post, check the location editor all works
  • Edit map settings
    • confirm you can move the marker around the map, zoom in/out
    • confirm map updates when changing settings below it

Ping @ushahidi/platform


This change is Reviewable

- Don't user angular-leaflet-directive
- Vastly simplify Maps helper
- Rewrite post-view-map
- Move map creation to shared function
- Rewrite post detail map code into own directive
- Make markers draggable
@rjmackay rjmackay temporarily deployed to ushahidi-platform-devel-pr-416 November 14, 2016 23:24 Inactive
@coveralls
Copy link

coveralls commented Nov 14, 2016

Coverage Status

Coverage decreased (-3.5%) to 70.903% when pulling d8e1cac on refactor-maps-code into d9fd6f9 on webpack.

@rjmackay rjmackay temporarily deployed to ushahidi-platform-devel-pr-416 November 15, 2016 03:08 Inactive
@rjmackay rjmackay temporarily deployed to ushahidi-platform-devel-pr-416 November 15, 2016 03:08 Inactive
@coveralls
Copy link

coveralls commented Nov 15, 2016

Coverage Status

Coverage decreased (-0.6%) to 73.747% when pulling c6d923f on refactor-maps-code into d9fd6f9 on webpack.

@coveralls
Copy link

coveralls commented Nov 15, 2016

Coverage Status

Coverage decreased (-0.6%) to 73.747% when pulling c6d923f on refactor-maps-code into d9fd6f9 on webpack.

@ushbot ushbot temporarily deployed to rackspace_pr November 15, 2016 20:46 Inactive
- Replace leaflet default markers in location editor
- Replace leaflet default markers in map settings
@rjmackay rjmackay temporarily deployed to ushahidi-platform-devel-pr-416 November 17, 2016 03:56 Inactive
@coveralls
Copy link

coveralls commented Nov 17, 2016

Coverage Status

Coverage decreased (-0.6%) to 73.747% when pulling f8cc7f6 on refactor-maps-code into d9fd6f9 on webpack.

@rjmackay rjmackay temporarily deployed to ushahidi-platform-devel-pr-416 November 17, 2016 03:59 Inactive
@coveralls
Copy link

coveralls commented Nov 17, 2016

Coverage Status

Coverage increased (+0.6%) to 74.932% when pulling 4312795 on refactor-maps-code into d9fd6f9 on webpack.

@ushbot ushbot temporarily deployed to rackspace_pr November 17, 2016 04:07 Inactive
@rjmackay rjmackay mentioned this pull request Nov 17, 2016
7 tasks
Conflicts:
	app/main/posts/posts-module.js
@rjmackay rjmackay temporarily deployed to ushahidi-platform-devel-pr-416 November 17, 2016 04:39 Inactive
@rjmackay
Copy link
Contributor Author

@coveralls
Copy link

coveralls commented Nov 17, 2016

Coverage Status

Coverage increased (+0.6%) to 74.933% when pulling 15bd004 on refactor-maps-code into 129bafe on webpack.

@ushbot ushbot temporarily deployed to rackspace_pr November 17, 2016 04:46 Inactive
Copy link
Contributor

@willdoran willdoran left a comment

Choose a reason for hiding this comment

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

LGTM

}};
return {
/* jshint ignore:start */
$promise: $q.when({"type": "FeatureCollection","features": [{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-122.330062,47.603832]}]},"properties": {"title": "Testing our qa twitter account","description": "Testing our qa twitter account\n\n#ushahidiqatest","marker-color": "#E69327","id": 2600,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2600"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.707703,30.063236]}]},"properties": {"title": "Masonry","description": "785275","marker-color": "#E69327","id": 2573,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2573"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.707146,30.102217]}]},"properties": {"title": "Wood","description": "223488","marker-color": "#E69327","id": 2575,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2575"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.704613,30.118774]}]},"properties": {"title": "Edited","description": "433512","marker-color": "#E69327","id": 2576,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2576"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.700455,30.089579]}]},"properties": {"title": "Wood","description": "206893","marker-color": "#E69327","id": 2570,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2570"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [77.531287,13.075209]},{"type": "Point","coordinates": [77.531287,13.075209]}]},"properties": {"title": "post via twitter","description": "#publicpolicy making in the #digital age https:\/\/t.co\/maAwmik3Zz #PolicyMakers #policymaking #ICT #ICT4D #ICT4D2016 #ICT4Dev #techforgood","marker-color": "#E69327","id": 2527,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2527"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.711777,30.102261]}]},"properties": {"title": "119736","description": "Masonry","marker-color": "#E69327","id": 2508,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2508"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.702675,30.060614]}]},"properties": {"title": "172534","description": "Wood","marker-color": "#E69327","id": 2512,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2512"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.707703,30.063236]}]},"properties": {"title": "785275","description": "Masonry","marker-color": "#E69327","id": 2513,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2513"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.713882,30.102226]}]},"properties": {"title": "995932","description": "Reinforced Concrete","marker-color": "#E69327","id": 2514,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2514"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.707664,30.063936]}]},"properties": {"title": "Masonry","description": "448094","marker-color": "#E69327","id": 2446,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2446"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.700455,30.089579]}]},"properties": {"title": "Wood","description": "206893","marker-color": "#E69327","id": 2447,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2447"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.707703,30.063236]}]},"properties": {"title": "Wood","description": "333743","marker-color": "#E69327","id": 2448,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2448"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.702675,30.060614]}]},"properties": {"title": "Wood","description": "172534","marker-color": "#E69327","id": 2449,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2449"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.707703,30.063236]}]},"properties": {"title": "Masonry","description": "785275","marker-color": "#E69327","id": 2450,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2450"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.713882,30.102226]}]},"properties": {"title": "Reinforced Concrete","description": "995932","marker-color": "#E69327","id": 2451,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2451"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.711777,30.102261]}]},"properties": {"title": "Masonry","description": "119736","marker-color": "#E69327","id": 2427,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2427"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.702675,30.060614]}]},"properties": {"title": "Wood","description": "172534","marker-color": "#E69327","id": 2431,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2431"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.707703,30.063236]}]},"properties": {"title": "Masonry","description": "785275","marker-color": "#E69327","id": 2432,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2432"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-81.713882,30.102226]}]},"properties": {"title": "Reinforced Concrete","description": "995932","marker-color": "#E69327","id": 2433,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2433"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [-122.330062,47.603832]}]},"properties": {"title": "jess testing radio button fix","description": "radio button pattern should match pattern library","marker-color": "#A51A1A","id": 2287,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/2287"}},{"type": "Feature","geometry": {"type": "GeometryCollection","geometries": [{"type": "Point","coordinates": [36.817245,-1.283253]}]},"properties": {"title": "Sample post type from Angie","description": "This is my sample image post","marker-color": "#2274B4","id": 24,"url": "http:\/\/qa.api.ushahididev.com\/api\/v3\/posts\/24"}}]})
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to be able to use fixtures more in our tests, that way keeping data inline with the backend will be easier.

@jshorland
Copy link

  1. Shadows when nearby map markers NOT combined are ugly
    screen shot 2016-11-17 at 1 12 56 pm
  2. if my post has a picture, it centers on the map pop and then loads picture instead of the other way around. In the case of one post, I couldn't click on the title because the picture caused it to be off the map.
    screen capture on 2016-11-17 at 13-14-47
  3. "under review" icon on map pop ups is off
    screen shot 2016-11-17 at 1 17 15 pm

@rjmackay
Copy link
Contributor Author

Shadows when nearby map markers NOT combined are ugly

Thats an issue already, not created by this change. I checked and logged it on the PL because its a styling issue ushahidi/platform-pattern-library#105

  1. if my post has a picture, it centers on the map pop and then loads picture instead of the other way around. In the case of one post, I couldn't click on the title because the picture caused it to be off the map.

Again thats an existing bug, not caused by this change. I'll have a look to see if there's a quick fix.

Under review icon

Will fix that..

Override leaflet position:absolute for svg.iconic
@coveralls
Copy link

coveralls commented Nov 17, 2016

Coverage Status

Coverage increased (+0.6%) to 74.933% when pulling ab1e337 on refactor-maps-code into 129bafe on webpack.

@ushbot ushbot temporarily deployed to rackspace_pr November 17, 2016 21:25 Inactive
@rjmackay rjmackay changed the base branch from webpack to develop November 17, 2016 22:52
@rjmackay rjmackay merged commit ec47ea9 into develop Nov 17, 2016
@tuxpiper tuxpiper deleted the refactor-maps-code branch August 19, 2020 12:53
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.

6 participants