Removed unused/old/pre-refactor settings

•Removed:
- unused/old/pre-refactor settings
This commit is contained in:
mgabdev 2020-06-07 14:01:54 -04:00
parent 250e6a4357
commit 985e1458d5
11 changed files with 5 additions and 44 deletions

View File

@ -43,14 +43,11 @@ class Settings::PreferencesController < Settings::BaseController
:setting_auto_play_gif, :setting_auto_play_gif,
:setting_display_media, :setting_display_media,
:setting_expand_spoilers, :setting_expand_spoilers,
:setting_reduce_motion,
:setting_system_font_ui,
:setting_noindex, :setting_noindex,
:setting_theme, :setting_theme,
:setting_hide_network, :setting_hide_network,
:setting_aggregate_reblogs, :setting_aggregate_reblogs,
:setting_show_application, :setting_show_application,
:setting_advanced_layout,
:setting_group_in_home_feed, :setting_group_in_home_feed,
notification_emails: %i(follow follow_request reblog favourite mention digest report pending_account emails_from_gabcom), notification_emails: %i(follow follow_request reblog favourite mention digest report pending_account emails_from_gabcom),
interactions: %i(must_be_follower must_be_following) interactions: %i(must_be_follower must_be_following)

View File

@ -96,8 +96,6 @@ module ApplicationHelper
def body_classes def body_classes
output = (@body_classes || '').split(' ') output = (@body_classes || '').split(' ')
output << "theme-#{current_theme.parameterize}" 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 << 'rtl' if locale_direction == 'rtl'
output.reject(&:blank?).join(' ') output.reject(&:blank?).join(' ')
end end

View File

@ -1,5 +1,4 @@
import { reduceMotion } from '../../../initial_state';
import ReducedMotion from './reduced_motion'; import ReducedMotion from './reduced_motion';
import Motion from 'react-motion/lib/Motion'; import Motion from 'react-motion/lib/Motion';
export default reduceMotion ? ReducedMotion : Motion; export default ReducedMotion

View File

@ -5,7 +5,6 @@ const initialState = element && JSON.parse(element.textContent);
const getMeta = (prop) => initialState && initialState.meta && initialState.meta[prop]; const getMeta = (prop) => initialState && initialState.meta && initialState.meta[prop];
export const reduceMotion = getMeta('reduce_motion');
export const autoPlayGif = getMeta('auto_play_gif'); export const autoPlayGif = getMeta('auto_play_gif');
export const displayMedia = getMeta('display_media'); export const displayMedia = getMeta('display_media');
export const expandSpoilers = getMeta('expand_spoilers'); export const expandSpoilers = getMeta('expand_spoilers');
@ -21,7 +20,6 @@ export const source_url = getMeta('source_url');
export const version = getMeta('version'); export const version = getMeta('version');
export const profile_directory = getMeta('profile_directory'); export const profile_directory = getMeta('profile_directory');
export const isStaff = getMeta('is_staff'); export const isStaff = getMeta('is_staff');
export const forceSingleColumn = !getMeta('advanced_layout');
export const promotions = initialState && initialState.promotions; export const promotions = initialState && initialState.promotions;
export const unreadCount = getMeta('unread_count'); export const unreadCount = getMeta('unread_count');
export const lastReadNotificationId = getMeta('last_read_notification_id'); export const lastReadNotificationId = getMeta('last_read_notification_id');

View File

@ -26,14 +26,11 @@ class UserSettingsDecorator
user.settings['auto_play_gif'] = auto_play_gif_preference if change?('setting_auto_play_gif') 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['display_media'] = display_media_preference if change?('setting_display_media')
user.settings['expand_spoilers'] = expand_spoilers_preference if change?('setting_expand_spoilers') 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['noindex'] = noindex_preference if change?('setting_noindex')
user.settings['theme'] = theme_preference if change?('setting_theme') user.settings['theme'] = theme_preference if change?('setting_theme')
user.settings['hide_network'] = hide_network_preference if change?('setting_hide_network') 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['aggregate_reblogs'] = aggregate_reblogs_preference if change?('setting_aggregate_reblogs')
user.settings['show_application'] = show_application_preference if change?('setting_show_application') 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') user.settings['group_in_home_feed'] = group_in_home_feed_preference if change?('setting_group_in_home_feed')
end end
@ -65,10 +62,6 @@ class UserSettingsDecorator
boolean_cast_setting 'setting_delete_modal' boolean_cast_setting 'setting_delete_modal'
end end
def system_font_ui_preference
boolean_cast_setting 'setting_system_font_ui'
end
def auto_play_gif_preference def auto_play_gif_preference
boolean_cast_setting 'setting_auto_play_gif' boolean_cast_setting 'setting_auto_play_gif'
end end
@ -81,10 +74,6 @@ class UserSettingsDecorator
boolean_cast_setting 'setting_expand_spoilers' boolean_cast_setting 'setting_expand_spoilers'
end end
def reduce_motion_preference
boolean_cast_setting 'setting_reduce_motion'
end
def noindex_preference def noindex_preference
boolean_cast_setting 'setting_noindex' boolean_cast_setting 'setting_noindex'
end end
@ -109,10 +98,6 @@ class UserSettingsDecorator
boolean_cast_setting 'setting_aggregate_reblogs' boolean_cast_setting 'setting_aggregate_reblogs'
end end
def advanced_layout_preference
boolean_cast_setting 'setting_advanced_layout'
end
def group_in_home_feed_preference def group_in_home_feed_preference
boolean_cast_setting 'setting_group_in_home_feed' boolean_cast_setting 'setting_group_in_home_feed'
end end

View File

@ -107,9 +107,9 @@ class User < ApplicationRecord
has_many :session_activations, dependent: :destroy has_many :session_activations, dependent: :destroy
delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :delete_modal, 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, :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_reader :invite_code
attr_writer :external attr_writer :external

View File

@ -32,8 +32,6 @@ class InitialStateSerializer < ActiveModel::Serializer
store[:auto_play_gif] = object.current_account.user.setting_auto_play_gif store[:auto_play_gif] = object.current_account.user.setting_auto_play_gif
store[:display_media] = object.current_account.user.setting_display_media store[:display_media] = object.current_account.user.setting_display_media
store[:expand_spoilers] = object.current_account.user.setting_expand_spoilers 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[:group_in_home_feed] = object.current_account.user.setting_group_in_home_feed
store[:is_staff] = object.current_account.user.staff? store[:is_staff] = object.current_account.user.staff?
store[:unread_count] = unread_count object.current_account store[:unread_count] = unread_count object.current_account

View File

@ -44,9 +44,6 @@
.fields-group.fields-row__column.fields-row__column-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 = 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 .fields-group
= f.input :setting_unfollow_modal, as: :boolean, wrapper: :with_label = f.input :setting_unfollow_modal, as: :boolean, wrapper: :with_label
= f.input :setting_boost_modal, as: :boolean, wrapper: :with_label = f.input :setting_boost_modal, as: :boolean, wrapper: :with_label
@ -58,8 +55,6 @@
.fields-group .fields-group
= f.input :setting_auto_play_gif, as: :boolean, wrapper: :with_label = f.input :setting_auto_play_gif, as: :boolean, wrapper: :with_label
= f.input :setting_expand_spoilers, 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 = f.input :setting_group_in_home_feed, as: :boolean, wrapper: :with_label
.actions .actions

View File

@ -9,7 +9,6 @@ SimpleNavigation::Configuration.run do |navigation|
end 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 :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 :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| 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 :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| 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 s.item :export, safe_join([fa_icon('cloud-download fw'), t('settings.export')]), settings_export_url
end 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 :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| n.item :moderation, safe_join([fa_icon('gavel fw'), t('moderation.title')]), admin_reports_url, if: proc { current_user.staff? } do |s|

View File

@ -141,9 +141,9 @@ Rails.application.routes.draw do
end end
resources :emojis, only: [:show] resources :emojis, only: [:show]
resources :invites, only: [:index, :create, :destroy] # resources :invites, only: [:index, :create, :destroy]
resources :filters, except: [:show] resources :filters, except: [:show]
resource :relationships, only: [:show, :update] # resource :relationships, only: [:show, :update]
get '/public', to: redirect('/home'), as: :public_timeline # homehack get '/public', to: redirect('/home'), as: :public_timeline # homehack
get '/media_proxy/:id/(*any)', to: 'media_proxy#show', as: :media_proxy get '/media_proxy/:id/(*any)', to: 'media_proxy#show', as: :media_proxy

View File

@ -27,11 +27,9 @@ defaults: &defaults
preview_sensitive_media: false preview_sensitive_media: false
reduce_motion: false reduce_motion: false
show_application: true show_application: true
system_font_ui: false
noindex: false noindex: false
theme: 'default' theme: 'default'
aggregate_reblogs: true aggregate_reblogs: true
advanced_layout: false
notification_emails: notification_emails:
follow: false follow: false
reblog: false reblog: false