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

Show loading spinner until share settings are fully loaded #38163

Merged

Conversation

danxuliu
Copy link
Member

The inputs of the sharing settings are generated in a template in the server, but the listeners to react to changes in the elements and save the values in the server are loaded in the client once the DOM finishes loading. If the DOM takes long to load the user can start to interact with the settings before the listeners were set up and, therefore, the changes would not be saved in the server. However, as the inputs are modified the user would think that the changes were already saved.

To address that now when the sharing settings are open a loading spinner is shown instead of the contents of the sharing settings, and only once the listeners to save the changes were set up the spinner is removed and the contents shown.

How to test

  • Open the Sharing section in the admin settings

Result with this pull request

A loading spinner is shown, which is removed once the settings were loaded

Result without this pull request

The sharing settings are immediately shown, so they can be modified, but if done too quickly after they are shown they are not saved to the server (which can be verified by reloading the page)

The inputs of the sharing settings are generated in a template in the
server, but the listeners to react to changes in the elements and save
the values in the server are loaded in the client once the DOM finishes
loading. If the DOM takes long to load the user can start to interact
with the settings before the listeners were set up and, therefore, the
changes would not be saved in the server. However, as the inputs are
modified the user would think that the changes were already saved.

To address that now when the sharing settings are open a loading spinner
is shown instead of the contents of the sharing settings, and only once
the listeners to save the changes were set up the spinner is removed and
the contents shown.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu added this to the Nextcloud 27 milestone May 10, 2023
@danxuliu danxuliu requested review from skjnldsv, Pytal, a team and Fenn-CS and removed request for a team May 10, 2023 03:59
@skjnldsv skjnldsv mentioned this pull request May 10, 2023
@danxuliu
Copy link
Member Author

CI failure is unrelated (it happens on master too), but I do not have enough rights to merge :-)

@Pytal Pytal added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels May 11, 2023
@Pytal Pytal merged commit 83ed1fb into master May 11, 2023
@Pytal Pytal deleted the show-loading-spinner-until-share-settings-are-fully-loaded branch May 11, 2023 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug feature: settings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants