Merge remote-tracking branch 'parent/main' into kb_migration

This commit is contained in:
KMY 2023-08-07 22:10:24 +09:00
commit ce3cf82f8f
175 changed files with 1951 additions and 826 deletions

View file

@ -32,6 +32,7 @@ class InitialStateSerializer < ActiveModel::Serializer
single_user_mode: Rails.configuration.x.single_user_mode,
trends_as_landing_page: Setting.trends_as_landing_page,
status_page_url: Setting.status_page_url,
sso_redirect: sso_redirect,
}
if object.current_account
@ -112,4 +113,8 @@ class InitialStateSerializer < ActiveModel::Serializer
def instance_presenter
@instance_presenter ||= InstancePresenter.new
end
def sso_redirect
"/auth/auth/#{Devise.omniauth_providers[0]}" if ENV['OMNIAUTH_ONLY'] == 'true' && Devise.omniauth_providers.length == 1
end
end

View file

@ -0,0 +1,5 @@
# frozen_string_literal: true
class REST::LanguageSerializer < ActiveModel::Serializer
attributes :code, :name
end

View file

@ -6,7 +6,7 @@ class REST::PreviewCardSerializer < ActiveModel::Serializer
attributes :url, :title, :description, :language, :type,
:author_name, :author_url, :provider_name,
:provider_url, :html, :width, :height,
:image, :embed_url, :blurhash, :published_at
:image, :image_description, :embed_url, :blurhash, :published_at
def image
object.image? ? full_asset_url(object.image.url(:original)) : nil