Skip to content

Commit bea60f8

Browse files
author
ppinette
committed
[dsfr-ui] fix componentId arg to dsfr-button-submit
1 parent dd9963b commit bea60f8

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

vertigo-ui/src/main/resources/io/vertigo/ui/components/dsfr/buttons/dsfr-button-submit.html

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,25 @@
1818

1919
<th:block th:fragment="dsfr-button-submit-confirm(label, icon, action, componentId, title, loading, titleMessage, confirmMessage, labelOk, labelCancel, modal_attrs, other_attrs)"
2020
th:assert="(${label} != null or (${icon} != null and ${title} != null)) and ${action} != null and ${componentId} != null"
21-
th:with="myComponentId='${componentId}',
22-
myLabelOk=${labelOk?:'Oui'},
21+
th:with="myLabelOk=${labelOk?:'Oui'},
2322
myLabelCancel=${labelCancel?:'Non'},
2423
myLoading=${loading}?:true"
25-
th:attr="objectKey=${model.vContext['componentStates'].addComponentState(myComponentId).addPrimitive('confirm',false)}">
24+
th:attr="objectKey=${model.vContext['componentStates'].addComponentState(componentId).addPrimitive('confirm',false)}">
2625

2726
<dsfr-button th:icon="${icon?:''}"
2827
th::icon-only="${label==null}"
2928
th:label="${label?:''}"
3029
th:title="${vTitle==null ? (title?:'') : ''}"
3130
th::title="${vTitle?:''}"
32-
th:@click="|componentStates.${myComponentId}.confirm = true|"
33-
th:ref="${myComponentId}"
31+
th:@click="|componentStates.__${componentId}__.confirm = true|"
32+
th:ref="__${componentId}__"
3433
type="button"
3534
th:attr="__${other_attrs}__">
3635
<span class="sr-only" th:if="${label==null && vTitle==null}" vu:text="${title?:''}"></span>
3736
<span class="sr-only" th:if="${label==null && vTitle!=null}" th:text="|{{ ${vTitle?:''} }}|"></span>
3837
</dsfr-button>
39-
<dsfr-modal th:v-model:opened="|componentStates.${myComponentId}.confirm|"
40-
th:@close="|componentStates.${myComponentId}.confirm = false|"
38+
<dsfr-modal th:v-model:opened="|componentStates.__${componentId}__.confirm|"
39+
th:@close="|componentStates.__${componentId}__.confirm = false|"
4140
th:title="${titleMessage}"
4241
th::actions="|[
4342
{label: '${myLabelOk}',
@@ -48,9 +47,9 @@
4847
{label: '${myLabelCancel}',
4948
type: 'button',
5049
secondary: true,
51-
onClick () { componentStates.${myComponentId}.confirm = false }
50+
onClick () { componentStates.__${componentId}__.confirm = false }
5251
}]|"
53-
th::origin="|$refs.${myComponentId}|"
52+
th::origin="|$refs.__${componentId}__|"
5453
th:attr="__${modal_attrs}__">
5554
<template #default>
5655
<vu:content>

vertigo-ui/src/test/resources/testWebApp/WEB-INF/views/data/componentsDemoDsfr.html

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ <h6>Test grid</h6>
6363
<h6>Global</h6>
6464
<vu:dsfr-grid cols="3" class="fr-grid-row--gutters">
6565

66-
<vu:dsfr-text-field :class="{ disabled: true && false || false }" readonly="true" object="movie" field="movId"/>
66+
<vu:dsfr-text-field :class="{ disabled: true && false || false }" readonly="true" object="movie"
67+
field="movId"/>
6768
<th:block th:with="readonly=true">
6869
<vu:dsfr-text-field object="movie" field="title" emptyValue="Non renseignée"/>
6970
</th:block>
@@ -134,12 +135,15 @@ <h6>Global</h6>
134135
C’est une super modale
135136
</p>
136137
</vu:dsfr-dialog>
137-
<dsfr-button @click="componentStates.dialog.opened = true" label="Ouvre-moi" secondary type="button"></dsfr-button>
138+
<dsfr-button @click="componentStates.dialog.opened = true" label="Ouvre-moi" secondary
139+
type="button"></dsfr-button>
138140

139141
<h2>Tooltip</h2>
140142

141143
<vu:dsfr-grid-cell class="q-gutter-md">
142-
<dsfr-button-tooltip @click="componentStates.dialog.opened = true" label="Ouvre-moi" secondary type="button">Ouvre la modale juste normal tqt</dsfr-button-tooltip>
144+
<dsfr-button-tooltip @click="componentStates.dialog.opened = true" label="Ouvre-moi" secondary
145+
type="button">Ouvre la modale juste normal tqt
146+
</dsfr-button-tooltip>
143147

144148
<dsfr-button icon="fr-icon-arrow-right-line" icon-only></dsfr-button>
145149
<dsfr-button-tooltip icon="fr-icon-arrow-right-line" icon-only>Icône seulement</dsfr-button-tooltip>
@@ -151,10 +155,12 @@ <h2>Tooltip</h2>
151155
<dsfr-link th:href="@{/}" size="sm">Petit lien</dsfr-link>
152156
<dsfr-link th:href="@{/}" as-button size="sm">Petit lien</dsfr-link>
153157
<dsfr-link-tooltip th:href="@{/}" label="Ceci est un lien">Lien</dsfr-link-tooltip>
154-
<dsfr-link-tooltip as-button tertiary th:href="@{/}" label="Ceci est un lien">Bouton (lien)</dsfr-link-tooltip>
158+
<dsfr-link-tooltip as-button tertiary th:href="@{/}" label="Ceci est un lien">Bouton (lien)
159+
</dsfr-link-tooltip>
155160

156161
<p>
157-
Lorem ipsum doleret <dsfr-link-tooltip inline th:href="@{/}" label="ispum demso">ipsum demso</dsfr-link-tooltip>
162+
Lorem ipsum doleret
163+
<dsfr-link-tooltip inline th:href="@{/}" label="ispum demso">ipsum demso</dsfr-link-tooltip>
158164
</p>
159165

160166
<dsfr-link th:href="@{/dossier/eleve/candidatures/}" as-button secondary disabled>
@@ -238,6 +244,11 @@ <h2>Tooltip</h2>
238244
</div>
239245
</div>
240246

247+
<vu:dsfr-button-submit-confirm componentId="com"
248+
confirmMessage="Coucou la confirmation"
249+
action="@{/}"
250+
label="Bouton de confirmation"/>
251+
241252

242253
</vu:form>
243254

0 commit comments

Comments
 (0)