From c24408b41a7cdb494d467c7fbb9e0144cebd5885 Mon Sep 17 00:00:00 2001 From: MayZamudio Date: Thu, 11 Apr 2024 22:50:41 -0700 Subject: [PATCH 1/3] [Finishes #187093434] Remove view and associated tests that use it --- app/controllers/store_controller.rb | 2 +- app/helpers/application_helper.rb | 2 +- app/views/store/donate_to_fund.html.haml | 29 ----------------------- config/routes.rb | 1 - spec/controllers/store_controller_spec.rb | 4 ---- 5 files changed, 2 insertions(+), 36 deletions(-) delete mode 100644 app/views/store/donate_to_fund.html.haml diff --git a/app/controllers/store_controller.rb b/app/controllers/store_controller.rb index 3ec0b456d..f635f899f 100644 --- a/app/controllers/store_controller.rb +++ b/app/controllers/store_controller.rb @@ -323,7 +323,7 @@ def referer_target redirect_target = case params[:referer].to_s when 'donate' then quick_donate_path(:account_code_string => params[:account_code_string]) # no @customer assumed - when 'donate_to_fund' then donate_to_fund_path(params[:account_code_id], @customer) + # when 'donate_to_fund' then donate_to_fund_path(params[:account_code_id], @customer) when 'subscribe' then store_subscribe_path(@customer,promo_code_args) when 'index' then store_path(@customer, promo_code_args.merge(:what => params[:what], :showdate_id => params[:showdate_id])) else store_path(@customer,promo_code_args) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7925372aa..c331ccfd4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -46,7 +46,7 @@ def display_customer_actions? :customers => [:show, :edit, :change_password_for, :change_secret_question], :vouchers => [:index], :orders => [:index], - :store => [:index, :subscribe, :donate, :donate_to_fund, :shipping_address, :checkout] + :store => [:index, :subscribe, :donate, :shipping_address, :checkout] } ! @customer.try(:new_record?) && (allowed_actions[controller.controller_name.to_sym] || {}).include?(action_name.to_sym) diff --git a/app/views/store/donate_to_fund.html.haml b/app/views/store/donate_to_fund.html.haml deleted file mode 100644 index a8d63a07d..000000000 --- a/app/views/store/donate_to_fund.html.haml +++ /dev/null @@ -1,29 +0,0 @@ -= set_active_tab '#t_store_donate' -#store - #donation_panel - = form_tag process_cart_path(@customer) do - - if @gAdminDisplay - %h1.text-center Record Donation - %label{:for => :account_code_id} Fund or Account: - = select_tag 'account_code_id', options_from_collection_for_select(AccountCode.all, :id, :name_with_code, @account_code.id) - - else - %h1.text-center Donation to #{@account_code.name} - - if @account_code.description - %p.text-center= @account_code.description - = hidden_field_tag 'account_code_id', @account_code.id - - - unless @account_code.donation_prompt.blank? - %label{:for => :donation_comments}= @account_code.donation_prompt - = text_field_tag 'donation_comments', '', :size => 40 - %br - %br - - %label{:for => :donation} Your tax-deductible donation - = text_field_tag 'donation', '', :size => 5, :class => 'currency' - \.00 - %br - %br - = hidden_field_tag 'referer', 'donate_to_fund' - = submit_tag 'CONTINUE >>', {:id => 'submit', :class => 'btn btn-success'} - %span#nextstep to Billing Information - diff --git a/config/routes.rb b/config/routes.rb index 41122a906..fe8b2b212 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -112,7 +112,6 @@ get '/store/(:customer_id)' => 'store#index', :defaults => {:customer_id => nil}, :as => 'store' get '/subscribe/(:customer_id)' => 'store#subscribe', :defaults => {:customer_id => nil}, :as => 'store_subscribe' - # get '/donate_to_fund/:id/(:customer_id)' => 'store#donate_to_fund', :defaults => {:customer_id => nil}, :as => 'donate_to_fund' get '/donate_to_fund/(:id)/(:customer_id)', :defaults => {:customer_id => nil}, to: 'store#donate_to_fund_redirect' get '/store/cancel' => 'store#cancel', :as => 'store_cancel' diff --git a/spec/controllers/store_controller_spec.rb b/spec/controllers/store_controller_spec.rb index acb9d9540..467853740 100644 --- a/spec/controllers/store_controller_spec.rb +++ b/spec/controllers/store_controller_spec.rb @@ -80,10 +80,6 @@ before :each do ; @action = :subscribe ; end it_should_behave_like 'initial visit' end - describe 'to :donate_to_fund' do - before :each do ; @action = :donate_to_fund ; @extras = { id: '2' }; end - it_should_behave_like 'initial visit' - end end describe "on InvalidAuthenticityToken exception" do From 830ddaf0a9c71578760d324e1b163c903829ae6a Mon Sep 17 00:00:00 2001 From: MayZamudio Date: Tue, 16 Apr 2024 18:18:26 -0700 Subject: [PATCH 2/3] deleted donate_to_fund path --- app/controllers/store_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/store_controller.rb b/app/controllers/store_controller.rb index f635f899f..6b405ea75 100644 --- a/app/controllers/store_controller.rb +++ b/app/controllers/store_controller.rb @@ -323,7 +323,6 @@ def referer_target redirect_target = case params[:referer].to_s when 'donate' then quick_donate_path(:account_code_string => params[:account_code_string]) # no @customer assumed - # when 'donate_to_fund' then donate_to_fund_path(params[:account_code_id], @customer) when 'subscribe' then store_subscribe_path(@customer,promo_code_args) when 'index' then store_path(@customer, promo_code_args.merge(:what => params[:what], :showdate_id => params[:showdate_id])) else store_path(@customer,promo_code_args) From d1806211ab6f507067d69cfd984e27a0713b07dc Mon Sep 17 00:00:00 2001 From: MayZamudio Date: Tue, 16 Apr 2024 19:35:28 -0700 Subject: [PATCH 3/3] [Finishes #187386170] Remove quick donation banner and explanation fields from Options model and other references --- app/views/options/index.html.haml | 2 - config/locales/en.option_descriptions.yml | 11 ---- ...move_quick_donation_fields_from_options.rb | 4 ++ db/schema.rb | 61 +++++++++---------- 4 files changed, 33 insertions(+), 45 deletions(-) create mode 100644 db/migrate/20240417020007_remove_quick_donation_fields_from_options.rb diff --git a/app/views/options/index.html.haml b/app/views/options/index.html.haml index 7f1fcb2c7..5263c7907 100644 --- a/app/views/options/index.html.haml +++ b/app/views/options/index.html.haml @@ -36,8 +36,6 @@ default_retail_account_code | default_donation_account_code | default_donation_account_code_with_subscriptions | - quick_donation_banner | - quick_donation_explanation | quick_donation_redirect | donation_ack_from | ) | diff --git a/config/locales/en.option_descriptions.yml b/config/locales/en.option_descriptions.yml index d5a5e0cd4..b569bb745 100644 --- a/config/locales/en.option_descriptions.yml +++ b/config/locales/en.option_descriptions.yml @@ -107,17 +107,6 @@ en: Auto-generated confirmation emails for online donations will appear to be signed by this person. Example: "Bob Jones, Development Chair" - quick_donation_banner: > - - The banner text that appears at the top of the "donate instantly" - (donate by credit card without logging in) page. - - quick_donation_explanation: > - - Explanatory text that appears on the "donate instantly" page. Basic - HTML is allowed. For example, you could direct patrons who wish to - donate by check to download a form or call the development office. - quick_donation_redirect: > If not blank, the absolute URL to which the patron is redirected after diff --git a/db/migrate/20240417020007_remove_quick_donation_fields_from_options.rb b/db/migrate/20240417020007_remove_quick_donation_fields_from_options.rb new file mode 100644 index 000000000..f1827df35 --- /dev/null +++ b/db/migrate/20240417020007_remove_quick_donation_fields_from_options.rb @@ -0,0 +1,4 @@ +class RemoveQuickDonationFieldsFromOptions < ActiveRecord::Migration + def change + end +end diff --git a/db/schema.rb b/db/schema.rb index 23709840f..bcc2120a7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,10 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20240225093946) do - - # These are extensions that must be enabled in order to support this database - enable_extension "plpgsql" +ActiveRecord::Schema.define(version: 20240417020007) do create_table "account_codes", force: :cascade do |t| t.string "name", limit: 255, default: "", null: false @@ -68,14 +65,14 @@ t.integer "ticket_sales_import_id" end - add_index "customers", ["ticket_sales_import_id"], name: "index_customers_on_ticket_sales_import_id", using: :btree + add_index "customers", ["ticket_sales_import_id"], name: "index_customers_on_ticket_sales_import_id" create_table "customers_labels", id: false, force: :cascade do |t| t.integer "customer_id" t.integer "label_id" end - add_index "customers_labels", ["customer_id", "label_id"], name: "index_customers_labels_on_customer_id_and_label_id", unique: true, using: :btree + add_index "customers_labels", ["customer_id", "label_id"], name: "index_customers_labels_on_customer_id_and_label_id", unique: true create_table "items", force: :cascade do |t| t.integer "vouchertype_id", default: 0, null: false @@ -99,15 +96,15 @@ t.datetime "sold_on" end - add_index "items", ["account_code_id"], name: "index_items_on_account_code_id", using: :btree - add_index "items", ["bundle_id"], name: "index_items_on_bundle_id", using: :btree - add_index "items", ["customer_id"], name: "index_items_on_customer_id", using: :btree - add_index "items", ["finalized"], name: "index_items_on_finalized", using: :btree - add_index "items", ["order_id"], name: "index_items_on_order_id", using: :btree - add_index "items", ["processed_by_id"], name: "index_items_on_processed_by_id", using: :btree - add_index "items", ["seat"], name: "index_items_on_seat", using: :btree - add_index "items", ["showdate_id"], name: "index_items_on_showdate_id", using: :btree - add_index "items", ["vouchertype_id"], name: "index_items_on_vouchertype_id", using: :btree + add_index "items", ["account_code_id"], name: "index_items_on_account_code_id" + add_index "items", ["bundle_id"], name: "index_items_on_bundle_id" + add_index "items", ["customer_id"], name: "index_items_on_customer_id" + add_index "items", ["finalized"], name: "index_items_on_finalized" + add_index "items", ["order_id"], name: "index_items_on_order_id" + add_index "items", ["processed_by_id"], name: "index_items_on_processed_by_id" + add_index "items", ["seat"], name: "index_items_on_seat" + add_index "items", ["showdate_id"], name: "index_items_on_showdate_id" + add_index "items", ["vouchertype_id"], name: "index_items_on_vouchertype_id" create_table "labels", force: :cascade do |t| t.string "name", limit: 255 @@ -225,11 +222,11 @@ t.text "from_import" end - add_index "orders", ["customer_id"], name: "index_orders_on_customer_id", using: :btree - add_index "orders", ["external_key"], name: "index_orders_on_external_key", using: :btree - add_index "orders", ["processed_by_id"], name: "index_orders_on_processed_by_id", using: :btree - add_index "orders", ["purchaser_id"], name: "index_orders_on_purchaser_id", using: :btree - add_index "orders", ["ticket_sales_import_id"], name: "index_orders_on_ticket_sales_import_id", using: :btree + add_index "orders", ["customer_id"], name: "index_orders_on_customer_id" + add_index "orders", ["external_key"], name: "index_orders_on_external_key" + add_index "orders", ["processed_by_id"], name: "index_orders_on_processed_by_id" + add_index "orders", ["purchaser_id"], name: "index_orders_on_purchaser_id" + add_index "orders", ["ticket_sales_import_id"], name: "index_orders_on_ticket_sales_import_id" create_table "seating_zones", force: :cascade do |t| t.string "name" @@ -264,8 +261,8 @@ t.string "house_seats", limit: 8192 end - add_index "showdates", ["seatmap_id"], name: "index_showdates_on_seatmap_id", using: :btree - add_index "showdates", ["show_id"], name: "index_showdates_on_show_id", using: :btree + add_index "showdates", ["seatmap_id"], name: "index_showdates_on_seatmap_id" + add_index "showdates", ["show_id"], name: "index_showdates_on_show_id" create_table "shows", force: :cascade do |t| t.string "name", limit: 255 @@ -295,7 +292,7 @@ t.datetime "created_at" end - add_index "ticket_sales_imports", ["processed_by_id"], name: "index_ticket_sales_imports_on_processed_by_id", using: :btree + add_index "ticket_sales_imports", ["processed_by_id"], name: "index_ticket_sales_imports_on_processed_by_id" create_table "txns", force: :cascade do |t| t.integer "customer_id", default: 1, null: false @@ -311,12 +308,12 @@ t.string "txn_type", limit: 255 end - add_index "txns", ["customer_id"], name: "index_txns_on_customer_id", using: :btree - add_index "txns", ["entered_by_id"], name: "index_txns_on_entered_by_id", using: :btree - add_index "txns", ["order_id"], name: "index_txns_on_order_id", using: :btree - add_index "txns", ["show_id"], name: "index_txns_on_show_id", using: :btree - add_index "txns", ["showdate_id"], name: "index_txns_on_showdate_id", using: :btree - add_index "txns", ["voucher_id"], name: "index_txns_on_voucher_id", using: :btree + add_index "txns", ["customer_id"], name: "index_txns_on_customer_id" + add_index "txns", ["entered_by_id"], name: "index_txns_on_entered_by_id" + add_index "txns", ["order_id"], name: "index_txns_on_order_id" + add_index "txns", ["show_id"], name: "index_txns_on_show_id" + add_index "txns", ["showdate_id"], name: "index_txns_on_showdate_id" + add_index "txns", ["voucher_id"], name: "index_txns_on_voucher_id" create_table "valid_vouchers", force: :cascade do |t| t.integer "showdate_id" @@ -331,8 +328,8 @@ t.integer "max_sales_per_txn", default: 100000 end - add_index "valid_vouchers", ["showdate_id"], name: "index_valid_vouchers_on_showdate_id", using: :btree - add_index "valid_vouchers", ["vouchertype_id"], name: "index_valid_vouchers_on_vouchertype_id", using: :btree + add_index "valid_vouchers", ["showdate_id"], name: "index_valid_vouchers_on_showdate_id" + add_index "valid_vouchers", ["vouchertype_id"], name: "index_valid_vouchers_on_vouchertype_id" create_table "vouchertypes", force: :cascade do |t| t.string "name", limit: 255 @@ -352,6 +349,6 @@ t.integer "seating_zone_id" end - add_index "vouchertypes", ["account_code_id"], name: "index_vouchertypes_on_account_code_id", using: :btree + add_index "vouchertypes", ["account_code_id"], name: "index_vouchertypes_on_account_code_id" end