Skip to content

Commit

Permalink
Merge pull request #7306 from fjordllc/main
Browse files Browse the repository at this point in the history
Release 2024-02-08 05:43:31
  • Loading branch information
komagata authored Feb 8, 2024
2 parents b11b5e9 + af01eb0 commit 3af306a
Show file tree
Hide file tree
Showing 34 changed files with 150 additions and 154 deletions.
20 changes: 0 additions & 20 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ Style/HashSyntax:
- 'app/controllers/api/session_controller.rb'
- 'app/controllers/api/watches/toggle_controller.rb'
- 'app/controllers/application_controller.rb'
- 'app/controllers/notifications/read_by_category_controller.rb'
- 'app/controllers/notifications_controller.rb'
- 'app/controllers/products_controller.rb'
- 'app/controllers/user_sessions_controller.rb'
- 'app/helpers/meta_tags_helper.rb'
- 'app/helpers/page_tab_helper.rb'
- 'app/helpers/reactions_helper.rb'
- 'app/jobs/ai_answer_create_job.rb'
- 'app/mailers/activity_mailer.rb'
- 'app/mailers/notification_mailer.rb'
- 'app/models/announcement_notifier.rb'
- 'app/models/answer.rb'
- 'app/models/answer_notifier.rb'
Expand Down Expand Up @@ -63,16 +53,6 @@ Style/HashSyntax:
- 'app/models/reaction.rb'
- 'app/models/regular_event/participants_creator.rb'
- 'app/models/regular_event/participants_watcher.rb'
- 'app/models/regular_event_update_notifier.rb'
- 'app/models/report.rb'
- 'app/models/report_notifier.rb'
- 'app/models/searcher.rb'
- 'app/models/subscription.rb'
- 'app/models/unfinished_data_destroyer.rb'
- 'app/models/user.rb'
- 'app/notifiers/activity_notifier.rb'
- 'app/notifiers/discord_notifier.rb'
- 'lib/bootcamp/setup.rb'
- 'test/deliveries/activity_delivery_test.rb'
- 'test/mailers/activity_mailer_test.rb'
- 'test/mailers/notification_mailer_test.rb'
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,11 @@ GEM
netrc (0.11.0)
newspaper (0.2.0)
nio4r (2.7.0)
nokogiri (1.15.4-arm64-darwin)
nokogiri (1.16.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-darwin)
nokogiri (1.16.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux)
nokogiri (1.16.2-x86_64-linux)
racc (~> 1.4)
oauth (1.1.0)
oauth-tty (~> 1.0, >= 1.0.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ def create
target = params[:target].presence&.to_sym
notifications = current_user.notifications.by_target(target).unreads
current_user.mark_all_as_read_and_delete_cache_of_unreads(target_notifications: notifications)
redirect_to notifications_path(target: target), notice: '既読にしました'
redirect_to notifications_path(target:), notice: '既読にしました'
end
end
2 changes: 1 addition & 1 deletion app/controllers/notifications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def index

def show
link = @notification.read_attribute :link
@notifications = current_user.notifications.where(link: link)
@notifications = current_user.notifications.where(link:)
current_user.mark_all_as_read_and_delete_cache_of_unreads(target_notifications: @notifications)
redirect_to link
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def update
set_wip
update_published_at
if @product.update(product_params)
Newspaper.publish(:product_update, { product: @product, current_user: current_user })
Newspaper.publish(:product_update, { product: @product, current_user: })
Newspaper.publish(:product_save, { product: @product })
notice_another_mentor_assigned_as_checker
redirect_to Redirection.determin_url(self, @product), notice: notice_message(@product, :update)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/user_sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def callback
auth = request.env['omniauth.auth']
github_id = auth[:uid]
if current_user.blank?
user = User.find_by(github_id: github_id)
user = User.find_by(github_id:)
if user.blank?
flash[:alert] = 'ログインに失敗しました。先にアカウントを作成後、GitHub連携を行ってください。'
redirect_to root_url
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/meta_tags_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def default_meta_tags

def welcome_meta_tags
default_meta_tags.deep_merge({
title: title,
title:,
description: '月額29,800円、全機能が使えるお試し期間付き。フィヨルドブートキャンプは現場の即戦力になるためのスキルとプログラミングの楽しさを伝える、現役エンジニアが考える理想のプログラミングスクールの実現に励んでいます。',
og: {
title: title || 'FJORD BOOT CAMP(フィヨルドブートキャンプ)',
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/page_tab_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def root_tab(resource)

def page_tab_member(path, tab_name, is_products_tab: false)
{
path: path,
path:,
target_name: tab_name.to_s,
display_name: display_tab_name(tab_name),
is_products_tab: is_products_tab
is_products_tab:
}
end

Expand Down
2 changes: 1 addition & 1 deletion app/helpers/reactions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def reactions_attributes(reactionable)
end

def reaction_attributes(reactionable, kind, only_reacted: true)
attributes = { data: { reaction: { kind: kind } } }
attributes = { data: { reaction: { kind: } } }
attributes[:hidden] = reactionable.reaction_count_by(kind).zero? if only_reacted
reaction_id = reactionable.find_reaction_id_by(kind, current_user.login_name)

Expand Down
4 changes: 2 additions & 2 deletions app/javascript/answers.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template lang="pug">
.thread-comments(v-if='loaded === false')
#comments.thread-comments(v-if='loaded === false')
commentPlaceholder(v-for='num in placeholderCount', :key='num')
.thread-comments(v-else)
#comments.thread-comments(v-else)
header.thread-comments__header
h2.thread-comments__title 回答・コメント
.thread-comments__items
Expand Down
20 changes: 0 additions & 20 deletions app/javascript/stylesheets/atoms/_a-user-icon.sass
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,3 @@
+size(1.5rem)
+media-breakpoint-down(sm)
+size(1.125rem)

.a-long-text
.a-user-emoji-link
+size(2em)
display: inline-block
&:not(:first-child)
margin-left: .5em
.header-anchor + .a-user-emoji-link
margin-left: 0
.a-user-emoji
+size(1.8em)
object-fit: cover
background-color: var(--base)
border-radius: 2px
display: inline-block !important
border: none !important
margin-left: 0 !important
margin-right: 0 !important
.articles & .a-user-emoji-link
pointer-events: none
31 changes: 26 additions & 5 deletions app/javascript/stylesheets/config/mixins/_long-text-style.sass
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,6 @@

+speak

*:first-child
margin-top: 0
*:last-child
margin-bottom: 0

// header-anchor
h1,
h2,
Expand Down Expand Up @@ -346,3 +341,29 @@
&:link,
&:visited
color: var(--main)

.a-user-emoji-link
+size(2em)
display: inline-block
&:not(:first-child)
margin-left: .5em
.header-anchor + .a-user-emoji-link
margin-left: 0
.a-user-emoji
+size(1.8em)
object-fit: cover
background-color: var(--base)
border-radius: 2px
display: inline-block !important
border: none !important
margin-left: 0 !important
margin-right: 0 !important
vertical-align: middle
body.articles & .a-user-emoji-link,
body.buzz & .a-user-emoji-link
pointer-events: none

*:first-child
margin-top: 0
*:last-child
margin-bottom: 0
2 changes: 1 addition & 1 deletion app/jobs/ai_answer_create_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ def perform(question_id:)
token = Rails.application.secrets[:open_ai][:access_token]
generator = AI::AnswerGenerator.new(open_ai_access_token: token)
ai_answer = generator.call("#{question.body}\n#{question.description}")
question.update(ai_answer: ai_answer)
question.update(ai_answer:)
end
end
44 changes: 22 additions & 22 deletions app/mailers/activity_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def comebacked(args = {})
kind: Notification.kinds[:comebacked]
)
subject = "[FBC] #{@sender.login_name}さんが休会から復帰しました。"
mail to: @user.email, subject: subject
mail to: @user.email, subject:
end

# required params: comment, message, receiver
Expand All @@ -48,7 +48,7 @@ def came_comment(args = {})
@user = @receiver
link = "/#{@comment.commentable_type.downcase.pluralize}/#{@comment.commentable.id}"
@link_url = notification_redirector_url(
link: link,
link:,
kind: Notification.kinds[:came_comment]
)
mail to: @user.email, subject: "[FBC] #{@message}"
Expand All @@ -67,7 +67,7 @@ def graduated(args = {})
kind: Notification.kinds[:graduated]
)
subject = "[FBC] #{@sender.login_name}さんが卒業しました。"
mail to: @user.email, subject: subject
mail to: @user.email, subject:
end

# required params: answer
Expand Down Expand Up @@ -95,7 +95,7 @@ def submitted(args = {})
kind: Notification.kinds[:submitted]
)
subject = "[FBC] #{@product.user.login_name}さんが#{@product.title}を提出しました。"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?

message
Expand All @@ -112,7 +112,7 @@ def post_announcement(args = {})
kind: Notification.kinds[:announced]
)
subject = "[FBC] お知らせ「#{@announcement.title}」"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?

message
Expand All @@ -129,7 +129,7 @@ def came_question(args = {})
kind: Notification.kinds[:came_question]
)
subject = "[FBC] #{@sender.login_name}さんから質問「#{@question.title}」が投稿されました。"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)

message.perform_deliveries = @user.mail_notification? && !@user.retired?
message
Expand All @@ -146,7 +146,7 @@ def retired(args = {})
kind: Notification.kinds[:retired]
)
subject = "[FBC] #{@sender.login_name}さんが退会しました。"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?

message
Expand All @@ -163,7 +163,7 @@ def checked(args = {})
kind: Notification.kinds[:checked]
)
subject = "[FBC] #{@user.login_name}さんの#{@check.checkable.title}を確認しました。"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?

message
Expand All @@ -180,7 +180,7 @@ def mentioned(args = {})
kind: Notification.kinds[:mentioned]
)
subject = "[FBC] #{@mentionable.where_mention}#{@mentionable.sender.login_name}さんからメンションがありました。"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?

message
Expand All @@ -198,7 +198,7 @@ def create_page(args = {})
)
subject = "[FBC] #{@page.user.login_name}さんがDocsに#{@page.title}を投稿しました。"

message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?

message
Expand All @@ -214,7 +214,7 @@ def moved_up_event_waiting_user(args = {})
kind: Notification.kinds[:moved_up_event_waiting_user]
)
subject = "[FBC] #{@event.title}で、補欠から参加に繰り上がりました。"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?

message
Expand All @@ -232,7 +232,7 @@ def following_report(args = {})
)
subject = "[FBC] #{@report.user.login_name}さんが日報【 #{@report.title} 】を書きました!"

message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?

message
Expand All @@ -253,7 +253,7 @@ def watching_notification(args = {})
@action = @watchable.instance_of?(Question) ? '回答' : 'コメント'
subject = "[FBC] #{@watchable.user.login_name}さんの#{@watchable.notification_title}#{@sender.login_name}さんが#{@action}しました。"

message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?
message
end
Expand All @@ -270,7 +270,7 @@ def assigned_as_checker(args = {})
)

subject = "[FBC] #{@product.user.login_name}さんの提出物#{@product.title}の担当になりました。"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?

message
Expand All @@ -288,7 +288,7 @@ def hibernated(args = {})
)

subject = "[FBC] #{@sender.login_name}さんが休会しました。"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?
message
end
Expand All @@ -305,7 +305,7 @@ def first_report(args = {})
)

subject = "[FBC] #{@report.user.login_name}さんがはじめての日報を書きました!"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?
message
end
Expand All @@ -321,7 +321,7 @@ def consecutive_sad_report(args = {})
kind: Notification.kinds[:consecutive_sad_report]
)
subject = "[FBC] #{@report.user.login_name}さんが#{User::DEPRESSED_SIZE}回連続でsadアイコンの日報を提出しました。"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?

message
Expand All @@ -338,7 +338,7 @@ def update_regular_event(args = {})
)

subject = "[FBC] 定期イベント【#{@regular_event.title}】が更新されました。"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?

message
Expand All @@ -356,7 +356,7 @@ def no_correct_answer(args = {})
)

subject = "[FBC] #{@user.login_name}さんの質問【 #{@question.title} 】のベストアンサーがまだ選ばれていません。"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?

message
Expand All @@ -375,7 +375,7 @@ def signed_up(args = {})
)

subject = "[FBC] #{@sender.login_name}さん#{@sender_roles}が新しく入会しました!"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?

message
Expand All @@ -393,7 +393,7 @@ def chose_correct_answer(args = {})
)

subject = "[FBC] #{@answer.receiver.login_name}さんの質問【 #{@answer.question.title} 】で#{@answer.sender.login_name}さんの回答がベストアンサーに選ばれました。"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?
message
end
Expand All @@ -409,7 +409,7 @@ def product_update(args = {})
kind: Notification.kinds[:product_update]
)
subject = "[FBC] #{@product.user.login_name}さんが#{@product.title}を更新しました。"
message = mail to: @user.email, subject: subject
message = mail(to: @user.email, subject:)
message.perform_deliveries = @user.mail_notification? && !@user.retired?

message
Expand Down
Loading

0 comments on commit 3af306a

Please sign in to comment.