From 482a267da514f39072e2d62c1773cd1f311d3494 Mon Sep 17 00:00:00 2001 From: motohiro-mm Date: Sun, 9 Jun 2024 22:54:28 +0900 Subject: [PATCH 01/10] =?UTF-8?q?=E9=80=80=E4=BC=9A=E8=80=85=E3=81=AE?= =?UTF-8?q?=E6=97=A5=E5=A0=B1=E3=81=A7=E7=AE=A1=E7=90=86=E8=80=85=E3=83=BB?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=82=BF=E3=83=BC=E3=81=AB=E3=81=A0=E3=81=91?= =?UTF-8?q?=E3=80=8C=E3=81=93=E3=81=AE=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC?= =?UTF-8?q?=E3=81=AF=E9=80=80=E4=BC=9A=E3=81=97=E3=81=A6=E3=81=84=E3=81=BE?= =?UTF-8?q?=E3=81=99=E3=80=82=E3=80=8D=E3=81=AE=E3=83=A1=E3=83=83=E3=82=BB?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/reports/show.html.slim | 4 ++++ db/fixtures/reports.yml | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/app/views/reports/show.html.slim b/app/views/reports/show.html.slim index eacbea64057..3e46963eb6d 100644 --- a/app/views/reports/show.html.slim +++ b/app/views/reports/show.html.slim @@ -13,6 +13,10 @@ | #{@report.interval}日 | ぶりの日報です +- if admin_or_mentor_login? && @report.user.retired_on? + p + | このユーザーは退会しています。 + .page-body .container.is-xxl .row.justify-center diff --git a/db/fixtures/reports.yml b/db/fixtures/reports.yml index 276d9287bc7..a84c43ac4ff 100644 --- a/db/fixtures/reports.yml +++ b/db/fixtures/reports.yml @@ -322,3 +322,11 @@ report<%= i + 71 %>: MaruMaru Inc.で研修をしました。 reported_on: <%= Time.now - 1.month + i.day %> <% end %> + +report87: + user: yameo + title: "退会済みユーザーの日報" + emotion: 1 + description: |- + お世話になりました + reported_on: <%= Time.now - 1.month - 1.day %> From 3f57dc882bbcf582f762cce6c704d33a9f636c2f Mon Sep 17 00:00:00 2001 From: motohiro-mm Date: Sun, 9 Jun 2024 22:55:22 +0900 Subject: [PATCH 02/10] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=80=81=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/fixtures/reports.yml | 8 ++++++++ test/integration/api/reports/unchecked_test.rb | 2 +- test/system/reports_test.rb | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/test/fixtures/reports.yml b/test/fixtures/reports.yml index 9425488d21d..a461fbaedf3 100644 --- a/test/fixtures/reports.yml +++ b/test/fixtures/reports.yml @@ -350,3 +350,11 @@ report74: description: 休会します wip: true reported_on: "2019-12-31" + +report75: + user: yameo + title: "退会済みユーザーの日報" + emotion: 1 + description: |- + お世話になりました + reported_on: <%= Time.now - 1.month - 1.day %> diff --git a/test/integration/api/reports/unchecked_test.rb b/test/integration/api/reports/unchecked_test.rb index c2f5ab0ec18..68ee666127a 100644 --- a/test/integration/api/reports/unchecked_test.rb +++ b/test/integration/api/reports/unchecked_test.rb @@ -13,6 +13,6 @@ class API::Reports::UncheckedTest < ActionDispatch::IntegrationTest get counts_api_reports_unchecked_index_path(format: :text), headers: { 'Authorization' => "Bearer #{token}" } assert_response :ok - assert_match '65件', response.body + assert_match '66件', response.body end end diff --git a/test/system/reports_test.rb b/test/system/reports_test.rb index 175c5a255ba..4c90c49d018 100644 --- a/test/system/reports_test.rb +++ b/test/system/reports_test.rb @@ -754,4 +754,9 @@ def wait_for_watch_change assert_no_text 'この日報はすでに提出済みです。' assert_button '提出' end + + test 'display message to admin or mentor in report of retired user' do + visit_with_auth report_path(reports(:report75)), 'komagata' + assert_selector 'p', text: 'このユーザーは退会しています。' + end end From 8274679837c3449c1837af87e30c3e9a46e375db Mon Sep 17 00:00:00 2001 From: machida Date: Tue, 11 Jun 2024 09:25:31 +0900 Subject: [PATCH 03/10] =?UTF-8?q?n=E6=97=A5=E3=81=AE=E3=81=B6=E3=82=8A?= =?UTF-8?q?=E3=81=AE=E6=97=A5=E5=A0=B1=E3=81=A7=E3=81=99=E3=83=A1=E3=83=83?= =?UTF-8?q?=E3=82=BB=E3=83=BC=E3=82=B8=E3=81=AB=E5=8F=A5=E8=AA=AD=E7=82=B9?= =?UTF-8?q?=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/views/reports/show.html.slim | 2 +- test/system/reports_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/reports/show.html.slim b/app/views/reports/show.html.slim index 3e46963eb6d..d692145cc54 100644 --- a/app/views/reports/show.html.slim +++ b/app/views/reports/show.html.slim @@ -11,7 +11,7 @@ p strong | #{@report.interval}日 - | ぶりの日報です + | ぶりの日報です。 - if admin_or_mentor_login? && @report.user.retired_on? p diff --git a/test/system/reports_test.rb b/test/system/reports_test.rb index 4c90c49d018..9656457ec87 100644 --- a/test/system/reports_test.rb +++ b/test/system/reports_test.rb @@ -546,14 +546,14 @@ def wait_for_watch_change test 'display report interval for mentor while undoing wip' do visit_with_auth report_path(reports(:report32)), 'komagata' - assert_selector '.a-page-notice.is-only-mentor.is-danger', text: '10日ぶりの日報です' + assert_selector '.a-page-notice.is-only-mentor.is-danger', text: '10日ぶりの日報です。' visit_with_auth report_path(reports(:report33)), 'kananashi' click_link '内容修正' click_button '提出' visit_with_auth report_path(reports(:report32)), 'komagata' - assert_no_selector '.a-page-notice.is-only-mentor.is-danger', text: '9日ぶりの日報です' + assert_no_selector '.a-page-notice.is-only-mentor.is-danger', text: '9日ぶりの日報です。' end test 'notify to chat after create a report' do From 72fa3267e5d11a315b5eeadc0098950f72ad10e9 Mon Sep 17 00:00:00 2001 From: machida Date: Tue, 11 Jun 2024 10:04:37 +0900 Subject: [PATCH 04/10] =?UTF-8?q?=E9=80=80=E4=BC=9A=E3=83=A6=E3=83=BC?= =?UTF-8?q?=E3=82=B6=E3=83=BC=E6=97=A5=E5=A0=B1=E3=83=A1=E3=83=83=E3=82=BB?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=AB=E3=83=87=E3=82=B6=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=92=E5=85=A5=E3=82=8C=E3=80=81=E9=80=80=E4=BC=9A=E3=83=A6?= =?UTF-8?q?=E3=83=BC=E3=82=B6=E3=83=BC=E3=81=AE=E3=81=AB=E3=81=AFn?= =?UTF-8?q?=E6=97=A5=E3=81=B6=E3=82=8A=E3=81=AE=E6=97=A5=E5=A0=B1=E3=83=A1?= =?UTF-8?q?=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=81=AF=E9=9D=9E=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/reports/show.html.slim | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/app/views/reports/show.html.slim b/app/views/reports/show.html.slim index d692145cc54..3b25f7e18da 100644 --- a/app/views/reports/show.html.slim +++ b/app/views/reports/show.html.slim @@ -4,18 +4,21 @@ = render 'users/page_title', user: @report.user = render 'users/page_tabs', user: @report.user -- if mentor_login? && !@report.first? && @report.latest_of_user? - .a-page-notice.is-only-mentor(class="#{@report.interval >= 10 ? 'is-danger' : ''}") - .container - .a-page-notice__inner - p - strong - | #{@report.interval}日 - | ぶりの日報です。 - -- if admin_or_mentor_login? && @report.user.retired_on? - p - | このユーザーは退会しています。 +- if admin_or_mentor_login? + - if @report.user.retired_on? + .a-page-notice.is-muted.is-only-mentor(class="#{@report.interval >= 10 ? 'is-danger' : ''}") + .container + .a-page-notice__inner + p + | このユーザーは退会しています。 + - else !@report.first? && @report.latest_of_user? + .a-page-notice.is-only-mentor(class="#{@report.interval >= 10 ? 'is-danger' : ''}") + .container + .a-page-notice__inner + p + strong + | #{@report.interval}日 + | ぶりの日報です。 .page-body .container.is-xxl From 186708c3f43e276ad7996aae1fb19d992b268f89 Mon Sep 17 00:00:00 2001 From: machida Date: Tue, 11 Jun 2024 13:16:43 +0900 Subject: [PATCH 05/10] =?UTF-8?q?elsif=E3=81=AE=E6=9B=B8=E3=81=8D=E3=83=9F?= =?UTF-8?q?=E3=82=B9=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/views/reports/show.html.slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/reports/show.html.slim b/app/views/reports/show.html.slim index 3b25f7e18da..612b745efec 100644 --- a/app/views/reports/show.html.slim +++ b/app/views/reports/show.html.slim @@ -11,7 +11,7 @@ .a-page-notice__inner p | このユーザーは退会しています。 - - else !@report.first? && @report.latest_of_user? + - elsif !@report.first? && @report.latest_of_user? .a-page-notice.is-only-mentor(class="#{@report.interval >= 10 ? 'is-danger' : ''}") .container .a-page-notice__inner From 40212271e7ad279e4fe34ebc6cf7cdef44c333c6 Mon Sep 17 00:00:00 2001 From: machida Date: Tue, 11 Jun 2024 13:47:57 +0900 Subject: [PATCH 06/10] =?UTF-8?q?=E9=80=80=E4=BC=9A=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=BE=E3=81=99=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=81=AB=E4=BB=98=E3=81=84=E3=81=A6=E3=82=8B=E4=B8=8D?= =?UTF-8?q?=E8=A6=81=E3=81=AA=E3=82=AF=E3=83=A9=E3=82=B9=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/views/reports/show.html.slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/reports/show.html.slim b/app/views/reports/show.html.slim index 612b745efec..d008aec4658 100644 --- a/app/views/reports/show.html.slim +++ b/app/views/reports/show.html.slim @@ -6,7 +6,7 @@ - if admin_or_mentor_login? - if @report.user.retired_on? - .a-page-notice.is-muted.is-only-mentor(class="#{@report.interval >= 10 ? 'is-danger' : ''}") + .a-page-notice.is-muted.is-only-mentor .container .a-page-notice__inner p From 08a3d47ec88fded955858f29e85b437d23d9ea46 Mon Sep 17 00:00:00 2001 From: motohiro-mm Date: Tue, 11 Jun 2024 15:19:29 +0900 Subject: [PATCH 07/10] =?UTF-8?q?=E3=83=87=E3=82=B6=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=AB=E4=BC=B4=E3=81=86=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=81=AE=E4=BF=AE=E6=AD=A3=E3=80=81=E5=8B=95=E4=BD=9C?= =?UTF-8?q?=E7=A2=BA=E8=AA=8D=E3=81=AB=E5=BF=85=E8=A6=81=E3=81=AA=E6=97=A5?= =?UTF-8?q?=E5=A0=B1=E3=81=AE=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/fixtures/reports.yml | 11 ++++++++++- test/system/reports_test.rb | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/db/fixtures/reports.yml b/db/fixtures/reports.yml index a84c43ac4ff..c8d4085bb22 100644 --- a/db/fixtures/reports.yml +++ b/db/fixtures/reports.yml @@ -325,7 +325,16 @@ report<%= i + 71 %>: report87: user: yameo - title: "退会済みユーザーの日報" + title: "退会済みユーザーの日報1" + emotion: 1 + description: |- + なかなか頑張れていない + reported_on: <%= Time.now - 1.month - 11.day %> + + +report88: + user: yameo + title: "退会済みユーザーの日報2" emotion: 1 description: |- お世話になりました diff --git a/test/system/reports_test.rb b/test/system/reports_test.rb index 9656457ec87..3c522d52996 100644 --- a/test/system/reports_test.rb +++ b/test/system/reports_test.rb @@ -757,6 +757,6 @@ def wait_for_watch_change test 'display message to admin or mentor in report of retired user' do visit_with_auth report_path(reports(:report75)), 'komagata' - assert_selector 'p', text: 'このユーザーは退会しています。' + assert_selector '.a-page-notice.is-muted.is-only-mentor', text: 'このユーザーは退会しています。' end end From 02458ac09256cceb80cf3f1411b0e4b715223fe1 Mon Sep 17 00:00:00 2001 From: motohiro-mm Date: Fri, 14 Jun 2024 14:50:48 +0900 Subject: [PATCH 08/10] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E7=A9=BA?= =?UTF-8?q?=E8=A1=8C=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/fixtures/reports.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/db/fixtures/reports.yml b/db/fixtures/reports.yml index c8d4085bb22..f6e6a77c30f 100644 --- a/db/fixtures/reports.yml +++ b/db/fixtures/reports.yml @@ -331,7 +331,6 @@ report87: なかなか頑張れていない reported_on: <%= Time.now - 1.month - 11.day %> - report88: user: yameo title: "退会済みユーザーの日報2" From 668ce7d34f2d6c8b6ea93c1e6827b007ed176f88 Mon Sep 17 00:00:00 2001 From: motohiro-mm Date: Sun, 23 Jun 2024 21:14:27 +0900 Subject: [PATCH 09/10] =?UTF-8?q?view=E3=81=AE=E4=B8=8D=E8=A6=81=E3=81=AA?= =?UTF-8?q?=E3=83=91=E3=82=A4=E3=83=97=E3=81=A8=E6=94=B9=E8=A1=8C=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 --- app/views/reports/show.html.slim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/reports/show.html.slim b/app/views/reports/show.html.slim index d008aec4658..726976a45cc 100644 --- a/app/views/reports/show.html.slim +++ b/app/views/reports/show.html.slim @@ -9,15 +9,13 @@ .a-page-notice.is-muted.is-only-mentor .container .a-page-notice__inner - p - | このユーザーは退会しています。 + p このユーザーは退会しています。 - elsif !@report.first? && @report.latest_of_user? .a-page-notice.is-only-mentor(class="#{@report.interval >= 10 ? 'is-danger' : ''}") .container .a-page-notice__inner p - strong - | #{@report.interval}日 + strong #{@report.interval}日 | ぶりの日報です。 .page-body From dbfdc160be7b157ee5051df64041f98608a6ee75 Mon Sep 17 00:00:00 2001 From: motohiro-mm Date: Sun, 23 Jun 2024 22:44:24 +0900 Subject: [PATCH 10/10] =?UTF-8?q?fixture=E3=81=AB=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=81=97=E3=81=9F=E6=97=A5=E5=A0=B1=E3=82=92=E5=89=8A=E9=99=A4?= =?UTF-8?q?=E3=81=97=E3=80=81=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/fixtures/reports.yml | 8 -------- test/integration/api/reports/unchecked_test.rb | 2 +- test/system/reports_test.rb | 12 +++++++++++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/test/fixtures/reports.yml b/test/fixtures/reports.yml index a461fbaedf3..9425488d21d 100644 --- a/test/fixtures/reports.yml +++ b/test/fixtures/reports.yml @@ -350,11 +350,3 @@ report74: description: 休会します wip: true reported_on: "2019-12-31" - -report75: - user: yameo - title: "退会済みユーザーの日報" - emotion: 1 - description: |- - お世話になりました - reported_on: <%= Time.now - 1.month - 1.day %> diff --git a/test/integration/api/reports/unchecked_test.rb b/test/integration/api/reports/unchecked_test.rb index 68ee666127a..c2f5ab0ec18 100644 --- a/test/integration/api/reports/unchecked_test.rb +++ b/test/integration/api/reports/unchecked_test.rb @@ -13,6 +13,6 @@ class API::Reports::UncheckedTest < ActionDispatch::IntegrationTest get counts_api_reports_unchecked_index_path(format: :text), headers: { 'Authorization' => "Bearer #{token}" } assert_response :ok - assert_match '66件', response.body + assert_match '65件', response.body end end diff --git a/test/system/reports_test.rb b/test/system/reports_test.rb index 3c522d52996..47ca14a76e1 100644 --- a/test/system/reports_test.rb +++ b/test/system/reports_test.rb @@ -756,7 +756,17 @@ def wait_for_watch_change end test 'display message to admin or mentor in report of retired user' do - visit_with_auth report_path(reports(:report75)), 'komagata' + report = Report.create!( + user: users(:yameo), + title: '退会済みユーザーの日報', + reported_on: '2022-01-03', + emotion: 'happy', + no_learn: true, + wip: false, + description: 'お世話になりました' + ) + + visit_with_auth report_path(report), 'komagata' assert_selector '.a-page-notice.is-muted.is-only-mentor', text: 'このユーザーは退会しています。' end end