From a9d70d6625ccaed9fec73468e5d9e42b75ccea9f Mon Sep 17 00:00:00 2001 From: Judeeeee <43412616+Judeeeee@users.noreply.github.com> Date: Wed, 10 Jul 2024 00:34:19 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=E6=8B=85=E5=BD=93=E3=81=8C=E6=B1=BA?= =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84=E6=8F=90?= =?UTF-8?q?=E5=87=BA=E7=89=A9=E3=81=AB=E3=83=A1=E3=83=B3=E3=82=BF=E3=83=BC?= =?UTF-8?q?=E3=81=8C=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E3=82=92=E3=81=97?= =?UTF-8?q?=E3=81=9F=E5=A0=B4=E5=90=88=E3=80=81=E3=83=96=E3=83=A9=E3=82=A6?= =?UTF-8?q?=E3=82=B6=E3=81=AE=E3=83=80=E3=82=A4=E3=82=A2=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=95=E3=81=9B=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 従来通り担当するボタンを押下した場合はダイアログは表示されない --- app/javascript/checkable.js | 5 ++++- app/javascript/comments.vue | 3 ++- app/javascript/product_checker.vue | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/javascript/checkable.js b/app/javascript/checkable.js index ae172383aa8..684537c381a 100644 --- a/app/javascript/checkable.js +++ b/app/javascript/checkable.js @@ -54,7 +54,7 @@ export default { console.warn(error) }) }, - checkProduct(productId, currentUserId, url, method, token) { + checkProduct(productId, currentUserId, url, method, token, commented) { const params = { product_id: productId, current_user_id: currentUserId @@ -81,6 +81,9 @@ export default { this.id = json.checker_id this.name = json.checker_name if (this.id !== null) { + if (commented) { + alert('提出物の担当になりました。') // 担当が決まっていない提出物にメンターがコメントをした場合にアラートを出す + } this.toast('担当になりました。') } else { this.toast('担当から外れました。') diff --git a/app/javascript/comments.vue b/app/javascript/comments.vue index 97579a9b4a0..c1002dd9928 100644 --- a/app/javascript/comments.vue +++ b/app/javascript/comments.vue @@ -301,7 +301,8 @@ export default { this.currentUserId, '/api/products/checker', 'PATCH', - CSRF.getToken() + CSRF.getToken(), + true ) } }, diff --git a/app/javascript/product_checker.vue b/app/javascript/product_checker.vue index a30268ba57d..b71663b1dfa 100644 --- a/app/javascript/product_checker.vue +++ b/app/javascript/product_checker.vue @@ -64,7 +64,8 @@ export default { this.currentUserId, '/api/products/checker', this.productCheckerId ? 'DELETE' : 'PATCH', - CSRF.getToken() + CSRF.getToken(), + false ) } } From dcbe16acbb66e85545b29585ca65783d71ad34b3 Mon Sep 17 00:00:00 2001 From: Judeeeee <43412616+Judeeeee@users.noreply.github.com> Date: Wed, 10 Jul 2024 00:38:23 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BB=8A=E5=9B=9E=E3=81=AE=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B=E3=82=8B=E3=81=9F?= =?UTF-8?q?=E3=82=81=E3=81=AB=E3=80=81=E3=83=A1=E3=83=B3=E3=82=BF=E3=83=BC?= =?UTF-8?q?=E3=81=8C=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=A8=E6=8B=85=E5=BD=93=E8=80=85=E3=81=AB=E3=81=AA=E3=82=8B?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=82=92=E7=A2=BA=E8=AA=8D=E3=81=99=E3=82=8B?= =?UTF-8?q?=E5=BE=93=E6=9D=A5=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E3=81=AB?= =?UTF-8?q?=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/system/comments_test.rb | 1 + test/system/product/checker_test.rb | 1 + test/system/product/unchecked_test.rb | 1 + test/system/products_test.rb | 1 + 4 files changed, 4 insertions(+) diff --git a/test/system/comments_test.rb b/test/system/comments_test.rb index 8e62e30a2d0..81273748733 100644 --- a/test/system/comments_test.rb +++ b/test/system/comments_test.rb @@ -140,6 +140,7 @@ class CommentsTest < ApplicationSystemTestCase fill_in('new_comment[description]', with: 'test') end click_button 'コメントする' + accept_alert '提出物の担当になりました。' assert_text 'test' assert_text 'Watch中' end diff --git a/test/system/product/checker_test.rb b/test/system/product/checker_test.rb index 67c95dbf1bd..5215e22ce6d 100644 --- a/test/system/product/checker_test.rb +++ b/test/system/product/checker_test.rb @@ -14,6 +14,7 @@ def assigned_product_count visit "/products/#{products(:product1).id}" post_comment('担当者がいない提出物の場合、担当者になる') + accept_alert '提出物の担当になりました。' assert_text '担当になりました。' assert_text '担当から外れる' diff --git a/test/system/product/unchecked_test.rb b/test/system/product/unchecked_test.rb index bd3d01b5f9b..44ce25753c8 100644 --- a/test/system/product/unchecked_test.rb +++ b/test/system/product/unchecked_test.rb @@ -106,6 +106,7 @@ class Product::UncheckedTest < ApplicationSystemTestCase visit_with_auth "/products/#{product.id}", 'mentormentaro' fill_in('new_comment[description]', with: 'test') click_button 'コメントする' + accept_alert '提出物の担当になりました。' within('.thread-comment.is-latest') do assert_text 'mentormentaro' assert_text 'test' diff --git a/test/system/products_test.rb b/test/system/products_test.rb index 9e0555865e1..ae5587e924e 100644 --- a/test/system/products_test.rb +++ b/test/system/products_test.rb @@ -359,6 +359,7 @@ class ProductsTest < ApplicationSystemTestCase visit_with_auth "/products/#{products(:product1).id}", 'komagata' fill_in 'new_comment[description]', with: 'コメントしたら担当になるテスト' click_button 'コメントする' + accept_alert '提出物の担当になりました。' assert_text 'コメントしたら担当になるテスト' visit current_path assert_text '担当から外れる' From ee4d3801c180562f19dde579dcd429b148e094b4 Mon Sep 17 00:00:00 2001 From: Judeeeee <43412616+Judeeeee@users.noreply.github.com> Date: Tue, 16 Jul 2024 14:33:16 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=E3=82=88=E3=82=8A=E6=84=8F=E5=9B=B3?= =?UTF-8?q?=E3=82=92=E8=A1=A8=E3=81=99=E5=A4=89=E6=95=B0=E5=90=8D=E3=81=B8?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commentedからisChargeFromCommentへ変更 --- app/javascript/checkable.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/javascript/checkable.js b/app/javascript/checkable.js index 684537c381a..3d9c13d5124 100644 --- a/app/javascript/checkable.js +++ b/app/javascript/checkable.js @@ -54,7 +54,14 @@ export default { console.warn(error) }) }, - checkProduct(productId, currentUserId, url, method, token, commented) { + checkProduct( + productId, + currentUserId, + url, + method, + token, + isChargeFromComment + ) { const params = { product_id: productId, current_user_id: currentUserId @@ -81,7 +88,7 @@ export default { this.id = json.checker_id this.name = json.checker_name if (this.id !== null) { - if (commented) { + if (isChargeFromComment) { alert('提出物の担当になりました。') // 担当が決まっていない提出物にメンターがコメントをした場合にアラートを出す } this.toast('担当になりました。') From f1d15f1dd8a572bf07b9b51e023a7177c18f5c26 Mon Sep 17 00:00:00 2001 From: Judeeeee <43412616+Judeeeee@users.noreply.github.com> Date: Tue, 16 Jul 2024 14:34:43 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=E3=80=8C=E6=8B=85=E5=BD=93=E3=82=92?= =?UTF-8?q?=E5=A4=96=E3=82=8C=E3=82=8B=E3=83=9C=E3=82=BF=E3=83=B3=E3=80=8D?= =?UTF-8?q?=E3=81=AE=E8=83=8C=E6=99=AF=E3=81=8C=E5=BD=93=E3=81=9F=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=9F?= =?UTF-8?q?=E3=82=81=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ラベル・文頭のマーク切り替えはproductCheckerIdの条件分岐で行っている。 そのため、背景もこの仕様に合わせた。 --- app/javascript/product_checker.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/product_checker.vue b/app/javascript/product_checker.vue index b71663b1dfa..3521d400854 100644 --- a/app/javascript/product_checker.vue +++ b/app/javascript/product_checker.vue @@ -1,7 +1,7 @@