Skip to content

Commit 555545b

Browse files
authored
Merge pull request #1966 from all-of-us/sn/hpro-1875/update-aou-order-finalize-bs5
2 parents 519192d + 5670daa commit 555545b

10 files changed

+79
-41
lines changed

src/Form/OrderType.php

+13-3
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
131131
'model_timezone' => 'UTC',
132132
'constraints' => $constraints,
133133
'attr' => [
134-
'autocomplete' => 'off'
134+
'autocomplete' => 'off',
135+
'class' => 'form-control-sm'
135136
]
136137
]);
137138
}
@@ -209,9 +210,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
209210
'value' => $constraintDateTime,
210211
'message' => 'Timestamp cannot be in the future'
211212
])
213+
],
214+
'attr' => [
215+
'autocomplete' => 'off'
212216
]
213217
],
214-
'required' => false
218+
'required' => false,
215219
]);
216220
// Display centrifuge type for kit orders only
217221
if ($options['order']->getType() === 'kit') {
@@ -267,10 +271,16 @@ public function buildForm(FormBuilderInterface $builder, array $options)
267271
'disabled' => $disabled,
268272
'invalid_message' => 'Tracking numbers must match.',
269273
'first_options' => [
270-
'label' => 'FedEx or UPS tracking number'
274+
'label' => 'FedEx or UPS tracking number',
275+
'attr' => [
276+
'class' => 'form-control-sm'
277+
]
271278
],
272279
'second_options' => [
273280
'label' => 'Verify tracking number',
281+
'attr' => [
282+
'class' => 'form-control-sm'
283+
]
274284
],
275285
'required' => false,
276286
'error_mapping' => [

templates/order/collect.html.twig

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
{% block title %}Collect - Order {{ order.orderId }} - {% endblock %}
88
{% block bodycontainer %}container-fluid{% endblock %}
99
{% block body %}
10+
{% form_theme collectForm 'custom_bootstrap_5_layout.html.twig' %}
1011
{% include 'order/header.html.twig' with { active: 'collect' } %}
11-
{{ form_start(collectForm, { attr: { class: 'warn-unsaved disable-enter prevent-resubmit' } }) }}
12+
{{ form_start(collectForm, { attr: { class: 'warn-unsaved disable-enter prevent-resubmit aou-order-form' } }) }}
1213
{% if updatedTubes == true %}
1314
<input type="hidden" hidden="hidden" id="tubesChanged" name="tubesChanged" value="true">
1415
{% endif %}

templates/order/create.html.twig

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{% block title %}Order Create - {% endblock %}
66
{% block bodycontainer %}container-fluid{% endblock %}
77
{% block body %}
8+
{% form_theme createForm 'custom_bootstrap_5_layout.html.twig' %}
89
<div class="page-header mb-4 border-bottom">
910
<h2>
1011
<i class="fa fa-medkit" aria-hidden="true"></i>
@@ -29,11 +30,11 @@
2930
<br />
3031

3132
<div id="createOrder">
32-
{{ form_start(createForm, { attr: { class: 'warn-unsaved disable-enter prevent-resubmit' } }) }}
33+
{{ form_start(createForm, { attr: { class: 'warn-unsaved disable-enter prevent-resubmit aou-order-form' } }) }}
3334
{{ form_errors(createForm) }}
3435
<div class="row row-equal-height">
3536
{% if app.session.get('orderType') == 'hpo' and not isPediatricOrder %}
36-
<div class="col-sm-6 col-md-6 {% if app.session.get('siteType') == 'dv' %} col-sm-offset-3 col-md-offset-3 {% endif %}">
37+
<div class="col-sm-6 col-md-6 {% if app.session.get('siteType') == 'dv' %} offset-sm-3 offset-md-3 {% endif %}">
3738
<div class="card">
3839
<div class="card-header">
3940
<h5 class="card-title text-center">HPO Biobank Order</h5>
@@ -89,7 +90,7 @@
8990
</div>
9091
{% endif %}
9192
{% if app.session.get('orderType') == 'dv' %}
92-
<div class="col-sm-8 col-sm-offset-2">
93+
<div class="col-sm-8 offset-sm-2">
9394
<div class="card">
9495
<div class="card-header">
9596
<h5 class="card-title text-center">DV Biobank Order</h5>
@@ -103,7 +104,7 @@
103104
{% endif %}
104105
<br />
105106
{{ form_row(createForm.kitId) }}
106-
<p class="text-center">
107+
<p class="text-center mt-2">
107108
<button type="submit" name="existing" class="btn btn-primary">
108109
Create
109110
<span class="spinner-border spinner-border-sm-bs5" style="display: none;"></span>

templates/order/finalize.html.twig

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{% set bootstrapVersion = 5 %}
12
{% extends 'program/hpo/ppsc/base.html.twig' %}
23
{% import 'order/samples.html.twig' as samples %}
34
{% if order.type != 'saliva' %}
@@ -6,8 +7,9 @@
67
{% block title %}Finalize - Order {{ order.orderId }} - {% endblock %}
78
{% block bodycontainer %}container-fluid{% endblock %}
89
{% block body %}
10+
{% form_theme finalizeForm 'custom_bootstrap_5_layout.html.twig' %}
911
{% include 'order/header.html.twig' with { active: 'finalize' } %}
10-
{{ form_start(finalizeForm, { attr: { class: 'warn-unsaved disable-enter prevent-resubmit finalize-form' } }) }}
12+
{{ form_start(finalizeForm, { attr: { class: 'warn-unsaved disable-enter prevent-resubmit finalize-form aou-order-form' } }) }}
1113
{{ form_errors(finalizeForm) }}
1214

1315
<div class="form-group{% if not finalizeForm.finalizedTs.vars.valid %} has-error{% endif %}" id="order_finalize"
@@ -29,7 +31,7 @@
2931
{% endif %}
3032
{{ form_errors(finalizeForm.finalizedSamples) }}
3133
{% if finalizeForm.sampleShippingMethod is defined %}
32-
{{ form_label(finalizeForm.sampleShippingMethod) }}
34+
<label class="form-label required">{{ finalizeForm.sampleShippingMethod.vars.label }}</label>
3335
<span class="toggle-help-text" id="toggleShippingHelpModal">
3436
<i class="fa fa-question-circle" aria-hidden="true"></i><span class="sr-only">Help</span>
3537
</span>
@@ -48,28 +50,28 @@
4850
{% endif %}
4951
<div id="shipping_fields" {% if order.hideTrackingFieldByDefault %} style="display:none;" {% endif %}>
5052
<ul class="nav nav-tabs">
51-
<li role="presentation" class="active"><a href="#" id="enable-number">
53+
<li role="presentation" class="nav-item"><a class="nav-link active" href="#" id="enable-number">
5254
<i class="fa fa-keyboard-o" aria-hidden="true"></i>
5355
Enter tracking number
5456
</a></li>
55-
<li role="presentation"><a href="#" id="enable-barcode">
57+
<li role="presentation" class="nav-item"><a class="nav-link" href="#" id="enable-barcode">
5658
<i class="fa fa-barcode" aria-hidden="true"></i>
5759
Scan barcode
5860
</a></li>
5961
</ul>
6062
<br />
6163
<div class="row">
62-
<div class="col-xs-6" id="fedex-barcode" style="display:none">
64+
<div class="col-6" id="fedex-barcode" style="display:none">
6365
<div class="form-group">
6466
<label class="control-label" for="fedex_barcode_first">FedEx or UPS barcode</label>
65-
<input type="text" id="fedex_barcode_first" class="form-control">
67+
<input type="text" id="fedex_barcode_first" class="form-control form-control-sm">
6668
</div>
6769
<div class="form-group">
6870
<label class="control-label" for="fedex_barcode_second">Verify barcode</label>
69-
<input type="text" id="fedex_barcode_second" class="form-control">
71+
<input type="text" id="fedex_barcode_second" class="form-control form-control-sm">
7072
</div>
7173
</div>
72-
<div class="col-xs-12" id="fedex-number">
74+
<div class="col-12" id="fedex-number">
7375
{{ form_row(finalizeForm.fedexTracking) }}
7476
</div>
7577
</div>
@@ -89,15 +91,15 @@
8991
{{ form_rest(finalizeForm) }}
9092
{% set routePrefix = readOnlyView ? 'read_' : '' %}
9193
{% if not order.disabled and not readOnlyView and not inactiveSiteFormDisabled %}
92-
<p>
94+
<p class="mt-2 mb-4">
9395
<button type="submit" {% if hasErrors %} class="btn btn-default" disabled="disabled" {% else %} class="btn btn-primary" {% endif %}>
9496
Save and mark as finalized
95-
<span class="spinner-border spinner-border-sm" style="display: none;"></span>
97+
<span class="spinner-border spinner-border-sm-bs5" style="display: none;"></span>
9698
</button>
97-
<a href="{{ path(routePrefix ~ 'participant', { id: participant.id }) }}" class="btn btn-default">Cancel</a>
99+
<a href="{{ path(routePrefix ~ 'participant', { id: participant.id }) }}" class="btn btn-secondary">Cancel</a>
98100
</p>
99101
{% else %}
100-
<a href="{{ path(routePrefix ~ 'participant', { id: participant.id }) }}" class="btn btn-default">Return to In-Person Enrollment</a>
102+
<a href="{{ path(routePrefix ~ 'participant', { id: participant.id }) }}" class="btn btn-secondary mt-2 mb-4">Return to In-Person Enrollment</a>
101103
{% endif %}
102104
{{ form_end(finalizeForm) }}
103105
{% if order.status == 'unlock' %}
@@ -115,14 +117,14 @@
115117
<p>A tracking number is not required for sites who use a courier service to ship biospecimen kits to the Biobank.</p>
116118
</div>
117119
<div class="modal-footer">
118-
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
120+
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Close</button>
119121
</div>
120122
</div>
121123
</div>
122124
</div>
123125
{% endblock %}
124126

125127
{% block pagejs %}
126-
{{ encore_entry_script_tags('order-sub') }}
128+
{{ encore_entry_script_tags('order-sub-bs5') }}
127129
{{ encore_entry_script_tags('order-finalize') }}
128130
{% endblock %}

templates/order/header.html.twig

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
</div>
5454
{% endif %}
5555
{% if app.session.get('orderType') == 'dv'and reportKitUrl and order.type == 'kit' %}
56-
<button type="button" data-href="{{ reportKitUrl }}" class="btn btn-danger pull-right external-link">Report Kit Problem</button>
56+
<button type="button" data-href="{{ reportKitUrl }}" class="btn btn-danger float-end external-link">Report Kit Problem</button>
5757
{% endif %}
5858
{% endif %}
5959
</p>
@@ -97,9 +97,9 @@
9797
{% endif %}
9898
{# TODO: Replace with class constants #}
9999
{% if activeStep == 'finalized' and order.submissionTs %}
100-
<h4 class="pull-right submission-label">
101-
<span class="label label-success">Order Submitted: {{ order.submissionTs|date('n/j/Y g:ia', app.user.timezone) }}</span>
102-
</h4>
100+
<h5 class="float-end">
101+
<span class="badge badge-success">Order Submitted: {{ order.submissionTs|date('n/j/Y g:ia', app.user.timezone) }}</span>
102+
</h5>
103103
{% endif %}
104104
</div>
105105
{% endif %}

templates/order/process.html.twig

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
{% block title %}Process - Order {{ order.orderId }} - {% endblock %}
99
{% block bodycontainer %}container-fluid{% endblock %}
1010
{% block body %}
11+
{% form_theme processForm 'custom_bootstrap_5_layout.html.twig' %}
1112
{% include 'order/header.html.twig' with { active: 'process' } %}
1213
<div id="order_process" data-order-type="{{ order.type }}" data-order-finalized="{{ order.finalizedTs ? 1 : 0 }}">
13-
{{ form_start(processForm, { attr: { class: 'warn-unsaved disable-enter prevent-resubmit process-form' } }) }}
14+
{{ form_start(processForm, { attr: { class: 'warn-unsaved disable-enter prevent-resubmit process-form aou-order-form' } }) }}
1415
{{ form_errors(processForm) }}
1516
{% if processForm.processedSamples is defined %}
1617
<div class="form-group{% if not processForm.processedSamples.vars.valid %} has-error{% endif %}">
@@ -42,7 +43,7 @@
4243
{{ form_rest(processForm) }}
4344
{% set routePrefix = readOnlyView ? 'read_' : '' %}
4445
{% if not order.formDisabled and not readOnlyView and not inactiveSiteFormDisabled %}
45-
<p>
46+
<p class="mt-2 mb-4">
4647
<button type="submit" class="btn btn-primary">
4748
{% if order.processedTs %}
4849
Update
@@ -54,7 +55,7 @@
5455
<a href="{{ path(routePrefix ~ 'participant', { id: participant.id }) }}" class="btn btn-secondary">Cancel</a>
5556
</p>
5657
{% else %}
57-
<a href="{{ path(routePrefix ~ 'participant', { id: participant.id }) }}" class="btn btn-secondary">Cancel</a>
58+
<a href="{{ path(routePrefix ~ 'participant', { id: participant.id }) }}" class="btn btn-secondary mt-2">Cancel</a>
5859
{% endif %}
5960
{{ form_end(processForm) }}
6061
{% if order.status == 'unlock' %}

templates/order/samples.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% macro form_widget(form, showCheckAll, samplesInfo, version, order, isCustom) %}
22
<div class="row">
33
<div class="{% if app.request.get('_route') != 'order_create' %} col-sm-8 {% else %} col-sm-12 {% endif %}">
4-
<table id="{{ form.vars.id }}" class="table table-condensed table-auto-width table-samples table-borderless">
4+
<table id="{{ form.vars.id }}" class="table table-sm table-auto-width table-samples table-borderless">
55
{% if showCheckAll or app.request.get('_route') == 'order_finalize' %}
66
<thead>
77
<tr>

web/assets/css/bs5.css

+17
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,20 @@ a {
124124
.text-purple {
125125
color: #6f42c1;
126126
}
127+
128+
.aou-order-form .col-form-label, .aou-order-form .form-label {
129+
font-weight: 700;
130+
}
131+
132+
.aou-order-form .form-check-input {
133+
border-color: #7a8086
134+
}
135+
136+
.aou-order-form .form-check-input[disabled] ~ .form-check-label, .aou-order-form .form-check-input:disabled ~ .form-check-label {
137+
opacity: 1;
138+
}
139+
140+
.form-control[readonly] {
141+
background-color: #eeeeee;
142+
opacity: 1;
143+
}

web/assets/js/views/FinalizeOrder.js

+14-8
Original file line numberDiff line numberDiff line change
@@ -85,25 +85,30 @@ $(document).ready(function () {
8585
}
8686
}
8787

88-
$("#order_finalizedTs").pmiDateTimePicker();
88+
let orderFinalizeTss = document.querySelector("#order_finalizedTs");
89+
bs5DateTimepicker(orderFinalizeTss, {
90+
clock: true,
91+
sideBySide: true,
92+
useCurrent: true
93+
});
8994

9095
new PMI.views["OrderSubPage"]({
9196
el: $("body")
9297
});
9398

9499
$("#enable-number").on("click", function () {
95-
$("#enable-number").parent().addClass("active");
96-
$("#enable-barcode").parent().removeClass("active");
100+
$("#enable-number").addClass("active");
101+
$("#enable-barcode").removeClass("active");
97102
$("#fedex-barcode").hide();
98-
$("#fedex-number").removeClass("col-xs-6").addClass("col-xs-12");
103+
$("#fedex-number").removeClass("col-6").addClass("col-12");
99104
$("#fedex-number input").attr("readonly", false);
100105
return false;
101106
});
102107
$("#enable-barcode").on("click", function () {
103-
$("#enable-barcode").parent().addClass("active");
104-
$("#enable-number").parent().removeClass("active");
108+
$("#enable-barcode").addClass("active");
109+
$("#enable-number").removeClass("active");
105110
$("#fedex-barcode").show();
106-
$("#fedex-number").removeClass("col-xs-12").addClass("col-xs-6");
111+
$("#fedex-number").removeClass("col-12").addClass("col-6");
107112
$("#fedex-number input").attr("readonly", true);
108113
return false;
109114
});
@@ -179,6 +184,7 @@ $(document).ready(function () {
179184
handleShippingFields();
180185

181186
$("#toggleShippingHelpModal").on("click", function () {
182-
$("#shipping_method_help_modal").modal();
187+
let helpModal = new bootstrap.Modal($("#shipping_method_help_modal"));
188+
helpModal.show();
183189
});
184190
});

web/assets/js/views/OrderProcess.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ $(document).ready(function () {
5151
}
5252
}
5353
var checkBoxTr = $(this).closest("tr");
54-
var timeTd = $('<td colspan="4">');
54+
var timeTd = $('<td colspan="5">');
5555
var timeTr = $("<tr><td></td></tr>");
5656
var sample = $(this).val();
5757
$("#order_processedSamplesTs_" + sample)
58-
.closest(".form-group")
58+
.closest(".form-control")
5959
.detach()
6060
.css("margin-bottom", "10px")
6161
.appendTo(timeTd);
@@ -67,7 +67,7 @@ $(document).ready(function () {
6767
sideBySide: true,
6868
useCurrent: true
6969
});
70-
$("#order_processedSamplesTs_" + sample).addClass("input-sm");
70+
$("#order_processedSamplesTs_" + sample).addClass("form-control-sm");
7171
});
7272
$("#order_processedSamplesTs").remove();
7373

0 commit comments

Comments
 (0)