-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Primerize all backend flashes #16789
Conversation
b752561
to
1d073a7
Compare
6f85e04
to
d962123
Compare
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.
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.
Congrats 👏 It really cleans things up!
I have some minor remarks, and also a bit of confusion. For one, I'm not sure to understand the difference between flash and toast now. Is toast for angular only now?
def expect_primerized_flash(message:, type: :success, wait: 20) | ||
expected_css = expected_flash_css(type) | ||
expect(page).to have_css(expected_css, text: message, wait:) | ||
end |
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.
Another comment about #expect_primerized_flash
. That's something that already bugged me with #expect_toast
: I don't like that type: :success
is assumed when using this helper. I think that if the type is not specified, then it should not be checked. I see that :default
value will not make any assumption about the type. I think this should be the default value.
If a shorter version of #expect_primerized_flash(message:, type: :success)
is needed, then we can introduce a #expect_primerized_success_flash(message:)
like we already do for errors.
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.
I agree, but this should be a separate PR, it will break a lot of tests and will be easier to fix that way
expect(page).to have_css(".op-toast.-info", text: I18n.t("js.ifc_models.empty_warning")) | ||
show_default_page.expect_toast(type: :info, message: I18n.t("js.ifc_models.empty_warning")) |
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.
So toasts are still a thing? I'm not sure I get the difference between a flash and a toast. I thought everything was a flash now (rendered as a banner).
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.
The op-toast classes are still used by angular
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.
Not sure if we want to clarify this in the examples? I just removed the primerized implementation detail, so not sure what to do with the angular part. As we will likely only remove toast expects, not add to them - maybe do nothing about it for now?
modules/budgets/spec/features/budgets/attachment_upload_spec.rb
Outdated
Show resolved
Hide resolved
the list can not be rendered within primer
Co-authored-by: Christophe Bliard <[email protected]>
c72c542
to
f480a56
Compare
f480a56
to
4c66b7d
Compare
4c66b7d
to
cd2d0f0
Compare
Ticket
https://community.openproject.org/work_packages/58003
What are you trying to accomplish?
Render all Rails flashes using the OpPrimer::FlashComponent now that it's possible