inferno_core 0.6.17 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/inferno/apps/cli/execute.rb +1 -1
- data/lib/inferno/apps/cli/templates/.rubocop.yml +2 -2
- data/lib/inferno/apps/cli/templates/lib/%library_name%/example_suite.rb.tt +0 -1
- data/lib/inferno/apps/cli/templates/spec/%library_name%/patient_group_spec.rb.tt +11 -10
- data/lib/inferno/apps/web/controllers/test_runs/create.rb +1 -1
- data/lib/inferno/apps/web/controllers/test_session_form_post_controller.rb +32 -1
- data/lib/inferno/apps/web/controllers/test_sessions/client_show.rb +1 -1
- data/lib/inferno/apps/web/router.rb +30 -3
- data/lib/inferno/apps/web/serializers/requirements_filtering_extractor.rb +17 -0
- data/lib/inferno/apps/web/serializers/test.rb +2 -1
- data/lib/inferno/apps/web/serializers/test_group.rb +7 -3
- data/lib/inferno/apps/web/serializers/test_session.rb +12 -2
- data/lib/inferno/apps/web/serializers/test_suite.rb +9 -6
- data/lib/inferno/apps/web/templates/test_kit.html.erb +316 -0
- data/lib/inferno/entities/test_kit.rb +4 -0
- data/lib/inferno/public/bundle.js +34 -34
- data/lib/inferno/public/bundle.js.LICENSE.txt +1 -1
- data/lib/inferno/repositories/test_kits.rb +11 -0
- data/lib/inferno/utils/persist_inputs.rb +4 -4
- data/lib/inferno/version.rb +1 -1
- metadata +33 -3
- /data/lib/inferno/apps/web/{index.html.erb → templates/client_index.html.erb} +0 -0
@@ -0,0 +1,316 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<!-- Required meta tags -->
|
5
|
+
<meta charset="utf-8">
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
7
|
+
|
8
|
+
<!-- Bootstrap CSS -->
|
9
|
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
10
|
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<!-- Local styles -->
|
13
|
+
<link rel="stylesheet" href="<%= Inferno::Application['public_path'] %>/common.css?v=<%= Inferno::VERSION %>">
|
14
|
+
|
15
|
+
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
16
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
17
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.9.3/umd/popper.min.js"></script>
|
18
|
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js"></script>
|
19
|
+
|
20
|
+
<!-- Internal scripts -->
|
21
|
+
<script src="<%= Inferno::Application['public_path'] %>/common.js?v=<%= Inferno::VERSION %>"></script>
|
22
|
+
<script src="<%= Inferno::Application['public_path'] %>/session.js?v=<%= Inferno::VERSION %>"></script>
|
23
|
+
<script src="<%= Inferno::Application['public_path'] %>/test_kits.js?v=<%= Inferno::VERSION %>"></script>
|
24
|
+
|
25
|
+
<title><%= test_kit.title %></title>
|
26
|
+
</head>
|
27
|
+
<body data-spy="scroll" data-target="#toc">
|
28
|
+
<div class="flex-wrapper">
|
29
|
+
<div>
|
30
|
+
<div class="container-fluid">
|
31
|
+
<h1 class="mt-4 mb-1"><%= test_kit.title %></h1>
|
32
|
+
<div class="col-8 date-version-header">
|
33
|
+
<% if test_kit.last_updated %>
|
34
|
+
<time datetime="<%= DateTime.parse(test_kit.last_updated).strftime('%m/%d/%Y') %>" class="last-updated">
|
35
|
+
<b>Last Updated:</b> <%= DateTime.parse(test_kit.last_updated).strftime('%B %-d, %Y') %>
|
36
|
+
</time>
|
37
|
+
<% end %>
|
38
|
+
<% if test_kit.version %>
|
39
|
+
<div class="version"><b>Test Kit Version:</b> <%= test_kit.version %></div>
|
40
|
+
<% end %>
|
41
|
+
<% if test_kit.maturity %>
|
42
|
+
<div class="maturity"><b>Maturity:</b> <%= test_kit.maturity %>
|
43
|
+
<a href="#" data-bs-toggle="modal" data-bs-target="#maturity-info-modal" title="About Maturity"><i
|
44
|
+
class="bi bi-question-circle"></i></a>
|
45
|
+
</div>
|
46
|
+
<% end %>
|
47
|
+
</div>
|
48
|
+
<div>
|
49
|
+
<% if test_kit.tags.present? %>
|
50
|
+
<div class="tags mb-4">
|
51
|
+
<% test_kit.tags.each do |tag| %>
|
52
|
+
<div class="tag"><%= tag %></div>
|
53
|
+
<% end %>
|
54
|
+
</div>
|
55
|
+
<% end %>
|
56
|
+
</div>
|
57
|
+
<div class="row">
|
58
|
+
<div id="left-column">
|
59
|
+
<%= Kramdown::Document.new(test_kit.description, input: 'GFM', hard_wrap: false).to_html %>
|
60
|
+
<% if Inferno::Repositories::TestKits.all.length > 1 %>
|
61
|
+
<% if test_kit == Inferno::Repositories::TestKits.new.local_test_kit %>
|
62
|
+
<h2>Imported Test Kits</h2>
|
63
|
+
<p><%= test_kit.title %> depends on the following imported test kits.</p>
|
64
|
+
<% else %>
|
65
|
+
<h2>Other Test Kits</h2>
|
66
|
+
<% end %>
|
67
|
+
<ul>
|
68
|
+
<% (Inferno::Repositories::TestKits.all - [test_kit]).each do |other_test_kit| %>
|
69
|
+
<li><a href="<%= other_test_kit.url_fragment %>"><%= other_test_kit.title %></a></li>
|
70
|
+
<% end %>
|
71
|
+
</ul>
|
72
|
+
<% end %>
|
73
|
+
</div>
|
74
|
+
<div id="right-column">
|
75
|
+
<div class="form-container">
|
76
|
+
<form id="start-testing-form">
|
77
|
+
<h2 class="text-center fw-normal text-muted">Options</h2>
|
78
|
+
<fieldset class="mb-3" <% if test_kit.suites.blank? || test_kit.suites.length < 2 %>style="display:none" <% end %>>
|
79
|
+
<legend class="form-title fs-6">Test Suite</legend>
|
80
|
+
<% test_kit.suites.each_with_index do |suite, index| %>
|
81
|
+
<div class="form-check">
|
82
|
+
<% if index.zero? %>
|
83
|
+
<input class="form-check-input" type="radio" name="suite" id="<%= suite.id %>" value="<%= suite.id %>"
|
84
|
+
checked>
|
85
|
+
<% else %>
|
86
|
+
<input class="form-check-input" type="radio" name="suite" id="<%= suite.id %>" value="<%= suite.id %>">
|
87
|
+
<% end %>
|
88
|
+
<label class="form-check-label" for="<%= suite.id %>">
|
89
|
+
<%= suite.title %>
|
90
|
+
</label>
|
91
|
+
</div>
|
92
|
+
<% end %>
|
93
|
+
</fieldset>
|
94
|
+
<!-- TODO -->
|
95
|
+
<% test_kit.suites.each do |suite| %>
|
96
|
+
<% suite.suite_options.each do |option| %>
|
97
|
+
<fieldset class="option-group mb-3" style="display: none"
|
98
|
+
data-option-group-for-suites="<%= suite.id %>">
|
99
|
+
<legend class="form-title fs-6"><%= option.title %></legend>
|
100
|
+
<% option.list_options.each_with_index do |list_option, option_index| %>
|
101
|
+
<div class="form-check">
|
102
|
+
<% if option_index.zero? || list_option[:value] == option.default %>
|
103
|
+
<input
|
104
|
+
class="form-check-input"
|
105
|
+
type="radio"
|
106
|
+
name="<%= option.id %>"
|
107
|
+
id="<%= "#{suite.id}-#{list_option[:value]}" %>"
|
108
|
+
value="<%= list_option[:value] %>"
|
109
|
+
checked
|
110
|
+
data-default="true">
|
111
|
+
<% else %>
|
112
|
+
<input
|
113
|
+
class="form-check-input"
|
114
|
+
type="radio"
|
115
|
+
name="<%= option.id %>"
|
116
|
+
id="<%= "#{suite.id}-#{list_option[:value]}" %>"
|
117
|
+
value="<%= list_option[:value] %>"
|
118
|
+
>
|
119
|
+
<% end %>
|
120
|
+
<label class="form-check-label" for="<%= "#{suite.id}-#{list_option[:value]}" %>">
|
121
|
+
<%= list_option[:label] %>
|
122
|
+
</label>
|
123
|
+
</div>
|
124
|
+
<% end %>
|
125
|
+
</fieldset>
|
126
|
+
<% end %>
|
127
|
+
<% end %>
|
128
|
+
|
129
|
+
<!-- Submit Button -->
|
130
|
+
<a class="btn btn-primary start-testing-button w-100" id="start-testing-button">
|
131
|
+
Start Testing
|
132
|
+
</a>
|
133
|
+
</form>
|
134
|
+
</div>
|
135
|
+
</div>
|
136
|
+
</div>
|
137
|
+
</div>
|
138
|
+
|
139
|
+
<div class="modal fade" id="maturity-info-modal" tabindex="-1" aria-labelledby="maturity-info-modal-label" aria-hidden="true">
|
140
|
+
<div class="modal-dialog modal-dialog-centered">
|
141
|
+
<div class="modal-content">
|
142
|
+
<div class="modal-header">
|
143
|
+
<h5 class="modal-title" id="maturity-info-modal-label">About Test Kit Maturity</h5>
|
144
|
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
145
|
+
</div>
|
146
|
+
<div class="modal-body">
|
147
|
+
<p>
|
148
|
+
Test Kits are broadly grouped into three levels of maturity:
|
149
|
+
<strong>High</strong>, <strong>Moderate</strong>, and
|
150
|
+
<strong>Low</strong>. This is intended to provide guidance to users
|
151
|
+
on the level of confidence they should place in the accuracy and
|
152
|
+
completeness of these tests.
|
153
|
+
</p>
|
154
|
+
<p>
|
155
|
+
<strong>High</strong> maturity Test Kits typically have been
|
156
|
+
used to test many different systems against a stable specification
|
157
|
+
that has limited ambiguity.
|
158
|
+
</p>
|
159
|
+
<p>
|
160
|
+
<strong>Moderate</strong> and <strong>Low</strong> maturity Test Kits typically have
|
161
|
+
not had widespread usage and/or are targeting less mature
|
162
|
+
specifications that contain ambiguous or conflicting information.
|
163
|
+
These Test Kits are still of value to implementers, but they should be
|
164
|
+
aware of potential issues and are encouraged to contact the team with
|
165
|
+
problems as they arise.
|
166
|
+
</p>
|
167
|
+
</div>
|
168
|
+
<div class="modal-footer">
|
169
|
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
170
|
+
</div>
|
171
|
+
</div>
|
172
|
+
</div>
|
173
|
+
</div>
|
174
|
+
|
175
|
+
<script>
|
176
|
+
// Hook up the start testing button with the function
|
177
|
+
$('#start-testing-button').click(() => {
|
178
|
+
createSession();
|
179
|
+
});
|
180
|
+
|
181
|
+
// Handle hiding/unhiding the options depending on which suite is selected
|
182
|
+
// Note that if there is only 1 suite, it won't show up for users
|
183
|
+
// but it is still there.
|
184
|
+
// Also force triggering this on load so if initial suite select has
|
185
|
+
// options, those get opened.
|
186
|
+
// And finally, if a suites share the same option names, as is common for
|
187
|
+
// multiple versions of suites, this will auto-select the default option when
|
188
|
+
// switching between suites.
|
189
|
+
|
190
|
+
$('#start-testing-form input[type=radio][name=suite]').change(function () {
|
191
|
+
const newSuite = this.value;
|
192
|
+
|
193
|
+
$("#start-testing-form .option-group").css("display", "none");
|
194
|
+
|
195
|
+
$("#start-testing-form .option-group").filter((index, el) => {
|
196
|
+
const forSuites = $(el).data('option-group-for-suites');
|
197
|
+
return forSuites.length === 0 || forSuites.split(",").indexOf(newSuite) > -1;
|
198
|
+
|
199
|
+
}).css("display", "").find('input[data-default="true"]').prop('checked', true);
|
200
|
+
|
201
|
+
}).filter(":checked").trigger('change');
|
202
|
+
|
203
|
+
/* Full page vs narrow page styles */
|
204
|
+
const leftColumn = document.getElementById('left-column');
|
205
|
+
const rightColumn = document.getElementById('right-column');
|
206
|
+
|
207
|
+
const updateStyles = () => {
|
208
|
+
let fullView = window.innerWidth >= 500; // narrow view width threshold
|
209
|
+
|
210
|
+
if (fullView) {
|
211
|
+
leftColumn.classList.add('col-8');
|
212
|
+
rightColumn.classList.add('col-4');
|
213
|
+
|
214
|
+
leftColumn.classList.remove('second');
|
215
|
+
rightColumn.classList.remove('first');
|
216
|
+
} else {
|
217
|
+
leftColumn.classList.remove('col-8');
|
218
|
+
rightColumn.classList.remove('col-4');
|
219
|
+
|
220
|
+
leftColumn.classList.add('second');
|
221
|
+
rightColumn.classList.add('first');
|
222
|
+
}
|
223
|
+
};
|
224
|
+
|
225
|
+
// Debounce resize listener
|
226
|
+
let timeout = false; // holder for timeout id
|
227
|
+
let delay = 200; // delay after event is "complete" to run callback
|
228
|
+
|
229
|
+
addEventListener('resize', (event) => {
|
230
|
+
// clear the timeout
|
231
|
+
clearTimeout(timeout);
|
232
|
+
// start timing for event "completion"
|
233
|
+
timeout = setTimeout(updateStyles, delay);
|
234
|
+
});
|
235
|
+
|
236
|
+
updateStyles();
|
237
|
+
</script>
|
238
|
+
|
239
|
+
<style>
|
240
|
+
.first {
|
241
|
+
order: 1;
|
242
|
+
}
|
243
|
+
|
244
|
+
.second {
|
245
|
+
order: 2;
|
246
|
+
}
|
247
|
+
|
248
|
+
.form-container {
|
249
|
+
border: 1px solid #e0e0e0;
|
250
|
+
border-radius: 10px;
|
251
|
+
padding: 10px 20px 20px;
|
252
|
+
/* Reduced top padding from 20px to 10px */
|
253
|
+
}
|
254
|
+
|
255
|
+
.form-title {
|
256
|
+
font-size: 1.25rem;
|
257
|
+
font-weight: 500;
|
258
|
+
color: #777;
|
259
|
+
margin-bottom: 10px;
|
260
|
+
}
|
261
|
+
|
262
|
+
.tag {
|
263
|
+
font-size: 0.9rem;
|
264
|
+
margin-right: 10px;
|
265
|
+
padding: 2px 5px;
|
266
|
+
background-color: #f2f2f2;
|
267
|
+
border-radius: 4px;
|
268
|
+
display: inline-block;
|
269
|
+
}
|
270
|
+
|
271
|
+
.date-version-header {
|
272
|
+
display: flex;
|
273
|
+
justify-content: space-between;
|
274
|
+
flex-wrap: wrap;
|
275
|
+
font-style: italic;
|
276
|
+
padding-bottom: 10px;
|
277
|
+
}
|
278
|
+
|
279
|
+
.flex-wrapper {
|
280
|
+
display: flex;
|
281
|
+
min-height: 100vh;
|
282
|
+
flex-direction: column;
|
283
|
+
justify-content: space-between;
|
284
|
+
}
|
285
|
+
|
286
|
+
.btn-primary {
|
287
|
+
background-color: rgb(247, 122, 37);
|
288
|
+
border: none;
|
289
|
+
border-radius: 4px;
|
290
|
+
box-shador: rgba(0, 0, 0, 0.2) 0px 2px 4px -1px, rgba(0, 0, 0, 0.14) 0px 4px 5px 0px, rgba(0, 0, 0, 0.12) 0px 1px 10px 0px;
|
291
|
+
color: white;
|
292
|
+
outline-style: none;
|
293
|
+
text-transform: uppercase;
|
294
|
+
}
|
295
|
+
|
296
|
+
.btn-primary:hover {
|
297
|
+
background-color: rgb(172, 85, 25);
|
298
|
+
}
|
299
|
+
|
300
|
+
.btn-primary:active {
|
301
|
+
background-color: rgb(172, 85, 25);
|
302
|
+
}
|
303
|
+
|
304
|
+
.btn-primary:focus {
|
305
|
+
background-color: rgb(247, 122, 37);
|
306
|
+
}
|
307
|
+
|
308
|
+
.form-check-input:checked {
|
309
|
+
border-color: rgb(247, 122, 37);
|
310
|
+
background-color: rgb(247, 122, 37);
|
311
|
+
}
|
312
|
+
</style>
|
313
|
+
</div>
|
314
|
+
</div>
|
315
|
+
</body>
|
316
|
+
</html>
|