- Issue created by @YannDecelle
- Issue was unassigned.
- Status changed to Needs review
8 months ago 4:46pm 21 March 2024 - Status changed to Needs work
8 months ago 2:19pm 22 March 2024 - 🇫🇷France pdureau Paris
so, you decided to keep 3 options in
dismissible: type: select label: Dismissible? description: It’s possible to dismiss any notice inline. options: "": No core: Using dsfr custom: Custom
And use only one in the Twig:
<button{% if dismissible == 'core' %} onclick="const notice = this.parentNode; notice.parentNode.removeChild(notice);" {% endif %} class="fr-btn fr-btn--close" title="{{ close_title }}">{{ close_title }}</button>
It doesn't look right...
- 🇫🇷France pdureau Paris
I may have understood why it is also like that in
alert
component:- https://git.drupalcode.org/project/ui_suite_dsfr/-/blob/1.0.x/templates/...
- https://git.drupalcode.org/project/ui_suite_dsfr/-/blob/1.0.x/templates/...
- if dismissible is false: no button.
- if dismissible == "custom" : a button, without the event, so the sub-theme need to provide its own event.
- if dismissible == "core" : a button, with the onclick event from DSFR.
So, the twig snippet make sense:
{% if dismissible %} {% set close_title = close_title|default('Close'|t) %} <button{% if dismissible == 'core' %} onclick="const alert = this.parentNode; alert.parentNode.removeChild(alert);"{% endif %} class="fr-btn fr-btn--close" title="{{ close_title }}">{{ close_title }}</button> {% endif %}
Maybe there is something to do in both
alert
andnotice
component to make this clearer:Do we rename the options label?
And/or do we revamp a bit the Twig implementation?
And/or do we move some logic to button component?I would be glad to have a talk before any implementation.
Moved to beta6 in case a breaking change is done to
alert
. Let's add ⚠️ to the ticket title if we do the change. - 🇫🇷France pdureau Paris
Also, closing the notice keep the component wrapper. Let's fix that.
- Status changed to Fixed
8 months ago 4:24pm 28 March 2024 - 🇫🇷France pdureau Paris
Checked with Yassine.
Do we rename the options label?
We moved to boolean prop
And/or do we revamp a bit the Twig implementation?
Indeed, because of boolean prop
And/or do we move some logic to button component?
No, because we noticed than the onlcik event is different from alert to notice.
Do we change also alert component?
No, too risky.
-
pdureau →
committed 468a6626 on 1.0.x authored by
YannDecelle →
Issue #3432796 by pdureau, YannDecelle, yassrzg: Add missing notice...
-
pdureau →
committed 468a6626 on 1.0.x authored by
YannDecelle →
Automatically closed - issue fixed for 2 weeks with no activity.