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

Label destructive 'Dismiss' buttons red #7364

Merged
merged 1 commit into from
Nov 14, 2022

Conversation

NotMyFault
Copy link
Member

@NotMyFault NotMyFault commented Nov 11, 2022

This PR intends to distinguish better between primary buttons' with positive and negative operations. Dismissing warnings silences them forever. Making the button red draws more attention to it, like buttons used in other views themed red for irreversible actions.
Additionally, this gets a rid of multiple primary buttons with different, non-primary, tasks for the same notification window.

Testing done

Before:
Screenshot 2022-11-11 at 23 17 30

After:
Screenshot 2022-11-12 at 10 44 29

Proposed changelog entries

  • Label 'Dismiss' buttons red.

Proposed upgrade guidelines

N/A

Submitter checklist

  • The Jira issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples).
    • Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • New or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@mention

Maintainer checklist

Before the changes are marked as ready-for-merge:

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

@NotMyFault NotMyFault added web-ui The PR includes WebUI changes which may need special expertise rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted labels Nov 11, 2022
@NotMyFault NotMyFault requested a review from a team November 11, 2022 22:26
@janfaracik
Copy link
Contributor

I definitely like the separation between the buttons +1
I do wonder though if the use of a primary button for dismissing a notification is too prominent and as a result might draw too much attention to itself? Perhaps it'd look better if it wasn't using the '--primary' modifier - any thoughts?

@NotMyFault
Copy link
Member Author

Perhaps it'd look better if it wasn't using the '--primary' modifier - any thoughts?

Good call, it does indeed, most notably by dropping the primary effect.

Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

lgtm, would be good if the UI for this was more standardised by default rather than all this copy and paste (well out of scope of this though)

any downstream PRs need filing for plugins?

@NotMyFault
Copy link
Member Author

any downstream PRs need filing for plugins?

I'm currently not aware of plugins out of my mind, but if I spot some, I'll happily propose upgrade PRs, as always.

@basil
Copy link
Member

basil commented Nov 12, 2022

https://github.com/search?ref=simplesearch&type=code&q=user%3Ajenkinsci+%22submit+value%3D%5C%22%24%7B%25Dismiss%7D%5C%22%22

Needs downstream PRs in active-directory-plugin and role-strategy-plugin

@basil
Copy link
Member

basil commented Nov 12, 2022

Not a complete list either:

~/src/jenkinsci $ rg -l 'submit .* value=".*Dismiss' | sort -u
dimensionsscm-plugin/src/main/resources/hudson/plugins/dimensionsscm/MissingJarsAdministrativeMonitor/message.jelly
ec2-plugin/src/main/resources/hudson/plugins/ec2/ssh/verifiers/SshHostKeyVerificationAdministrativeMonitor/message.jelly
ec2-plugin/src/main/resources/hudson/plugins/ec2/win/SelfSignedCertificateAllowedMonitor/message.jelly
localization-support-plugin/src/main/resources/io/jenkins/plugins/localization/support/LocalizationMonitor/message.jelly
matrix-auth-plugin/src/main/resources/org/jenkinsci/plugins/matrixauth/AmbiguityMonitor/message.jelly
opentelemetry-plugin/src/main/resources/io/jenkins/plugins/opentelemetry/administrativemonitor/ElasticBackendDashboardNotEnabledAdministrativeMonitor/message.jelly
opentelemetry-plugin/src/main/resources/io/jenkins/plugins/opentelemetry/administrativemonitor/ElasticBackendKibanaBaseUrlNotSetAdministrativeMonitor/message.jelly
opentelemetry-plugin/src/main/resources/io/jenkins/plugins/opentelemetry/administrativemonitor/ObservabilityBackendCheckAdministrativeMonitor/message.jelly
pipeline-maven-plugin/jenkins-plugin/src/main/resources/org/jenkinsci/plugins/pipeline/maven/NonProductionGradeDatabaseWarningAdministrativeMonitor/message.jelly

@NotMyFault
Copy link
Member Author

https://github.com/search?ref=simplesearch&type=code&q=user%3Ajenkinsci+%22submit+value%3D%5C%22%24%7B%25Dismiss%7D%5C%22%22

Needs downstream PRs in active-directory-plugin and role-strategy-plugin

The only repository I can submit a PR to would be opentelemetry, all other ones have an ancient baseline from years ago, which do not support the concept of jenkins-buttons at all. They rely on the default design for everything.

@timja
Copy link
Member

timja commented Nov 12, 2022

The only repository I can submit a PR to would be opentelemetry, all other ones have an ancient baseline from years ago, which do not support the concept of jenkins-buttons at all. They rely on the default design for everything.

It's just adding these attributes isn't it?

primary="false" clazz="jenkins-!-destructive-color"

If they aren't supported on those baselines they'll just be ignored.
IDEs will flag a warning but it won't cause any actual harm

and users on newer versions will get the benefits

@NotMyFault NotMyFault requested a review from a team November 12, 2022 22:15
Copy link
Member

@basil basil left a comment

Choose a reason for hiding this comment

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

This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback. Please see the merge process documentation for more information about the merge process. Thanks!

@basil basil added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Nov 13, 2022
@NotMyFault NotMyFault removed the request for review from a team November 13, 2022 22:28
@NotMyFault NotMyFault merged commit cf42eb7 into jenkinsci:master Nov 14, 2022
@NotMyFault NotMyFault deleted the red-dismiss branch November 15, 2022 14:45
@basil
Copy link
Member

basil commented Nov 21, 2022

Causes JENKINS-70128.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted web-ui The PR includes WebUI changes which may need special expertise
Projects
None yet
4 participants