Skip to content

Commit add0d50

Browse files
authored
[JENKINS-71145] warn when leaving with unsaved changes (#293)
2 parents c3a03c6 + a0abc1b commit add0d50

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

src/main/resources/com/michelin/cio/hudson/plugins/rolestrategy/RoleStrategyConfig/assign-roles.jelly

+2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
<h1>
8888
${it.assignRolesName}
8989
</h1>
90+
<button class="default-hidden" id="rs-dirty-indicator"/>
9091

9192
<f:section title="${%Global roles}">
9293
<f:rowSet name="globalRoles">
@@ -110,6 +111,7 @@
110111
</f:bottomButtonBar>
111112
</l:isAdmin>
112113
</f:form>
114+
<st:adjunct includes="lib.form.confirm" />
113115
</l:main-panel>
114116
</l:layout>
115117
</j:jelly>

src/main/resources/com/michelin/cio/hudson/plugins/rolestrategy/RoleStrategyConfig/index.jelly

+2
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
<h1>
110110
${it.manageRolesName}
111111
</h1>
112+
<button class="default-hidden" id="rs-dirty-indicator"/>
112113

113114
<f:section title="${%Global roles}">
114115
<f:rowSet name="globalRoles">
@@ -142,6 +143,7 @@
142143
</div>
143144
</section>
144145
<div class="overlay default-hidden"/>
146+
<st:adjunct includes="lib.form.confirm" />
145147
</l:main-panel>
146148
</l:layout>
147149
</j:jelly>

src/main/webapp/js/tableAssign.js

+2
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ Behaviour.specify(".global-matrix-authorization-strategy-table A.remove", 'RoleB
162162
if (parent.children.length < footerLimit) {
163163
table.tFoot.style.display = "none";
164164
}
165+
let dirtyButton = document.getElementById("rs-dirty-indicator");
166+
dirtyButton.dispatchEvent(new Event('click'));
165167
return false;
166168
}
167169
});

src/main/webapp/js/tableManage.js

+2
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ Behaviour.specify(".global-matrix-authorization-strategy-table A.remove", 'RoleB
275275
if (parent.children.length < footerLimit) {
276276
table.tFoot.style.display = "none";
277277
}
278+
let dirtyButton = document.getElementById("rs-dirty-indicator");
279+
dirtyButton.dispatchEvent(new Event('click'));
278280
return false;
279281
}
280282
});

0 commit comments

Comments
 (0)