Page MenuHomePhabricator

Switching to "read" state immediately when 'publish' button is clicked - is this a good idea?
Closed, ResolvedPublic

Description

When the "publish" button is clicked the depicts form switches to a 'read' state instantly, rather than waiting for the api calls to complete

Perhaps this won't cause problems, but I think it probably will. This ticket is to either verify that it won't, or to change things so there's a 'sending' state that prevents the user from sending more data until it's done

Related Objects

Event Timeline

Cparle triaged this task as High priority.Feb 14 2019, 5:16 PM
Cparle created this task.

Actually, right now, widgets don't switch to "read" until the previous one has been submitted.
That should probably change: they should switch to read right away (or rather: make it so that editing is no longer possible) because data for all qualifiers is fetched right at the start, and making last-minute changes while previous statements are already being submitted won't change anything.

My idea right now is that, upon submission, we should switch all to "read" mode (or at least disable all edit controls), and switch back to edit mode with an error message should anything go wrong.
And it should indeed probably be impossible to switch back to "edit" until all API requests have gone through.

I was actually thinking of the buttons rather than the widgets themselves ... but yeah, either way, I think the whole form should probably go into some sort of blocking state (with 'cancel' hidden and 'submit' in a disabled state) while edits are being processed

Change 491298 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/WikibaseMediaInfo@master] Toggle edit mode on primary, and make state changes impossible during submit

https://gerrit.wikimedia.org/r/491298

@matthiasmullie this task is in the to-do column, but has a patch-for-review tag. Should we move it to "doing"?

Change 491298 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Toggle edit mode on primary, and make state changes impossible during submit

https://gerrit.wikimedia.org/r/491298

no problems on production so far.