-
Notifications
You must be signed in to change notification settings - Fork 1
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
[#60588] Implement Danger Dialog warning variant, without second step confirmation #234
Conversation
🦋 Changeset detectedLatest commit: af6ae73 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Changes preview to use `primer_form_with` and an example `DeletionForm`. This provides a more realistic example of an advanced integration with form builders.
(tldr: not to be confused with `within`) Only other assertions should be called within `&optional_filter_block`: this filter block is passed to `Capybara::SelectorQuery`, which resets the wait time to 0 before calling it. Actions such as `fill_in` may rely on a longer wait time - this is the case in particular for our overriden `fill_in` (see `System::TestCase`), which executes the Axe accessibility testing engine asynchronously after a text field is filled in.
eab7b13
to
2214d56
Compare
Applies `display: contents` style to `danger-dialog-form-helper`, which makes the custom element behave as if it doesn't exist in the DOM structure, passing all styles directly to its children. This makes `scrollable-region` behaves correcly, which in turn ensures the dialog behaves the same as `Primer::Alpha::Dialog` with regards to scrolling.
5e8a646
to
10e03e7
Compare
Changes the default confirm button text from "Delete permanently" to the less-destructive "Delete".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job @myabc 👍 Thanks for also fixing the documentation and the scrolling issue 🙇 Good to merge once the CI is green
What are you trying to accomplish?
Implementation of Danger Dialog, a generalised dialog for "potentially dangerous" actions such as item deletion.
There are two variants:
Screenshots
Integration
All references in calling code to
DangerConfirmationDialog
will need to be updated toDangerDialog
.Callers will need to update the class name and consider which behaviour they wish to present to the end user. The confirmation variant behaviour is enabled by defining a
confirmation_check_box
slot.List the issues that this change affects.
https://community.openproject.org/wp/60588
Risk Assessment
What approach did you choose and why?
The fewest code changes necessary.
Anything you want to highlight for special attention from reviewers?
In summary this PR:
DangerConfirmationDialog
toDangerDialog
.confirmation_check_box
slot optional. If this slot is not provided, the confirmation button is always enabled.This PR also
Accessibility
Removing the check box control from
scrollable-region
uncovered a Axe violation (in Firefox only). This was fixed in commit 10e03e7.Merge checklist