Plots2: (multiple issues) Fix UI flow and debug dashboard location input form

Created on 13 Oct 2020  Â·  27Comments  Â·  Source: publiclab/plots2

We have a feature where you can add your location from the dashboard -- https://publiclab.org/dashboard (while logged in):

image

You click "Add your location" and a modal popup appears, prompting you:

image

Unfortunately, as @Tlazypanda noted, this doesn't really work smoothly, both due to possible UI design gaps (no notification to the user when tags are created) and possibly bugs. @Tlazypanda noted:

  • clicking "Save" doesn't apparently do anything, because you're just dropped back on the dashboard
  • On adding location modal, the slider works by zooming in but when we save it and check it out in the profile page it is saved without any zoom.
  • Also after adding your location it still shows add location on dashboard
  • This is invoked by adding location from dashboard but on clicking share location from profile page nothing happens.
  • Also after adding location for first time, it doesn't seem to update for a second time

Even after fixing this, we also ought to add a system test for adding profile tags - like, one of these modified for the dashboard!

https://github.com/publiclab/plots2/blob/86776c2c72a505b0db563f52d1a8165c36c6eb37/test/system/post_test.rb#L188-L211

We could add one of these assertions afterwards that checks that the profile tags are properly created:

https://github.com/publiclab/plots2/blob/86776c2c72a505b0db563f52d1a8165c36c6eb37/test/system/tag_test.rb#L40-L51

Intended workflow

The ideal intended workflow is:

  1. See "add a location" on dashboard, click it
  2. See modal and check content of one or more of the inputs
  3. enter lat/lon and zoom, or use the slider
  4. press Save and see an alert (maybe?) that says "profile location was saved. Learn more about location privacy" - linking to https://publiclab.org/location-privacy
  5. confirm dashboard button now says "View nearby content
  6. confirm tags were added and appear on profile page
JavaScript break-me-up help wanted testing

Most helpful comment

Great collaboration here @Manasa2850 @gauravahlawat81 :tada: :tada:

All 27 comments

Hi can I work on this issue?

@khadija-nur have you started working on this issue already? if yes we can work on it together since the issue's description is kind of lengthy. why don't we use this issue as a means of starting our pair pogramming journey.

This looks interesting and I would like to team up as well! @khadija-nur @tawahpeggy

ok @aissshah that will be awesome. i guess we are both waiting on @khadija-nur to confirm.

Sorry I've already started working on it with others @tawahpeggy Hopefully another issue comes up soon

Ok no problem.
Hopefully I'll find an issue

On Wed, Oct 14, 2020, 5:46 PM khadija notifications@github.com wrote:

Sorry I've already started working on it with others @tawahpeggy
https://github.com/tawahpeggy Hopefully another issue comes up soon

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/8566#issuecomment-708525566,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJT4KDWBZJ5CHMLKSIXDXUTSKXIWDANCNFSM4SPUGEXQ
.

Hi all! Thank you so much for your help. I think this may best be completed in a few different parts:

  • [x] clicking "Save" doesn't apparently do anything, because you're just dropped back on the dashboard: let's ensure we add a flash[:notice] telling the user that the location was saved! Or, it may require the use of the noty helper to make an alert appear in pure Javascript: https://github.com/publiclab/plots2/blob/baa7e7cd335b8325c8194f0740a59449448050d9/app/views/spam2/_nodes.html.erb#L118-L122
  • [ ] ensuring that a tag such as zoom:_____ (like, zoom:8) is saved on the profile page once this form is submitted - should be done in this controller, i believe!
  • [ ] after adding your location it still shows add location on dashboard - we should check if lat:____ and lon:____ user tags exist and switch to a button saying Nearby activity, linking to a page like https://publiclab.org/map/#6/18/-66 (with zoom/lat/lon built into the URL (template here: https://github.com/publiclab/plots2/blob/27a3839154e0cec071860448f99697f9c831042c/app/views/sidebar/_dashboard.html.erb#L20-L28)
  • [ ] on clicking share location from profile page nothing happens - let's ensure the button on /profile works too, and write a test to protect it
  • [ ] after adding location for first time, it doesn't seem to update for a second time - so, let's be sure that in https://github.com/publiclab/plots2/blob/main/app/controllers/user_tags_controller.rb#L35, we /replace/ location tags, perhaps? this is probably a big enough issue to break out by itself.

Each of these may need a test to protect it, so take a look at the example tests and assertions above!

I recommend folks pick one, and we'll coordinate from here!

Thanks for the additional info @jywarren, they're super helpful

I would like to work on this issue if it's not assigned to someone else. CC: @jywarren

@jywarren When we click Add location on dashboard, the location doesn't get saved, but when we go on the profile page and the location isn't added yet, Share your Location will prompt you to add the location first,after adding location, it indeed saves the location. This seems weird and I will be looking into this deeply!

@jywarren clicking on the Share your Location button in the profile page does not do anything. (4th item in your checklist)
I would like to take this up and try to fix it.

@Manasa2850 sure go ahead! Good luck!

Hey @Manasa2850 , thanks for the help, I have already started working on this and I would love to collaborate! :+1:

Awesome @gauravahlawat81! I just saw your PR regarding saving the location.
Could I work on enabling the Share your Location button from the profile page?

Sure @Manasa2850 please go ahead and take that up!
Cheers!

Thanks @coder645. I'll start working on it then!

Could I work on enabling the Share your Location button from the profile page?

Sure no problem, I am currently working on displaying Nearby Activity button if the location exists!

@Manasa2850 could you please help me with writing tests for the code that I have written till now ? It seems to me that you are very well versed with writing tests! :smile:

We can work together on this and I will get to learn a lot from you, I believe! :nerd_face:

@gauravahlawat81 I can help you with that mate! :heart:

Thanks @coder645 !

Sure @gauravahlawat81. I'm not an expert in this too but I'll definitely try to help!

@gauravahlawat81 please be respectful of others.
Not everyone who contributes here is there on Gitter.

@cesswairimu could we have some sort of mechanism / code of conduct to ensure people (here @gauravahlawat81 and maybe some other time myself) don't make disrespectful comments and then delete it?
Cheers!

We do have a code of conduct, you can find it in the documentation... Cheers

@gauravahlawat81 I suggest that you take a look at that and not make disrespectful comments from next time onwards.
Cheers!

Thanks @cesswairimu :+1:

Great collaboration here @Manasa2850 @gauravahlawat81 :tada: :tada:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

keshavsethi picture keshavsethi  Â·  3Comments

jywarren picture jywarren  Â·  3Comments

jywarren picture jywarren  Â·  3Comments

grvsachdeva picture grvsachdeva  Â·  3Comments

grvsachdeva picture grvsachdeva  Â·  3Comments