Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/javascript/controllers/subject_selector_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class extends Controller {
noChoicesText: "No hay materias disponibles",
shouldSort: false,
classNames: {
containerOuter: ["choices", "!m-0", "!h-10"],
containerOuter: ["choices", "!m-0", "!h-10", "flex-grow-1"],
containerInner: [
"choices__inner",
"!min-h-10",
Expand All @@ -23,7 +23,11 @@ export default class extends Controller {
"!items-center",
"!bg-white",
"!rounded-md",
"!px-4",
"!py-3",
"!border-none",
],
listSingle: ["choices__list", "choices__list--single", "!p-0"],
},
});
}
Expand Down
9 changes: 2 additions & 7 deletions app/views/subject_plans/_semester_add_subject_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
url: subject_plans_path,
method: :post,
data: { turbo: true, controller: "subject-selector" },
class: 'flex items-center gap-3 px-4 py-3 hover:bg-gray-100 border-t border-gray-100'
class: 'flex items-center border-t border-gray-100 text-sm/6'
) do |form| %>
<span class="grow text-sm/6 text-gray-900">
Planificar:
</span>
<%= form.select(
:subject_id,
grouped_options_for_select(
Expand All @@ -20,7 +17,5 @@
{ data: { subject_selector_target: "select", action: "subject-selector#onChange" }, class: "invisible absolute" }
) %>
<%= form.hidden_field :semester, value: semester %>
<%= 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 %>
add_circle_outline
<% end %>
<%= render ButtonComponent.new(form: form, label: "Añadir") %>
<% end %>
4 changes: 2 additions & 2 deletions spec/system/planned_subjects_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
within_semester_section("Primer semestre") do
within_add_subject_section do
select_from_choices('GAL 1 - 1030')
find("button[type='submit']").click
click_button "Añadir"
end

assert_available_subject "GAL 1"
Expand All @@ -88,7 +88,7 @@
within_semester_section("Segundo semestre") do
within_add_subject_section do
select_from_choices('GAL 2 - 1031')
find("button[type='submit']").click
click_button "Añadir"
end

assert_blocked_subject "GAL 2"
Expand Down