diff --git a/app/controllers/admin/order_cycles_controller.rb b/app/controllers/admin/order_cycles_controller.rb index 05b6cb891d..f8becca16c 100644 --- a/app/controllers/admin/order_cycles_controller.rb +++ b/app/controllers/admin/order_cycles_controller.rb @@ -64,7 +64,7 @@ module Admin if @order_cycle_form.save respond_to do |format| flash[:notice] = I18n.t(:order_cycles_update_notice) if params[:reloading] == '1' - format.html { redirect_to main_app.edit_admin_order_cycle_path(@order_cycle) } + format.html { redirect_back(fallback_location: root_path) } format.json { render json: { success: true } } end else diff --git a/app/views/admin/order_cycles/_order_cycle_top_buttons.html.haml b/app/views/admin/order_cycles/_order_cycle_top_buttons.html.haml new file mode 100644 index 0000000000..86ca6b2ae4 --- /dev/null +++ b/app/views/admin/order_cycles/_order_cycle_top_buttons.html.haml @@ -0,0 +1,19 @@ +- content_for :page_actions do + :javascript + function toggleSettings(){ + if( $('#advanced_settings').is(":visible") ){ + $('button#toggle_settings i').switchClass("icon-chevron-up","icon-chevron-down") + } + else { + $('button#toggle_settings i').switchClass("icon-chevron-down","icon-chevron-up") + } + $("#advanced_settings").slideToggle() + } + + %li + %button#toggle_settings{ onClick: 'toggleSettings()' } + = t('.advanced_settings') + %i.icon-chevron-down + +#advanced_settings{ hidden: true } + = render partial: "/admin/order_cycles/advanced_settings" diff --git a/app/views/admin/order_cycles/edit.html.haml b/app/views/admin/order_cycles/edit.html.haml index 2a781974ca..5c700c5b18 100644 --- a/app/views/admin/order_cycles/edit.html.haml +++ b/app/views/admin/order_cycles/edit.html.haml @@ -1,25 +1,8 @@ += render partial: "/admin/order_cycles/order_cycle_top_buttons" - content_for :page_actions do - :javascript - function toggleSettings(){ - if( $('#advanced_settings').is(":visible") ){ - $('button#toggle_settings i').switchClass("icon-chevron-up","icon-chevron-down") - } - else { - $('button#toggle_settings i').switchClass("icon-chevron-down","icon-chevron-up") - } - $("#advanced_settings").slideToggle() - } - - if can? :notify_producers, @order_cycle %li = button_to t(:notify_producers), main_app.notify_producers_admin_order_cycle_path, :id => 'admin_notify_producers', :confirm => t(:are_you_sure) - %li - %button#toggle_settings{ onClick: 'toggleSettings()' } - = t('.advanced_settings') - %i.icon-chevron-down - -#advanced_settings{ hidden: true } - = render partial: "/admin/order_cycles/advanced_settings" - content_for :page_title do = t :edit_order_cycle diff --git a/app/views/admin/order_cycles/incoming.html.haml b/app/views/admin/order_cycles/incoming.html.haml index faaa81e03b..254119bf24 100644 --- a/app/views/admin/order_cycles/incoming.html.haml +++ b/app/views/admin/order_cycles/incoming.html.haml @@ -1,3 +1,5 @@ += render partial: "/admin/order_cycles/order_cycle_top_buttons" + - content_for :page_title do = t :edit_order_cycle diff --git a/app/views/admin/order_cycles/outgoing.html.haml b/app/views/admin/order_cycles/outgoing.html.haml index 0623d1f71e..9924e3dae9 100644 --- a/app/views/admin/order_cycles/outgoing.html.haml +++ b/app/views/admin/order_cycles/outgoing.html.haml @@ -1,3 +1,5 @@ += render partial: "/admin/order_cycles/order_cycle_top_buttons" + - content_for :page_title do = t :edit_order_cycle diff --git a/config/locales/en.yml b/config/locales/en.yml index 89af6187d2..8a151dd959 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -996,7 +996,6 @@ en: cancel: "Cancel" back_to_list: "Back To List" edit: - advanced_settings: "Advanced Settings" save: "Save" save_and_next: "Save and Next" next: "Next" @@ -1049,6 +1048,8 @@ en: preferred_product_selection_from_coordinator_inventory_only_here: Coordinator's Inventory Only preferred_product_selection_from_coordinator_inventory_only_all: All Available Products save_reload: Save and Reload Page + order_cycle_top_buttons: + advanced_settings: "Advanced Settings" coordinator_fees: add: Add coordinator fee filters: diff --git a/spec/features/admin/enterprise_groups_spec.rb b/spec/features/admin/enterprise_groups_spec.rb index e702f98cd5..fb0a7b8d6e 100644 --- a/spec/features/admin/enterprise_groups_spec.rb +++ b/spec/features/admin/enterprise_groups_spec.rb @@ -119,7 +119,5 @@ feature ' click_link 'Groups' expect(page).to have_content 'My Group' end - - xit "should show me only enterprises I manage when creating a new enterprise group" end end diff --git a/spec/features/admin/overview_spec.rb b/spec/features/admin/overview_spec.rb index fb1c772b4b..ef710d59e3 100644 --- a/spec/features/admin/overview_spec.rb +++ b/spec/features/admin/overview_spec.rb @@ -43,7 +43,7 @@ feature ' end end - pending "when user is a profile only" do + context "when user is a profile only" do before do d1.sells = "none" d1.save! @@ -51,7 +51,7 @@ feature ' it "does not show a products item" do visit '/admin' - page.should_not have_selector "#products" + expect(page).to have_no_selector "#products" end end end diff --git a/spec/features/admin/shipping_methods_spec.rb b/spec/features/admin/shipping_methods_spec.rb index 691483305c..bc716a0c0e 100644 --- a/spec/features/admin/shipping_methods_spec.rb +++ b/spec/features/admin/shipping_methods_spec.rb @@ -45,8 +45,6 @@ feature 'shipping methods' do expect(sm.distributors).to match_array [distributor1, distributor2] end - it "at checkout, user can only see shipping methods for their current distributor (checkout spec)" - scenario "deleting a shipping method" do visit_delete spree.admin_shipping_method_path(@shipping_method)