Skip to content

Commit 08700e1

Browse files
authored
Fix grouping of subscription elements (#114)
* Fix grouping of subscription elements
1 parent 20c287a commit 08700e1

File tree

1 file changed

+76
-74
lines changed

1 file changed

+76
-74
lines changed

src/main/resources/templates/subscription.html

Lines changed: 76 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ <h3 class="modal-title text-center" id="formHeader">Subscription Form</h3>
8787
<div id="ViewModelDOMObject" class="form-body">
8888

8989
<div class="form-group">
90-
<label class="pl-1 control-label font-weight-bold">Load Subscription Template (Examples)</label>
90+
<label class="h5 pl-1 control-label font-weight-bold">Load Subscription Template (Examples)</label>
9191
<div>
9292
<select class="w-100" id="selectTemplate"
9393
data-bind="options: subscription_templates_in,
@@ -100,7 +100,7 @@ <h3 class="modal-title text-center" id="formHeader">Subscription Form</h3>
100100

101101
<!-- ko foreach: subscription -->
102102
<div class="form-group">
103-
<label class="pl-1 control-label font-weight-bold">SubscriptionName</label>
103+
<label class="h5 pl-1 control-label font-weight-bold">SubscriptionName</label>
104104
<div>
105105
<!-- text injected from subscription.js -->
106106
<span class="text-danger font-small" id="invalidSubscriptionName"></span>
@@ -127,82 +127,84 @@ <h3 class="modal-title text-center" id="formHeader">Subscription Form</h3>
127127
</div>
128128
</div>
129129
-->
130-
<div class="form-group">
131-
<label class="pl-1 control-label font-weight-bold">NotificationType</label>
132-
<img class="cursor-pointer" id="notificationTypeInfo" alt="NotificationType Info" src="assets/images/information.png" data-toggle="tooltip" data-placement="top"
130+
131+
<div class="p-1 border form-group">
132+
<div class="form-group">
133+
<label class="h5 pl-1 control-label font-weight-bold">NotificationType</label>
134+
<img class="cursor-pointer" id="notificationTypeInfo" alt="NotificationType Info" src="assets/images/information.png" data-toggle="tooltip" data-placement="top"
133135
title="This is the notification method used when the subscription is triggered."/>
134136

135137
<!-- Rest or Mail radio buttons -->
136-
<div id="notificationTypeRadio" data-bind="foreach: $root.notificationType_in" >
137-
<label>
138-
<input type="radio" name="restOrMailGroup" data-bind="
138+
<div id="notificationTypeRadio" data-bind="foreach: $root.notificationType_in" >
139+
<label>
140+
<input type="radio" name="restOrMailGroup" data-bind="
139141
attr: {value: value, id: id}, checked: $parent.notificationType, onChange" />
140-
<span data-bind="text: label"></span>
141-
</label>
142+
<span data-bind="text: label"></span>
143+
</label>
144+
</div>
142145
</div>
143-
</div>
144-
145-
<div class="form-group" data-bind="visible: $data.notificationType() == 'REST_POST'">
146-
<label class="pl-1 control-label font-weight-bold">RestPostMediaType</label>
147-
<img class="cursor-pointer popup-large" id="restPostMediaTypeInfo" alt="RestPostMediaType Info" src="assets/images/information.png" data-toggle="tooltip" data-placement="top"
146+
<div class="form-group" data-bind="visible: $data.notificationType() == 'REST_POST'">
147+
<label class="h5 pl-1 control-label font-weight-bold">RestPostMediaType</label>
148+
<img class="cursor-pointer popup-large" id="restPostMediaTypeInfo" alt="RestPostMediaType Info" src="assets/images/information.png" data-toggle="tooltip" data-placement="top"
148149
title=
149150
"This decides the Content-Type of the POST body. <br>
150151
Default is: <br>
151152
RAW BODY: JSON (application/json) <br>
152153
You may select: <br>
153154
FORM/POST Parameters (application/x-www-form-urlencoded)" />
154155

155-
<!-- Form post radio buttons -->
156-
<div data-bind="foreach: $root.restPostBodyMediaType_in" >
156+
<!-- Form post radio buttons -->
157+
<div data-bind="foreach: $root.restPostBodyMediaType_in" >
157158
<label>
158159
<input type="radio" name="restPostBodyMediaTypeGroup" data-bind="
159160
attr: {value: value, id: id}, checked: $parent.restPostBodyMediaType, onChange" />
160161
<span data-bind="text: label"></span>
161-
</label>
162-
</div>
163-
</div>
164-
165-
<div class="p-1 border form-group">
166-
<label class="control-label font-weight-bold">NotificationMessage</label>
167-
<div>
168-
<span class="text-danger font-small" id="noNotificationKeyOrValue"></span>
169-
</div>
170-
<div>
171-
<span class="text-danger font-small" id="notificationMessageKeyValuesArrayToLarge"></span>
172-
</div>
173-
<div>
174-
<span class="text-danger font-small" id="keyInNotificationMessage"></span>
175-
</div>
176-
<div>
177-
<span class="text-danger font-small" id="noNotificationMessage"></span>
178-
</div>
179-
<!-- Table for FORM/POST Parameters (application/x-www-form-urlencoded) -->
180-
<table width="100%" data-bind="visible: $root.formpostkeyvaluepairs()">
181-
<thead>
182-
<tr>
183-
<th width="20%">Key</th>
184-
<th width="80%">Value</th>
185-
</tr>
186-
</thead>
187-
<tbody data-bind="foreach: notificationMessageKeyValues">
188-
<tr>
189-
<td valign="top">
190-
<input data-bind="textInput:$data.formkey, onChange" name="formkey" placeholder="Key" class="form-control"
162+
</label>
163+
</div>
164+
</div>
165+
166+
<label class="h5 control-label font-weight-bold">NotificationMessage</label>
167+
<div>
168+
<span class="text-danger font-small" id="noNotificationKeyOrValue"></span>
169+
</div>
170+
<div>
171+
<span class="text-danger font-small" id="notificationMessageKeyValuesArrayToLarge"></span>
172+
</div>
173+
<div>
174+
<span class="text-danger font-small" id="keyInNotificationMessage"></span>
175+
</div>
176+
<div>
177+
<span class="text-danger font-small" id="noNotificationMessage"></span>
178+
</div>
179+
<!-- Table for FORM/POST Parameters (application/x-www-form-urlencoded) -->
180+
<table width="100%" data-bind="visible: $root.formpostkeyvaluepairs()">
181+
<thead>
182+
<tr>
183+
<th width="20%">Key</th>
184+
<th width="80%">Value</th>
185+
</tr>
186+
</thead>
187+
<tbody data-bind="foreach: notificationMessageKeyValues">
188+
<tr>
189+
<td valign="top">
190+
<input data-bind="textInput:$data.formkey, onChange" name="formkey" placeholder="Key" class="form-control"
191+
>>>>>>> 12cfe8e... Fix grouping of subscription elements
191192
type="text" />
192-
</td>
193-
<td>
194-
<textarea data-bind="textInput:$data.formvalue, onChange" name="formvalue"
193+
</td>
194+
<td>
195+
<textarea data-bind="textInput:$data.formvalue, onChange" name="formvalue"
195196
placeholder="Value" class="form-control" type="text"></textarea>
196-
</td>
197-
<td data-bind="if: $root.subscription()[0].notificationMessageKeyValues().length > 1" valign="top" >
198-
<button data-bind="click: function(data, event) {$root.delete_NotificationMsgKeyValuePair(data, event, $index());}"
197+
</td>
198+
<td data-bind="if: $root.subscription()[0].notificationMessageKeyValues().length > 1" valign="top" >
199+
<button data-bind="click: function(data, event) {$root.delete_NotificationMsgKeyValuePair(data, event, $index());}"
199200
class="btn btn-danger float-rightmr-1 mr-1 mt-1 d-inline-block">
200-
<i class="fa fa-fw fa-trash"></i>
201-
</button>
202-
</td>
203-
</tr>
204-
</tbody>
201+
<i class="fa fa-fw fa-trash"></i>
202+
</button>
203+
</td>
204+
</tr>
205+
</tbody>
205206
</table>
207+
206208
<!-- Button for FORM/POST Parameters (application/x-www-form-urlencoded) -->
207209
<div data-bind="if: $root.formpostkeyvaluepairs() && $root.restPost()" class="pt-1 d-flex justify-content-end">
208210
<button id="kvID" data-bind="click: $root.addNotificationMsgKeyValuePair" class="btn btn-success mr-1 mt-1 d-inline-block">
@@ -226,11 +228,24 @@ <h3 class="modal-title text-center" id="formHeader">Subscription Form</h3>
226228
</tr>
227229
</tbody>
228230
</table>
231+
232+
<!-- NOTIFICATION META -->
233+
<div class="form-group">
234+
<label class="h5 pl-1 control-label font-weight-bold">NotificationMeta</label>
235+
<img class="cursor-pointer" id="notificationMetaInfo" alt="NotificationMeta Info" src="assets/images/information.png" data-toggle="tooltip" data-placement="top"
236+
title="The specific point to notify. Example: my@mail.com or host.com/endpoint"/>
237+
<div>
238+
<span class="text-danger font-small" id="invalidNotificationMeta"></span>
239+
<textarea id="notificationMeta" data-bind="textInput:$data.notificationMeta, onChange"
240+
name="notificationMeta" placeholder="notificationMeta" class="form-control" type="text"></textarea>
241+
<span class="help-block"></span>
242+
</div>
243+
</div>
229244
</div>
230245

231246
<!-- AUTHENTICATION -->
232247
<div class="pt-3 form-group">
233-
<label class="pl-1 control-label font-weight-bold">Authorization</label>
248+
<label class="h5 pl-1 control-label font-weight-bold">Authorization</label>
234249
<div>
235250
<select id="selectAuth" title="Choose an authentication type" data-bind="options: $root.authenticationType_in,
236251
optionsText: 'text', optionsValue: 'value', value: authenticationType">
@@ -262,7 +277,7 @@ <h3 class="modal-title text-center" id="formHeader">Subscription Form</h3>
262277
</div>
263278

264279
<div class="pt-3 form-group">
265-
<label class="pl-1 control-label font-weight-bold">Repeat</label>
280+
<label class="h5 pl-1 control-label font-weight-bold">Repeat</label>
266281
<img class="cursor-pointer" id="repeatInfo" alt="Repeat Info" src="assets/images/information.png" data-toggle="tooltip" data-placement="top"
267282
title="Instructs whether the subscription should be re-triggered for new additions to the aggregated object. If false only first time the conditions are fulfilled
268283
a notification will be triggered. No matter how many times the aggregated object is updated."/>
@@ -276,19 +291,6 @@ <h3 class="modal-title text-center" id="formHeader">Subscription Form</h3>
276291
</div>
277292
</div>
278293

279-
<!-- NOTIFICATION META -->
280-
<div class="form-group">
281-
<label class="pl-1 control-label font-weight-bold">NotificationMeta</label>
282-
<img class="cursor-pointer" id="notificationMetaInfo" alt="NotificationMeta Info" src="assets/images/information.png" data-toggle="tooltip" data-placement="top"
283-
title="The specific point to notify. Example: my@mail.com or host.com/endpoint"/>
284-
<div>
285-
<span class="text-danger font-small" id="invalidNotificationMeta"></span>
286-
<textarea id="notificationMeta" data-bind="textInput:$data.notificationMeta, onChange"
287-
name="notificationMeta" placeholder="notificationMeta" class="form-control" type="text"></textarea>
288-
<span class="help-block"></span>
289-
</div>
290-
</div>
291-
292294
<!-- REQUIREMENTS -->
293295
<!-- ko foreach: { data: requirements, as: 'requirements_item' } -->
294296
<div class="pl-0 ml-0">
@@ -299,7 +301,7 @@ <h5>OR</h5>
299301
title="Info: 'AND' is used between Conditions in Requirement groups, and 'OR' is used between Requirement groups."/>
300302
</div>
301303
<div class="p-1 border form-group">
302-
<label class="control-label font-weight-bold">Requirement</label>
304+
<label class="h5 control-label font-weight-bold">Requirement</label>
303305
<div id="requirementID">
304306

305307
<!-- ko foreach: requirements_item.conditions -->

0 commit comments

Comments
 (0)