diff --git a/Gemfile.lock b/Gemfile.lock index 31e331ea6e..e08cc74ea4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -187,7 +187,7 @@ GEM irb (~> 1.10) reline (>= 0.3.8) debug_inspector (1.2.0) - devise (5.0.1) + devise (5.0.2) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 7.0) diff --git a/app/controllers/admin/collections_controller.rb b/app/controllers/admin/collections_controller.rb new file mode 100644 index 0000000000..4701500f9f --- /dev/null +++ b/app/controllers/admin/collections_controller.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Admin + class CollectionsController < BaseController + before_action :set_account + before_action :set_collection, only: :show + + def show + authorize @collection, :show? + end + + private + + def set_account + @account = Account.find(params[:account_id]) + end + + def set_collection + @collection = @account.collections.includes(accepted_collection_items: :account).find(params[:id]) + end + end +end diff --git a/app/controllers/admin/reports_controller.rb b/app/controllers/admin/reports_controller.rb index aa877f1448..44ee7206bf 100644 --- a/app/controllers/admin/reports_controller.rb +++ b/app/controllers/admin/reports_controller.rb @@ -50,7 +50,7 @@ module Admin private def filtered_reports - ReportFilter.new(filter_params).results.order(id: :desc).includes(:account, :target_account) + ReportFilter.new(filter_params).results.order(id: :desc).includes(:account, :target_account, :collections) end def filter_params @@ -58,7 +58,7 @@ module Admin end def set_report - @report = Report.find(params[:id]) + @report = Report.includes(collections: :accepted_collection_items).find(params[:id]) end end end diff --git a/app/javascript/flavours/glitch/api_types/accounts.ts b/app/javascript/flavours/glitch/api_types/accounts.ts index 913a201fef..9fe076ce96 100644 --- a/app/javascript/flavours/glitch/api_types/accounts.ts +++ b/app/javascript/flavours/glitch/api_types/accounts.ts @@ -12,6 +12,26 @@ export interface ApiAccountRoleJSON { name: string; } +type ApiFeaturePolicy = + | 'public' + | 'followers' + | 'following' + | 'disabled' + | 'unsupported_policy'; + +type ApiUserFeaturePolicy = + | 'automatic' + | 'manual' + | 'denied' + | 'missing' + | 'unknown'; + +interface ApiFeaturePolicyJSON { + automatic: ApiFeaturePolicy[]; + manual: ApiFeaturePolicy[]; + current_user: ApiUserFeaturePolicy; +} + // See app/serializers/rest/account_serializer.rb export interface BaseApiAccountJSON { acct: string; @@ -23,6 +43,7 @@ export interface BaseApiAccountJSON { indexable: boolean; display_name: string; emojis: ApiCustomEmojiJSON[]; + feature_approval: ApiFeaturePolicyJSON; fields: ApiAccountFieldJSON[]; followers_count: number; following_count: number; diff --git a/app/javascript/flavours/glitch/components/account_bio.tsx b/app/javascript/flavours/glitch/components/account_bio.tsx index 6d4ab1ddd4..75067530c9 100644 --- a/app/javascript/flavours/glitch/components/account_bio.tsx +++ b/app/javascript/flavours/glitch/components/account_bio.tsx @@ -6,7 +6,7 @@ import { EmojiHTML } from './emoji/html'; import { useElementHandledLink } from './status/handled_link'; interface AccountBioProps { - className: string; + className?: string; accountId: string; showDropdown?: boolean; } diff --git a/app/javascript/flavours/glitch/components/form_fields/text_area_field.stories.tsx b/app/javascript/flavours/glitch/components/form_fields/text_area_field.stories.tsx index 448af8a28e..190239aee2 100644 --- a/app/javascript/flavours/glitch/components/form_fields/text_area_field.stories.tsx +++ b/app/javascript/flavours/glitch/components/form_fields/text_area_field.stories.tsx @@ -42,6 +42,13 @@ export const WithError: Story = { }, }; +export const AutoSize: Story = { + args: { + autoSize: true, + defaultValue: 'This textarea will grow as you type more lines.', + }, +}; + export const Plain: Story = { render(args) { return