Skip to content

Conversation

kp77
Copy link
Contributor

@kp77 kp77 commented Oct 1, 2025

No description provided.

Copy link

github-actions bot commented Oct 1, 2025

🚀 Deployed on https://preview-693--oelibrary.netlify.app

@github-actions github-actions bot temporarily deployed to pull request October 1, 2025 09:26 Inactive
{% if _with_body_wrapper %}
</div>
{% endif %}
{{- _toast.custom_content|default('') -}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@github-actions github-actions bot temporarily deployed to pull request October 1, 2025 15:16 Inactive
@kp77 kp77 changed the title UCPKN-3880: Pass attributes to toast elements, add custom content. UCPKN-3880: Pass attributes to modal and toast sections. Oct 9, 2025
@github-actions github-actions bot temporarily deployed to pull request October 9, 2025 07:11 Inactive
{
role: "alert",
aria_live: "assertive",
with_close: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we add another test without close?

Copy link
Collaborator

Choose a reason for hiding this comment

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

you can use the same data, but overwritting in test like this:
render({ ...demoData, with_close: false }),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test added.

with_close: true,
header: "Toast title",
header_attributes: new drupalAttribute().addClass("test-class"),
button_attributes: new drupalAttribute().addClass("test-class"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I've updated in another pr the drupalAttributes package and when that pr is going to be merged we will need to change to DrupalAttribute from drupalAttribute.. I will take care of it, no worries

<div{{ _body_attributes.addClass(['toast-body']) }}>
{{- _body -}}
</div>
{% if _with_body_wrapper %}
Copy link
Collaborator

@tibi2303 tibi2303 Oct 10, 2025

Choose a reason for hiding this comment

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

I think we didnt approach correctly these toasts in the first version and now with your changes, it becomes even more complex.. I think we can simplify it but I need to think of the impact
I dont like: _body_wrapper_classes _with_body_wrapper parameters and by removing them we would have a more simple template. We can leave it like this for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I was also wondering about the body wrapper (there's no mention of that in the Bootstrap docs).

{% set button_attributes = create_attribute()
{% set _button_attributes = _button_attributes
.addClass(['btn-close'])
.setAttribute('aria-label', 'close')
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would change this as if _button_attributes has aria-label attribute it would be overwritten by this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed it, also made the label capitalized 'Close', because that's the convention in other components (alert, modal).

@tibi2303
Copy link
Collaborator

Thanks @kp77 for this, 2 small points to update:

  1. One more test
  2. Aria label attribute

@github-actions github-actions bot temporarily deployed to pull request October 10, 2025 14:24 Inactive
@kp77
Copy link
Contributor Author

kp77 commented Oct 10, 2025

Thanks @kp77 for this, 2 small points to update:

  1. One more test
  2. Aria label attribute

Thanks for the review @tibi2303,

I pushed the requested changes, please check.

@github-actions github-actions bot temporarily deployed to pull request October 10, 2025 14:34 Inactive
@github-actions github-actions bot temporarily deployed to pull request October 20, 2025 10:12 Inactive
@tibi2303 tibi2303 merged commit df87b00 into development Oct 20, 2025
7 checks passed
@tibi2303 tibi2303 deleted the UCPKN-3880 branch October 20, 2025 10:33
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.

2 participants