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

Integration of new map module of PublicLab.editor . #4608

Merged
merged 5 commits into from
Jan 22, 2019

Conversation

sagarpreet-chadha
Copy link
Contributor

Integration of new map module of PublicLab.editor .

screenshot 2019-01-13 at 3 05 57 pm

@jywarren ...kindly review this 😄 !

@plotsbot
Copy link
Collaborator

plotsbot commented Jan 13, 2019

2 Messages
📖 @sagarpreet-chadha Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.
📖 This pull request doesn’t link to a issue number. Please refer to the issue it fixes (if any) in the body of your PR, in the format: Fixes #123.

Generated by 🚫 Danger

Copy link
Member

@jywarren jywarren left a comment

Choose a reason for hiding this comment

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

Just a few requests and a suggestion to aim for some closer integration. Thanks @sagarpreet-chadha !!!

app/views/layouts/_footer.html.erb Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
$("#map_content").toggle() ;
}) ;
});

Copy link
Member

Choose a reason for hiding this comment

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

Down on line ~257, could we insert some params from the tags if they exist? Like, if there are already lat:___ and lon:____ tags in format /post?tags=one,two,lat:90,lon:-90 we could detect them and insert them here? We can just supply them in format:

editor = new PL.Editor({
  lat: 90,
  lon: -90,
  ...

for now, and develop the detection and response code for it later in the Editor itself. How does that sound?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awesome ! I guess we are trying to solve the case when we edit a document , right ?
Currently default location on map will be shown and not the existing one .

Copy link
Member

Choose a reason for hiding this comment

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

I think we might want to do either edit or create new -- both will open with this template. So if we add this option, we'll be able to insert either pre-populated ones from a link, or the default ones if it's editing an existing node. How does that sound?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense 😄 !

@@ -12,6 +12,10 @@
<meta name="author" content="Public Lab contributors" />
<link href="https://<%= request.host %>/feed.rss" rel="alternate" type="application/rss+xml" title="Public Lab research" />


<script src="https://maps.googleapis.com/maps/api/js?libraries=places&language=en&key=AIzaSyAOLUQngEmJv0_zcG1xkGq-CXIPpLQY8iQ"></script>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @jywarren ! Instead of adding the if condition in _footer.html.erb , can i add that if condition here ?
When used in footer , the Google API gave - google not found error and when adding an explicit script tag to the page - it gave - 'google api used two times , may give unexpected error' .

So i finally removed the google API script everywhere AND kept it here . What do you think ?

Copy link
Member

Choose a reason for hiding this comment

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

Sure, that sounds good. Thanks!

@sagarpreet-chadha
Copy link
Contributor Author

@publiclab/reviewers @publiclab/plots2-reviewers @jywarren ...i guess we can ignore the code-climate issue ?

screenshot 2019-01-16 at 2 55 29 am

@sagarpreet-chadha
Copy link
Contributor Author

@gauravano , @SidharthBansal ...what do you think ? Any pointers on how to reduce cognitive complexity OR it is currently easy to understand ?
Thanks 😄 !

@SidharthBansal
Copy link
Member

I think we can ignore this. Your work looks good to me.

@grvsachdeva
Copy link
Member

Testing your PR on unstable

@grvsachdeva
Copy link
Member

Hey @sagarpreet-chadha, I also think we can ignore the cognitive complexity issue. Let's see how map module is looking in unstable. Thanks!

@jywarren
Copy link
Member

A couple more comments above, but this looks cool! I think we ought to incorporate the lat/lon options before merging, but then we'll be ready. We can, in the template, only insert the values @lat and @lon if they exist; we can generate them in the controllers in a later PR.

Great!!!

@jywarren
Copy link
Member

Looks great. Referencing publiclab/PublicLab.Editor#211 and merging!

Follow up will be to get the editor to detect the lat/lon initial data we pass. Thanks!!

@jywarren jywarren merged commit 5ec8663 into master Jan 22, 2019
SrinandanPai pushed a commit to SrinandanPai/plots2 that referenced this pull request May 5, 2019
* integration done

* changes done

* missing spinner dependency resolved

* codeclimate resolve

* coordinate exist condtions added
@emilyashley emilyashley deleted the feature_editor_integration branch January 15, 2020 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants