Skip to content

Commit e61b486

Browse files
committed
Make Backlog Header form responsive
Display on multiple lines on smaller viewports.
1 parent 276da56 commit e61b486

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

frontend/src/assets/sass/backlogs/_master_backlog.sass

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,9 @@ $op-backlogs-header--points-min-width: 5rem
8686
align-self: start // Align to top of second row
8787
word-wrap: break-word
8888
overflow-wrap: break-word
89+
90+
@media screen and (min-width: $breakpoint-sm)
91+
.op-backlogs-header-form
92+
.FormControl-spacingWrapper
93+
flex-direction: row
94+
column-gap: 0.5rem

modules/backlogs/app/components/backlogs/backlog_header_component.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
primer_form_with(
5151
url: backlogs_project_sprint_path(project, sprint),
5252
model: sprint,
53-
method: :patch
53+
method: :patch,
54+
class: "op-backlogs-header-form"
5455
) do |f|
5556
render(Backlogs::BacklogHeaderForm.new(f, cancel_path: show_name_backlogs_project_sprint_path(project, sprint)))
5657
end

modules/backlogs/app/forms/backlogs/backlog_header_form.rb

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,35 +33,37 @@ class BacklogHeaderForm < ApplicationForm
3333
attr_reader :cancel_path
3434

3535
form do |f|
36-
f.group(layout: :horizontal) do |group|
37-
group.text_field(
38-
name: :name,
39-
label: attribute_name(:name),
40-
placeholder: attribute_name(:name),
41-
visually_hide_label: true,
42-
autofocus: true,
43-
autocomplete: "off"
44-
)
36+
f.text_field(
37+
name: :name,
38+
label: attribute_name(:name),
39+
placeholder: attribute_name(:name),
40+
visually_hide_label: true,
41+
autofocus: true,
42+
autocomplete: "off"
43+
)
4544

46-
group.single_date_picker(
45+
f.group(layout: :horizontal) do |dates|
46+
dates.single_date_picker(
4747
name: :start_date,
4848
label: attribute_name(:start_date),
4949
placeholder: attribute_name(:start_date),
5050
visually_hide_label: true,
5151
leading_visual: { icon: :calendar },
5252
datepicker_options: {}
5353
)
54-
group.single_date_picker(
54+
dates.single_date_picker(
5555
name: :effective_date,
5656
label: attribute_name(:effective_date),
5757
placeholder: attribute_name(:effective_date),
5858
visually_hide_label: true,
5959
leading_visual: { icon: :calendar },
6060
datepicker_options: {}
6161
)
62+
end
6263

63-
group.submit(scheme: :primary, name: :submit, label: I18n.t(:button_save))
64-
group.button(
64+
f.group(layout: :horizontal) do |buttons|
65+
buttons.submit(scheme: :primary, name: :submit, label: I18n.t(:button_save))
66+
buttons.button(
6567
scheme: :secondary,
6668
name: :cancel,
6769
label: I18n.t(:button_cancel),

0 commit comments

Comments
 (0)