MSFREACH / msf-reach

Web platform for MSF-REACH
https://msf-reach.org/
4 stars 5 forks source link

per operator default layers on landing page and events page #172

Closed matthewberryman closed 6 years ago

matthewberryman commented 6 years ago

Can each operator decide on which default layers are present on the landing page? Personally, I only want the hazards layers (PDC, GDACS, etc.). Even if I select only the hazards layers, every time I move away from the landing page and go back, all the layers are back.

matthewberryman commented 6 years ago

I think cookies are the best solution here. https://github.com/voltace/browser-cookies looks like a suitable library browser side for this.

matthewberryman commented 6 years ago

Or https://github.com/js-cookie/js-cookie (browser-cookies would require a build system that we don't have yet)

matthewberryman commented 6 years ago

js-cookie already in use for the jwt stuff; could also use server side in lib/util.js for more efficient parsing of cookies.

matthewberryman commented 6 years ago

seems to work Ok in dev on events page although the page is taking a bit longer to load than usual (perhaps just cache catching up with changes) - I will give this another look tomorrow, and once it's working in dev events page will roll it out to landing page and in master (prod) too. @LucieGueuning

matthewberryman commented 6 years ago

@LucieGueuning reports this not working on log out and log in, but I cannot reproduce this. Lucie have you cleared your browser cache? The events page has a separate issue on page zoom & pan as the code for making the layers dynamic with the table is breaking the changes, which I will fix, and which may be what you are seeing.

matthewberryman commented 6 years ago

Separately I wasn't storing the reports sublayers properly. Have that fixed locally, will deploy once I get this new code interacting properly with the dynamic missions and contacts updating.

matthewberryman commented 6 years ago

@LucieGueuning I have implemented and tested this across all layers on landing page and events page (dev only at this point) and fixed the issues you were seeing plus for the issue I noticed on sublayers. Also if the user is a new user I go with the defaults we'd previously had for on/off and set those. By the time you wake up your browser should be fetching the new page instead of the cached version, if you have issues then try Ctrl-R (Windows) or Command-R (Mac) to get your browser to refresh the page from the server.

LucieGueuning commented 6 years ago

I tested it. Please find my feedback:

  1. On landing page, working well to remember my preferences except for USGS and GDACS layers.
  2. On event page, layers are not as stipulated into spreadsheets.
  3. Are we moving to a design of one page level?
matthewberryman commented 6 years ago
  1. Will check tomorrow my time and fix those layers.
  2. Everything with exception of non-MSF contacts is on by default (in absence of having selected / deselected layers), per previous discussions. If you'd like something different please fill in the spreadsheet, currently blank with exception of terrain as default base map, or make a note here.
  3. Issue for discussion of that is https://github.com/MSFREACH/msf-reach/issues/194 (cc @anexact ) but needs to follow from separate ethnographic work.
matthewberryman commented 6 years ago

Update:

  1. I have fixed the two layers USGS and GDACS and deployed to dev and prod environments.
  2. I have noticed that the non-MSF contacts for landing page are now listed as on in the spreadsheet, as the starting default (in the absence of any changes by the user, which are now saved). I will deploy that in a commit in just a couple of minutes. To see the starting defaults you need to clear your cookies, in chrome enter chrome://settings/cookies/detail?site=dev.msf-reach.org into the address bar (for dev) or chrome://settings/cookies/detail?site=msf-reach.org (for prod) and remove all the cookies—just noting that will also force a logout so you will have to login and then you will see the starting defaults.
LucieGueuning commented 6 years ago

Great. working well on Google Chrome. Not working on Internet Explorer. We only have the hazards on the legend, no contacts nor mission history layers, neither current event.

I will share the concrete progress on front-end to Natasha in terms of legend, once it is done.

matthewberryman commented 6 years ago

IE support is a separate issue https://github.com/MSFREACH/msf-reach/issues/224

LucieGueuning commented 6 years ago

You can keep non-MSF contacts (as per spreadsheet) on by default please.

Everything on and people will manage their preferences by themselves.

matthewberryman commented 6 years ago

Although this has been done a while and working well through testing for the custom layers we're adding (reports, contacts, missions, events, hazards) it's not saving the selected underlying map title layer, which will become more important with #255, so re-opening this issue to deal with saving of the map layer.

matthewberryman commented 6 years ago

@LucieGueuning with regards to the new code for saving map layers (in addition to previous layers already done), note that the behaviour for map layer is to use the same one for both landing and events maps (leaving terrain as the default for new reports and new contacts, neither of which have the OSM layer, though I can change all of this if required).