Skip to content

Commit 0f084b1

Browse files
feat(planner): improve space in add subject section
1 parent fe79f1e commit 0f084b1

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

app/javascript/controllers/subject_selector_controller.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class extends Controller {
1414
noChoicesText: "No hay materias disponibles",
1515
shouldSort: false,
1616
classNames: {
17-
containerOuter: ["choices", "!m-0", "!h-10"],
17+
containerOuter: ["choices", "!m-0", "!h-10", "flex-grow-1"],
1818
containerInner: [
1919
"choices__inner",
2020
"!min-h-10",
@@ -23,7 +23,11 @@ export default class extends Controller {
2323
"!items-center",
2424
"!bg-white",
2525
"!rounded-md",
26+
"!px-4",
27+
"!py-3",
28+
"!border-none",
2629
],
30+
listSingle: ["choices__list", "choices__list--single", "!p-0"],
2731
},
2832
});
2933
}

app/views/subjects/_planned_subjects_list.html.erb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,8 @@
4242
url: subject_plans_path,
4343
method: :post,
4444
data: { turbo: true, controller: "subject-selector" },
45-
class: 'flex items-center gap-3 px-4 py-3 hover:bg-gray-100 border-t border-gray-100'
45+
class: 'flex items-center border-t border-gray-100 text-sm/6'
4646
) do |form| %>
47-
<span class="grow text-sm/6 text-gray-900">
48-
Planificar:
49-
</span>
5047
<%= form.select(
5148
:subject_id,
5249
grouped_options_for_select(
@@ -58,9 +55,7 @@
5855
{ data: { subject_selector_target: "select", action: "subject-selector#onChange" }, class: "invisible absolute" }
5956
) %>
6057
<%= form.hidden_field :semester, value: semester %>
61-
<%= form.button type: :submit, class: "cursor-pointer py-2 ps-3 material-icons text-gray-400 disabled:opacity-50 disabled:cursor-not-allowed", disabled: true, data: { subject_selector_target: "submitButton" } do %>
62-
add_circle_outline
63-
<% end %>
58+
<%= render ButtonComponent.new(form: form, label: "Añadir") %>
6459
<% end %>
6560
</div>
6661
<% end %>

spec/system/planned_subjects_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
within_semester_section("Primer semestre") do
6363
within_add_subject_section do
6464
select_from_choices('GAL 1 - 1030')
65-
find("button[type='submit']").click
65+
click_button "Añadir"
6666
end
6767

6868
assert_available_subject "GAL 1"
@@ -80,7 +80,7 @@
8080
within_semester_section("Segundo semestre") do
8181
within_add_subject_section do
8282
select_from_choices('GAL 2 - 1031')
83-
find("button[type='submit']").click
83+
click_button "Añadir"
8484
end
8585

8686
assert_blocked_subject "GAL 2"

0 commit comments

Comments
 (0)