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

Enable to remind previously used value in submitter and node for reserve #13

Open
tloubrieu-jpl opened this issue Dec 10, 2020 · 3 comments
Labels

Comments

@tloubrieu-jpl
Copy link
Member

The user are likely to use exactly the same inputs always here.

The should be done only if there is a simple way to do so with react.

@tloubrieu-jpl tloubrieu-jpl added the enhancement New feature or request label Dec 10, 2020
eddiesarevalo added a commit that referenced this issue Feb 1, 2021
-When an error is encountered on submission the form values are not deleted so that the form can be easily submitted again.
-When there is an error on the upload the error message is shown in a readable format. The format is title followed by description.
@eddiesarevalo
Copy link
Member

@tloubrieu-jpl In short there is no super simple way to do this using React and Material-UI. The first reason is that Material-UI turns off the browser's auto fill automatically due to rendering issues. Secondly, each browser supports it's own auto fill values but not custom ones. For example Chrome saves payment information, addresses and passwords only. Safari and Firefox are similar. Internet Explorer attempts to save the entire form but we don't support IE. The third reason is that these values get saved on submission of a form on a normal HTML page but we are using AJAX requests so there would have to be a workaround to get the browser to save the values.

There are alternatives including many hacky solutions but they are probably not worth it since we are only trying to save 2 fields. For example one alternative is to use a third party plugin that saves the values of a form and adds them back later, however this might lower our usability as anyone using this app will probably not want to use a third party plugin.

Another alternative would be to save any submission values in the browser's local data storage so that when they return to the app it can be loaded into autocomplete widgets for the form. This would be the simplest good solution but it is probably not worth it since it would take some time to get this set up and tested. It might not be worth it for just 2 fields.

@tloubrieu-jpl
Copy link
Member Author

Thanks Eddie for the detailed answer. This is indeed not critical but that would help the user a lot.

Anyway ticket #17 priority is higher so you can work on it first.

One last question, is the third alternative (save any submission values in the browser's local data storage) related to cookies management as discussed there https://stackoverflow.com/questions/39826992/how-can-i-set-a-cookie-in-react

If yes, I can confirm that would be my preferred solution also.

@eddiesarevalo
Copy link
Member

@tloubrieu-jpl Yes cookies are usually used as a backup for local storage but we can use only cookies to store this information to make this easier and simpler. It would also be my preferred solution when we get back to this.

tloubrieu-jpl pushed a commit that referenced this issue Feb 9, 2021
* Keep Values And Show Message On Error #9 #13

-When an error is encountered on submission the form values are not deleted so that the form can be easily submitted again.
-When there is an error on the upload the error message is shown in a readable format. The format is title followed by description.

* Add Submitter And Node To Release #19

-Submitter and node can now be changed in release. The default value is what is returned in the doi search.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ToDo
Development

No branches or pull requests

3 participants