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

added modal to the infomartion display #447

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

added modal to the infomartion display #447

wants to merge 13 commits into from

Conversation

neelesh17
Copy link
Member

@neelesh17 neelesh17 commented Mar 18, 2020

Fixes #444 (<=== Add issue number here)

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

Copy link
Contributor

@crisner crisner left a comment

Choose a reason for hiding this comment

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

@neelesh17, did this work when you ran it locally? This is what I am getting when I clicked the info button:
image

@neelesh17
Copy link
Member Author

neelesh17 commented Mar 20, 2020

yes @crisner it is working locally on my device.
123

@crisner
Copy link
Contributor

crisner commented Mar 20, 2020

Awesome! Thanks! Could you fix the conflicting files?

@neelesh17 neelesh17 requested a review from crisner March 21, 2020 14:55
@neelesh17
Copy link
Member Author

neelesh17 commented Mar 21, 2020

@crisner I made the changes you requested.

this._infoDisplay.classList.add(this.options.classname);
this._infoModal = L.DomUtil.create('div');
this._infoModal.classList.add('modal', 'fade', 'leaflet-bar', 'leaflet-control-info');
$(this._infoModal).attr('role', 'dialog');
Copy link
Member

Choose a reason for hiding this comment

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

Hi, this is looking really nice. I wanted to suggest you could construct the HTML as strings and it might end up a bit more readable... what do you think? For reference, see this section of another project where a block of HTML/CSS is constructed in a string:

https://github.com/publiclab/inline-markdown-editor/blob/c41cf426bc010b382346ffd31b8d2924570162b7/src/buildSectionForm.js#L2-L14

What's more, it used standard Bootstrap classes rather than unique css styles. This could be helpful for you too because it would add standard margins, padding, etc and it might make your code overall shorter. If you use the standard Bootstrap html/css as in https://getbootstrap.com/docs/4.0/components/modal/, you may not need as many customizations of the style attribute, you know? And it may accommodate more varied content since those styles have been so thoroughly tested.

What do you think?

Thanks again for your help!!! 🎉

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi, I think it is a nice idea to construct the HTML as string and as for the unique css styles, i added those because the styles present in the standard bootstrap were being overwritten due to another class.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jywarren i made the changes you requested but the test are failing and i m not able to find the cause, would you help me out.

@jywarren
Copy link
Member

     TypeError: undefined is not a constructor (evaluating 'new L.Control.GPlaceAutocomplete') in file:///home/travis/build/publiclab/leaflet-environmental-layers/dist/LeafletEnvironmentalLayers_babel.js (line 5139) (1)

Hmm, what could be causing this error? https://travis-ci.com/github/publiclab/leaflet-environmental-layers/builds/158924297#L301

else {
var infoModal = "<div class='modal fade leaflet-bar leaflet-control-info' role='dialog' tapindex='3' aria-hidden='true' >";
}
infoModal += "<div class='modal-dialog'>";
Copy link
Member

Choose a reason for hiding this comment

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

This is really nice and clean. Can you share a screenshot?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah Sure
displayinfocode

@nstjean
Copy link
Contributor

nstjean commented Apr 29, 2020

Hopefully this error is fixed by #454 ?

@jywarren
Copy link
Member

jywarren commented May 7, 2020

Indeed, could you try rebasing and rebuilding it? Thanks!

there are more tips and guides on rebasing here: https://publiclab.org/wiki/developers#Resources

@jywarren jywarren changed the base branch from master to main June 24, 2020 14:51
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.

Change how layer information is displayed
4 participants