diff --git a/Gemfile b/Gemfile index 8576937d2df..16ced425861 100644 --- a/Gemfile +++ b/Gemfile @@ -45,7 +45,7 @@ gem 'omniauth-saml', '~> 2.0' gem 'color_diff', '~> 0.1' gem 'csv', '~> 3.2' -gem 'discard', '~> 1.2' +gem 'discard', '~> 2.0' gem 'doorkeeper', '~> 5.6' gem 'faraday-httpclient' gem 'fast_blank', '~> 1.0' diff --git a/Gemfile.lock b/Gemfile.lock index 2a659eb3c21..64091eedf99 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -99,7 +99,7 @@ GEM ast (2.4.3) attr_required (1.0.2) aws-eventstream (1.4.0) - aws-partitions (1.1254.0) + aws-partitions (1.1255.0) aws-sdk-core (3.250.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) @@ -108,11 +108,11 @@ GEM bigdecimal jmespath (~> 1, >= 1.6.1) logger - aws-sdk-kms (1.125.0) - aws-sdk-core (~> 3, >= 3.247.0) + aws-sdk-kms (1.128.0) + aws-sdk-core (~> 3, >= 3.248.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.222.0) - aws-sdk-core (~> 3, >= 3.247.0) + aws-sdk-s3 (1.224.0) + aws-sdk-core (~> 3, >= 3.248.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) aws-sigv4 (1.12.1) @@ -205,8 +205,8 @@ GEM devise (>= 4.0.0) rpam2 (~> 4.0) diff-lcs (1.6.2) - discard (1.4.0) - activerecord (>= 4.2, < 9.0) + discard (2.0.0) + activerecord (>= 7.0, < 9.0) docile (1.4.1) domain_name (0.6.20240107) doorkeeper (5.9.0) @@ -354,7 +354,7 @@ GEM azure-blob (~> 0.5.2) hashie (~> 5.0) jmespath (1.6.2) - json (2.19.5) + json (2.19.7) json-canonicalization (1.0.0) json-jwt (1.17.0) activesupport (>= 4.2) @@ -755,7 +755,7 @@ GEM rspec-mocks (~> 3.0) sidekiq (>= 5, < 9) rspec-support (3.13.7) - rubocop (1.86.2) + rubocop (1.87.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -779,7 +779,7 @@ GEM lint_roller (~> 1.1) rubocop (>= 1.75.0, < 2.0) rubocop-ast (>= 1.47.1, < 2.0) - rubocop-rails (2.35.2) + rubocop-rails (2.35.3) activesupport (>= 4.2.0) lint_roller (~> 1.1) rack (>= 1.1) @@ -802,7 +802,7 @@ GEM ruby-vips (2.3.0) ffi (~> 1.12) logger - rubyzip (3.3.0) + rubyzip (3.3.1) rufus-scheduler (3.9.2) fugit (~> 1.1, >= 1.11.1) safety_net_attestation (0.5.0) @@ -970,7 +970,7 @@ DEPENDENCIES devise devise-two-factor devise_pam_authenticatable2 (~> 9.2) - discard (~> 1.2) + discard (~> 2.0) doorkeeper (~> 5.6) dotenv fabrication diff --git a/app/controllers/concerns/settings/export_controller_concern.rb b/app/controllers/concerns/settings/export_controller_concern.rb index 2cf28cced87..9917a5bd049 100644 --- a/app/controllers/concerns/settings/export_controller_concern.rb +++ b/app/controllers/concerns/settings/export_controller_concern.rb @@ -19,15 +19,12 @@ module Settings::ExportControllerConcern def send_export_file respond_to do |format| - format.csv { send_data export_data, filename: export_filename } + format.csv { send_data export_data, filename: "#{controller_name}.csv" } + format.json { send_data export_data, filename: "#{controller_name}.json" } end end def export_data raise 'Override in controller' end - - def export_filename - "#{controller_name}.csv" - end end diff --git a/app/controllers/settings/exports/custom_filters_controller.rb b/app/controllers/settings/exports/custom_filters_controller.rb new file mode 100644 index 00000000000..ec7c0dfa040 --- /dev/null +++ b/app/controllers/settings/exports/custom_filters_controller.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Settings + module Exports + class CustomFiltersController < BaseController + include Settings::ExportControllerConcern + + def index + send_export_file + end + + private + + def export_data + @export.to_custom_filters_json + end + end + end +end diff --git a/app/javascript/mastodon/features/closed_registrations_modal/index.jsx b/app/javascript/mastodon/features/closed_registrations_modal/index.jsx index 89ced8029c2..244be5916a2 100644 --- a/app/javascript/mastodon/features/closed_registrations_modal/index.jsx +++ b/app/javascript/mastodon/features/closed_registrations_modal/index.jsx @@ -7,7 +7,7 @@ import { fetchServer } from 'mastodon/actions/server'; import { domain } from 'mastodon/initial_state'; const mapStateToProps = state => ({ - message: state.getIn(['server', 'server', 'registrations', 'message']), + message: state.getIn(['server', 'server', 'item', 'registrations', 'message']), }); class ClosedRegistrationsModal extends ImmutablePureComponent { diff --git a/app/javascript/mastodon/features/report/category.jsx b/app/javascript/mastodon/features/report/category.jsx index 7a37426a65c..4c3a7d6a3b9 100644 --- a/app/javascript/mastodon/features/report/category.jsx +++ b/app/javascript/mastodon/features/report/category.jsx @@ -28,14 +28,14 @@ const messages = defineMessages({ }); const mapStateToProps = state => ({ - rules: state.getIn(['server', 'server', 'rules'], ImmutableList()), + rules: state.getIn(['server', 'server', 'item', 'rules'], []), }); class Category extends PureComponent { static propTypes = { onNextStep: PropTypes.func.isRequired, - rules: ImmutablePropTypes.list, + rules: PropTypes.arrayOf(PropTypes.object), category: PropTypes.string, onChangeCategory: PropTypes.func.isRequired, startedFrom: PropTypes.oneOf(['status', 'account']), @@ -69,7 +69,7 @@ class Category extends PureComponent { render () { const { category, startedFrom, rules, intl } = this.props; - const options = rules.size > 0 ? [ + const options = rules.length > 0 ? [ 'dislike', 'spam', 'legal', diff --git a/app/javascript/mastodon/features/report/rules.jsx b/app/javascript/mastodon/features/report/rules.jsx index 33087e3d620..765bef7c6c7 100644 --- a/app/javascript/mastodon/features/report/rules.jsx +++ b/app/javascript/mastodon/features/report/rules.jsx @@ -11,7 +11,7 @@ import { Button } from 'mastodon/components/button'; import Option from './components/option'; const mapStateToProps = state => ({ - rules: state.getIn(['server', 'server', 'rules']), + rules: state.getIn(['server', 'server', 'item', 'rules']), locale: state.getIn(['meta', 'locale']), }); @@ -19,7 +19,7 @@ class Rules extends PureComponent { static propTypes = { onNextStep: PropTypes.func.isRequired, - rules: ImmutablePropTypes.list, + rules: PropTypes.arrayOf(PropTypes.object), locale: PropTypes.string, selectedRuleIds: ImmutablePropTypes.set.isRequired, onToggle: PropTypes.func.isRequired, @@ -46,12 +46,12 @@ class Rules extends PureComponent {
{rules.map(item => (