diff --git a/app/controllers/alma_item_set_controller.rb b/app/controllers/alma_item_set_controller.rb index 33c4fb10..4eba2ddf 100644 --- a/app/controllers/alma_item_set_controller.rb +++ b/app/controllers/alma_item_set_controller.rb @@ -1,6 +1,7 @@ require 'date' class AlmaItemSetController < ApplicationController + VALID_ENVS = %w[production sandbox].freeze # TODO: - Need to make sure only certain staff access this page before_action :authorize! @@ -14,7 +15,9 @@ def index # rubocop:disable Metrics/AbcSize def update env = params[:alma_env] - alma_set_id = params[:alma_set_id] + return head(:bad_request) unless env.in? VALID_ENVS + + alma_set_id = params[:"alma_set_id_#{env}"] num = params[:note_num] note = new_note(params[:note_value], params[:initials]) diff --git a/app/views/alma_item_set/index.html.erb b/app/views/alma_item_set/index.html.erb index 16b24144..21513f63 100644 --- a/app/views/alma_item_set/index.html.erb +++ b/app/views/alma_item_set/index.html.erb @@ -17,13 +17,21 @@ <%= f.label("#{rb_alma_env}_sandbox".to_sym, "Sandbox") %> <%# Set Name %> -
- <%= label_tag(:alma_set_id, 'Alma Set Name:', class: 'control-label') %> +
+
+ <%= label_tag(:alma_set_id_production, 'Production Alma Set Name:', class: 'control-label') %> +
+
+ <%= f.select(:alma_set_id_production, @production_sets, {}, {:class => 'form-control'}) %> +
-
- <%# f.text_field(:alma_set_name, class: 'narrow form-control add-required', aria: { required: true }, required: true, autofocus: true) %> - <%= f.select(:alma_set_id, @production_sets, {}, {:class => 'form-control', :id => 'prod-drop-down'}) %> - <%= f.select(:alma_set_id, @sandbox_sets, {}, {:class => 'form-control', :id => 'sand-drop-down'}) %> +
+
+ <%= label_tag(:alma_set_id_sandbox, 'Sandbox Alma Set Name:', class: 'control-label') %> +
+
+ <%= f.select(:alma_set_id_sandbox, @sandbox_sets, {}, {:class => 'form-control'}) %> +
<%# Note Number %>