Skip to content

Commit 9d57953

Browse files
gregturnodrotbohm
authored andcommitted
DATAREST-941 - Modify existing browser.html
Instead of replacing the HAL Browser's browser.html, take the existing one and alter it inside the build job. This ensures that future updates don't break so horribly. Related to mikekelly/hal-browser#89 which will provide an explicit token to match, instead of using the closing `</body>` tag.
1 parent 262a2a1 commit 9d57953

File tree

2 files changed

+46
-288
lines changed
  • spring-data-rest-hal-browser

2 files changed

+46
-288
lines changed

spring-data-rest-hal-browser/pom.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,52 @@
108108
<copy todir="${project.build.outputDirectory}/META-INF/spring-data-rest/hal-browser/vendor/js">
109109
<fileset dir="${project.build.directory}/json-editor/META-INF/resources/webjars/json-editor/${json-editor.version}" />
110110
</copy>
111+
<copy file="${project.build.outputDirectory}/META-INF/spring-data-rest/hal-browser/browser.html"
112+
tofile="${project.build.outputDirectory}/META-INF/spring-data-rest/hal-browser/index.html" />
113+
<replace file="${project.build.outputDirectory}/META-INF/spring-data-rest/hal-browser/index.html">
114+
<replacefilter>
115+
<replacetoken><![CDATA[</body>]]></replacetoken>
116+
<replacevalue><![CDATA[
117+
<script id="dynamic-request-template" type="text/template">
118+
<div class="modal-header">
119+
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
120+
<h3>Create/Update</h3>
121+
</div>
122+
123+
<form class="non-safe" action="<%= href %>">
124+
<div class="modal-body" style="padding-top: 0px">
125+
<div id="jsoneditor"></div>
126+
127+
<div class="well well-small" style="padding-bottom: 0px;">
128+
<div class="container-fluid">
129+
<div class="row-fluid">
130+
<div class="control-group">
131+
<label class="control-label" style="display: inline-block; font-weight: bold;">Action:</label>
132+
<input name="method" type="text" class="method controls" style="width: 98%" value="POST" />
133+
<input name="url" type="text" class="url controls" style="width: 98%" value="<%= href %>" />
134+
</div>
135+
</div>
136+
</div>
137+
</div>
138+
</div>
139+
<div class="modal-footer">
140+
<button type="submit" class="btn btn-primary">Make Request</button>
141+
</div>
142+
</form>
143+
</script>
144+
145+
<script src="vendor/js/jsoneditor.js"></script>
146+
<script src="js/CustomPostForm.js"></script>
147+
148+
</body>]]></replacevalue>
149+
</replacefilter>
150+
</replace>
151+
<replace file="${project.build.outputDirectory}/META-INF/spring-data-rest/hal-browser/index.html">
152+
<replacefilter>
153+
<replacetoken>The HAL Browser</replacetoken>
154+
<replacevalue>The HAL Browser (for Spring Data REST)</replacevalue>
155+
</replacefilter>
156+
</replace>
111157
<delete file="${project.build.outputDirectory}/META-INF/spring-data-rest/hal-browser/browser.html" />
112158
</target>
113159
</configuration>

spring-data-rest-hal-browser/src/main/resources/META-INF/spring-data-rest/hal-browser/index.html

Lines changed: 0 additions & 288 deletions
This file was deleted.

0 commit comments

Comments
 (0)