From 985e1458d57041613bc036f9820fcd1e50f5b3ca Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Sun, 7 Jun 2020 14:01:54 -0400 Subject: [PATCH] Removed unused/old/pre-refactor settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit •Removed: - unused/old/pre-refactor settings --- .../settings/preferences_controller.rb | 3 --- app/helpers/application_helper.rb | 2 -- .../gabsocial/features/ui/util/optional_motion.js | 3 +-- app/javascript/gabsocial/initial_state.js | 2 -- app/lib/user_settings_decorator.rb | 15 --------------- app/models/user.rb | 4 ++-- app/serializers/initial_state_serializer.rb | 2 -- app/views/settings/preferences/show.html.haml | 5 ----- config/navigation.rb | 7 ------- config/routes.rb | 4 ++-- config/settings.yml | 2 -- 11 files changed, 5 insertions(+), 44 deletions(-) diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb index 8b7dbac8..cb1de69d 100644 --- a/app/controllers/settings/preferences_controller.rb +++ b/app/controllers/settings/preferences_controller.rb @@ -43,14 +43,11 @@ class Settings::PreferencesController < Settings::BaseController :setting_auto_play_gif, :setting_display_media, :setting_expand_spoilers, - :setting_reduce_motion, - :setting_system_font_ui, :setting_noindex, :setting_theme, :setting_hide_network, :setting_aggregate_reblogs, :setting_show_application, - :setting_advanced_layout, :setting_group_in_home_feed, notification_emails: %i(follow follow_request reblog favourite mention digest report pending_account emails_from_gabcom), interactions: %i(must_be_follower must_be_following) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bdeb8cf1..e76df3e0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -96,8 +96,6 @@ module ApplicationHelper def body_classes output = (@body_classes || '').split(' ') output << "theme-#{current_theme.parameterize}" - output << 'system-font' if current_account&.user&.setting_system_font_ui - output << (current_account&.user&.setting_reduce_motion ? 'reduce-motion' : 'no-reduce-motion') output << 'rtl' if locale_direction == 'rtl' output.reject(&:blank?).join(' ') end diff --git a/app/javascript/gabsocial/features/ui/util/optional_motion.js b/app/javascript/gabsocial/features/ui/util/optional_motion.js index df3a8b54..dfc9655c 100644 --- a/app/javascript/gabsocial/features/ui/util/optional_motion.js +++ b/app/javascript/gabsocial/features/ui/util/optional_motion.js @@ -1,5 +1,4 @@ -import { reduceMotion } from '../../../initial_state'; import ReducedMotion from './reduced_motion'; import Motion from 'react-motion/lib/Motion'; -export default reduceMotion ? ReducedMotion : Motion; +export default ReducedMotion diff --git a/app/javascript/gabsocial/initial_state.js b/app/javascript/gabsocial/initial_state.js index b4ac7bc3..1bab3e14 100644 --- a/app/javascript/gabsocial/initial_state.js +++ b/app/javascript/gabsocial/initial_state.js @@ -5,7 +5,6 @@ const initialState = element && JSON.parse(element.textContent); const getMeta = (prop) => initialState && initialState.meta && initialState.meta[prop]; -export const reduceMotion = getMeta('reduce_motion'); export const autoPlayGif = getMeta('auto_play_gif'); export const displayMedia = getMeta('display_media'); export const expandSpoilers = getMeta('expand_spoilers'); @@ -21,7 +20,6 @@ export const source_url = getMeta('source_url'); export const version = getMeta('version'); export const profile_directory = getMeta('profile_directory'); export const isStaff = getMeta('is_staff'); -export const forceSingleColumn = !getMeta('advanced_layout'); export const promotions = initialState && initialState.promotions; export const unreadCount = getMeta('unread_count'); export const lastReadNotificationId = getMeta('last_read_notification_id'); diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb index de6bf670..401e87cf 100644 --- a/app/lib/user_settings_decorator.rb +++ b/app/lib/user_settings_decorator.rb @@ -26,14 +26,11 @@ class UserSettingsDecorator user.settings['auto_play_gif'] = auto_play_gif_preference if change?('setting_auto_play_gif') user.settings['display_media'] = display_media_preference if change?('setting_display_media') user.settings['expand_spoilers'] = expand_spoilers_preference if change?('setting_expand_spoilers') - user.settings['reduce_motion'] = reduce_motion_preference if change?('setting_reduce_motion') - user.settings['system_font_ui'] = system_font_ui_preference if change?('setting_system_font_ui') user.settings['noindex'] = noindex_preference if change?('setting_noindex') user.settings['theme'] = theme_preference if change?('setting_theme') user.settings['hide_network'] = hide_network_preference if change?('setting_hide_network') user.settings['aggregate_reblogs'] = aggregate_reblogs_preference if change?('setting_aggregate_reblogs') user.settings['show_application'] = show_application_preference if change?('setting_show_application') - user.settings['advanced_layout'] = advanced_layout_preference if change?('setting_advanced_layout') user.settings['group_in_home_feed'] = group_in_home_feed_preference if change?('setting_group_in_home_feed') end @@ -65,10 +62,6 @@ class UserSettingsDecorator boolean_cast_setting 'setting_delete_modal' end - def system_font_ui_preference - boolean_cast_setting 'setting_system_font_ui' - end - def auto_play_gif_preference boolean_cast_setting 'setting_auto_play_gif' end @@ -81,10 +74,6 @@ class UserSettingsDecorator boolean_cast_setting 'setting_expand_spoilers' end - def reduce_motion_preference - boolean_cast_setting 'setting_reduce_motion' - end - def noindex_preference boolean_cast_setting 'setting_noindex' end @@ -109,10 +98,6 @@ class UserSettingsDecorator boolean_cast_setting 'setting_aggregate_reblogs' end - def advanced_layout_preference - boolean_cast_setting 'setting_advanced_layout' - end - def group_in_home_feed_preference boolean_cast_setting 'setting_group_in_home_feed' end diff --git a/app/models/user.rb b/app/models/user.rb index eb78a4d6..9105059a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -107,9 +107,9 @@ class User < ApplicationRecord has_many :session_activations, dependent: :destroy delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :delete_modal, - :reduce_motion, :system_font_ui, :noindex, :theme, :display_media, :hide_network, + :noindex, :theme, :display_media, :hide_network, :expand_spoilers, :default_language, :aggregate_reblogs, :show_application, - :advanced_layout, :group_in_home_feed, to: :settings, prefix: :setting, allow_nil: false + :group_in_home_feed, to: :settings, prefix: :setting, allow_nil: false attr_reader :invite_code attr_writer :external diff --git a/app/serializers/initial_state_serializer.rb b/app/serializers/initial_state_serializer.rb index f50d0502..b1af0cf7 100644 --- a/app/serializers/initial_state_serializer.rb +++ b/app/serializers/initial_state_serializer.rb @@ -32,8 +32,6 @@ class InitialStateSerializer < ActiveModel::Serializer store[:auto_play_gif] = object.current_account.user.setting_auto_play_gif store[:display_media] = object.current_account.user.setting_display_media store[:expand_spoilers] = object.current_account.user.setting_expand_spoilers - store[:reduce_motion] = object.current_account.user.setting_reduce_motion - store[:advanced_layout] = object.current_account.user.setting_advanced_layout store[:group_in_home_feed] = object.current_account.user.setting_group_in_home_feed store[:is_staff] = object.current_account.user.staff? store[:unread_count] = unread_count object.current_account diff --git a/app/views/settings/preferences/show.html.haml b/app/views/settings/preferences/show.html.haml index 67d41561..98f3aedd 100644 --- a/app/views/settings/preferences/show.html.haml +++ b/app/views/settings/preferences/show.html.haml @@ -44,9 +44,6 @@ .fields-group.fields-row__column.fields-row__column-6 = f.input :setting_display_media, collection: ['default', 'show_all', 'hide_all'], wrapper: :with_label, include_blank: false, label_method: lambda { |item| t("simple_form.hints.defaults.setting_display_media_#{item}") }, hint: false - .fields-group - = f.input :setting_advanced_layout, as: :boolean, wrapper: :with_label - .fields-group = f.input :setting_unfollow_modal, as: :boolean, wrapper: :with_label = f.input :setting_boost_modal, as: :boolean, wrapper: :with_label @@ -58,8 +55,6 @@ .fields-group = f.input :setting_auto_play_gif, as: :boolean, wrapper: :with_label = f.input :setting_expand_spoilers, as: :boolean, wrapper: :with_label - = f.input :setting_reduce_motion, as: :boolean, wrapper: :with_label - = f.input :setting_system_font_ui, as: :boolean, wrapper: :with_label = f.input :setting_group_in_home_feed, as: :boolean, wrapper: :with_label .actions diff --git a/config/navigation.rb b/config/navigation.rb index 55fb5ac4..f4c5cd9a 100644 --- a/config/navigation.rb +++ b/config/navigation.rb @@ -9,7 +9,6 @@ SimpleNavigation::Configuration.run do |navigation| end n.item :preferences, safe_join([fa_icon('cog fw'), t('settings.preferences')]), settings_preferences_url, highlights_on: %r{/settings/preferences|/settings/notifications} - n.item :relationships, safe_join([fa_icon('users fw'), t('settings.relationships')]), relationships_url n.item :filters, safe_join([fa_icon('filter fw'), t('filters.index.title')]), filters_path, highlights_on: %r{/filters} n.item :security, safe_join([fa_icon('lock fw'), t('settings.account')]), edit_user_registration_url do |s| @@ -24,16 +23,10 @@ SimpleNavigation::Configuration.run do |navigation| n.item :requests, safe_join([fa_icon('id-card-o fw'), t('verifications.requests.title')]), settings_verifications_requests_url - n.item :billing, safe_join([fa_icon('usd fw'), t('settings.billing')]), settings_billing_transactions_url do |s| - s.item :transactions, safe_join([fa_icon('bars fw'), t('settings.transactions')]), settings_billing_transactions_url - s.item :upgrade, safe_join([fa_icon('usd fw'), t('settings.upgrade')]), 'https://pro.gab.com' - end - n.item :data, safe_join([fa_icon('cloud-download fw'), t('settings.import_and_export')]), settings_export_url do |s| s.item :export, safe_join([fa_icon('cloud-download fw'), t('settings.export')]), settings_export_url end - n.item :invites, safe_join([fa_icon('user-plus fw'), t('invites.title')]), invites_path, if: proc { Setting.min_invite_role == 'user' } n.item :development, safe_join([fa_icon('code fw'), t('settings.development')]), settings_applications_url n.item :moderation, safe_join([fa_icon('gavel fw'), t('moderation.title')]), admin_reports_url, if: proc { current_user.staff? } do |s| diff --git a/config/routes.rb b/config/routes.rb index 258bd245..de124054 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -141,9 +141,9 @@ Rails.application.routes.draw do end resources :emojis, only: [:show] - resources :invites, only: [:index, :create, :destroy] + # resources :invites, only: [:index, :create, :destroy] resources :filters, except: [:show] - resource :relationships, only: [:show, :update] + # resource :relationships, only: [:show, :update] get '/public', to: redirect('/home'), as: :public_timeline # homehack get '/media_proxy/:id/(*any)', to: 'media_proxy#show', as: :media_proxy diff --git a/config/settings.yml b/config/settings.yml index ec9d21f7..d7c38878 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -27,11 +27,9 @@ defaults: &defaults preview_sensitive_media: false reduce_motion: false show_application: true - system_font_ui: false noindex: false theme: 'default' aggregate_reblogs: true - advanced_layout: false notification_emails: follow: false reblog: false