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

Modify Button Behaviour When enable-submissions Flag is Disabled #22779

Merged
merged 16 commits into from
Oct 31, 2024

Conversation

chrstinalin
Copy link
Contributor

@chrstinalin chrstinalin commented Oct 17, 2024

Fixes: mozilla/addons#15090

Description

when enable-submissions is disabled, now:

  1. Disables the 'create a theme' button
  2. Addon submission buttons are disabled and a warning is displayed banner style with the flag note (if any).

image

image

Testing

  1. Deactivate the enable-submissions waffle flag (everyone should be = True by default).
  2. User should be unable to make new submissions and warned via the disabled button.

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.

@chrstinalin chrstinalin marked this pull request as draft October 17, 2024 18:47
@chrstinalin chrstinalin requested review from a team and KevinMind and removed request for a team October 17, 2024 19:56
@KevinMind
Copy link
Contributor

@chrstinalin could you reassign review. I'll be on PTO next week and don't want to block you.

@chrstinalin chrstinalin requested review from a team, KevinMind and eviljeff and removed request for KevinMind and a team October 18, 2024 19:37
Copy link
Member

@eviljeff eviljeff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing some context here, but why are we doing the disabling, and rendering the error, in javascript? We know submissions are disabled when the template is rendered so add the logic to disable the buttons and display the message in the template?

We can test the error message is visible and the button disabled in tests too that way

@chrstinalin
Copy link
Contributor Author

chrstinalin commented Oct 29, 2024

I honestly can't recall if I had a reason for this, I think it may have been the natural progression of my original barebones fix... That solution makes alot more sense.

@chrstinalin chrstinalin marked this pull request as ready for review October 29, 2024 21:10
Copy link
Member

@eviljeff eviljeff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits in the test code, and it works fine. I want to get a second opinion on the UI though - exposing the reason in a tooltip you have to mouse-over to seee feels too hidden to me. Can you include a screenshot of what it looks like for reference? (you've already included one)

src/olympia/devhub/tests/test_views_submit.py Outdated Show resolved Hide resolved
src/olympia/devhub/tests/test_views_submit.py Outdated Show resolved Hide resolved
src/olympia/devhub/tests/test_views_submit.py Outdated Show resolved Hide resolved
@eviljeff
Copy link
Member

@diox you requested the changes in your PR review - was this what you intended? I'm not sure a tooltip you have to hover to expose is obvious enough?

@diox
Copy link
Member

diox commented Oct 30, 2024

I'm no UX/Product person but I think it should be a bit more obvious. My idea was to prevent submissions while at the same time still showing a page that looks somewhat normal, because the error page you otherwise get from the decorator is a bit too generic/empty (it's good as a fallback for anyone trying to bypass the more user-friendly error).

@chrstinalin
Copy link
Contributor Author

@diox My initial fear with directly putting the reason on the page is if the reason is longer than usual (which may not happen) and possibly look weird.

Though IIRC there's somewhere in DevHub that use a banner-style information section, which might work better? I can't seem to find it, though.

@diox
Copy link
Member

diox commented Oct 30, 2024

Search for site-notice (it displays the content of the zadmin.models.Config named site_notice which can be set in the admin)

src/olympia/devhub/views.py Outdated Show resolved Hide resolved
src/olympia/devhub/views.py Outdated Show resolved Hide resolved
@chrstinalin chrstinalin merged commit 7375f1e into mozilla:master Oct 31, 2024
31 checks passed
@chrstinalin chrstinalin removed the request for review from eviljeff October 31, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Submissions Waffle Flag Follow-up
4 participants