Skip to content

Commit 719683a

Browse files
Fix to content stretching beyond screen space (#95)
* CSS fixes * Small fix * Small fix * Fix to elements that fail test * Remove deprecated attribute styles * Replace deprecated font tag. * Make sure all error texts get hidden on modal close. * Fix error message problem * Removed unnecessary media rule
1 parent c188f4f commit 719683a

File tree

8 files changed

+65
-59
lines changed

8 files changed

+65
-59
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[]
1+
[]

src/main/resources/static/css/style.css

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
html, body {
2+
height: 100%;
3+
}
4+
body {
5+
overflow: hidden;
6+
padding-top: 60px;
7+
}
8+
.content-wrapper {
9+
height: 100%;
10+
}
11+
#table {
12+
cellspacing: 0px;
13+
}
114
.modal-subscription {
215
max-width: 650px;
316
}
@@ -92,6 +105,16 @@
92105
.showPasswordButton{
93106
margin-top: 10px;
94107
}
108+
.font-small {
109+
font-size: small;
110+
}
111+
.font-medium {
112+
font-size: medium;
113+
}
114+
.hide {
115+
position: absolute;
116+
left: -999em;
117+
}
95118
/* Safari */
96119
@-webkit-keyframes spin {
97120
0% { -webkit-transform: rotate(0deg); }
@@ -102,16 +125,10 @@
102125
100% { transform: rotate(360deg); }
103126
}
104127
@media (max-width: 576px) {
128+
body {
129+
padding-top: 80px;
130+
}
105131
.container {
106132
max-width: 480px;
107133
}
108-
}
109-
body {
110-
padding-top: 60px;
111-
overflow: scroll !important;
112-
}
113-
@media (max-width: 576px) {
114-
body {
115-
padding-top: 80px;
116-
}
117-
}
134+
}

src/main/resources/static/js/subscription.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,9 @@ jQuery(document).ready(function () {
683683
$('#modal_form').on('shown.bs.modal', function() {
684684
loadTooltip();
685685
});
686+
$('#modal_form').on('hidden.bs.modal', function() {
687+
$('.text-danger').hide();
688+
});
686689
}
687690
}
688691

@@ -709,7 +712,7 @@ jQuery(document).ready(function () {
709712
notificationMessageKeyValuesArray[0].formkey = ""; // OBS must be empty when NOT using REST POST Form key/value pairs
710713
}
711714

712-
$('.addSubscriptionErrors').hide();
715+
$('.text-danger').hide();
713716
//START: Make sure all datatables field has a value
714717
var subscriptionName = String(vm.subscription()[0].subscriptionName());
715718
// Validate SubscriptionName field

src/main/resources/templates/add-instances.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<meta name="author" content=""/>
99
</head>
1010
<body class="bg-dark">
11-
<div class="hidden" style="display: none" id="frontendServiceUrl" th:text="${frontendServiceUrl}"></div>
1211
<div class="d-flex justify-content-center ml-3 mr-3">
1312
<div class="card card-standard">
1413
<div class="card-header">Add backend instance</div>

src/main/resources/templates/index.html

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@
88
<meta name="description" content="" />
99
<meta name="author" content="" />
1010

11-
<title>Eiffel Intelligence</title>
12-
<!-- Bootstrap core CSS-->
1311
<link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
14-
<!-- Page level plugin CSS-->
1512
<link href="assets/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
16-
<!-- Custom styles for this template-->
1713
<link href="assets/datatables/dataTables.bootstrap4.css" rel="stylesheet" />
1814
<link href="assets/datatables/responsive.dataTables.min.css" rel="stylesheet" />
1915
<link href="css/sb-admin.css" rel="stylesheet" />
@@ -23,11 +19,13 @@
2319
<link href="assets/jquery-ui/jquery-ui.min.css" rel="stylesheet"/>
2420
<link href="css/errMsg.css" rel="stylesheet"/>
2521
<link href="css/style.css" rel="stylesheet" />
22+
23+
<title>Eiffel Intelligence</title>
2624
</head>
2725

2826
<body class="bg-dark" id="page-top">
29-
<div class="hidden" style="display: none" id="eiffelDocumentationUrlLinks" th:text="${eiffelDocumentationUrlLinks}"></div>
30-
<div class="hidden" style="display: none" id="frontendServiceUrl" th:text="${frontendServiceUrl}"></div>
27+
<div class="d-none" id="eiffelDocumentationUrlLinks" th:text="${eiffelDocumentationUrlLinks}"></div>
28+
<div class="d-none" id="frontendServiceUrl" th:text="${frontendServiceUrl}"></div>
3129
<!-- Navigation-->
3230
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top" id="mainNav">
3331
<a class="navbar-brand" th:href="${frontendServiceUrl}">
@@ -156,7 +154,6 @@ <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
156154
<script type="text/javascript" src="assets/datatables/jquery.dataTables.js"></script>
157155
<script type="text/javascript" src="assets/datatables/dataTables.bootstrap4.js"></script>
158156
<script type="text/javascript" src="assets/datatables/dataTables.responsive.min.js"></script>
159-
160157
<script type="text/javascript" src="assets/knockout/knockout-3.4.2.js"></script>
161158
<script type="text/javascript" src="assets/knockout/knockout.mapping.js"></script>
162159
<script type="text/javascript" src="assets/jquery-ui/jquery-ui.min.js"></script>
@@ -165,13 +162,10 @@ <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
165162
<script type="text/javascript" src="assets/jgrowl/jquery.jgrowl.min.js"></script>
166163
<script type="text/javascript" src="assets/dateformat/date.format.js"></script>
167164
<script type="text/javascript" src="assets/jsonlint/jsonlint.js"></script>
168-
169165
<script type="text/javascript" src="assets/bootstrap/js/popper.min.js"></script>
170166
<script type="text/javascript" src="assets/bootstrap/js/bootstrap.bundle.min.js"></script>
171-
172167
<script type="text/javascript" src="assets/js/sb-admin.min.js"></script>
173168
<script type="text/javascript" src="assets/js/sb-admin-datatables.min.js"></script>
174-
175169
<script type="text/javascript" src="js/main.js"></script>
176170
<script type="text/javascript" src="js/errorMessages.js"></script>
177171
</body>

src/main/resources/templates/subscription.html

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,13 @@
88
<meta name="description" content="" />
99
<meta name="author" content="" />
1010

11-
<link href="css/style.css" rel="stylesheet" />
11+
<script type="text/javascript" src="resources/subscription_templates.js"></script>
1212

1313
<title>Eiffel Intelligence Subscription Handling</title>
1414
</head>
1515

1616
<body>
17-
18-
<div class="hidden" id="frontendServiceUrl" style="display: none" th:text="${frontendServiceUrl}"></div>
19-
<div class="hidden" id="subscriptionTemplate" style="display: none" th:text="${subscriptionTemplate}"></div>
20-
21-
<script type="text/javascript" src="resources/subscription_templates.js"></script>
22-
17+
<div class="d-none" id="subscriptionTemplate" th:text="${subscriptionTemplate}"></div>
2318
<div class="d-flex">
2419
<div class="col-md-9 col-8">
2520
<h3>Eiffel Intelligence Subscription Handling</h3>
@@ -54,7 +49,7 @@ <h3 id="subData">Subscription Data</h3>
5449
<button id="uploadSubscription" class="mt-1 btn btn-info upload_subscriptions show_if_authorized">
5550
<i class="glyphicon glyphicon-upload"></i>Upload Subscriptions
5651
</button>
57-
<input class="hidden" type='file' id='upload_sub' name='file' style="position: absolute; left: -999em;" />
52+
<input class="hide" type='file' id='upload_sub' name='file'/>
5853
</div>
5954
<div class="pb-1 col-12 loadingAnimation">
6055
<!-- This div is the animated loading indicator -->
@@ -64,7 +59,7 @@ <h3 id="subData">Subscription Data</h3>
6459

6560
<!-- Datatable -->
6661

67-
<div class="pl-2 pr-2">
62+
<div class="pl-2 pr-2 pb-3">
6863
<table id="table" class="table table-bordered" width="100%" cellspacing="0"></table>
6964
</div>
7065

@@ -89,7 +84,7 @@ <h3 class="modal-title text-center" id="formHeader">Subscription Form</h3>
8984
<div class="form-group">
9085
<label class="pl-1 control-label font-weight-bold">Load Subscription Template (Examples)</label>
9186
<div>
92-
<select style="width: 100%" id="selectTemplate"
87+
<select class="w-100" id="selectTemplate"
9388
data-bind="options: subscription_templates_in,
9489
optionsText: 'text',
9590
optionsValue: 'value',
@@ -104,8 +99,8 @@ <h3 class="modal-title text-center" id="formHeader">Subscription Form</h3>
10499
<label class="pl-1 control-label font-weight-bold">SubscriptionName</label>
105100
<div>
106101
<!-- text injected from subscription.js -->
107-
<font class="addSubscriptionErrors" id="invalidLetters" color="red" size="2" />
108-
<font class="addSubscriptionErrors" id="noNameGiven" color="red" size="2" />
102+
<span class="text-danger font-small" id="invalidLetters"></span>
103+
<span class="text-danger font-small" id="noNameGiven"></span>
109104

110105
<input id="subscriptionNameInput" data-bind="textInput:$data.subscriptionName"
111106
name="subscriptionName" placeholder="subscriptionName" class="form-control display-inline-table" type="text"/>
@@ -138,7 +133,7 @@ <h3 class="modal-title text-center" id="formHeader">Subscription Form</h3>
138133
optionsValue: 'value',
139134
value: $data.notificationType,
140135
optionsCaption: 'Choose...'"></select>
141-
<font class="addSubscriptionErrors" id="notificationTypeNotSet" color="red" size="2" />
136+
<span class="text-danger font-small" id="notificationTypeNotSet"></span>
142137
</div>
143138
</div>
144139

@@ -147,7 +142,7 @@ <h3 class="modal-title text-center" id="formHeader">Subscription Form</h3>
147142
<img class="cursor-pointer" id="restPostMediaTypeInfo" alt="RestPostMediaType Info" src="assets/images/information.png"
148143
title="This decides the Content-Type of the POST body."/>
149144
<div>
150-
<select style="width: 100%" data-bind="options: $root.restPostBodyType_in,
145+
<select class="w-100" data-bind="options: $root.restPostBodyType_in,
151146
optionsText: 'text',
152147
optionsValue: 'value',
153148
value: $data.restPostBodyMediaType,
@@ -158,16 +153,16 @@ <h3 class="modal-title text-center" id="formHeader">Subscription Form</h3>
158153
<div class="p-1 border border-primary form-group">
159154
<label class="control-label font-weight-bold">NotificationMessage</label>
160155
<div>
161-
<font class="addSubscriptionErrors" id="noNotificationKeyOrValue" color="red" size="2" />
156+
<span class="text-danger font-small" id="noNotificationKeyOrValue"></span>
162157
</div>
163158
<div>
164-
<font class="addSubscriptionErrors" id="notificationMessageKeyValuesArrayToLarge" color="red" size="2" />
159+
<span class="text-danger font-small" id="notificationMessageKeyValuesArrayToLarge"></span>
165160
</div>
166161
<div>
167-
<font class="addSubscriptionErrors" id="keyInNotificationMessage" color="red" size="2" />
162+
<span class="text-danger font-small" id="keyInNotificationMessage"></span>
168163
</div>
169164
<div>
170-
<font class="addSubscriptionErrors" id="noNotificationMessage" color="red" size="2" />
165+
<span class="text-danger font-small" id="noNotificationMessage"></span>
171166
</div>
172167
<table width="100%">
173168
<thead>
@@ -248,7 +243,7 @@ <h3 class="modal-title text-center" id="formHeader">Subscription Form</h3>
248243
optionsText: $data.repeat(),
249244
value: $data.repeat,
250245
optionsCaption: 'Choose...'"></select>
251-
<font class="addSubscriptionErrors" id="repeatNotSet" color="red" size="2" />
246+
<span class="text-danger font-small" id="repeatNotSet"></span>
252247
<span class="help-block"></span>
253248
</div>
254249
</div>
@@ -257,7 +252,7 @@ <h3 class="modal-title text-center" id="formHeader">Subscription Form</h3>
257252
<img class="cursor-pointer" id="notificationMetaInfo" alt="NotificationMeta Info" src="assets/images/information.png"
258253
title="The specific point to notify. Example: my@mail.com or host.com/endpoint"/>
259254
<div>
260-
<font class="addSubscriptionErrors" id="noNotificationMetaGiven" color="red" size="2" />
255+
<span class="text-danger font-small" id="noNotificationMetaGiven"></span>
261256
<textarea id="metaData" data-bind="textInput:$data.notificationMeta"
262257
name="notificationMeta" placeholder="notificationMeta" class="form-control" type="text"></textarea>
263258
<span class="help-block"></span>
@@ -280,13 +275,13 @@ <h5>OR</h5>
280275
<!-- ko foreach: requirements_item.conditions -->
281276
<div id="conditionID">
282277
<!-- ko if: $index() !== 0 -->
283-
<h5 style="display:inline">AND</h5>
278+
<h5 class="d-inline">AND</h5>
284279
<!-- /ko -->
285280
<label class="control-label font-weight-bold">Condition</label>
286281

287282
<!-- ko ifnot: $data.jmespath() -->
288-
<div>
289-
<font class="addSubscriptionErrors emptyCondition" color="red" size="2" />
283+
<div >
284+
<span class="text-danger font-small emptyCondition"></span>
290285
</div>
291286
<!-- /ko -->
292287

@@ -321,8 +316,8 @@ <h5 style="display:inline">AND</h5>
321316
</form>
322317
</div>
323318
<div class="modal-footer">
324-
<font class="addSubscriptionErrors" id="errorExists" color="red" size="3" />
325-
<font class="addSubscriptionErrors" id="serverError" color="red" size="3" />
319+
<span class="text-danger font-medium" id="errorExists"></span>
320+
<span class="text-danger font-medium" id="serverError"></span>
326321
<button type="button" id="btnSave" class="btn btn-primary save_record">
327322
Save
328323
</button>

src/main/resources/templates/switch-backend.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
<meta name="author" content=""/>
99
</head>
1010
<body class="bg-dark">
11-
<div class="hidden" style="display: none" id="frontendServiceUrl" th:text="${frontendServiceUrl}"></div>
12-
<div class="d-flex justify-content-center ml-3 mr-3">
11+
<div class="d-flex justify-content-center ml-3 mr-3 pb-3">
1312
<div class="card">
1413
<div class="card-header">Switch backend</div>
1514
<div class="card-body" id="instancesModel">
@@ -28,14 +27,14 @@
2827
</thead>
2928
<tbody data-bind="foreach: instances">
3029
<tr>
31-
<td align="center"><input align="center" name="activate" type="radio"
30+
<td class="text-center"><input name="activate" type="radio"
3231
data-bind="checked: active, checkedValue: true, click: $parent.checked, attr: { id: 'SelectBackendInstance' + $index()}"/></td>
3332
<td data-bind="text: name, attr: { id: 'BackendInstance' + $index() + 'Name'}"></td>
3433
<td data-bind="text: host"></td>
3534
<td data-bind="text: port"></td>
3635
<td data-bind="text: path"></td>
37-
<td align="center"><input type="checkbox" disabled="disabled" data-bind="checked: https"/></td>
38-
<td align="center"><a href="#" data-bind="click: $parent.removeInstance, attr: { id: 'removeBtn' + $index()}">Remove</a></td>
36+
<td class="text-center"><input type="checkbox" disabled="disabled" data-bind="checked: https"/></td>
37+
<td class="text-center"><a href="#" data-bind="click: $parent.removeInstance, attr: { id: 'removeBtn' + $index()}">Remove</a></td>
3938
</tr>
4039
</tbody>
4140
</table>

src/main/resources/templates/testRules.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,19 @@
1212
</head>
1313

1414
<body>
15-
<div class="hidden" id="frontendServiceUrl" style="display: none" th:text="${frontendServiceUrl}"></div>
16-
<div class="container pull-left" id="testRule" style="max-width: 100%; max-height: 100%">
17-
<div align="center">
15+
<div class="container mw-100 pb-3" id="testRule">
16+
<div class="text-center">
1817
<h1 id="test_rules_header">Test Rules</h1>
1918
</div>
20-
<div class="row" style="max-height: 950; padding: 10px">
19+
<div class="row px-3">
2120
<div class="p-1 col-lg-6 col-md-6 col-12 border border-right border-success" id="testRulesDOMObject">
2221
<div class="d-flex flex-wrap">
2322
<div class="col-11">
2423
<button class="btn btn-primary upload_rules rule-button mr-1 mt-1 d-inline-block">
2524
Upload Rules
2625
<i class="fa fa-fw fa-upload"></i>
2726
</button>
28-
<input class="hidden" type='file' id='uploadRulesFile' name='file' style="position: absolute; left: -999em;" />
27+
<input class="hide" type='file' id='uploadRulesFile' name='file'/>
2928
<button class="btn btn-primary download_rules_template rule-button mr-1 mt-1 d-inline-block">
3029
Get Template
3130
<i class="fa fa-fw fa-download"></i>
@@ -66,7 +65,7 @@ <h6>
6665
Upload Events
6766
<i class="fa fa-fw fa-upload"></i>
6867
</button>
69-
<input class="hidden" type='file' id='uploadEventsFile' name='file' style="position: absolute; left: -999em;" />
68+
<input class="hide" type='file' id='uploadEventsFile' name='file'/>
7069
<button class="btn btn-primary download_events_template rule-button mr-1 mt-1 d-inline-block">
7170
Get Template
7271
<i class="fa fa-fw fa-download"></i>

0 commit comments

Comments
 (0)