From c9fa8c0159a8d095f4359f17d17f5362b93419b6 Mon Sep 17 00:00:00 2001 From: ymmtd0x0b Date: Tue, 21 Mar 2023 00:00:16 +0900 Subject: [PATCH 01/72] =?UTF-8?q?=E5=8F=96=E5=BE=97=E3=81=99=E3=82=8B?= =?UTF-8?q?=E6=8F=90=E5=87=BA=E7=89=A9=E3=81=8B=E3=82=89WIP=E3=82=92?= =?UTF-8?q?=E9=99=A4=E5=A4=96=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/product.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/product.rb b/app/models/product.rb index 13c9ab2af95..6f68beee883 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -78,6 +78,7 @@ def self.self_assigned_no_replied_product_ids(current_user_id) SELECT products.* FROM products WHERE checker_id = ? + AND wip = false ) SELECT self_assigned_products.id FROM self_assigned_products From 282a847a9893464c24dec8838414d6513d1716a7 Mon Sep 17 00:00:00 2001 From: ymmtd0x0b Date: Tue, 21 Mar 2023 00:06:26 +0900 Subject: [PATCH 02/72] =?UTF-8?q?=E3=80=8EWIP=E3=82=92=E5=90=AB=E3=81=BE?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=80=8F=E4=BA=8B=E3=82=92=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E9=A0=85=E7=9B=AE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/models/product_test.rb | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test/models/product_test.rb b/test/models/product_test.rb index 5e980febe2c..dfcf4489512 100644 --- a/test/models/product_test.rb +++ b/test/models/product_test.rb @@ -114,13 +114,25 @@ class ProductTest < ActiveSupport::TestCase test '.self_assigned_no_replied_products' do current_user = users(:mentormentaro) - product = Product.create!( + published_product = Product.create!( body: 'test', user: users(:kimura), practice: practices(:practice5), - checker_id: nil + checker_id: nil, + published_at: Time.current.to_formatted_s(:db) ) - product.save_checker(current_user.id) - assert_equal [product.id], Product.self_assigned_no_replied_products(current_user.id).pluck(:id) + wip_product = Product.create!( + body: 'test', + user: users(:kimura), + practice: practices(:practice7), + checker_id: nil, + wip: true + ) + published_product.save_checker(current_user.id) + wip_product.save_checker(current_user.id) + + self_assigned_no_replied_products = Product.self_assigned_no_replied_products(current_user.id).pluck(:id) + assert_not_equal [wip_product.id], self_assigned_no_replied_products + assert_equal [published_product.id], self_assigned_no_replied_products end end From d167b5fba0aa6b3c9ed815e4f44163c92c612508 Mon Sep 17 00:00:00 2001 From: ymmtd0x0b Date: Tue, 21 Mar 2023 08:39:38 +0900 Subject: [PATCH 03/72] =?UTF-8?q?Issue=E3=81=AE=E6=9D=A1=E4=BB=B6=E3=82=92?= =?UTF-8?q?=E6=BA=80=E3=81=9F=E3=81=99=E6=8F=90=E5=87=BA=E7=89=A9=E3=81=8C?= =?UTF-8?q?=E5=90=AB=E3=81=BE=E3=82=8C=E3=81=AA=E3=81=84=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=81=AE=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - コメントが0でかつ未完了の提出物 - 最後にコメントしたのがメンターではなく提出者でかつ未完了の提出物 --- test/system/product/self_assigned_test.rb | 47 +++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/test/system/product/self_assigned_test.rb b/test/system/product/self_assigned_test.rb index e6a8bb149ce..15b41a19f1a 100644 --- a/test/system/product/self_assigned_test.rb +++ b/test/system/product/self_assigned_test.rb @@ -95,6 +95,53 @@ class Product::SelfAssignedTest < ApplicationSystemTestCase assert_equal [user.login_name], names end + test 'not include no replied wip products' do + product62 = products(:product62) + product_title = "#{product62.practice.title}の提出物" + + assert_not product62.checked? + + visit_with_auth '/products/self_assigned?target=self_assigned_no_replied', 'machida' + product_list_titles = all('.card-list-item-title__title').map(&:text) + assert_includes product_list_titles, product_title + + product62.update!(wip: true) + + visit '/products/self_assigned?target=self_assigned_no_replied' + product_list_titles = all('.card-list-item-title__title').map(&:text) + assert_not_includes product_list_titles, product_title + end + + test 'not include wip product last replied by owner' do + checker = users(:machida) + product62 = products(:product62) + product_title = "#{product62.practice.title}の提出物" + + Comment.create!( + user: checker, + commentable: product62, + description: 'メンターのコメント' + ) + + Comment.create!( + user: product62.user, + commentable: product62, + description: '提出者のコメント' + ) + + assert_not product62.checked? + + visit_with_auth '/products/self_assigned?target=self_assigned_no_replied', checker.login_name + product_list_titles = all('.card-list-item-title__title').map(&:text) + assert_includes product_list_titles, product_title + + product62.update!(wip: true) + + visit '/products/self_assigned?target=self_assigned_no_replied' + product_list_titles = all('.card-list-item-title__title').map(&:text) + assert_not_includes product_list_titles, product_title + end + test 'display replied products if click on self_assigned_all-button' do checker = users(:mentormentaro) practice = practices(:practice5) From 8480e064e1182053b28ca4b806caa470299504bf Mon Sep 17 00:00:00 2001 From: ymmtd0x0b Date: Wed, 15 Mar 2023 01:52:12 +0900 Subject: [PATCH 04/72] =?UTF-8?q?=E6=9C=80=E5=88=9D=E3=81=AE=E6=97=A5?= =?UTF-8?q?=E5=A0=B1=E4=BD=9C=E6=88=90=E9=80=9A=E7=9F=A5=E3=82=92=20Callba?= =?UTF-8?q?ck=20=E3=81=8B=E3=82=89=20Newspaper=20=E3=81=AB=E7=BD=AE?= =?UTF-8?q?=E3=81=8D=E6=8F=9B=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/reports_controller.rb | 2 ++ app/models/first_report_notifier.rb | 9 +++++++++ app/models/report_callbacks.rb | 7 ------- config/initializers/newspaper.rb | 4 ++++ 4 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 app/models/first_report_notifier.rb diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index 5048f137437..43f5a939ae0 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -52,6 +52,7 @@ def create canonicalize_learning_times(@report) if @report.save Newspaper.publish(:report_create, @report.user) + Newspaper.publish(:first_report_create, @report) redirect_to redirect_url(@report), notice: notice_message(@report), flash: flash_contents(@report) else render :new @@ -65,6 +66,7 @@ def update canonicalize_learning_times(@report) if @report.save Newspaper.publish(:report_update, @report.user) + Newspaper.publish(:first_report_update, @report) redirect_to redirect_url(@report), notice: notice_message(@report), flash: flash_contents(@report) else render :edit diff --git a/app/models/first_report_notifier.rb b/app/models/first_report_notifier.rb new file mode 100644 index 00000000000..768a0a7342c --- /dev/null +++ b/app/models/first_report_notifier.rb @@ -0,0 +1,9 @@ +class FirstReportNotifier + def call(report) + return if report.wip || !report.first? || Notification.find_by(kind: :first_report, sender_id: report.user.id).present? + + User.admins_and_mentors.each do |receiver| + NotificationFacade.first_report(report, receiver) if report.sender != receiver + end + end +end diff --git a/app/models/report_callbacks.rb b/app/models/report_callbacks.rb index 9011a1d5f80..a96f1138aaa 100644 --- a/app/models/report_callbacks.rb +++ b/app/models/report_callbacks.rb @@ -29,14 +29,7 @@ def create_author_watch(report) Watch.create!(user: report.user, watchable: report) end - def notify_first_report(report) - User.admins_and_mentors.each do |receiver| - NotificationFacade.first_report(report, receiver) if report.sender != receiver - end - end - def notify_users(report) - notify_first_report(report) if report.first? notify_advisers(report) if report.user.trainee? && report.user.company_id? notify_consecutive_sad_report(report) if report.user.depressed? notify_followers(report) diff --git a/config/initializers/newspaper.rb b/config/initializers/newspaper.rb index bad55d8927a..2f80ae7ed3d 100644 --- a/config/initializers/newspaper.rb +++ b/config/initializers/newspaper.rb @@ -16,6 +16,10 @@ Newspaper.subscribe(:report_update, sad_streak_updater) Newspaper.subscribe(:report_destroy, sad_streak_updater) + first_report_notifier = FirstReportNotifier.new + Newspaper.subscribe(:first_report_create, first_report_notifier) + Newspaper.subscribe(:first_report_update, first_report_notifier) + learning_cache_destroyer = LearningCacheDestroyer.new Newspaper.subscribe(:learning_create, learning_cache_destroyer) Newspaper.subscribe(:learning_destroy, learning_cache_destroyer) From d120e9d662e11aa52e9bdf2103896bd52c5adfcd Mon Sep 17 00:00:00 2001 From: ymmtd0x0b Date: Thu, 16 Mar 2023 20:48:26 +0900 Subject: [PATCH 05/72] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E3=83=97=E3=83=AD?= =?UTF-8?q?=E3=82=BB=E3=82=B9=E3=81=AE=E5=A4=89=E6=9B=B4=E3=81=AB=E4=BC=B4?= =?UTF-8?q?=E3=81=86=E3=82=B3=E3=83=BC=E3=83=AB=E3=83=90=E3=83=83=E3=82=AF?= =?UTF-8?q?=E4=BE=9D=E5=AD=98=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/notification/reports_test.rb | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/test/system/notification/reports_test.rb b/test/system/notification/reports_test.rb index 75750c70bd2..44239d7d44e 100644 --- a/test/system/notification/reports_test.rb +++ b/test/system/notification/reports_test.rb @@ -13,20 +13,9 @@ class Notification::ReportsTest < ApplicationSystemTestCase end test 'the first daily report notification is sent only to mentors' do - report = users(:muryou).reports.create!( - title: '初日報です', - description: '初日報の内容です', - reported_on: Date.current - ) - - Notification.create!( - kind: 7, - user: users(:komagata), - sender: users(:muryou), - message: "#{users(:muryou).login_name}さんがはじめての日報を書きました!", - link: "/reports/#{report.id}", - read: false - ) + login_user 'muryou', 'testtest' + create_report('初日報です', '初日報の内容です', false) + logout notification_message = 'muryouさんがはじめての日報を書きました!' visit_with_auth '/notifications', 'machida' From 7134d891f451ac8a6e4fd596d06133c706c724eb Mon Sep 17 00:00:00 2001 From: ymmtd0x0b Date: Fri, 17 Mar 2023 00:44:23 +0900 Subject: [PATCH 06/72] =?UTF-8?q?rubocop=E3=81=AE=E6=8C=87=E6=91=98?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/first_report_notifier.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/first_report_notifier.rb b/app/models/first_report_notifier.rb index 768a0a7342c..60d4c5cf542 100644 --- a/app/models/first_report_notifier.rb +++ b/app/models/first_report_notifier.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FirstReportNotifier def call(report) return if report.wip || !report.first? || Notification.find_by(kind: :first_report, sender_id: report.user.id).present? From dfbea8a6cc810c61f44e9749ef5231d4fff5e53c Mon Sep 17 00:00:00 2001 From: ymmtd0x0b Date: Sat, 18 Mar 2023 01:03:05 +0900 Subject: [PATCH 07/72] =?UTF-8?q?Newspaper=E3=81=AB=E7=99=BB=E9=8C=B2?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=A4=E3=83=99=E3=83=B3=E3=83=88=E5=90=8D?= =?UTF-8?q?=E3=82=92=E9=81=A9=E5=88=87=E3=81=AA=E5=90=8D=E7=A7=B0=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reportコントローラーからの呼び出しなので、 SadStreekUpdaterに渡すデータをuserからreportに変更 --- app/controllers/reports_controller.rb | 8 +++----- app/models/sad_streak_updater.rb | 4 ++-- config/initializers/newspaper.rb | 7 ++----- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index 43f5a939ae0..955f44f69fc 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -51,8 +51,7 @@ def create set_wip canonicalize_learning_times(@report) if @report.save - Newspaper.publish(:report_create, @report.user) - Newspaper.publish(:first_report_create, @report) + Newspaper.publish(:report_save, @report) redirect_to redirect_url(@report), notice: notice_message(@report), flash: flash_contents(@report) else render :new @@ -65,8 +64,7 @@ def update @report.assign_attributes(report_params) canonicalize_learning_times(@report) if @report.save - Newspaper.publish(:report_update, @report.user) - Newspaper.publish(:first_report_update, @report) + Newspaper.publish(:report_save, @report) redirect_to redirect_url(@report), notice: notice_message(@report), flash: flash_contents(@report) else render :edit @@ -75,7 +73,7 @@ def update def destroy @report.destroy - Newspaper.publish(:report_destroy, @report.user) + Newspaper.publish(:report_destroy, @report) redirect_to reports_url, notice: '日報を削除しました。' end diff --git a/app/models/sad_streak_updater.rb b/app/models/sad_streak_updater.rb index 139352a2e78..2823c464743 100644 --- a/app/models/sad_streak_updater.rb +++ b/app/models/sad_streak_updater.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class SadStreakUpdater - def call(user) - user.update_sad_streak + def call(report) + report.user.update_sad_streak end end diff --git a/config/initializers/newspaper.rb b/config/initializers/newspaper.rb index 2f80ae7ed3d..f8aad89c796 100644 --- a/config/initializers/newspaper.rb +++ b/config/initializers/newspaper.rb @@ -12,13 +12,10 @@ Newspaper.subscribe(:announcement_update, announcement_notifier) sad_streak_updater = SadStreakUpdater.new - Newspaper.subscribe(:report_create, sad_streak_updater) - Newspaper.subscribe(:report_update, sad_streak_updater) + Newspaper.subscribe(:report_save, sad_streak_updater) Newspaper.subscribe(:report_destroy, sad_streak_updater) - first_report_notifier = FirstReportNotifier.new - Newspaper.subscribe(:first_report_create, first_report_notifier) - Newspaper.subscribe(:first_report_update, first_report_notifier) + Newspaper.subscribe(:report_save, FirstReportNotifier.new) learning_cache_destroyer = LearningCacheDestroyer.new Newspaper.subscribe(:learning_create, learning_cache_destroyer) From 98a6a91b792b9b32b1115162b69716cbd9282d5c Mon Sep 17 00:00:00 2001 From: ymmtd0x0b Date: Tue, 21 Mar 2023 09:17:45 +0900 Subject: [PATCH 08/72] =?UTF-8?q?=E3=83=AC=E3=83=93=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E7=94=A8=E3=81=AE=E5=88=9D=E6=9C=9F=E3=83=87=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=82=92=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/fixtures/comments.yml | 18 ++++++++++++++++++ db/fixtures/products.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/db/fixtures/comments.yml b/db/fixtures/comments.yml index 6f42bf311b8..82fabea219e 100644 --- a/db/fixtures/comments.yml +++ b/db/fixtures/comments.yml @@ -126,3 +126,21 @@ comment41: user: machida commentable: announcement1 (Announcement) description: "お知らせのコメントです。" + +<% (1..3).each do |i| %> +comment<%= i + 41 %>: + user: <%= i.odd? ? 'kimura' : 'mentormentaro' %> + commentable: product73 (Product) + description: <%= "#{i.odd? ? '提出者' : 'メンター'}のコメントです。" %> + created_at: <%= Time.current + i.minutes %> + updated_at: <%= Time.current + i.minutes %> +<% end %> + +<% (1..3).each do |i| %> +comment<%= i + 45 %>: + user: <%= i.even? ? 'kimura' : 'mentormentaro' %> + commentable: product74 (Product) + description: <%= "#{i.even? ? '提出者' : 'メンター'}のコメントです。" %> + created_at: <%= Time.current + i.minutes %> + updated_at: <%= Time.current + i.minutes %> +<% end %> diff --git a/db/fixtures/products.yml b/db/fixtures/products.yml index 9800acc147d..a77c092579a 100644 --- a/db/fixtures/products.yml +++ b/db/fixtures/products.yml @@ -140,3 +140,35 @@ product70: created_at: <%= 23.hour.ago %> updated_at: <%= 23.hour.ago %> published_at: <%= 23.hour.ago %> + +product71: + practice: practice7 + user: kimura + body: 『mentormentaroが担当/提出済み/コメントがゼロ』の提出物です。 + checker: mentormentaro + published_at: <%= now.to_formatted_s(:db) %> + created_at: <%= now.to_formatted_s(:db) %> + +product72: + practice: practice8 + user: kimura + body: 『mentormentaroが担当/WIP/コメントがゼロ』の提出物です。 + checker: mentormentaro + created_at: <%= now.to_formatted_s(:db) %> + wip: true + +product73: + practice: practice9 + user: kimura + body: 『mentormentaroが担当/提出済み/最新のコメントがkimura』の提出物です。 + checker: mentormentaro + published_at: <%= now.to_formatted_s(:db) %> + created_at: <%= now.to_formatted_s(:db) %> + +product74: + practice: practice10 + user: kimura + body: 『mentormentaroが担当/提出済み/最新のコメントがmentormentaro』の提出物です。 + checker: mentormentaro + published_at: <%= now.to_formatted_s(:db) %> + created_at: <%= now.to_formatted_s(:db) %> From 7f170764e763282b8b7dc3b803d2f2c7666ae210 Mon Sep 17 00:00:00 2001 From: ymmtd0x0b Date: Wed, 22 Mar 2023 18:52:17 +0900 Subject: [PATCH 09/72] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E3=82=B9?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B9=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/models/product_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/models/product_test.rb b/test/models/product_test.rb index dfcf4489512..2ac8696a8b4 100644 --- a/test/models/product_test.rb +++ b/test/models/product_test.rb @@ -132,7 +132,7 @@ class ProductTest < ActiveSupport::TestCase wip_product.save_checker(current_user.id) self_assigned_no_replied_products = Product.self_assigned_no_replied_products(current_user.id).pluck(:id) - assert_not_equal [wip_product.id], self_assigned_no_replied_products + assert_not_equal [wip_product.id], self_assigned_no_replied_products assert_equal [published_product.id], self_assigned_no_replied_products end end From 974464cccfc1f1ab6212582fa5482a8c79633247 Mon Sep 17 00:00:00 2001 From: uchihiro Date: Tue, 21 Mar 2023 14:12:15 +0900 Subject: [PATCH 10/72] =?UTF-8?q?VueMounter=E3=81=ABstore=E3=82=92import?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/VueMounter.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/javascript/VueMounter.js b/app/javascript/VueMounter.js index 086b3bfa3eb..900407b9ec5 100644 --- a/app/javascript/VueMounter.js +++ b/app/javascript/VueMounter.js @@ -1,4 +1,5 @@ import Vue from 'vue' +import store from './check-store.js' export default class VueMounter { constructor() { @@ -20,6 +21,7 @@ export default class VueMounter { const component = this.components[name] new Vue({ + store, render: (h) => h(component, { props: props }) }).$mount(`[data-vue="${name}"]`) }) From be186758939d630cdcc20d709d95c025df085d2d Mon Sep 17 00:00:00 2001 From: uchihiro Date: Thu, 23 Mar 2023 16:48:53 +0900 Subject: [PATCH 11/72] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=83=BB=E5=9B=9E=E7=AD=94=E6=8A=95=E7=A8=BF=E6=99=82=E3=81=AB?= =?UTF-8?q?=E3=80=81=E3=83=AA=E3=83=AD=E3=83=BC=E3=83=89=E3=81=9B=E3=81=9A?= =?UTF-8?q?=E3=81=ABWatch=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=8C=E3=80=8CWatc?= =?UTF-8?q?h=E4=B8=AD=E3=80=8D=E3=81=AB=E5=A4=89=E5=8C=96=E3=81=99?= =?UTF-8?q?=E3=82=8B=E5=BD=A2=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/answers.vue | 3 +++ app/javascript/check-store.js | 20 ++++++++++++++-- app/javascript/comments.vue | 3 +++ app/javascript/components/watch-toggle.vue | 28 +++++++++++++++++----- 4 files changed, 46 insertions(+), 8 deletions(-) diff --git a/app/javascript/answers.vue b/app/javascript/answers.vue index 4cfe4afa5b5..8b76831c13e 100644 --- a/app/javascript/answers.vue +++ b/app/javascript/answers.vue @@ -171,6 +171,9 @@ export default { this.resizeTextarea() this.updateAnswerCount() this.toast('回答を投稿しました!') + this.$store.dispatch('setWatchable', { + watchableUserId: this.currentUser.id + }) }) .catch((error) => { console.warn(error) diff --git a/app/javascript/check-store.js b/app/javascript/check-store.js index 3e688224f5f..50f575fe09c 100644 --- a/app/javascript/check-store.js +++ b/app/javascript/check-store.js @@ -11,7 +11,8 @@ export default new Vuex.Store({ checkableId: null, checkableType: null, productId: null, - productCheckerId: null + productCheckerId: null, + watchableUserId: null }, getters: { checkId: (state) => state.checkId, @@ -20,7 +21,8 @@ export default new Vuex.Store({ checkableId: (state) => state.checkableId, checkableType: (state) => state.checkableType, productId: (state) => state.productId, - productCheckerId: (state) => state.productCheckerId + productCheckerId: (state) => state.productCheckerId, + watchableUserId: (state) => state.watchableUserId }, mutations: { setCheckable( @@ -36,6 +38,9 @@ export default new Vuex.Store({ setProduct(state, { productId, productCheckerId }) { state.productId = productId state.productCheckerId = productCheckerId + }, + setWatchable(state, { watchableUserId }) { + state.watchableUserId = watchableUserId } }, actions: { @@ -107,6 +112,17 @@ export default new Vuex.Store({ .catch((error) => { console.warn(error) }) + }, + setWatchable({ commit }, { watchableUserId }) { + if (watchableUserId) { + commit('setWatchable', { + watchableUserId: watchableUserId + }) + } else { + commit('setWatchable', { + watchableUserId: null + }) + } } } }) diff --git a/app/javascript/comments.vue b/app/javascript/comments.vue index d8e2dc1da02..531300aa6b8 100644 --- a/app/javascript/comments.vue +++ b/app/javascript/comments.vue @@ -283,6 +283,9 @@ export default { }, postComment() { this.createComment() + this.$store.dispatch('setWatchable', { + watchableUserId: this.currentUserId + }) if (this.isUnassignedAndUnchekedProduct) { this.checkProduct( this.commentableId, diff --git a/app/javascript/components/watch-toggle.vue b/app/javascript/components/watch-toggle.vue index 9bdf32ff539..a1ea42a6dc2 100644 --- a/app/javascript/components/watch-toggle.vue +++ b/app/javascript/components/watch-toggle.vue @@ -1,6 +1,6 @@ @@ -20,18 +20,28 @@ export default { data() { return { watchId: null, - watchLabel: 'Watch', totalPages: 0, watchValue: null } }, + computed: { + watchableUserId() { + return this.$store.getters.watchableUserId + }, + watchLabel() { + if (this.checked) { + return '削除' + } else { + return this.watchableUserId ? 'Watch中' : 'Watch' + } + } + }, mounted() { const params = new URL(location.href).searchParams params.set('watchable_type', this.watchableType) params.set('watchable_id', this.watchableId) if (this.checked) { this.watchId = this.watchIndexId - this.watchLabel = '削除' } else { fetch(`/api/watches/toggle.json?${params}`, { method: 'GET', @@ -47,7 +57,9 @@ export default { .then((json) => { if (json[0]) { this.watchId = json[0].id - this.watchLabel = 'Watch中' + this.$store.dispatch('setWatchable', { + watchableUserId: json[0].user_id + }) } }) .catch((error) => { @@ -88,8 +100,10 @@ export default { }) .then((json) => { this.watchId = json.id - this.watchLabel = 'Watch中' this.toast('Watchしました!') + this.$store.dispatch('setWatchable', { + watchableUserId: json.user_id + }) }) .catch((error) => { console.warn(error) @@ -108,8 +122,10 @@ export default { }) .then(() => { this.watchId = null - this.watchLabel = 'Watch' this.toast('Watchを外しました') + this.$store.dispatch('setWatchable', { + watchableUserId: null + }) }) .then(() => { this.$emit('update-index') From 6e7a19c018115efa1d707eb361f26584edff3b8e Mon Sep 17 00:00:00 2001 From: uchihiro Date: Fri, 24 Mar 2023 10:36:01 +0900 Subject: [PATCH 12/72] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E6=8A=95=E7=A8=BF=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=81=AB=E3=80=81Watch=E4=B8=AD=E3=81=8B?= =?UTF-8?q?=E8=A9=95=E4=BE=A1=E3=81=99=E3=82=8B=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/answers_test.rb | 1 + test/system/comments_test.rb | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/test/system/answers_test.rb b/test/system/answers_test.rb index 107251f78db..22a37bedce0 100644 --- a/test/system/answers_test.rb +++ b/test/system/answers_test.rb @@ -31,6 +31,7 @@ class AnswersTest < ApplicationSystemTestCase assert_text 'test' click_button 'コメントする' assert_text 'test' + assert_text 'Watch中' end test 'edit answer form has comment tab and preview tab' do diff --git a/test/system/comments_test.rb b/test/system/comments_test.rb index 55e2161ccef..6c5079843c4 100644 --- a/test/system/comments_test.rb +++ b/test/system/comments_test.rb @@ -44,6 +44,7 @@ class CommentsTest < ApplicationSystemTestCase assert_text 'test' click_button 'コメントする' assert_text 'test' + assert_text 'Watch中' end test 'post new comment with mention for report' do @@ -140,6 +141,7 @@ class CommentsTest < ApplicationSystemTestCase end click_button 'コメントする' assert_text 'test' + assert_text 'Watch中' end test 'check preview for product' do @@ -160,6 +162,7 @@ class CommentsTest < ApplicationSystemTestCase assert_text 'test' click_button 'コメントする' assert_text 'test' + assert_text 'Watch中' end test 'post new comment for page' do @@ -171,6 +174,7 @@ class CommentsTest < ApplicationSystemTestCase assert_text 'test' click_button 'コメントする' assert_text 'test' + assert_text 'Watch中' end test 'post new comment for event' do @@ -182,6 +186,7 @@ class CommentsTest < ApplicationSystemTestCase assert_text 'test' click_button 'コメントする' assert_text 'test' + assert_text 'Watch中' end test 'comment tab is active after a comment has been posted' do From 0f592f8cb25ae28f88ea34ac02681b8995e62ce7 Mon Sep 17 00:00:00 2001 From: akingo55 Date: Sun, 12 Feb 2023 16:21:55 +0900 Subject: [PATCH 13/72] =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=8C?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=A6=E3=81=8B=E3=82=89?= =?UTF-8?q?=E3=81=8A=E7=9F=A5=E3=82=89=E3=81=9B=E5=89=8A=E9=99=A4=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/announcements_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/system/announcements_test.rb b/test/system/announcements_test.rb index 116a10277e2..450202f36c4 100644 --- a/test/system/announcements_test.rb +++ b/test/system/announcements_test.rb @@ -131,7 +131,7 @@ class AnnouncementsTest < ApplicationSystemTestCase assert_text 'お知らせ「タイトルtest」' visit_with_auth '/announcements', 'komagata' - click_on 'タイトルtest' + page.find('h2', text: 'タイトルtest').click_on accept_confirm do click_link '削除' end From 46c8a30825c02b8fff6939f3b659b651d6e9e2f5 Mon Sep 17 00:00:00 2001 From: akingo55 Date: Sun, 12 Feb 2023 21:01:27 +0900 Subject: [PATCH 14/72] =?UTF-8?q?=E3=81=8A=E7=9F=A5=E3=82=89=E3=81=9B?= =?UTF-8?q?=E5=89=8A=E9=99=A4=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E3=82=92?= =?UTF-8?q?=E8=90=BD=E3=81=A1=E3=81=AB=E3=81=8F=E3=81=8F=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/announcements_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/system/announcements_test.rb b/test/system/announcements_test.rb index 450202f36c4..96253aecbfb 100644 --- a/test/system/announcements_test.rb +++ b/test/system/announcements_test.rb @@ -125,17 +125,17 @@ class AnnouncementsTest < ApplicationSystemTestCase assert has_no_button? '公開' click_button '作成' - assert_text 'お知らせを作成しました' + assert page.has_css?('p.flash__message', text: 'お知らせを作成しました') visit_with_auth '/notifications', 'hatsuno' - assert_text 'お知らせ「タイトルtest」' + assert page.has_text? 'お知らせ「タイトルtest」' visit_with_auth '/announcements', 'komagata' page.find('h2', text: 'タイトルtest').click_on accept_confirm do click_link '削除' end - assert_text 'お知らせを削除しました' + assert page.has_css?('p.flash__message', text: 'お知らせを削除しました') visit_with_auth '/notifications', 'hatsuno' assert_no_text 'お知らせ「タイトルtest」' From e9f224e6d83a0bf6f078dd7dc984ac1419837957 Mon Sep 17 00:00:00 2001 From: akingo55 Date: Mon, 13 Feb 2023 22:25:24 +0900 Subject: [PATCH 15/72] =?UTF-8?q?=E5=8D=92=E6=A5=AD=E3=83=9C=E3=82=BF?= =?UTF-8?q?=E3=83=B3=E6=8A=BC=E3=81=97=E3=81=9F=E5=BE=8C=E3=81=AB=E3=83=95?= =?UTF-8?q?=E3=83=A9=E3=83=83=E3=82=B7=E3=83=A5=E3=83=A1=E3=83=83=E3=82=BB?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=82=92=E7=A2=BA=E8=AA=8D=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/notification/graduation_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/system/notification/graduation_test.rb b/test/system/notification/graduation_test.rb index db40f3408a9..50d3bb5387f 100644 --- a/test/system/notification/graduation_test.rb +++ b/test/system/notification/graduation_test.rb @@ -19,6 +19,7 @@ class Notification::GraduationTest < ApplicationSystemTestCase accept_confirm do find('.a-button.is-sm.is-danger.is-block', text: '卒業にする').click end + page.has_css?('p.flash__message', text: 'ユーザー情報を更新しました。') logout visit_with_auth '/notifications', 'mentormentaro' From 0b5024bff897b0139aec0f1e605305f4fe3e44ce Mon Sep 17 00:00:00 2001 From: akingo55 Date: Tue, 14 Feb 2023 23:17:19 +0900 Subject: [PATCH 16/72] =?UTF-8?q?=E3=81=8A=E7=9F=A5=E3=82=89=E3=81=9B?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=81=AE=E5=AE=89=E5=AE=9A=E6=80=A7?= =?UTF-8?q?=E5=90=91=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/footprints_controller.rb | 9 +++++---- test/system/announcements_test.rb | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/controllers/api/footprints_controller.rb b/app/controllers/api/footprints_controller.rb index ea70f5762f0..d5c98f2d170 100644 --- a/app/controllers/api/footprints_controller.rb +++ b/app/controllers/api/footprints_controller.rb @@ -2,9 +2,10 @@ class API::FootprintsController < API::BaseController def index - if params[:footprintable_type].present? - footprintable.footprints.create_or_find_by(user: current_user) if footprintable.user != current_user - @footprints = footprintable.footprints.with_avatar.order(created_at: :desc) + footprintable_data = footprintable + if params[:footprintable_type].present? && footprintable_data.present? + footprintable_data.footprints.create_or_find_by(user: current_user) if footprintable_data.user != current_user + @footprints = footprintable_data.footprints.with_avatar.order(created_at: :desc) @footprint_total_count = @footprints.size else head :bad_request @@ -14,6 +15,6 @@ def index private def footprintable - params[:footprintable_type].constantize.find(params[:footprintable_id]) + params[:footprintable_type].constantize.find_by(id: params[:footprintable_id]) end end diff --git a/test/system/announcements_test.rb b/test/system/announcements_test.rb index 96253aecbfb..dd1a35900b4 100644 --- a/test/system/announcements_test.rb +++ b/test/system/announcements_test.rb @@ -128,11 +128,11 @@ class AnnouncementsTest < ApplicationSystemTestCase assert page.has_css?('p.flash__message', text: 'お知らせを作成しました') visit_with_auth '/notifications', 'hatsuno' - assert page.has_text? 'お知らせ「タイトルtest」' + assert_text 'お知らせ「タイトルtest」' visit_with_auth '/announcements', 'komagata' - page.find('h2', text: 'タイトルtest').click_on - accept_confirm do + click_on 'タイトルtest' + page.accept_confirm do click_link '削除' end assert page.has_css?('p.flash__message', text: 'お知らせを削除しました') From 4c1364e52989ed66525e9ef3abd556dc876c461e Mon Sep 17 00:00:00 2001 From: akingo55 Date: Tue, 14 Feb 2023 23:42:28 +0900 Subject: [PATCH 17/72] =?UTF-8?q?footprint=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=81=A7=E8=90=BD=E3=81=A1=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=83=AD=E3=82=B8=E3=83=83=E3=82=AF=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/footprints_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/footprints_controller.rb b/app/controllers/api/footprints_controller.rb index d5c98f2d170..3ae928fc86b 100644 --- a/app/controllers/api/footprints_controller.rb +++ b/app/controllers/api/footprints_controller.rb @@ -3,7 +3,7 @@ class API::FootprintsController < API::BaseController def index footprintable_data = footprintable - if params[:footprintable_type].present? && footprintable_data.present? + if footprintable_data.present? footprintable_data.footprints.create_or_find_by(user: current_user) if footprintable_data.user != current_user @footprints = footprintable_data.footprints.with_avatar.order(created_at: :desc) @footprint_total_count = @footprints.size @@ -15,6 +15,8 @@ def index private def footprintable + return if params[:footprintable_type].nil? + params[:footprintable_type].constantize.find_by(id: params[:footprintable_id]) end end From 3e8aeec2330624c5c6c1b98769a4997ca1767d86 Mon Sep 17 00:00:00 2001 From: akingo55 Date: Sat, 25 Feb 2023 22:30:19 +0900 Subject: [PATCH 18/72] =?UTF-8?q?page=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/announcements_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/system/announcements_test.rb b/test/system/announcements_test.rb index dd1a35900b4..7b6a6493a43 100644 --- a/test/system/announcements_test.rb +++ b/test/system/announcements_test.rb @@ -132,7 +132,7 @@ class AnnouncementsTest < ApplicationSystemTestCase visit_with_auth '/announcements', 'komagata' click_on 'タイトルtest' - page.accept_confirm do + accept_confirm do click_link '削除' end assert page.has_css?('p.flash__message', text: 'お知らせを削除しました') From 93ce63c4e5078e27516816635c3ceba7b96e4c35 Mon Sep 17 00:00:00 2001 From: akingo55 Date: Sat, 25 Feb 2023 22:41:42 +0900 Subject: [PATCH 19/72] =?UTF-8?q?footprintable=E3=81=AE=E3=83=AA=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=AF=E3=82=BF=E3=83=AA=E3=83=B3=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/footprints_controller.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/controllers/api/footprints_controller.rb b/app/controllers/api/footprints_controller.rb index 3ae928fc86b..2f2d464fbfd 100644 --- a/app/controllers/api/footprints_controller.rb +++ b/app/controllers/api/footprints_controller.rb @@ -1,11 +1,12 @@ # frozen_string_literal: true class API::FootprintsController < API::BaseController + before_action :footprintable + def index - footprintable_data = footprintable - if footprintable_data.present? - footprintable_data.footprints.create_or_find_by(user: current_user) if footprintable_data.user != current_user - @footprints = footprintable_data.footprints.with_avatar.order(created_at: :desc) + if @footprintable.present? + @footprintable.footprints.create_or_find_by(user: current_user) if @footprintable.user != current_user + @footprints = @footprintable.footprints.with_avatar.order(created_at: :desc) @footprint_total_count = @footprints.size else head :bad_request @@ -15,8 +16,10 @@ def index private def footprintable - return if params[:footprintable_type].nil? - - params[:footprintable_type].constantize.find_by(id: params[:footprintable_id]) + @footprintable = if params[:footprintable_type].nil? + nil + else + params[:footprintable_type].constantize.find_by(id: params[:footprintable_id]) + end end end From 5bc403f83877e5cbcd9f73095fdba9eeef7c3cab Mon Sep 17 00:00:00 2001 From: akingo55 Date: Wed, 1 Mar 2023 22:57:30 +0900 Subject: [PATCH 20/72] =?UTF-8?q?=E5=91=BC=E3=81=B3=E5=87=BA=E3=81=99?= =?UTF-8?q?=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E3=82=92=E5=88=B6=E9=99=90?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/footprints_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/footprints_controller.rb b/app/controllers/api/footprints_controller.rb index 2f2d464fbfd..2d917a75a6e 100644 --- a/app/controllers/api/footprints_controller.rb +++ b/app/controllers/api/footprints_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class API::FootprintsController < API::BaseController - before_action :footprintable + before_action :footprintable, only: %i[index] def index if @footprintable.present? From 910aadf19a279513830ff33f1b7a580df95acda1 Mon Sep 17 00:00:00 2001 From: akingo55 Date: Tue, 21 Mar 2023 19:30:42 +0900 Subject: [PATCH 21/72] =?UTF-8?q?page=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/notification/graduation_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/system/notification/graduation_test.rb b/test/system/notification/graduation_test.rb index 50d3bb5387f..efd5ecdd171 100644 --- a/test/system/notification/graduation_test.rb +++ b/test/system/notification/graduation_test.rb @@ -19,7 +19,7 @@ class Notification::GraduationTest < ApplicationSystemTestCase accept_confirm do find('.a-button.is-sm.is-danger.is-block', text: '卒業にする').click end - page.has_css?('p.flash__message', text: 'ユーザー情報を更新しました。') + has_css?('p.flash__message', text: 'ユーザー情報を更新しました。') logout visit_with_auth '/notifications', 'mentormentaro' From 19e5d485daf8a5b3432fbf834458b5c5017a7b98 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Wed, 22 Feb 2023 14:30:36 +0900 Subject: [PATCH 22/72] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=95=E3=83=AA?= =?UTF-8?q?=E3=82=AF=E3=83=88=E3=81=AE=E8=A7=A3=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/activity_mailer.rb | 23 +++++++++++++++++++ app/models/comment/after_create_callback.rb | 3 ++- .../watching_notification.html.slim | 9 ++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 app/views/activity_mailer/watching_notification.html.slim diff --git a/app/mailers/activity_mailer.rb b/app/mailers/activity_mailer.rb index d8f8e07bfeb..873ce543001 100644 --- a/app/mailers/activity_mailer.rb +++ b/app/mailers/activity_mailer.rb @@ -11,7 +11,12 @@ class ActivityMailer < ApplicationMailer @announcement = params[:announcement] if params&.key?(:announcement) @question = params[:question] if params&.key?(:question) @mentionable = params[:mentionable] if params&.key?(:mentionable) +<<<<<<< HEAD @page = params[:page] if params&.key?(:page) +======= + @watchable = params[:watchable] if params&.key?(:watchable) + @comment = params[:comment] if params&.key?(:comment) +>>>>>>> c705d3210 (active_delivery置き換えを行った) end # required params: sender, receiver @@ -212,4 +217,22 @@ def following_report(args = {}) message end + + # required params: sender, comment, watchable + def watching_notification( args = {} ) + # @sender ||= args[:sender] + # @comment ||= args[:comment] + # @watchable ||= args[:watchable] + + @user = @receiver + link = "/#{@watchable.class.name.underscore.pluralize}/#{@watchable.id}" + @notification = @user.notifications.find_by(link: link) + action = @watchable.instance_of?(Question) ? '回答' : 'コメント' + subject = "[FBC] #{@sender.login_name}さんの【 #{@watchable.notification_title} 】に#{@comment.user.login_name}さんが#{action}しました。" + + message = mail to: @user.email, subject: subject + message.perform_deliveries = @user.mail_notification? && !@user.retired? + + message + end end diff --git a/app/models/comment/after_create_callback.rb b/app/models/comment/after_create_callback.rb index 6f4391edce5..a98ae9b2681 100644 --- a/app/models/comment/after_create_callback.rb +++ b/app/models/comment/after_create_callback.rb @@ -46,7 +46,8 @@ def notify_to_watching_user(comment) watcher_ids.each do |watcher_id| if watcher_id != comment.sender.id && !mention_user_ids.include?(watcher_id) watcher = User.find_by(id: watcher_id) - NotificationFacade.watching_notification(watchable, watcher, comment) + sender = watchable.user + ActivityDelivery.with(watchable: watchable, receiver: watcher, comment: comment, sender: sender).notify(:watching_notification) end end end diff --git a/app/views/activity_mailer/watching_notification.html.slim b/app/views/activity_mailer/watching_notification.html.slim new file mode 100644 index 00000000000..e2f43421f94 --- /dev/null +++ b/app/views/activity_mailer/watching_notification.html.slim @@ -0,0 +1,9 @@ +ruby: + is_question = @watchable.instance_of?(Question) + anchor_prefix = is_question ? 'answer_' : 'comment_' + action = is_question ? '回答' : 'コメント' += render '/notification_mailer/notification_mailer_template', + title: "#{@watchable.notification_title}に#{@comment.user.login_name}さんが#{action}しました。", + link_url: notification_url(@notification, anchor: "#{anchor_prefix}#{@comment.id}"), + link_text: "この#{@watchable.class.model_name.human}へ" do + = md2html @comment.description From e56a2fc613cb40dbc7a9dc9f6bf3e438e07b1a2c Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Wed, 22 Feb 2023 14:47:33 +0900 Subject: [PATCH 23/72] =?UTF-8?q?conflict=E3=81=AE=E8=A7=A3=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/activity_mailer.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/mailers/activity_mailer.rb b/app/mailers/activity_mailer.rb index 873ce543001..9df5413427b 100644 --- a/app/mailers/activity_mailer.rb +++ b/app/mailers/activity_mailer.rb @@ -232,7 +232,6 @@ def watching_notification( args = {} ) message = mail to: @user.email, subject: subject message.perform_deliveries = @user.mail_notification? && !@user.retired? - message end end From 85475a8b11bf1dcbb1c13144ad9aee7868ea52e3 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Wed, 22 Feb 2023 14:50:52 +0900 Subject: [PATCH 24/72] =?UTF-8?q?rubocop=E3=82=92=E9=80=9A=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/activity_mailer.rb | 2 +- app/models/comment/after_create_callback.rb | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/mailers/activity_mailer.rb b/app/mailers/activity_mailer.rb index 9df5413427b..6333817cc06 100644 --- a/app/mailers/activity_mailer.rb +++ b/app/mailers/activity_mailer.rb @@ -219,7 +219,7 @@ def following_report(args = {}) end # required params: sender, comment, watchable - def watching_notification( args = {} ) + def watching_notification(_args = {}) # @sender ||= args[:sender] # @comment ||= args[:comment] # @watchable ||= args[:watchable] diff --git a/app/models/comment/after_create_callback.rb b/app/models/comment/after_create_callback.rb index a98ae9b2681..2a173acf9b0 100644 --- a/app/models/comment/after_create_callback.rb +++ b/app/models/comment/after_create_callback.rb @@ -44,11 +44,11 @@ def notify_to_watching_user(comment) watcher_ids = watchable.watches.pluck(:user_id) watcher_ids.each do |watcher_id| - if watcher_id != comment.sender.id && !mention_user_ids.include?(watcher_id) - watcher = User.find_by(id: watcher_id) - sender = watchable.user - ActivityDelivery.with(watchable: watchable, receiver: watcher, comment: comment, sender: sender).notify(:watching_notification) - end + next unless watcher_id != comment.sender.id && !mention_user_ids.include?(watcher_id) + + watcher = User.find_by(id: watcher_id) + sender = watchable.user + ActivityDelivery.with(watchable: watchable, receiver: watcher, comment: comment, sender: sender).notify(:watching_notification) end end From 35171b35eb5167a15c280eeb3fae261627afdf5a Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Fri, 24 Feb 2023 15:07:44 +0900 Subject: [PATCH 25/72] =?UTF-8?q?=E6=B6=88=E3=81=99=E3=81=B9=E3=81=8D?= =?UTF-8?q?=E7=AE=87=E6=89=80=E3=81=8C=E6=B6=88=E3=81=9B=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/activity_mailer.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/mailers/activity_mailer.rb b/app/mailers/activity_mailer.rb index 6333817cc06..f3aa7fa6688 100644 --- a/app/mailers/activity_mailer.rb +++ b/app/mailers/activity_mailer.rb @@ -11,12 +11,9 @@ class ActivityMailer < ApplicationMailer @announcement = params[:announcement] if params&.key?(:announcement) @question = params[:question] if params&.key?(:question) @mentionable = params[:mentionable] if params&.key?(:mentionable) -<<<<<<< HEAD @page = params[:page] if params&.key?(:page) -======= @watchable = params[:watchable] if params&.key?(:watchable) @comment = params[:comment] if params&.key?(:comment) ->>>>>>> c705d3210 (active_delivery置き換えを行った) end # required params: sender, receiver From e649f818c36a2c84d282615e0368fd4b5067835d Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Sat, 25 Feb 2023 14:28:52 +0900 Subject: [PATCH 26/72] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/notification_facade.rb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/models/notification_facade.rb b/app/models/notification_facade.rb index 0da5c775dec..031d18a3992 100644 --- a/app/models/notification_facade.rb +++ b/app/models/notification_facade.rb @@ -27,17 +27,6 @@ def self.first_report(report, receiver) ).first_report.deliver_later(wait: 5) end - def self.watching_notification(watchable, receiver, comment) - ActivityNotifier.with(watchable: watchable, receiver: receiver, comment: comment).watching_notification.notify_now - return unless receiver.mail_notification? && !receiver.retired? - - NotificationMailer.with( - watchable: watchable, - receiver: receiver, - comment: comment - ).watching_notification.deliver_later(wait: 5) - end - def self.trainee_report(report, receiver) ActivityNotifier.with(report: report, receiver: receiver).trainee_report.notify_now return unless receiver.mail_notification? && !receiver.retired? From f2185f1484b366c54cb97ac59da46627fcb95a7d Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Wed, 1 Mar 2023 16:20:46 +0900 Subject: [PATCH 27/72] =?UTF-8?q?=E5=A4=89=E6=95=B0=E5=90=8D=E3=81=A8?= =?UTF-8?q?=E4=B8=AD=E8=BA=AB=E3=81=8C=E4=B8=80=E8=87=B4=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/activity_mailer.rb | 2 +- app/models/comment/after_create_callback.rb | 2 +- app/notifiers/activity_notifier.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/mailers/activity_mailer.rb b/app/mailers/activity_mailer.rb index f3aa7fa6688..6482de9e496 100644 --- a/app/mailers/activity_mailer.rb +++ b/app/mailers/activity_mailer.rb @@ -225,7 +225,7 @@ def watching_notification(_args = {}) link = "/#{@watchable.class.name.underscore.pluralize}/#{@watchable.id}" @notification = @user.notifications.find_by(link: link) action = @watchable.instance_of?(Question) ? '回答' : 'コメント' - subject = "[FBC] #{@sender.login_name}さんの【 #{@watchable.notification_title} 】に#{@comment.user.login_name}さんが#{action}しました。" + subject = "[FBC] #{@watchable.user.login_name}さんの【 #{@watchable.notification_title} 】に#{@sender.login_name}さんが#{action}しました。" message = mail to: @user.email, subject: subject message.perform_deliveries = @user.mail_notification? && !@user.retired? diff --git a/app/models/comment/after_create_callback.rb b/app/models/comment/after_create_callback.rb index 2a173acf9b0..ddd035b6df1 100644 --- a/app/models/comment/after_create_callback.rb +++ b/app/models/comment/after_create_callback.rb @@ -47,7 +47,7 @@ def notify_to_watching_user(comment) next unless watcher_id != comment.sender.id && !mention_user_ids.include?(watcher_id) watcher = User.find_by(id: watcher_id) - sender = watchable.user + sender = comment.user ActivityDelivery.with(watchable: watchable, receiver: watcher, comment: comment, sender: sender).notify(:watching_notification) end end diff --git a/app/notifiers/activity_notifier.rb b/app/notifiers/activity_notifier.rb index 711a212ffef..753e9f9d77a 100644 --- a/app/notifiers/activity_notifier.rb +++ b/app/notifiers/activity_notifier.rb @@ -310,7 +310,7 @@ def watching_notification(params = {}) params.merge!(@params) watchable = params[:watchable] receiver = params[:receiver] - sender = params[:comment].user + sender = params[:sender] action = watchable.instance_of?(Question) ? '回答' : 'コメント' notification( body: "#{watchable.user.login_name}さんの【 #{watchable.notification_title} 】に#{sender.login_name}さんが#{action}しました。", From 24f11036ca7ba5b1bc9c23c6c24c8387ffc82dd3 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Wed, 1 Mar 2023 16:24:18 +0900 Subject: [PATCH 28/72] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E3=83=A1?= =?UTF-8?q?=E3=82=BD=E3=83=83=E3=83=89=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/notification_mailer.rb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index ff58e8e5205..9b0e33093fc 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -54,17 +54,6 @@ def first_report subject: "[FBC] #{@report.user.login_name}さんがはじめての日報を書きました!" end - # required params: watchable, receiver - def watching_notification - @sender = @watchable.user - @user = @receiver - link = "/#{@watchable.class.name.underscore.pluralize}/#{@watchable.id}" - @notification = @user.notifications.find_by(link: link) - action = @watchable.instance_of?(Question) ? '回答' : 'コメント' - subject = "[FBC] #{@sender.login_name}さんの【 #{@watchable.notification_title} 】に#{@comment.user.login_name}さんが#{action}しました。" - mail to: @user.email, subject: subject - end - # required params: sender, receiver def retired @user = @receiver From 458922c4fc20758e518bfe821ee0d260b63108fc Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Wed, 1 Mar 2023 16:32:18 +0900 Subject: [PATCH 29/72] =?UTF-8?q?=E8=90=BD=E3=81=A1=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=82=8B=E3=83=86=E3=82=B9=E3=83=88=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/notifier_to_watching_user.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/models/notifier_to_watching_user.rb b/app/models/notifier_to_watching_user.rb index 0d1fd798cc7..5aeee33d1e9 100644 --- a/app/models/notifier_to_watching_user.rb +++ b/app/models/notifier_to_watching_user.rb @@ -11,7 +11,13 @@ def call(answer) watcher_ids.each do |watcher_id| if watcher_id != answer.sender.id && !mention_user_ids.include?(watcher_id) watcher = User.find_by(id: watcher_id) - NotificationFacade.watching_notification(question, watcher, answer) + sender = answer.user + + ActivityDelivery.with( + watchable: question, + receiver: watcher, + comment: answer, + sender: sender).notify(:watching_notification) end end end From c429dcb1dd4486edafe3e82696c9250f44f1308d Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Wed, 1 Mar 2023 16:48:28 +0900 Subject: [PATCH 30/72] =?UTF-8?q?rubocop=E3=82=92=E9=80=9A=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/notifier_to_watching_user.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/models/notifier_to_watching_user.rb b/app/models/notifier_to_watching_user.rb index 5aeee33d1e9..4c13886e4cb 100644 --- a/app/models/notifier_to_watching_user.rb +++ b/app/models/notifier_to_watching_user.rb @@ -9,16 +9,17 @@ def call(answer) watcher_ids = Watch.where(watchable_id: question.id).pluck(:user_id) watcher_ids.each do |watcher_id| - if watcher_id != answer.sender.id && !mention_user_ids.include?(watcher_id) - watcher = User.find_by(id: watcher_id) - sender = answer.user + next unless watcher_id != answer.sender.id && !mention_user_ids.include?(watcher_id) - ActivityDelivery.with( - watchable: question, - receiver: watcher, - comment: answer, - sender: sender).notify(:watching_notification) - end + watcher = User.find_by(id: watcher_id) + sender = answer.user + + ActivityDelivery.with( + watchable: question, + receiver: watcher, + comment: answer, + sender: sender + ).notify(:watching_notification) end end end From adda9dcf1702899af7a979f3b6578d630c3f1cf4 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Wed, 1 Mar 2023 17:43:17 +0900 Subject: [PATCH 31/72] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/mailers/notification_mailer_test.rb | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/test/mailers/notification_mailer_test.rb b/test/mailers/notification_mailer_test.rb index f0f423d3a15..aaa80e4eb77 100644 --- a/test/mailers/notification_mailer_test.rb +++ b/test/mailers/notification_mailer_test.rb @@ -44,27 +44,6 @@ class NotificationMailerTest < ActionMailer::TestCase assert_match(/はじめて/, email.body.to_s) end - test 'watching_notification' do - watch = watches(:report1_watch_kimura) - watching = notifications(:notification_watching) - mailer = NotificationMailer.with( - watchable: watch.watchable, - receiver: watching.user, - comment: comments(:comment1) - ).watching_notification - - perform_enqueued_jobs do - mailer.deliver_later - end - - assert_not ActionMailer::Base.deliveries.empty? - email = ActionMailer::Base.deliveries.last - assert_equal ['noreply@bootcamp.fjord.jp'], email.from - assert_equal ['kimura@fjord.jp'], email.to - assert_equal '[FBC] komagataさんの【 「作業週1日目」の日報 】にmachidaさんがコメントしました。', email.subject - assert_match(/コメント/, email.body.to_s) - end - test 'trainee_report' do report = reports(:report11) trainee_report = notifications(:notification_trainee_report) From fa38b4f564816b02df409c0df4292ca572dd1733 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Thu, 2 Mar 2023 14:14:37 +0900 Subject: [PATCH 32/72] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=83=87=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/comment/after_create_callback.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/comment/after_create_callback.rb b/app/models/comment/after_create_callback.rb index ddd035b6df1..af8530937da 100644 --- a/app/models/comment/after_create_callback.rb +++ b/app/models/comment/after_create_callback.rb @@ -48,7 +48,12 @@ def notify_to_watching_user(comment) watcher = User.find_by(id: watcher_id) sender = comment.user - ActivityDelivery.with(watchable: watchable, receiver: watcher, comment: comment, sender: sender).notify(:watching_notification) + + ActivityDelivery.with( + watchable: watchable, + receiver: watcher, + comment: comment, + sender: sender).notify(:watching_notification) end end From 9948abe76567fc0bf212f2ab4e7342dbb73e53b2 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Sat, 4 Mar 2023 14:30:41 +0900 Subject: [PATCH 33/72] =?UTF-8?q?rubocop=E3=82=92=E9=80=9A=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/comment/after_create_callback.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/comment/after_create_callback.rb b/app/models/comment/after_create_callback.rb index af8530937da..fef2847fae4 100644 --- a/app/models/comment/after_create_callback.rb +++ b/app/models/comment/after_create_callback.rb @@ -53,7 +53,8 @@ def notify_to_watching_user(comment) watchable: watchable, receiver: watcher, comment: comment, - sender: sender).notify(:watching_notification) + sender: sender + ).notify(:watching_notification) end end From ba77e7c45449831d35553023acb5b4015cad3b0f Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Mon, 6 Mar 2023 14:57:15 +0900 Subject: [PATCH 34/72] =?UTF-8?q?=E5=BC=95=E6=95=B0=E5=90=8D=E3=82=92?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/activity_mailer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/mailers/activity_mailer.rb b/app/mailers/activity_mailer.rb index 6482de9e496..02e70c16108 100644 --- a/app/mailers/activity_mailer.rb +++ b/app/mailers/activity_mailer.rb @@ -216,7 +216,7 @@ def following_report(args = {}) end # required params: sender, comment, watchable - def watching_notification(_args = {}) + def watching_notification( args = {}) # @sender ||= args[:sender] # @comment ||= args[:comment] # @watchable ||= args[:watchable] From 6357fa0fdb3cd1e66328497192917920db0e3ce8 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Mon, 6 Mar 2023 15:16:32 +0900 Subject: [PATCH 35/72] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=95=E3=83=AA?= =?UTF-8?q?=E3=82=AF=E3=83=88=E3=82=92=E8=A7=A3=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/mailers/previews/activity_mailer_preview.rb | 14 ++++++++++++++ .../previews/notification_mailer_preview.rb | 12 ------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/test/mailers/previews/activity_mailer_preview.rb b/test/mailers/previews/activity_mailer_preview.rb index 35251d38c64..5038a1db4b5 100644 --- a/test/mailers/previews/activity_mailer_preview.rb +++ b/test/mailers/previews/activity_mailer_preview.rb @@ -86,4 +86,18 @@ def following_report receiver: receiver ).following_report end + + def watching_noitification + watchable = Report.find(ActiveRecord::FixtureSet.identify(:report1)) + receiver = User.find(ActiveRecord::FixtureSet.identify(:kimura)) + comment = Comment.find(ActiveRecord::FixtureSet.identify(:comment4)) + sender = comment.user + + ActivityMailer.with( + watchable: watchable, + receiver: receiver, + sender: sender, + comment: comment + ).watching_notification + end end diff --git a/test/mailers/previews/notification_mailer_preview.rb b/test/mailers/previews/notification_mailer_preview.rb index ad48cfad0f5..704722998f8 100644 --- a/test/mailers/previews/notification_mailer_preview.rb +++ b/test/mailers/previews/notification_mailer_preview.rb @@ -36,18 +36,6 @@ def first_report NotificationMailer.with(report: report, receiver: receiver).first_report end - def watching_noitification - watchable = Report.find(ActiveRecord::FixtureSet.identify(:report1)) - receiver = User.find(ActiveRecord::FixtureSet.identify(:kimura)) - comment = Comment.find(ActiveRecord::FixtureSet.identify(:comment4)) - - NotificationMailer.with( - watchable: watchable, - receiver: receiver, - comment: comment - ).watching_notification - end - def retired sender = User.find(ActiveRecord::FixtureSet.identify(:yameo)) receiver = User.find(ActiveRecord::FixtureSet.identify(:komagata)) From d0baf2bd75ec92f0c438cded08e628a18599529c Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Mon, 6 Mar 2023 15:17:09 +0900 Subject: [PATCH 36/72] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E5=A4=89?= =?UTF-8?q?=E6=95=B0=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/notification_mailer.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index 9b0e33093fc..0a14075523e 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -14,7 +14,6 @@ class NotificationMailer < ApplicationMailer # rubocop:disable Metrics/ClassLeng @announcement = params[:announcement] @question = params[:question] @report = params[:report] - @watchable = params[:watchable] @sender = params[:sender] @event = params[:event] @page = params[:page] From 3317494f7c0272c157726c0894bfb88d5e9ffb37 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Mon, 6 Mar 2023 16:23:08 +0900 Subject: [PATCH 37/72] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=97=E3=83=9F?= =?UTF-8?q?=E3=82=B9=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/activity_mailer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/mailers/activity_mailer.rb b/app/mailers/activity_mailer.rb index 02e70c16108..8c3dfeb3e27 100644 --- a/app/mailers/activity_mailer.rb +++ b/app/mailers/activity_mailer.rb @@ -216,7 +216,7 @@ def following_report(args = {}) end # required params: sender, comment, watchable - def watching_notification( args = {}) + def watching_notification(args = {}) # @sender ||= args[:sender] # @comment ||= args[:comment] # @watchable ||= args[:watchable] From deb52ab93988f33a1e32d5ab4a81f618a7030da6 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Mon, 13 Mar 2023 17:15:39 +0900 Subject: [PATCH 38/72] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=AB=E3=83=90?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=AE=E3=82=BF=E3=82=A4=E3=83=9F=E3=83=B3?= =?UTF-8?q?=E3=82=B0=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit コメントをした際のコールバックタイミングをafter_createからafter_commit変更 --- app/models/comment.rb | 2 +- app/models/comment/after_create_callback.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/comment.rb b/app/models/comment.rb index 2a49657ef07..065b246d4c2 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -7,7 +7,7 @@ class Comment < ApplicationRecord belongs_to :user, touch: true belongs_to :commentable, polymorphic: true - after_create Comment::AfterCreateCallback.new + after_commit Comment::AfterCreateCallback.new after_update Comment::AfterUpdateCallback.new after_destroy Comment::AfterDestroyCallback.new alias sender user diff --git a/app/models/comment/after_create_callback.rb b/app/models/comment/after_create_callback.rb index fef2847fae4..18e5c2c3f4e 100644 --- a/app/models/comment/after_create_callback.rb +++ b/app/models/comment/after_create_callback.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class Comment::AfterCreateCallback - def after_create(comment) + def after_commit(comment) if comment.commentable.class.include?(Watchable) create_watch(comment) notify_to_watching_user(comment) From 6b89d10f3cf4f1ea43d85deb10cf9b73d28621e5 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Wed, 15 Mar 2023 12:36:16 +0900 Subject: [PATCH 39/72] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=83=87=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=81=8C=E3=81=9A=E3=82=8C=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/activity_mailer.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/mailers/activity_mailer.rb b/app/mailers/activity_mailer.rb index 8c3dfeb3e27..3d66f689549 100644 --- a/app/mailers/activity_mailer.rb +++ b/app/mailers/activity_mailer.rb @@ -217,9 +217,9 @@ def following_report(args = {}) # required params: sender, comment, watchable def watching_notification(args = {}) - # @sender ||= args[:sender] - # @comment ||= args[:comment] - # @watchable ||= args[:watchable] + @sender ||= args[:sender] + @comment ||= args[:comment] + @watchable ||= args[:watchable] @user = @receiver link = "/#{@watchable.class.name.underscore.pluralize}/#{@watchable.id}" From e6d679ede15e78483000c9cf5d3979156b2eaeb5 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Thu, 16 Mar 2023 13:20:00 +0900 Subject: [PATCH 40/72] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=92=E5=90=8C=E6=9C=9F=E7=9A=84=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/activity_mailer.rb | 10 ++++++---- .../watching_notification.html.slim | 8 ++------ test/system/notifications_test.rb | 17 +++++++++-------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/app/mailers/activity_mailer.rb b/app/mailers/activity_mailer.rb index 3d66f689549..2cf4879f085 100644 --- a/app/mailers/activity_mailer.rb +++ b/app/mailers/activity_mailer.rb @@ -222,10 +222,12 @@ def watching_notification(args = {}) @watchable ||= args[:watchable] @user = @receiver - link = "/#{@watchable.class.name.underscore.pluralize}/#{@watchable.id}" - @notification = @user.notifications.find_by(link: link) - action = @watchable.instance_of?(Question) ? '回答' : 'コメント' - subject = "[FBC] #{@watchable.user.login_name}さんの【 #{@watchable.notification_title} 】に#{@sender.login_name}さんが#{action}しました。" + @link_url = notification_redirector_url( + link: @watchable.path, + kind: Notification.kinds[:watched] + ) + @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.perform_deliveries = @user.mail_notification? && !@user.retired? diff --git a/app/views/activity_mailer/watching_notification.html.slim b/app/views/activity_mailer/watching_notification.html.slim index e2f43421f94..d1c8cfc00b2 100644 --- a/app/views/activity_mailer/watching_notification.html.slim +++ b/app/views/activity_mailer/watching_notification.html.slim @@ -1,9 +1,5 @@ -ruby: - is_question = @watchable.instance_of?(Question) - anchor_prefix = is_question ? 'answer_' : 'comment_' - action = is_question ? '回答' : 'コメント' = render '/notification_mailer/notification_mailer_template', - title: "#{@watchable.notification_title}に#{@comment.user.login_name}さんが#{action}しました。", - link_url: notification_url(@notification, anchor: "#{anchor_prefix}#{@comment.id}"), + title: "#{@watchable.notification_title}に#{@comment.user.login_name}さんが#{@action}しました。", + link_url: @link_url, link_text: "この#{@watchable.class.model_name.human}へ" do = md2html @comment.description diff --git a/test/system/notifications_test.rb b/test/system/notifications_test.rb index 7b5c5f4b600..e62b2ae5b51 100644 --- a/test/system/notifications_test.rb +++ b/test/system/notifications_test.rb @@ -165,14 +165,15 @@ class NotificationsTest < ApplicationSystemTestCase login_user 'hatsuno', 'testtest' report = create_report 'コメントと', '確認があった', false - visit_with_auth "/reports/#{report}", 'komagata' - visit "/reports/#{report}" - fill_in 'new_comment[description]', with: 'コメントと確認した' - click_button '確認OKにする' - - visit_with_auth "/reports/#{report}", 'hatsuno' - find('.header-links__link.test-show-notifications').click - assert_text 'hatsunoさんの【 「コメントと」の日報 】にkomagataさんがコメントしました。' + perform_enqueued_jobs do + visit_with_auth "/reports/#{report}", 'komagata' + visit "/reports/#{report}" + fill_in 'new_comment[description]', with: 'コメントと確認した' + click_button '確認OKにする' + visit_with_auth "/reports/#{report}", 'hatsuno' + find('.header-links__link.test-show-notifications').click + assert_text 'hatsunoさんの【 「コメントと」の日報 】にkomagataさんがコメントしました。' + end end test 'show notification count' do From da2ee4b24c112b12186d33ad3582f48d3f8ce3f1 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Thu, 16 Mar 2023 13:45:16 +0900 Subject: [PATCH 41/72] =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=83=AB=E3=81=AE?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/mailers/activity_mailer_test.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/mailers/activity_mailer_test.rb b/test/mailers/activity_mailer_test.rb index 6cef8e89890..61d774a2732 100644 --- a/test/mailers/activity_mailer_test.rb +++ b/test/mailers/activity_mailer_test.rb @@ -601,4 +601,26 @@ class ActivityMailerTest < ActionMailer::TestCase assert_equal '[FBC] kensyuさんが日報【 フォローされた日報 】を書きました!', email.subject assert_match(%r{この日報へ}, email.body.to_s) end + + test 'watching_notification' do + watch = watches(:report1_watch_kimura) + watching = notifications(:notification_watching) + mailer = ActivityMailer.with( + watchable: watch.watchable, + receiver: watching.user, + comment: comments(:comment1), + sender: comments(:comment1).user + ).watching_notification + + perform_enqueued_jobs do + mailer.deliver_later + end + + assert_not ActionMailer::Base.deliveries.empty? + email = ActionMailer::Base.deliveries.last + assert_equal ['noreply@bootcamp.fjord.jp'], email.from + assert_equal ['kimura@fjord.jp'], email.to + assert_equal '[FBC] komagataさんの【 「作業週1日目」の日報 】にmachidaさんがコメントしました。', email.subject + assert_match(/コメント/, email.body.to_s) + end end From 16f9b72b2e22a449b5f20dc954e087daf376957d Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Thu, 16 Mar 2023 15:00:04 +0900 Subject: [PATCH 42/72] =?UTF-8?q?activity=5Fdelivery=E3=81=AE=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/activity_mailer.rb | 1 + test/deliveries/activity_delivery_test.rb | 27 +++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/app/mailers/activity_mailer.rb b/app/mailers/activity_mailer.rb index 2cf4879f085..cbe01e3074e 100644 --- a/app/mailers/activity_mailer.rb +++ b/app/mailers/activity_mailer.rb @@ -217,6 +217,7 @@ def following_report(args = {}) # required params: sender, comment, watchable def watching_notification(args = {}) + @receiver ||= args[:receiver] @sender ||= args[:sender] @comment ||= args[:comment] @watchable ||= args[:watchable] diff --git a/test/deliveries/activity_delivery_test.rb b/test/deliveries/activity_delivery_test.rb index fd406b5b966..5af022bf99d 100644 --- a/test/deliveries/activity_delivery_test.rb +++ b/test/deliveries/activity_delivery_test.rb @@ -173,4 +173,31 @@ class ActivityDeliveryTest < ActiveSupport::TestCase ActivityDelivery.with(**params).notify(:create_page) end end + + test '.notify(:watching_notification)' do + watch = watches(:report1_watch_kimura) + watching = notifications(:notification_watching) + params = { + watchable: watch.watchable, + receiver: watching.user, + comment: comments(:comment1), + sender: comments(:comment1).user + } + + assert_difference -> { AbstractNotifier::Testing::Driver.deliveries.count }, 1 do + ActivityDelivery.notify!(:watching_notification, **params) + end + + assert_difference -> { AbstractNotifier::Testing::Driver.enqueued_deliveries.count }, 1 do + ActivityDelivery.notify(:watching_notification, **params) + end + + assert_difference -> { AbstractNotifier::Testing::Driver.deliveries.count }, 1 do + ActivityDelivery.with(**params).notify!(:watching_notification) + end + + assert_difference -> { AbstractNotifier::Testing::Driver.enqueued_deliveries.count }, 1 do + ActivityDelivery.with(**params).notify(:watching_notification) + end + end end From 23736d596e0d283c58106dc64a3bdecc5f3bee88 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Thu, 16 Mar 2023 15:00:23 +0900 Subject: [PATCH 43/72] =?UTF-8?q?=E5=8F=AF=E8=AA=AD=E6=80=A7=E3=81=8C?= =?UTF-8?q?=E4=BD=8E=E3=81=84=E3=81=AE=E3=81=A7=E6=94=B9=E8=A1=8C=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/notifiers/activity_notifier.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/notifiers/activity_notifier.rb b/app/notifiers/activity_notifier.rb index 753e9f9d77a..610bcf49178 100644 --- a/app/notifiers/activity_notifier.rb +++ b/app/notifiers/activity_notifier.rb @@ -312,6 +312,7 @@ def watching_notification(params = {}) receiver = params[:receiver] sender = params[:sender] action = watchable.instance_of?(Question) ? '回答' : 'コメント' + notification( body: "#{watchable.user.login_name}さんの【 #{watchable.notification_title} 】に#{sender.login_name}さんが#{action}しました。", kind: :watching, From bc602961bedb240d01f4ffe592a82d34db1b918d Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Tue, 28 Mar 2023 09:29:37 +0900 Subject: [PATCH 44/72] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E3=81=8C=E4=BD=9C?= =?UTF-8?q?=E6=88=90=E3=81=95=E3=82=8C=E3=82=8B=E5=89=8D=E3=81=AB=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=81=8C=E8=B5=B0=E3=81=A3=E3=81=A6=E3=81=97?= =?UTF-8?q?=E3=81=BE=E3=81=86=E3=81=AE=E3=81=A7=E3=80=81=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E3=81=8C=E4=BD=9C=E6=88=90=E3=81=95=E3=82=8C=E3=82=8B=E3=81=BE?= =?UTF-8?q?=E3=81=A7=E5=BE=85=E3=81=A4=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/models/comment_test.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/models/comment_test.rb b/test/models/comment_test.rb index 0b7017a73c1..ec3126054b6 100644 --- a/test/models/comment_test.rb +++ b/test/models/comment_test.rb @@ -47,11 +47,13 @@ class CommentTest < ActiveSupport::TestCase end test 'not notify mentor watching product of submitted when comment on product' do + default_notifications_count = users(:kimura).notifications.count Comment.create!( user: users(:mentormentaro), commentable: products(:product8), description: '提出物のコメントcreate' ) + sleep 0.2 until users(:kimura).notifications.count == default_notifications_count + 1 assert users(:kimura).notifications.exists?( kind: 'watching', sender: users(:mentormentaro), From dde8b67f44a811ee4bc25c44580b537d1538a6cc Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Tue, 28 Mar 2023 10:30:16 +0900 Subject: [PATCH 45/72] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notification_mailer/watching_notification.html.slim | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 app/views/notification_mailer/watching_notification.html.slim diff --git a/app/views/notification_mailer/watching_notification.html.slim b/app/views/notification_mailer/watching_notification.html.slim deleted file mode 100644 index 1e81d7fee60..00000000000 --- a/app/views/notification_mailer/watching_notification.html.slim +++ /dev/null @@ -1,9 +0,0 @@ -ruby: - is_question = @watchable.instance_of?(Question) - anchor_prefix = is_question ? 'answer_' : 'comment_' - action = is_question ? '回答' : 'コメント' -= render 'notification_mailer_template', - title: "#{@watchable.notification_title}に#{@comment.user.login_name}さんが#{action}しました。", - link_url: notification_url(@notification, anchor: "#{anchor_prefix}#{@comment.id}"), - link_text: "この#{@watchable.class.model_name.human}へ" do - = md2html @comment.description From d54ffbaa964bcab7bfe97091ee3ca29ae0fd0ca3 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Tue, 28 Mar 2023 10:55:41 +0900 Subject: [PATCH 46/72] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/mailers/activity_mailer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/mailers/activity_mailer.rb b/app/mailers/activity_mailer.rb index cbe01e3074e..a62ead48e87 100644 --- a/app/mailers/activity_mailer.rb +++ b/app/mailers/activity_mailer.rb @@ -215,7 +215,7 @@ def following_report(args = {}) message end - # required params: sender, comment, watchable + # required params: sender, comment, watchable, receiver def watching_notification(args = {}) @receiver ||= args[:receiver] @sender ||= args[:sender] From c92fef726ec31134779c4467943753a76ded579f Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Wed, 29 Mar 2023 10:49:52 +0900 Subject: [PATCH 47/72] =?UTF-8?q?=E5=A4=89=E6=95=B0=E3=81=AE=E4=B8=AD?= =?UTF-8?q?=E8=BA=AB=E3=82=92=E3=82=8F=E3=81=8B=E3=82=8A=E3=82=84=E3=81=99?= =?UTF-8?q?=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/comment/after_create_callback.rb | 2 +- app/models/notifier_to_watching_user.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/comment/after_create_callback.rb b/app/models/comment/after_create_callback.rb index 18e5c2c3f4e..6d116b9be19 100644 --- a/app/models/comment/after_create_callback.rb +++ b/app/models/comment/after_create_callback.rb @@ -47,7 +47,7 @@ def notify_to_watching_user(comment) next unless watcher_id != comment.sender.id && !mention_user_ids.include?(watcher_id) watcher = User.find_by(id: watcher_id) - sender = comment.user + sender = comment.sender ActivityDelivery.with( watchable: watchable, diff --git a/app/models/notifier_to_watching_user.rb b/app/models/notifier_to_watching_user.rb index 4c13886e4cb..5656e55e36f 100644 --- a/app/models/notifier_to_watching_user.rb +++ b/app/models/notifier_to_watching_user.rb @@ -12,7 +12,7 @@ def call(answer) next unless watcher_id != answer.sender.id && !mention_user_ids.include?(watcher_id) watcher = User.find_by(id: watcher_id) - sender = answer.user + sender = answer.sender ActivityDelivery.with( watchable: question, From dae261fc50fb8eee9c155c3dcd557e0ec3fff55f Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Wed, 29 Mar 2023 22:59:59 +0900 Subject: [PATCH 48/72] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E3=83=AC=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=8C=E4=BD=9C=E6=88=90=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E5=89=8D=E3=81=AB=E3=82=A2=E3=82=B5=E3=83=BC=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=81=8C=E8=B5=B0=E3=81=A3=E3=81=A6=E3=81=97?= =?UTF-8?q?=E3=81=BE=E3=81=86=E7=AE=87=E6=89=80=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/models/comment_test.rb | 40 ++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/test/models/comment_test.rb b/test/models/comment_test.rb index ec3126054b6..fd842ab74ca 100644 --- a/test/models/comment_test.rb +++ b/test/models/comment_test.rb @@ -3,6 +3,8 @@ require 'test_helper' class CommentTest < ActiveSupport::TestCase + include ActiveJob::TestHelper + setup do @delivery_mode = AbstractNotifier.delivery_mode AbstractNotifier.delivery_mode = :normal @@ -47,18 +49,18 @@ class CommentTest < ActiveSupport::TestCase end test 'not notify mentor watching product of submitted when comment on product' do - default_notifications_count = users(:kimura).notifications.count - Comment.create!( - user: users(:mentormentaro), - commentable: products(:product8), - description: '提出物のコメントcreate' - ) - sleep 0.2 until users(:kimura).notifications.count == default_notifications_count + 1 - assert users(:kimura).notifications.exists?( - kind: 'watching', - sender: users(:mentormentaro), - message: 'kimuraさんの【 「PC性能の見方を知る」の提出物 】にmentormentaroさんがコメントしました。' - ) + perform_enqueued_jobs do + Comment.create!( + user: users(:mentormentaro), + commentable: products(:product8), + description: '提出物のコメントcreate' + ) + assert users(:kimura).notifications.exists?( + kind: 'watching', + sender: users(:mentormentaro), + message: 'kimuraさんの【 「PC性能の見方を知る」の提出物 】にmentormentaroさんがコメントしました。' + ) + end assert_not users(:mentormentaro).notifications.exists?( kind: 'submitted', sender: users(:kimura), @@ -100,3 +102,17 @@ class CommentTest < ActiveSupport::TestCase assert last_comment.certain_period_passed_since_the_last_comment_by_submitter?(5.days) end end + +# class ActiveJob::Base +# def queue_adapter +# @queue_adapter +# end + +# def queue_adapter=(queue_adapter) +# @queue_adapter = queue_adapter = :inline +# end +# end + +# ActiveJob::Base.queue_adapter = :inline +# ActiveJob::Base.queue_adapter +# => inline From e095126bb2eedc5054e2956f9f490a0ac7b504e5 Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Thu, 30 Mar 2023 12:00:55 +0900 Subject: [PATCH 49/72] =?UTF-8?q?rubocop=E3=82=92=E9=80=9A=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/models/comment_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/models/comment_test.rb b/test/models/comment_test.rb index fd842ab74ca..29c6a58da59 100644 --- a/test/models/comment_test.rb +++ b/test/models/comment_test.rb @@ -49,7 +49,7 @@ class CommentTest < ActiveSupport::TestCase end test 'not notify mentor watching product of submitted when comment on product' do - perform_enqueued_jobs do + perform_enqueued_jobs do Comment.create!( user: users(:mentormentaro), commentable: products(:product8), From d49bf2288be4347819c62a53e49065324f7310ad Mon Sep 17 00:00:00 2001 From: OdenTakashi Date: Thu, 30 Mar 2023 13:49:26 +0900 Subject: [PATCH 50/72] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E7=AE=87?= =?UTF-8?q?=E6=89=80=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/models/comment_test.rb | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/test/models/comment_test.rb b/test/models/comment_test.rb index 29c6a58da59..b3012d4745e 100644 --- a/test/models/comment_test.rb +++ b/test/models/comment_test.rb @@ -102,17 +102,3 @@ class CommentTest < ActiveSupport::TestCase assert last_comment.certain_period_passed_since_the_last_comment_by_submitter?(5.days) end end - -# class ActiveJob::Base -# def queue_adapter -# @queue_adapter -# end - -# def queue_adapter=(queue_adapter) -# @queue_adapter = queue_adapter = :inline -# end -# end - -# ActiveJob::Base.queue_adapter = :inline -# ActiveJob::Base.queue_adapter -# => inline From f3a07a48a8080cb96ec9f992c3738180ab4224f1 Mon Sep 17 00:00:00 2001 From: ymmtd0x0b Date: Thu, 30 Mar 2023 16:28:59 +0900 Subject: [PATCH 51/72] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E3=81=AE=E4=BD=99=E5=88=86=E3=82=92=E6=B8=9B=E3=82=89?= =?UTF-8?q?=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/product/self_assigned_test.rb | 50 +++++------------------ 1 file changed, 11 insertions(+), 39 deletions(-) diff --git a/test/system/product/self_assigned_test.rb b/test/system/product/self_assigned_test.rb index 15b41a19f1a..a6d2ebb0102 100644 --- a/test/system/product/self_assigned_test.rb +++ b/test/system/product/self_assigned_test.rb @@ -95,51 +95,23 @@ class Product::SelfAssignedTest < ApplicationSystemTestCase assert_equal [user.login_name], names end - test 'not include no replied wip products' do - product62 = products(:product62) - product_title = "#{product62.practice.title}の提出物" + test 'not display no replied wip products if click on no-replied-button' do + mentor = users(:mentormentaro) + product = products(:product5) - assert_not product62.checked? - - visit_with_auth '/products/self_assigned?target=self_assigned_no_replied', 'machida' - product_list_titles = all('.card-list-item-title__title').map(&:text) - assert_includes product_list_titles, product_title - - product62.update!(wip: true) - - visit '/products/self_assigned?target=self_assigned_no_replied' + visit_with_auth '/products/self_assigned?target=self_assigned_no_replied', mentor.login_name product_list_titles = all('.card-list-item-title__title').map(&:text) - assert_not_includes product_list_titles, product_title + assert_not_includes product_list_titles, product.title end - test 'not include wip product last replied by owner' do - checker = users(:machida) - product62 = products(:product62) - product_title = "#{product62.practice.title}の提出物" - - Comment.create!( - user: checker, - commentable: product62, - description: 'メンターのコメント' - ) - - Comment.create!( - user: product62.user, - commentable: product62, - description: '提出者のコメント' - ) - - assert_not product62.checked? - - visit_with_auth '/products/self_assigned?target=self_assigned_no_replied', checker.login_name - product_list_titles = all('.card-list-item-title__title').map(&:text) - assert_includes product_list_titles, product_title - - product62.update!(wip: true) + test 'not display last replied by student replied wip products if click on no-replied-button' do + mentor = users(:machida) + product = products(:product63) + product.update(wip: true) - visit '/products/self_assigned?target=self_assigned_no_replied' + visit_with_auth '/products/self_assigned?target=self_assigned_no_replied', mentor.login_name product_list_titles = all('.card-list-item-title__title').map(&:text) - assert_not_includes product_list_titles, product_title + assert_not_includes product_list_titles, product.title end test 'display replied products if click on self_assigned_all-button' do From b411a291e4d34c3a8be7cd8951804b5729f4c4a5 Mon Sep 17 00:00:00 2001 From: ymmtd0x0b Date: Thu, 30 Mar 2023 18:07:17 +0900 Subject: [PATCH 52/72] =?UTF-8?q?=E6=84=8F=E5=9B=B3=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=83=86=E3=82=B9=E3=83=88=E3=81=AE=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E3=81=AE=E4=BF=AE=E6=AD=A3=E3=81=A8=E5=A4=89=E6=95=B0=E5=90=8D?= =?UTF-8?q?=E3=82=92=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=A6=E5=8F=AF=E8=AA=AD?= =?UTF-8?q?=E6=80=A7=E3=82=A2=E3=83=83=E3=83=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/models/product_test.rb | 13 +++++++------ test/system/product/self_assigned_test.rb | 21 ++++++++++++++------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/test/models/product_test.rb b/test/models/product_test.rb index 2ac8696a8b4..ffa1c7573c6 100644 --- a/test/models/product_test.rb +++ b/test/models/product_test.rb @@ -113,25 +113,26 @@ class ProductTest < ActiveSupport::TestCase end test '.self_assigned_no_replied_products' do - current_user = users(:mentormentaro) + mentor = users(:mentormentaro) + student = users(:kimura) published_product = Product.create!( body: 'test', - user: users(:kimura), + user: student, practice: practices(:practice5), checker_id: nil, published_at: Time.current.to_formatted_s(:db) ) wip_product = Product.create!( body: 'test', - user: users(:kimura), + user: student, practice: practices(:practice7), checker_id: nil, wip: true ) - published_product.save_checker(current_user.id) - wip_product.save_checker(current_user.id) + published_product.save_checker(mentor.id) + wip_product.save_checker(mentor.id) - self_assigned_no_replied_products = Product.self_assigned_no_replied_products(current_user.id).pluck(:id) + self_assigned_no_replied_products = Product.self_assigned_no_replied_products(mentor.id).pluck(:id) assert_not_equal [wip_product.id], self_assigned_no_replied_products assert_equal [published_product.id], self_assigned_no_replied_products end diff --git a/test/system/product/self_assigned_test.rb b/test/system/product/self_assigned_test.rb index a6d2ebb0102..a1f22ae5512 100644 --- a/test/system/product/self_assigned_test.rb +++ b/test/system/product/self_assigned_test.rb @@ -96,22 +96,29 @@ class Product::SelfAssignedTest < ApplicationSystemTestCase end test 'not display no replied wip products if click on no-replied-button' do - mentor = users(:mentormentaro) - product = products(:product5) + mentor = users(:machida) + product = products(:product62) + product.update!(wip: true) visit_with_auth '/products/self_assigned?target=self_assigned_no_replied', mentor.login_name - product_list_titles = all('.card-list-item-title__title').map(&:text) - assert_not_includes product_list_titles, product.title + product_title_list = all('.card-list-item-title__title').map(&:text) + assert_not_includes product_title_list, "#{product.practice.title}の提出物" end - test 'not display last replied by student replied wip products if click on no-replied-button' do + test 'not display last replied wip products by student if click on no-replied-button' do mentor = users(:machida) product = products(:product63) product.update(wip: true) + Comment.create!( + user: product.user, + commentable: product, + description: '提出者のコメント' + ) + visit_with_auth '/products/self_assigned?target=self_assigned_no_replied', mentor.login_name - product_list_titles = all('.card-list-item-title__title').map(&:text) - assert_not_includes product_list_titles, product.title + product_title_list = all('.card-list-item-title__title').map(&:text) + assert_not_includes product_title_list, "#{product.practice.title}の提出物" end test 'display replied products if click on self_assigned_all-button' do From c8237f99ed8efae40989906b0d0767841ea31869 Mon Sep 17 00:00:00 2001 From: akingo55 Date: Sat, 1 Apr 2023 23:47:04 +0900 Subject: [PATCH 53/72] =?UTF-8?q?=E6=AE=8B=E3=81=A3=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=82=8Bpage=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/announcements_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/system/announcements_test.rb b/test/system/announcements_test.rb index 7b6a6493a43..41705bb974f 100644 --- a/test/system/announcements_test.rb +++ b/test/system/announcements_test.rb @@ -125,7 +125,7 @@ class AnnouncementsTest < ApplicationSystemTestCase assert has_no_button? '公開' click_button '作成' - assert page.has_css?('p.flash__message', text: 'お知らせを作成しました') + assert has_css?('p.flash__message', text: 'お知らせを作成しました') visit_with_auth '/notifications', 'hatsuno' assert_text 'お知らせ「タイトルtest」' @@ -135,7 +135,7 @@ class AnnouncementsTest < ApplicationSystemTestCase accept_confirm do click_link '削除' end - assert page.has_css?('p.flash__message', text: 'お知らせを削除しました') + assert has_css?('p.flash__message', text: 'お知らせを削除しました') visit_with_auth '/notifications', 'hatsuno' assert_no_text 'お知らせ「タイトルtest」' From 993d08a756e2f8bfbfbc39b7d79f6c0316aaf44c Mon Sep 17 00:00:00 2001 From: ymmtd0x0b Date: Sun, 2 Apr 2023 03:11:22 +0900 Subject: [PATCH 54/72] =?UTF-8?q?wip=E3=81=AE=E6=8F=90=E5=87=BA=E9=83=A8?= =?UTF-8?q?=E3=81=8C=E5=90=AB=E3=81=BE=E3=82=8C=E3=81=AA=E3=81=84=E4=BA=8B?= =?UTF-8?q?=E3=82=92=E6=A4=9C=E8=A8=BC=E3=81=99=E3=82=8B=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=92=E7=8B=AC=E7=AB=8B=E3=81=95=E3=81=9B=E3=81=A6?= =?UTF-8?q?=E5=8F=AF=E8=AA=AD=E6=80=A7=E3=82=A2=E3=83=83=E3=83=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/models/product_test.rb | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/test/models/product_test.rb b/test/models/product_test.rb index ffa1c7573c6..d312100b1a1 100644 --- a/test/models/product_test.rb +++ b/test/models/product_test.rb @@ -114,26 +114,30 @@ class ProductTest < ActiveSupport::TestCase test '.self_assigned_no_replied_products' do mentor = users(:mentormentaro) - student = users(:kimura) - published_product = Product.create!( + no_replied_product = Product.create!( body: 'test', - user: student, + user: users(:kimura), practice: practices(:practice5), - checker_id: nil, + checker_id: mentor.id, published_at: Time.current.to_formatted_s(:db) ) - wip_product = Product.create!( + + product_id_list = Product.self_assigned_no_replied_products(mentor.id).pluck(:id) + assert_includes product_id_list, no_replied_product.id + end + + test '.self_assigned_no_replied_products not include wip products' do + mentor = users(:mentormentaro) + no_replied_wip_product = Product.create!( body: 'test', - user: student, - practice: practices(:practice7), - checker_id: nil, + user: users(:kimura), + practice: practices(:practice5), + checker_id: mentor.id, + published_at: Time.current.to_formatted_s(:db), wip: true ) - published_product.save_checker(mentor.id) - wip_product.save_checker(mentor.id) - self_assigned_no_replied_products = Product.self_assigned_no_replied_products(mentor.id).pluck(:id) - assert_not_equal [wip_product.id], self_assigned_no_replied_products - assert_equal [published_product.id], self_assigned_no_replied_products + product_id_list = Product.self_assigned_no_replied_products(mentor.id).pluck(:id) + assert_not_includes product_id_list, no_replied_wip_product.id end end From 5ce445b91b5f39fc9b03f681d941998aaff5bfec Mon Sep 17 00:00:00 2001 From: ymmtd0x0b Date: Sun, 2 Apr 2023 15:08:47 +0900 Subject: [PATCH 55/72] =?UTF-8?q?=E5=88=9D=E6=9C=9F=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=81=AE=E8=A8=98=E8=BF=B0=E3=82=92=E5=88=86=E3=81=8B?= =?UTF-8?q?=E3=82=8A=E3=82=84=E3=81=99=E3=81=8F=E3=81=99=E3=82=8B=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/fixtures/comments.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/db/fixtures/comments.yml b/db/fixtures/comments.yml index 82fabea219e..8d360a49fce 100644 --- a/db/fixtures/comments.yml +++ b/db/fixtures/comments.yml @@ -127,20 +127,12 @@ comment41: commentable: announcement1 (Announcement) description: "お知らせのコメントです。" -<% (1..3).each do |i| %> -comment<%= i + 41 %>: - user: <%= i.odd? ? 'kimura' : 'mentormentaro' %> +comment42: + user: kimura commentable: product73 (Product) - description: <%= "#{i.odd? ? '提出者' : 'メンター'}のコメントです。" %> - created_at: <%= Time.current + i.minutes %> - updated_at: <%= Time.current + i.minutes %> -<% end %> + description: "提出者のコメントです。" -<% (1..3).each do |i| %> -comment<%= i + 45 %>: - user: <%= i.even? ? 'kimura' : 'mentormentaro' %> +comment43: + user: mentormentaro commentable: product74 (Product) - description: <%= "#{i.even? ? '提出者' : 'メンター'}のコメントです。" %> - created_at: <%= Time.current + i.minutes %> - updated_at: <%= Time.current + i.minutes %> -<% end %> + description: "メンターのコメントです。" From f177679a57640b420a4c85e85294adc75f67c363 Mon Sep 17 00:00:00 2001 From: YukiWatanabe824 Date: Tue, 4 Apr 2023 06:35:40 +0900 Subject: [PATCH 56/72] =?UTF-8?q?admin=20=E3=83=A6=E3=83=BC=E3=82=B6?= =?UTF-8?q?=E3=83=BC=E4=B8=80=E8=A6=A7=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=AE?= =?UTF-8?q?=E5=89=8A=E9=99=A4=E3=82=92=E6=B6=88=E5=8E=BB=E3=81=97=E3=80=81?= =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E5=80=8B=E5=88=A5=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=AB=E7=A7=BB=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admin/users/_table.html.slim | 5 ----- app/views/users/show.html.slim | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/views/admin/users/_table.html.slim b/app/views/admin/users/_table.html.slim index efc88a59790..a8794ad4221 100644 --- a/app/views/admin/users/_table.html.slim +++ b/app/views/admin/users/_table.html.slim @@ -24,7 +24,6 @@ th.admin-table__label 卒業 th.admin-table__label 外部サービス th.admin-table__label 操作 - th.admin-table__label 削除 tbody.admin-table__items - users.each do |user| - next if params[:target] == 'campaign' && user.adviser? @@ -125,10 +124,6 @@ td.admin-table__item-value.is-text-align-center = link_to edit_admin_user_path(user), id: "edit-#{user.id}", class: 'a-button is-sm is-secondary is-icon' do i.fa-solid.fa-pen - td.admin-table__item-value.is-text-align-center - - if user.id != current_user.id - = link_to admin_user_path(user), method: :delete, id: "delete-#{user.id}", class: 'a-button is-sm is-danger is-icon', data: { confirm: '本当によろしいですか?この操作はデータを削除するため元に戻すことができません。' } - i.fa-solid.fa-trash-alt .a-card header.card-header diff --git a/app/views/users/show.html.slim b/app/views/users/show.html.slim index 22f721cdc60..59ac45f0a92 100644 --- a/app/views/users/show.html.slim +++ b/app/views/users/show.html.slim @@ -93,3 +93,6 @@ method: :patch, data: { confirm: '本当によろしいですか?' }, class: 'a-button is-sm is-danger is-block' + / ユーザー削除の表示 + - if @user.id != current_user.id && current_user.admin? + = link_to '削除', admin_user_path(@user), method: :delete, id: "delete-#{@user.id}", class: 'a-button is-sm is-danger is-icon', data: { confirm: '本当によろしいですか?この操作はデータを削除するため元に戻すことができません。' } From 08856160ebe3161a3e5522e420040241865ef514 Mon Sep 17 00:00:00 2001 From: YukiWatanabe824 Date: Tue, 4 Apr 2023 17:57:15 +0900 Subject: [PATCH 57/72] =?UTF-8?q?test:=20=E5=89=8A=E9=99=A4=E3=83=9C?= =?UTF-8?q?=E3=82=BF=E3=83=B3=E7=A7=BB=E8=A1=8C=E3=81=AB=E3=81=A8=E3=82=82?= =?UTF-8?q?=E3=81=AA=E3=81=86=E3=83=86=E3=82=B9=E3=83=88=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/admin/users_test.rb | 8 -------- test/system/users_test.rb | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/system/admin/users_test.rb b/test/system/admin/users_test.rb index 5082ff037a5..a18cca3c9ec 100644 --- a/test/system/admin/users_test.rb +++ b/test/system/admin/users_test.rb @@ -99,14 +99,6 @@ class Admin::UsersTest < ApplicationSystemTestCase assert_equal('Fjord Inc.', find('.user-metas__item-label', text: '所属企業').sibling('.user-metas__item-value').text) end - test 'delete user' do - user = users(:kimura) - visit_with_auth admin_users_path(target: 'student_and_trainee'), 'komagata' - click_on "delete-#{user.id}" - page.driver.browser.switch_to.alert.accept - assert_text "#{user.name} さんを削除しました。" - end - test 'hide input for retire date when unchecked' do user = users(:hatsuno) visit_with_auth "/admin/users/#{user.id}/edit", 'komagata' diff --git a/test/system/users_test.rb b/test/system/users_test.rb index 6f7b09dbf2d..0a7585a579d 100644 --- a/test/system/users_test.rb +++ b/test/system/users_test.rb @@ -599,4 +599,12 @@ class UsersTest < ApplicationSystemTestCase assert_no_link '休会', href: '/users?target=hibernated' assert_no_link '退会', href: '/users?target=retired' end + + test 'delete user' do + user = users(:kimura) + visit_with_auth "users/#{user.id}", 'komagata' + click_link "delete-#{user.id}" + page.driver.browser.switch_to.alert.accept + assert_text "#{user.name} さんを削除しました。" + end end From 376e58b7a43f18c99bb2f993d8cc6a926833edfc Mon Sep 17 00:00:00 2001 From: YukiWatanabe824 Date: Tue, 4 Apr 2023 18:10:04 +0900 Subject: [PATCH 58/72] =?UTF-8?q?=E3=82=AF=E3=83=A9=E3=82=B9=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4=E3=81=97=E3=81=A6=E8=A6=81=E7=B4=A0=E3=81=AE?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=82=92=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB?= =?UTF-8?q?=E3=83=88=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/show.html.slim b/app/views/users/show.html.slim index 59ac45f0a92..96b1b9a48e9 100644 --- a/app/views/users/show.html.slim +++ b/app/views/users/show.html.slim @@ -95,4 +95,4 @@ class: 'a-button is-sm is-danger is-block' / ユーザー削除の表示 - if @user.id != current_user.id && current_user.admin? - = link_to '削除', admin_user_path(@user), method: :delete, id: "delete-#{@user.id}", class: 'a-button is-sm is-danger is-icon', data: { confirm: '本当によろしいですか?この操作はデータを削除するため元に戻すことができません。' } + = link_to '削除', admin_user_path(@user), method: :delete, id: "delete-#{@user.id}", class: '', data: { confirm: '本当によろしいですか?この操作はデータを削除するため元に戻すことができません。' } From 7569526891e12ddc24549d6c78eceb8a4772ed10 Mon Sep 17 00:00:00 2001 From: teppei machida Date: Thu, 6 Apr 2023 00:03:52 +0900 Subject: [PATCH 59/72] =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC?= =?UTF-8?q?=E5=89=8A=E9=99=A4=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=AB=E3=83=87?= =?UTF-8?q?=E3=82=B6=E3=82=A4=E3=83=B3=E3=82=92=E5=85=A5=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stylesheets/application/blocks/side/_user-statuses.sass | 6 ++++++ app/javascript/stylesheets/atoms/_a-text-link.sass | 4 ++++ app/views/users/show.html.slim | 6 +++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/javascript/stylesheets/application/blocks/side/_user-statuses.sass b/app/javascript/stylesheets/application/blocks/side/_user-statuses.sass index 3191cccc739..e34558a617b 100644 --- a/app/javascript/stylesheets/application/blocks/side/_user-statuses.sass +++ b/app/javascript/stylesheets/application/blocks/side/_user-statuses.sass @@ -25,3 +25,9 @@ .user-statuses__item flex: 1 max-width: calc(50% - .75rem) + +.user-statuses__delete + display: flex + justify-content: flex-end + margin-top: .75rem + +text-block(.8125rem 1.4) diff --git a/app/javascript/stylesheets/atoms/_a-text-link.sass b/app/javascript/stylesheets/atoms/_a-text-link.sass index 409d341c68c..6972b0c8bb1 100644 --- a/app/javascript/stylesheets/atoms/_a-text-link.sass +++ b/app/javascript/stylesheets/atoms/_a-text-link.sass @@ -5,3 +5,7 @@ .a-reversal-text-link +hover-link-reversal +reversal-link + +.a-muted-text-link + +hover-link-reversal + +muted-link diff --git a/app/views/users/show.html.slim b/app/views/users/show.html.slim index 96b1b9a48e9..b6c274883c7 100644 --- a/app/views/users/show.html.slim +++ b/app/views/users/show.html.slim @@ -93,6 +93,6 @@ method: :patch, data: { confirm: '本当によろしいですか?' }, class: 'a-button is-sm is-danger is-block' - / ユーザー削除の表示 - - if @user.id != current_user.id && current_user.admin? - = link_to '削除', admin_user_path(@user), method: :delete, id: "delete-#{@user.id}", class: '', data: { confirm: '本当によろしいですか?この操作はデータを削除するため元に戻すことができません。' } + - if @user.id != current_user.id + .user-statuses__delete + = link_to 'このユーザーを削除する', admin_user_path(@user), method: :delete, id: "delete-#{@user.id}", class: 'a-muted-text-link', data: { confirm: '本当によろしいですか?この操作はデータを削除するため元に戻すことができません。' } From 41098a3ae0516f8ccccea70af0110706d4ca27c5 Mon Sep 17 00:00:00 2001 From: YukiWatanabe824 Date: Sun, 9 Apr 2023 10:29:29 +0900 Subject: [PATCH 60/72] =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=88=86=E5=B2=90?= =?UTF-8?q?=E3=82=92id=E5=90=88=E8=87=B4=E3=81=8B=E3=82=89=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=B3=E3=82=B9=E3=81=8C=E5=90=88?= =?UTF-8?q?=E8=87=B4=E3=81=99=E3=82=8B=E3=81=8B=E3=81=A9=E3=81=86=E3=81=8B?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/show.html.slim b/app/views/users/show.html.slim index b6c274883c7..bc232d11448 100644 --- a/app/views/users/show.html.slim +++ b/app/views/users/show.html.slim @@ -93,6 +93,6 @@ method: :patch, data: { confirm: '本当によろしいですか?' }, class: 'a-button is-sm is-danger is-block' - - if @user.id != current_user.id + - if @user != current_user .user-statuses__delete = link_to 'このユーザーを削除する', admin_user_path(@user), method: :delete, id: "delete-#{@user.id}", class: 'a-muted-text-link', data: { confirm: '本当によろしいですか?この操作はデータを削除するため元に戻すことができません。' } From 44dc7f5b22defb876f7a0b7794d54f9c5f940d2b Mon Sep 17 00:00:00 2001 From: wata00913 <175d8639@gmail.com> Date: Tue, 21 Mar 2023 10:29:09 +0900 Subject: [PATCH 61/72] =?UTF-8?q?=E6=8F=90=E5=87=BA=E7=89=A9=E3=81=AE?= =?UTF-8?q?=E5=AD=A6=E7=BF=92=E3=82=B9=E3=83=86=E3=83=BC=E3=82=BF=E3=82=B9?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=87=A6=E7=90=86=E3=82=92callback=E3=81=8B?= =?UTF-8?q?=E3=82=89Newspaper=E3=81=B8=E7=BD=AE=E3=81=8D=E6=8F=9B=E3=81=88?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._status_updater_with_product_submission.rb | 19 +++++++++++++++++++ app/models/product_callbacks.rb | 18 ------------------ config/initializers/newspaper.rb | 2 ++ 3 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 app/models/learning_status_updater_with_product_submission.rb diff --git a/app/models/learning_status_updater_with_product_submission.rb b/app/models/learning_status_updater_with_product_submission.rb new file mode 100644 index 00000000000..8c7e10a93df --- /dev/null +++ b/app/models/learning_status_updater_with_product_submission.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class LearningStatusUpdaterWithProductSubmission + def call(product) + previous_learning = Learning.find_or_initialize_by( + user_id: product.user.id, + practice_id: product.practice.id + ) + status = if previous_learning.status == 'complete' + :complete + elsif product.wip + started_practice = product.user.learnings.map(&:status).include?('started') + started_practice ? :unstarted : :started + else + :submitted + end + product.change_learning_status status + end +end diff --git a/app/models/product_callbacks.rb b/app/models/product_callbacks.rb index b3873f8fc94..48c49e00592 100644 --- a/app/models/product_callbacks.rb +++ b/app/models/product_callbacks.rb @@ -16,8 +16,6 @@ def after_update(product) end def after_commit(product) - update_learning_status product - unless product.wip notify_watching_mentors product create_advisers_watch product if product.user.trainee? && product.user.company @@ -62,20 +60,4 @@ def notify_watching_mentors(product) receivers: mentors ) end - - def update_learning_status(product) - previous_learning = Learning.find_or_initialize_by( - user_id: product.user.id, - practice_id: product.practice.id - ) - status = if previous_learning.status == 'complete' - :complete - elsif product.wip - started_practice = product.user.learnings.map(&:status).include?('started') - started_practice ? :unstarted : :started - else - :submitted - end - product.change_learning_status status - end end diff --git a/config/initializers/newspaper.rb b/config/initializers/newspaper.rb index 53e05587926..5e7f428622a 100644 --- a/config/initializers/newspaper.rb +++ b/config/initializers/newspaper.rb @@ -37,6 +37,8 @@ Newspaper.subscribe(:check_create, ProductStatusUpdater.new) Newspaper.subscribe(:product_create, ProductAuthorWatcher.new) + Newspaper.subscribe(:product_create, LearningStatusUpdaterWithProductSubmission.new) + Newspaper.subscribe(:product_update, LearningStatusUpdaterWithProductSubmission.new) page_notifier = PageNotifier.new Newspaper.subscribe(:page_create, page_notifier) From 1ff1c863539aa45faef34047366c6880b0a9753d Mon Sep 17 00:00:00 2001 From: wata00913 <175d8639@gmail.com> Date: Tue, 21 Mar 2023 13:09:33 +0900 Subject: [PATCH 62/72] =?UTF-8?q?=E3=83=AA=E3=83=95=E3=82=A1=E3=82=AF?= =?UTF-8?q?=E3=82=BF=E3=83=AA=E3=83=B3=E3=82=B0:subscriber(LearningStatusU?= =?UTF-8?q?pdaterWithProductSubmission)=E3=81=AE=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=81=AB=E4=BC=B4=E3=81=A3=E3=81=A6=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E5=90=8D(ProductStatusUpdater)=E3=81=AE=E6=84=8F=E5=91=B3?= =?UTF-8?q?=E3=81=8C=E5=BA=83=E3=81=99=E3=81=8E=E3=82=8B=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E3=83=AA=E3=83=8D=E3=83=BC=E3=83=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...updater.rb => learning_status_updater_with_product_check.rb} | 2 +- config/initializers/newspaper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename app/models/{product_status_updater.rb => learning_status_updater_with_product_check.rb} (79%) diff --git a/app/models/product_status_updater.rb b/app/models/learning_status_updater_with_product_check.rb similarity index 79% rename from app/models/product_status_updater.rb rename to app/models/learning_status_updater_with_product_check.rb index d1c423595aa..c7aa71454ec 100644 --- a/app/models/product_status_updater.rb +++ b/app/models/learning_status_updater_with_product_check.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class ProductStatusUpdater +class LearningStatusUpdaterWithProductCheck def call(check) return unless check.checkable_type == 'Product' diff --git a/config/initializers/newspaper.rb b/config/initializers/newspaper.rb index 5e7f428622a..5ff1a1c5cac 100644 --- a/config/initializers/newspaper.rb +++ b/config/initializers/newspaper.rb @@ -35,7 +35,7 @@ Newspaper.subscribe(:comeback_update, ComebackNotifier.new) - Newspaper.subscribe(:check_create, ProductStatusUpdater.new) + Newspaper.subscribe(:check_create, LearningStatusUpdaterWithProductCheck.new) Newspaper.subscribe(:product_create, ProductAuthorWatcher.new) Newspaper.subscribe(:product_create, LearningStatusUpdaterWithProductSubmission.new) Newspaper.subscribe(:product_update, LearningStatusUpdaterWithProductSubmission.new) From 4598a89df386d717392fc2c608666b081fd6ebb0 Mon Sep 17 00:00:00 2001 From: wata00913 <175d8639@gmail.com> Date: Tue, 21 Mar 2023 16:27:12 +0900 Subject: [PATCH 63/72] =?UTF-8?q?=E6=8F=90=E5=87=BA=E7=89=A9=E3=81=AE?= =?UTF-8?q?=E5=AD=A6=E7=BF=92=E3=82=B9=E3=83=86=E3=83=BC=E3=82=BF=E3=82=B9?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=87=A6=E7=90=86=E3=82=92Product=E3=83=A2?= =?UTF-8?q?=E3=83=87=E3=83=AB=E3=81=AECallback=E3=81=8B=E3=82=89=E5=BC=95?= =?UTF-8?q?=E3=81=8D=E5=89=A5=E3=81=8C=E3=81=97=E3=81=A6=E3=83=A2=E3=83=87?= =?UTF-8?q?=E3=83=AB=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E3=81=8C=E8=90=BD?= =?UTF-8?q?=E3=81=A1=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/models/product_test.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/test/models/product_test.rb b/test/models/product_test.rb index d312100b1a1..8a6ac1a803d 100644 --- a/test/models/product_test.rb +++ b/test/models/product_test.rb @@ -52,7 +52,6 @@ class ProductTest < ActiveSupport::TestCase user: user, practice: practice ) - assert Learning.find_by(user: user, practice: practice, status: :submitted) status = :complete product.change_learning_status(status) From 6467247265e31860bbd267f4c6f3f503850dd25f Mon Sep 17 00:00:00 2001 From: wata00913 <175d8639@gmail.com> Date: Mon, 3 Apr 2023 07:43:37 +0900 Subject: [PATCH 64/72] =?UTF-8?q?=E3=82=AF=E3=83=A9=E3=82=B9=E5=90=8D?= =?UTF-8?q?=E3=83=BB=E6=84=8F=E5=91=B3=E7=9A=84=E3=81=AA=E5=88=86=E9=A1=9E?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E9=95=B7=E3=81=99=E3=81=8E=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=81=A7LearningStatusUpdater=E3=81=A8=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=BE=E3=81=A8=E3=82=81=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...bmission.rb => learning_status_updater.rb} | 19 +++++++++++++++++-- ...rning_status_updater_with_product_check.rb | 9 --------- config/initializers/newspaper.rb | 6 +++--- 3 files changed, 20 insertions(+), 14 deletions(-) rename app/models/{learning_status_updater_with_product_submission.rb => learning_status_updater.rb} (54%) delete mode 100644 app/models/learning_status_updater_with_product_check.rb diff --git a/app/models/learning_status_updater_with_product_submission.rb b/app/models/learning_status_updater.rb similarity index 54% rename from app/models/learning_status_updater_with_product_submission.rb rename to app/models/learning_status_updater.rb index 8c7e10a93df..2fd925aa67c 100644 --- a/app/models/learning_status_updater_with_product_submission.rb +++ b/app/models/learning_status_updater.rb @@ -1,7 +1,22 @@ # frozen_string_literal: true -class LearningStatusUpdaterWithProductSubmission - def call(product) +class LearningStatusUpdater + def call(product_or_associated_object) + case product_or_associated_object + when Product + update_with_submission(product_or_associated_object) + when Check + update_with_check(product_or_associated_object) + end + end + + def update_with_check(check) + return unless check.checkable_type == 'Product' + + check.checkable.change_learning_status(:complete) + end + + def update_with_submission(product) previous_learning = Learning.find_or_initialize_by( user_id: product.user.id, practice_id: product.practice.id diff --git a/app/models/learning_status_updater_with_product_check.rb b/app/models/learning_status_updater_with_product_check.rb deleted file mode 100644 index c7aa71454ec..00000000000 --- a/app/models/learning_status_updater_with_product_check.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class LearningStatusUpdaterWithProductCheck - def call(check) - return unless check.checkable_type == 'Product' - - check.checkable.change_learning_status(:complete) - end -end diff --git a/config/initializers/newspaper.rb b/config/initializers/newspaper.rb index 5ff1a1c5cac..7e8da93b6ec 100644 --- a/config/initializers/newspaper.rb +++ b/config/initializers/newspaper.rb @@ -35,10 +35,10 @@ Newspaper.subscribe(:comeback_update, ComebackNotifier.new) - Newspaper.subscribe(:check_create, LearningStatusUpdaterWithProductCheck.new) + Newspaper.subscribe(:check_create, LearningStatusUpdater.new) Newspaper.subscribe(:product_create, ProductAuthorWatcher.new) - Newspaper.subscribe(:product_create, LearningStatusUpdaterWithProductSubmission.new) - Newspaper.subscribe(:product_update, LearningStatusUpdaterWithProductSubmission.new) + Newspaper.subscribe(:product_create, LearningStatusUpdater.new) + Newspaper.subscribe(:product_update, LearningStatusUpdater.new) page_notifier = PageNotifier.new Newspaper.subscribe(:page_create, page_notifier) From c670f84400dcec00c1e06eea42a355aa18dcb864 Mon Sep 17 00:00:00 2001 From: wata00913 <175d8639@gmail.com> Date: Mon, 3 Apr 2023 11:23:51 +0900 Subject: [PATCH 65/72] =?UTF-8?q?=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89?= =?UTF-8?q?=E5=90=8D=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/learning_status_updater.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/learning_status_updater.rb b/app/models/learning_status_updater.rb index 2fd925aa67c..a433d9e4343 100644 --- a/app/models/learning_status_updater.rb +++ b/app/models/learning_status_updater.rb @@ -4,19 +4,19 @@ class LearningStatusUpdater def call(product_or_associated_object) case product_or_associated_object when Product - update_with_submission(product_or_associated_object) + update_after_submission(product_or_associated_object) when Check - update_with_check(product_or_associated_object) + update_after_check(product_or_associated_object) end end - def update_with_check(check) + def update_after_check(check) return unless check.checkable_type == 'Product' check.checkable.change_learning_status(:complete) end - def update_with_submission(product) + def update_after_submission(product) previous_learning = Learning.find_or_initialize_by( user_id: product.user.id, practice_id: product.practice.id From 5b7914ba8b69b77845d990ea52a4472ea7bdf3a2 Mon Sep 17 00:00:00 2001 From: wata00913 <175d8639@gmail.com> Date: Mon, 10 Apr 2023 13:18:01 +0900 Subject: [PATCH 66/72] =?UTF-8?q?=E5=85=B1=E9=80=9A=E3=81=AE=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=B3=E3=82=B9=E5=A4=89=E6=95=B0?= =?UTF-8?q?=E3=82=92=E4=BD=BF=E3=81=86=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/initializers/newspaper.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config/initializers/newspaper.rb b/config/initializers/newspaper.rb index 7e8da93b6ec..79140952211 100644 --- a/config/initializers/newspaper.rb +++ b/config/initializers/newspaper.rb @@ -35,10 +35,12 @@ Newspaper.subscribe(:comeback_update, ComebackNotifier.new) - Newspaper.subscribe(:check_create, LearningStatusUpdater.new) Newspaper.subscribe(:product_create, ProductAuthorWatcher.new) - Newspaper.subscribe(:product_create, LearningStatusUpdater.new) - Newspaper.subscribe(:product_update, LearningStatusUpdater.new) + + learning_status_updater = LearningStatusUpdater.new + Newspaper.subscribe(:check_create, learning_status_updater) + Newspaper.subscribe(:product_create, learning_status_updater) + Newspaper.subscribe(:product_update, learning_status_updater) page_notifier = PageNotifier.new Newspaper.subscribe(:page_create, page_notifier) From b3c9377c54455afae050ffd537cc7dc67a0be246 Mon Sep 17 00:00:00 2001 From: komagata Date: Tue, 11 Apr 2023 09:55:04 +0900 Subject: [PATCH 67/72] =?UTF-8?q?=E4=BC=91=E4=BC=9A=E4=B8=AD=E3=81=AE?= =?UTF-8?q?=E4=BA=BA=E3=82=92=E5=90=AB=E3=82=81=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/admin/count_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/admin/count_controller.rb b/app/controllers/api/admin/count_controller.rb index cdf18ada0aa..2e09ede6794 100644 --- a/app/controllers/api/admin/count_controller.rb +++ b/app/controllers/api/admin/count_controller.rb @@ -7,7 +7,8 @@ def show mentor: false, adviser: false, retired_on: nil, - graduated_on: nil + graduated_on: nil, + hibernated_at: nil ).count render json: { users_count: users_count } From e0d01408631a337419fac469c256fcd135803b47 Mon Sep 17 00:00:00 2001 From: teppei machida Date: Tue, 11 Apr 2023 13:59:27 +0900 Subject: [PATCH 68/72] =?UTF-8?q?RubyKaigi2023=E3=81=AE=E3=83=90=E3=83=8A?= =?UTF-8?q?=E3=83=BC=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E5=85=88=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/_welcome_top_banner.html.slim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/welcome/_welcome_top_banner.html.slim b/app/views/welcome/_welcome_top_banner.html.slim index 6b66124a99a..cf5a0a7b512 100644 --- a/app/views/welcome/_welcome_top_banner.html.slim +++ b/app/views/welcome/_welcome_top_banner.html.slim @@ -1,5 +1,4 @@ .welcome-section.has-no-padding-bottom .container.is-md - // TODO 発表内容が公開されたらブログ記事を書き、そっちにリンク先を変更 - = link_to 'https://rubykaigi.org/2023/speakers/', target: '_blank', rel: 'noopener' do + = link_to 'https://bootcamp.fjord.jp/articles/72', target: '_blank', rel: 'noopener' do = image_tag('welcome/banners/rubykaigi2023.svg', alt: '祝!RubyKaigi2023登壇 卒業生のima1zumiさん') From b82380544ba1910deb1dc24cb62b842f0dce30b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 05:37:49 +0000 Subject: [PATCH 69/72] Bump commonmarker from 0.23.7 to 0.23.9 Bumps [commonmarker](https://github.com/gjtorikian/commonmarker) from 0.23.7 to 0.23.9. - [Release notes](https://github.com/gjtorikian/commonmarker/releases) - [Changelog](https://github.com/gjtorikian/commonmarker/blob/main/CHANGELOG.md) - [Commits](https://github.com/gjtorikian/commonmarker/compare/v0.23.7...v0.23.9) --- updated-dependencies: - dependency-name: commonmarker dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 72782a49c5d..b7355abeda1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -157,7 +157,7 @@ GEM childprocess (4.1.0) cocoon (1.2.15) coderay (1.1.3) - commonmarker (0.23.7) + commonmarker (0.23.9) concurrent-ruby (1.1.10) connection_pool (2.3.0) crack (0.4.5) From 99140bdf5847cb04e19e290b293a1e6733fb76e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 05:53:41 +0000 Subject: [PATCH 70/72] Bump nokogiri from 1.13.10 to 1.14.3 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.10 to 1.14.3. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.10...v1.14.3) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 72782a49c5d..8df045386a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -288,7 +288,7 @@ GEM mime-types-data (3.2022.0105) mini_magick (4.11.0) mini_mime (1.1.2) - mini_portile2 (2.8.0) + mini_portile2 (2.8.1) minitest (5.17.0) minitest-ci (3.4.0) minitest (>= 5.0.6) @@ -308,10 +308,10 @@ GEM netrc (0.11.0) newspaper (0.2.0) nio4r (2.5.8) - nokogiri (1.13.10) + nokogiri (1.14.3) mini_portile2 (~> 2.8.0) racc (~> 1.4) - nokogiri (1.13.10-x86_64-darwin) + nokogiri (1.14.3-x86_64-darwin) racc (~> 1.4) oauth (0.6.2) snaky_hash (~> 2.0) @@ -362,7 +362,7 @@ GEM puma (6.0.0) nio4r (~> 2.0) raabro (1.4.0) - racc (1.6.1) + racc (1.6.2) rack (2.2.6.4) rack-cors (1.1.1) rack (>= 2.0.0) From e069e257d1523e370e35d417aa3548edbc3b7ac4 Mon Sep 17 00:00:00 2001 From: teppei machida Date: Thu, 13 Apr 2023 14:57:36 +0900 Subject: [PATCH 71/72] =?UTF-8?q?li=20=E3=81=AE=E4=B8=AD=E3=81=AE=20blockq?= =?UTF-8?q?ute=20=E3=81=AE=20margin=20=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stylesheets/config/mixins/_long-text-style.sass | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/javascript/stylesheets/config/mixins/_long-text-style.sass b/app/javascript/stylesheets/config/mixins/_long-text-style.sass index 5c408e5040b..25cf81284dc 100644 --- a/app/javascript/stylesheets/config/mixins/_long-text-style.sass +++ b/app/javascript/stylesheets/config/mixins/_long-text-style.sass @@ -121,6 +121,10 @@ margin-top: 0 *:not(ol):not(ul):last-child margin-bottom: 0 + blockquote + margin-left: calc(.75em + 1px) + blockquote + ul + margin-top: -2em code +text-block(.875em 1.7, $default-text inline-flex) align-items: center From 71228b1a49efeb3b2601079b6481a2f7823b8c5b Mon Sep 17 00:00:00 2001 From: teppei machida Date: Thu, 13 Apr 2023 15:08:34 +0900 Subject: [PATCH 72/72] =?UTF-8?q?UTF-8=E3=82=92=E4=BB=98=E3=81=91=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/stylesheets/application.sass | 2 ++ app/javascript/stylesheets/not-logged-in.sass | 2 ++ app/javascript/stylesheets/welcome.sass | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/javascript/stylesheets/application.sass b/app/javascript/stylesheets/application.sass index 3a5d8fda51a..645474228f6 100644 --- a/app/javascript/stylesheets/application.sass +++ b/app/javascript/stylesheets/application.sass @@ -1,3 +1,5 @@ +@charset "UTF-8" + @import common-imports @import application/blocks/admin/admin-table diff --git a/app/javascript/stylesheets/not-logged-in.sass b/app/javascript/stylesheets/not-logged-in.sass index e530b90e85d..65d4a11d3a8 100644 --- a/app/javascript/stylesheets/not-logged-in.sass +++ b/app/javascript/stylesheets/not-logged-in.sass @@ -1,3 +1,5 @@ +@charset "UTF-8" + @import common-imports @import not-logged-in/not-logged-in-wrapper diff --git a/app/javascript/stylesheets/welcome.sass b/app/javascript/stylesheets/welcome.sass index 9daa8789b12..6d8216273e1 100644 --- a/app/javascript/stylesheets/welcome.sass +++ b/app/javascript/stylesheets/welcome.sass @@ -1,3 +1,5 @@ +@charset "UTF-8" + @import common-imports @import welcome/articles/article