From a4a1de964d3212e8a2b3cecd32b74341468711ad Mon Sep 17 00:00:00 2001 From: Ben Halpern Date: Tue, 7 Nov 2023 09:50:08 -0500 Subject: [PATCH] =?UTF-8?q?Move=20features=20along=20in=20deprecation=20st?= =?UTF-8?q?atus=20=E2=9C=82=EF=B8=8F=20(#20315)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Move features along in deprecation status * Remove unnecessary tests --- app/lib/constants/settings.rb | 1 - app/models/admin_menu.rb | 1 - .../admin/settings/forms/_community.html.erb | 2 +- .../admin/settings/forms/_credits.html.erb | 2 +- app/views/admin/settings/show.html.erb | 1 - app/views/dashboards/_analytics.html.erb | 5 -- .../adminFlows/config/campaignSection.spec.js | 65 ------------------- .../dashboards/user_visits_dashboard_spec.rb | 27 +------- 8 files changed, 3 insertions(+), 101 deletions(-) delete mode 100644 cypress/e2e/seededFlows/adminFlows/config/campaignSection.spec.js diff --git a/app/lib/constants/settings.rb b/app/lib/constants/settings.rb index 3e8dda9bf..0776d4641 100644 --- a/app/lib/constants/settings.rb +++ b/app/lib/constants/settings.rb @@ -5,7 +5,6 @@ module Constants Customization Notifications Account - Billing Organization Extensions ].freeze diff --git a/app/models/admin_menu.rb b/app/models/admin_menu.rb index ff1e5f8a6..3eb12cf59 100644 --- a/app/models/admin_menu.rb +++ b/app/models/admin_menu.rb @@ -26,7 +26,6 @@ class AdminMenu scope :customization, "tools-line", [ item(name: "config"), - item(name: "html variants", controller: "html_variants"), item(name: "billboards"), item(name: "navigation links"), item(name: "pages"), diff --git a/app/views/admin/settings/forms/_community.html.erb b/app/views/admin/settings/forms/_community.html.erb index c796ab7e5..8f3dca270 100644 --- a/app/views/admin/settings/forms/_community.html.erb +++ b/app/views/admin/settings/forms/_community.html.erb @@ -1,6 +1,6 @@ <%= form_for(Settings::Community.new, url: admin_settings_communities_path, - html: { data: { action: "submit->config#updateConfigurationSettings" } }) do |f| %> + html: { data: { action: "submit->config#updateConfigurationSettings" }, class: "hidden" }) do |f| %>
Community Content
diff --git a/app/views/admin/settings/forms/_credits.html.erb b/app/views/admin/settings/forms/_credits.html.erb index 088c86a17..fd29ad01e 100644 --- a/app/views/admin/settings/forms/_credits.html.erb +++ b/app/views/admin/settings/forms/_credits.html.erb @@ -1,6 +1,6 @@ <%= form_for(Settings::General.new, url: admin_settings_general_settings_path, - html: { data: { action: "submit->config#updateConfigurationSettings" } }) do |f| %> + html: { data: { action: "submit->config#updateConfigurationSettings" }, class: "hidden" }) do |f| %>
Credits
diff --git a/app/views/admin/settings/show.html.erb b/app/views/admin/settings/show.html.erb index 971f900a2..f41ff3c16 100644 --- a/app/views/admin/settings/show.html.erb +++ b/app/views/admin/settings/show.html.erb @@ -9,7 +9,6 @@ <%= render partial: "forms/api_tokens" %> <%= render partial: "forms/authentication" %> - <%= render partial: "forms/campaign" %> <%= render partial: "forms/community" %> <%= render partial: "forms/credits" %> <%= render partial: "forms/emails" %> diff --git a/app/views/dashboards/_analytics.html.erb b/app/views/dashboards/_analytics.html.erb index 3436bb7c9..5f9d95b5f 100644 --- a/app/views/dashboards/_analytics.html.erb +++ b/app/views/dashboards/_analytics.html.erb @@ -17,9 +17,4 @@ <%= t("views.dashboard.summary.listings") %>
<%- end %> - -
- <%= @user.unspent_credits_count %> - <%= t("views.dashboard.summary.credits") %> -
diff --git a/cypress/e2e/seededFlows/adminFlows/config/campaignSection.spec.js b/cypress/e2e/seededFlows/adminFlows/config/campaignSection.spec.js deleted file mode 100644 index 013ce0819..000000000 --- a/cypress/e2e/seededFlows/adminFlows/config/campaignSection.spec.js +++ /dev/null @@ -1,65 +0,0 @@ -describe('Campaign Section', () => { - beforeEach(() => { - cy.testSetup(); - cy.fixture('users/adminUser.json').as('user'); - - cy.get('@user').then((user) => { - cy.loginUser(user); - }); - }); - - describe('sidebar image setting', () => { - it('rejects an invalid image URL', () => { - cy.get('@user').then(() => { - cy.visit('/admin/customization/config'); - cy.get('#new_settings_campaign').as('campaignSectionForm'); - - cy.get('@campaignSectionForm').findByText('Campaign').click(); - cy.get('@campaignSectionForm') - .findByPlaceholderText('Used at the top of the campaign sidebar') - .type('example.com/image.png'); - - cy.get('@campaignSectionForm').findByText('Update Settings').click(); - - cy.url().should('contains', '/admin/customization/config'); - - cy.findByTestId('snackbar').within(() => { - cy.findByRole('alert').should( - 'have.text', - 'Validation failed: Sidebar image is not a valid URL', - ); - }); - }); - }); - - it('accepts a valid image URL', () => { - cy.get('@user').then(() => { - cy.visit('/admin/customization/config'); - cy.get('#new_settings_campaign').as('campaignSectionForm'); - - cy.get('@campaignSectionForm').findByText('Campaign').click(); - cy.get('@campaignSectionForm') - .findByPlaceholderText('Used at the top of the campaign sidebar') - .type('https://example.com/image.png'); - - cy.get('@campaignSectionForm').findByText('Update Settings').click(); - - cy.url().should('contains', '/admin/customization/config'); - - cy.findByTestId('snackbar').within(() => { - cy.findByRole('alert').should( - 'have.text', - 'Successfully updated settings.', - ); - }); - - // Page reloaded so need to get a new reference to the form. - cy.get('#new_settings_campaign').as('campaignSectionForm'); - cy.get('#settings_campaign_sidebar_image').should( - 'have.value', - 'https://example.com/image.png', - ); - }); - }); - }); -}); diff --git a/spec/system/dashboards/user_visits_dashboard_spec.rb b/spec/system/dashboards/user_visits_dashboard_spec.rb index bdc796495..dabdc8c69 100644 --- a/spec/system/dashboards/user_visits_dashboard_spec.rb +++ b/spec/system/dashboards/user_visits_dashboard_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -RSpec.describe "Dashboard", js: true do +RSpec.describe "Dashboard", :js do let(:tag) { create(:tag) } let(:organization) { create(:organization) } let(:podcast) { create(:podcast) } @@ -9,31 +9,6 @@ RSpec.describe "Dashboard", js: true do let(:user1) { collection.user } let(:user2) { create(:user) } - context "when looking at analytics counters" do - before do - sign_in user1 - end - - it "shows the count of unspent credits and listings created" do - Credit.add_to(user1, 2) - - Credits::Buy.call( - purchaser: user1, - purchase: listing, - cost: 1, - ) - Credit.counter_culture_fix_counts - user1.reload - - visit dashboard_path - - within "main#main-content > header" do - expect(page).to have_text(/1\nCredits available/) - expect(page).to have_text(/1\nListings created/) - end - end - end - context "when looking at actions panel" do before do stub_const(