USEPA / EPA_Non-geo_Metadata_Editor

3 stars 0 forks source link

Add splash page asking user whether they are extramural or internal EPA audience. #71

Open torrin47 opened 5 years ago

torrin47 commented 5 years ago

Selection will determine guidance and elements shown.

Will offer option of login for internal users, but internal version of page can be viewed and used without login. Login only required for reading/writing from EDG.

torrin47 commented 5 years ago

Splash design clean and spare to start with.

aergul commented 5 years ago

@torrin47 would the splash screen become frustrating after some time if one is not an EPA/ORCID user? Should we go with a user initiated login instead of a splash screen asking at every page load? Or maybe have a "remember my selection" checkbox on the splash screen (and store it in a cookie)? Other ideas?

torrin47 commented 5 years ago

Honestly, I don't anticipate external users being frequent repeat visitors, so I was thinking of the splash page of having a side benefit of forcing these users to pause and read our introductory info before proceeding - the current header does include useful text and links, and I worry that most users instantly skip past it and focus on the editor portion.

That said, I do really like what you've already implemented with the discreet login button above the first field. I like it so much I'm inclined to work through the details of keeping it this way - details like... the EPA Agreement and EPA Contact elements should be hidden when an EPA user logs in - this might be the only change, do we think it would be disconcerting or a total non-issue?

aergul commented 5 years ago

No problem, done.

aergul commented 5 years ago

Here is an interesting twist that came up during implementation of #28: Since we are implementing oauth2-based login, a redirect to 3rd party server and then back is inevitable (to preserve the integrity of the process). If the user has already made input to the form, they will be lost. The options are then to either a) persist state, say in local storage, prior to redirect and then restore after redirect or b) implement login on the splash page so there will be no prior form input.

Both are doable though option a) is a bit bigger than a bread box and option b) is clearly simpler. Preference @torrin47 ?

aergul commented 5 years ago

So #28 has been deployed with option b) above. The splash page is shown only if the user is not logged in. Still open to option a if desired. Given the way #28 has been implemented, we can also imagine option c) where we don't preserve state, using inline buttons to manage authentication (instead of buttons on a splash page) but the user gets the prompt to leave the page if the form is dirty and it's the user's choice to stay and preserve state or leave and abandon state.

jzichichi commented 5 years ago

@aergul - I tested this with the splash page if user not logged in. Worked like a charm. THe only question I have is that if I log out and want to log back in, I don't see a way to do so. Perhaps I am missing this. I think that is where you were trying to go with option b above Ayhan? I guess my only concern is that it feels like it might be nice if folks were able to login after that splash screen went away, which of course runs into the issue you described above, where content might be lost. Perhaps @torrin47 will have an opinion about this.

aergul commented 5 years ago

@jzichichi, correct. Option a or c would provide an inline login button as opposed to one on splash page.

jzichichi commented 5 years ago

@aergul - OK sounds good. I will let @torrin47 weigh in on preferences.

torrin47 commented 5 years ago

Ahh, I just added comments in #28 about this. So the issue is with the redirection that would nuke any existing input. I've done some things with local storage before, I'm trying to remember the context, I just have a memory of it being pretty smooth - easier than expected. Guess that means I'm leaning towards option a.

aergul commented 5 years ago

Option a is implemented. All authentication buttons are now inline (top-right). Any input on the form is persisted during Oauth redirections to and from ArcGIS Online.

jzichichi commented 5 years ago

@aergul - testing so far this worked great for me. I tested with log-in log out and log back in with various fields filled out, etc. So far in testing everything was retained and it worked as I would have expected. I will test with a few more fields as well, but so far so good!!!

torrin47 commented 5 years ago

Very sweet. Wouldn't change a thing.