Move import to new action

Making way for a review step.
This commit is contained in:
David Cook
2025-02-04 16:16:23 +11:00
parent 8acefed857
commit c3b23a9fba
5 changed files with 13 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ module Admin
self.class
end
def index
def import
# The plan:
#
# * Fetch DFC catalog as JSON from URL.

View File

@@ -0,0 +1,7 @@
- content_for :page_title do
#{t(".title")}
= render partial: 'spree/admin/shared/product_sub_menu'
%p= t(".imported_products")
= @count

View File

@@ -3,5 +3,4 @@
= render partial: 'spree/admin/shared/product_sub_menu'
%p= t(".imported_products")
= @count
watch this space

View File

@@ -846,7 +846,7 @@ en:
map: Map
dfc_product_imports:
index:
import:
title: "Importing a DFC product catalog"
imported_products: "Imported products:"
enterprise_fees:

View File

@@ -69,7 +69,9 @@ Openfoodnetwork::Application.routes.draw do
post '/product_import/save_data', to: 'product_import#save_data', as: 'product_import_save_async'
post '/product_import/reset_absent', to: 'product_import#reset_absent_products', as: 'product_import_reset_async'
resources :dfc_product_imports, only: [:index]
resources :dfc_product_imports, only: [:index] do
post :import, on: :collection
end
constraints FeatureToggleConstraint.new(:admin_style_v3) do
# This might be easier to arrange once we rename the controller to plain old "products"