Page MenuHomePhabricator

Publish button is enabled when an alias is added, publishing is possible with only the output type specified
Closed, InvalidPublicBUG REPORT

Assigned To
Authored By
AAlhazwani-WMF
Jan 4 2023, 6:05 PM
Referenced Files
F35983193: image.png
Jan 4 2023, 6:05 PM
F35983190: image.png
Jan 4 2023, 6:05 PM
F35983189: image.png
Jan 4 2023, 6:05 PM
F35983188: image.png
Jan 4 2023, 6:05 PM

Description

Steps to replicate the issue (include links if applicable):

Go to https://wikifunctions.beta.wmflabs.org/wiki/Special:CreateZObject?zid=Z8

image.png (1×1 px, 125 KB)

Add an alias, the 'Publish' button is enabled

image.png (1×1 px, 130 KB)

Click 'Publish', an error under output is displayed

image.png (1×1 px, 133 KB)

If I select an output type I can publish

image.png (1×1 px, 191 KB)

What should have happened instead?:

  • The 'Publish' button is enabled only when an input and an output are specified

Event Timeline

I think there's no bug here:

  1. The button "Publish" is disabled initially and only when a change has been made to the ZObject from the initial state, it gets active. This is to stop the user from clicking "Publish" with zero-changes. This is expected (side note below)
  2. Once I can save (because I have changes), clicking the Publish button stops me from actually Publishing by showing me which are the mandatory fields. That's only "Output" (we decided that we would allow zero-input functions)

These work as expected.

SIDE NOTE: Point 1 however could be implemented better. If I open an existing ZObject, go to the edit view, the button is disabled: this is okay. I make a small change and the button is activated: this is also okay. But I change it back again to the initial state and the button stays active: this means that the app doesn't track whether there's any difference from the initial state, just activates when there's any edit action.

  1. The button "Publish" is disabled initially and only when a change has been made to the ZObject from the initial state, it gets active. This is to stop the user from clicking "Publish" with zero-changes. This is expected (side note below)

I wonder if we should hold editors from clicking 'Publish' as long as the required field/s are given. It may be counter-intuitive to enable the 'Publish' button (making publishing allowed) only to display an error message after the click. A similar behaviour is in use on the 'Create new repository' page on GitHub https://github.com/new. You can give a description, you can decide if the repository is public or private, you can add a readme and/or gitgnore, but as long as you don't give a repository name (the required field) the 'Create repository' button is not enabled.

  1. Once I can save (because I have changes), clicking the Publish button stops me from actually Publishing by showing me which are the mandatory fields. That's only "Output" (we decided that we would allow zero-input functions)

Ahhh, I see! Lemme update then the copy on T322132 marking all input fields (except 'output') as optional, hence making only the 'output' filed the required one.

SIDE NOTE: Point 1 however could be implemented better. If I open an existing ZObject, go to the edit view, the button is disabled: this is okay. I make a small change and the button is activated: this is also okay. But I change it back again to the initial state and the button stays active: this means that the app doesn't track whether there's any difference from the initial state, just activates when there's any edit action.

Is this for privacy reason? Otherwise also in this scenario we could enable the 'Publish' button only after publishable changes?

p.s. I might be not aware of technical requirements and/or constraint for the current implementation. My suggestions come from an experience-only viewpoint.

@AAlhazwani-WMF @gengh could you give me gerrit repository link of this task so that I can work on it .

@Sushrith_Bogi This task is currently under discussion/triage, so not ready to be worked on.

I wonder if we should hold editors from clicking 'Publish' as long as the required field/s are given.

@AAlhazwani-WMF This is the behavior that we were implementing few months ago and after all the discussions related to mandatory vs. optional data, errors and publish dialog it was decided that the button will be always be enabled (if there's any change to save) and that the necessary input fields will be highlighted to offer guidance when the user pushed the Publish button instead. I believe we should stick with our past decisions for now and explore post-launch if they were effective or we want to revert back to that behavior.

According to these decisions, the only time that Publish should be disabled is when there's no changes from the initial state.

I see, thanks for the additional context @gengh! 🙏🏼 I'll look back at the 'mandatory vs. optional data' document, and take some notes for future testing to learn if this is critical or not. We can close this task then!