Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
38be979
休会情報をメンターと管理者が常に確認できるように修正
s-tone-gs Feb 17, 2026
008e8a2
復帰ユーザーの休会情報表示のテストコードを作成
s-tone-gs Feb 26, 2026
e11b8a9
休会した回数を管理者・メンター・本人が確認できるようにした
s-tone-gs Feb 18, 2026
6f1cc69
休会回数の表示のテストコードを作成
s-tone-gs Feb 26, 2026
754abdf
休会情報の表示項目を変更
s-tone-gs Feb 18, 2026
8825562
hukkiを既存のテストに影響しない属性に変更
s-tone-gs Feb 19, 2026
328b9ba
テストメソッドの数を削減
s-tone-gs Feb 26, 2026
d45da97
開発環境での動作確認用データを作成
s-tone-gs Feb 26, 2026
ab5a58e
矛盾したデータを修正
s-tone-gs Feb 27, 2026
812ace7
休会情報にデザインを入れた
machida Mar 3, 2026
5262cca
管理者、メンター確認用 休会情報ブロックにデザインを入れた
machida Mar 3, 2026
533de49
ダッシュボードに休会履歴を表示
s-tone-gs Mar 4, 2026
4a00dd5
休会情報の表示をDRYに修正
s-tone-gs Mar 5, 2026
06441f5
ファイル名をhibernation_history.rbにリネーム
s-tone-gs Mar 6, 2026
e1ecaff
冗長な記述を削除
s-tone-gs Mar 9, 2026
4886674
デザインの修正に応じてプロフィールの休会履歴表示のテストを修正
s-tone-gs Mar 10, 2026
05438d9
デザインの修正に応じてダッシュボードに表示される休会情報のテストを修正
s-tone-gs Mar 10, 2026
d9a38d2
equal?を==に修正
s-tone-gs Mar 11, 2026
51ff2f3
yamlキーの重複を解消
s-tone-gs Mar 11, 2026
61f9880
unsubscribe_email_tokenの重複を解消
s-tone-gs Mar 11, 2026
e802ad3
使用していない翻訳キーを削除
s-tone-gs Mar 11, 2026
bf26fb4
retire_deadlineメソッドが休会期限の日時も返すように修正
s-tone-gs Mar 11, 2026
5a8ac59
discordプロフィールのシードデータに不正な値があったため修正
s-tone-gs Mar 12, 2026
982dfcd
非存在確認のテストがfixtureのデータ数に依存しないように修正
s-tone-gs Mar 12, 2026
8274e6d
モデルメソッドを削除
s-tone-gs Mar 12, 2026
d2cb799
不要な変数を削除
s-tone-gs Apr 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
background-color: var(--base);
}

.user-metas + .user-metas {
margin-top: 1rem;
}

.user-metas__title {
border: solid 1px var(--border);
margin-bottom: -1px;
Expand Down
3 changes: 1 addition & 2 deletions app/assets/stylesheets/shared/blocks/card/_card-footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@media (min-width: 48em) {
.card-footer {
padding: .5rem 1rem;
min-height: 3rem;
}
}
@media (max-width: 47.9375em) {
Expand Down Expand Up @@ -47,8 +46,8 @@
display: flex;
justify-content: flex-end;
align-items: flex-end;

}

.card-footer__footer-text-link {
font-size: .8125rem;
line-height: 1.4;
Expand Down
2 changes: 2 additions & 0 deletions app/views/home/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
= render '/users/practices/active_practices', user: current_user
- if current_user.completed_practices.present?
= render '/users/practices/completed_practices', user: current_user, completed_learnings: @completed_learnings
- if current_user.hibernations.present?
= render '/users/hibernation_history', user: current_user
.col-xs-12.col-xl-6.col-xxl-6
- if current_user.student_or_trainee?
= render 'required_field', user: current_user
Expand Down
75 changes: 75 additions & 0 deletions app/views/users/_hibernation_history.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
.a-card class=('is-only-mentor' unless user == current_user)
header.card-header.is-sm
h2.card-header__title
| 休会履歴
| (#{user.hibernations.count}回)
hr.a-border-tint
.user-data
.user-data__row
- user.hibernations.order(created_at: :desc).each_with_index do |hibernation, i|
- number = user.hibernations.count - i
- if i.zero? && user.hibernated?
.user-metas.is-only-mentor
h2.user-metas__title
| 現在
| #{number}回目の
| 休会中
.user-metas__items
.user-metas__item
.user-metas__item-label 休会開始日時
.user-metas__item-value
= l user.hibernated_at
.user-metas__item
.user-metas__item-label 復帰予定日時
.user-metas__item-value
- if hibernation.scheduled_return_on.present?
= l hibernation.scheduled_return_on
- else
| 未登録

.user-metas__item
.user-metas__item-label 休会期限日時
.user-metas__item-value
- if !user.auto_retire
span.user-metas__item-value-text
| 企業都合休会中(#{user.hibernation_days}日)
- else
span.user-metas__item-value-text(class=user.countdown_danger_tag)
= user.retire_deadline

.user-metas__item
.user-metas__item-label
= Hibernation.human_attribute_name :reason
.user-metas__item-value
.a-short-text
- if hibernation.reason.present?
= simple_format(hibernation.reason)
- else
| 未登録
- else
.user-metas class=('is-only-mentor' unless user == current_user)
h2.user-metas__title
| #{number}回目の休会
.user-metas__items
.user-metas__item
.user-metas__item-label
- if hibernation.returned_at?
| 休会期間
- else
| 休会予定期間

.user-metas__item-value
= l hibernation.created_at
|  〜 
- if hibernation.returned_at?
= l hibernation.returned_at
- else
= l hibernation.scheduled_return_on
| 予定

.user-metas__item
.user-metas__item-label
= Hibernation.human_attribute_name :reason
.user-metas__item-value
.a-short-text
= simple_format(hibernation.reason)
36 changes: 0 additions & 36 deletions app/views/users/_hibernation_info.html.slim

This file was deleted.

31 changes: 19 additions & 12 deletions app/views/users/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,28 @@
.user-data__row
.user-data__tags
= render(Tag::FormComponent.new(taggable: @user, param_name: 'user[tag_list]', input_id: 'user_tag_list', editable: (@user.id == current_user.id)))
- if admin_or_mentor_login? && @user.hibernated?
.user-data__row
= render 'users/hibernation_info', user: @user
- if admin_or_mentor_login? && @user.training_completed?
.user-data__row
= render 'users/training_completion_info', user: @user
- if admin_or_mentor_login? && @user.retired?
.user-data__row
= render 'users/retire_info', user: @user
- if admin_or_mentor_login? && @user.student_or_trainee_or_retired?
.user-data__row
= render 'users/user_secret_attributes', user: @user
.user-data__row
= render 'users/metas', user: @user, user_course_practice: UserCoursePractice.new(@user)

- if admin_or_mentor_login?
.a-card.is-only-mentor
header.card-header.is-sm
h2.card-header__title
| ユーザー非公開情報
hr.a-border-tint
.user-data
- if @user.training_completed?
.user-data__row
= render 'users/training_completion_info', user: @user
- if @user.retired?
.user-data__row
= render 'users/retire_info', user: @user
- if @user.student_or_trainee_or_retired?
.user-data__row
= render 'users/user_secret_attributes', user: @user

- if admin_or_mentor_login? && @user.hibernations.present?
= render 'users/hibernation_history', user: @user
.col-xs-12(class="#{visible_learning_time_frames?(@user) ? 'col-lg-4 col-xxl-4' : 'col-lg-6 col-xxl-6'}")
- if @user.student_or_trainee? && @user.total_learning_time.positive?
= render(StudyStreak::StudyStreakTrackerComponent.new(study_streak: @study_streak))
Expand Down
6 changes: 3 additions & 3 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,9 @@ ja:
buddy: ペア
enums:
emotion:
negative: Negative
neutral: Neutral
positive: Positive
negative: Negative
neutral: Neutral
positive: Positive
user:
Copy link
Copy Markdown
Contributor Author

@s-tone-gs s-tone-gs Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

今回のPRとは関係ないですが、インデントがおかしかったので修正しました。

job:
student: 学生
Expand Down
5 changes: 5 additions & 0 deletions db/fixtures/discord_profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,8 @@ discord_profile_new-mentor:
user: new-mentor
account_name: new-mentor
times_url:

discord_profile_hukki:
user: hukki
account_name: hukki
times_url:
Comment thread
coderabbitai[bot] marked this conversation as resolved.
15 changes: 14 additions & 1 deletion db/fixtures/hibernations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ hibernation2:
user: kyuukai
scheduled_return_on: 2035-01-01
reason: 学習時間が取れないため
returned_at: 202l-09-01 00:00:00
created_at: 2022-01-10 00:00:02

hibernation3:
Expand Down Expand Up @@ -53,3 +52,17 @@ hibernation9:
scheduled_return_on: <%= Time.current + 30.days %>
reason: オンラインでのコミュニケーションが向いていないと感じたため
created_at: <%= Time.current - 3.months %>

hibernation10:
user: hukki
scheduled_return_on: 2030-01-01
reason: 仕事が繁忙期で忙しいため
returned_at: 2022-02-01 00:00:00
created_at: 2022-01-10 00:00:01

hibernation11:
user: hukki
scheduled_return_on: 2035-01-01
reason: 学習時間が取れないため
returned_at: 2022-04-01 00:00:00
created_at: 2022-03-10 00:00:02
4 changes: 4 additions & 0 deletions db/fixtures/talks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,7 @@ talk_pjord:
talk_new-mentor:
user: new-mentor
action_completed: true

talk_hukki:
user: hukki
action_completed: true
21 changes: 21 additions & 0 deletions db/fixtures/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,27 @@ muryou:
sent_student_followup_message: true
last_activity_at: "2014-01-01 00:00:10"

hukki:
login_name: hukki
email: hukki@fjord.jp
crypted_password: $2a$10$n/xv4/1luueN6plzm2OyDezWlZFyGHjQEf4hwAW1r3k.lCm0frPK. # testtest
salt: zW3kQ9ubsxQQtzzzs4ap
name: Hukki Taro
name_kana: フッキ タロウ
twitter_account: hukki
facebook_url: https://www.facebook.com/fjordllc/hukki
blog_url: https://example.com/hukki
description: "フッキです。休会から復帰しました。"
customer_id: cus_LZ2wCJqYybuDlJ
subscription_id: "sub_12345678"
course: course1
job: office_worker
os: mac
github_account: hukki
unsubscribe_email_token: V8qOx_NwgTsiJS0oHGU2Fw
updated_at: "2026-01-01 00:00:13"
created_at: "2026-01-01 00:00:13"

kensyu:
login_name: kensyu
email: kensyu@fjord.jp
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/discord_profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ discord_profile_kyuukai:
account_name:
times_url:

discord_profile_hukki:
user: hukki
account_name:
times_url:

discord_profile_sotsugyoukigyoshozoku:
user: sotsugyoukigyoshozoku
account_name:
Expand Down
7 changes: 7 additions & 0 deletions test/fixtures/hibernations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ hibernation1:
reason: I am so busy.
scheduled_return_on: 2030-01-01
created_at: 2025-01-01 00:00:00

hibernation2:
user: hukki
reason: I am so tired.
scheduled_return_on: 2035-01-01
created_at: 2026-01-01 00:00:00
returned_at: 2026-03-01 00:00:00
4 changes: 4 additions & 0 deletions test/fixtures/talks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,7 @@ talk47:
talk48:
user: kensyu-invoice
action_completed: true

talk49:
user: hukki
action_completed: true
21 changes: 21 additions & 0 deletions test/fixtures/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,27 @@ kyuukai:
updated_at: "2014-01-01 00:00:13"
created_at: "2014-01-01 00:00:13"

hukki:
login_name: hukki
email: hukki@fjord.jp
crypted_password: $2a$10$n/xv4/1luueN6plzm2OyDezWlZFyGHjQEf4hwAW1r3k.lCm0frPK. # testtest
salt: zW3kQ9ubsxQQtzzzs4ap
name: Hukki Taro
name_kana: フッキ タロウ
twitter_account: hukki
facebook_url: https://www.facebook.com/fjordllc/hukki
blog_url: https://example.com/hukki
description: "フッキです。休会から復帰しました。"
customer_id: "cus_JhRfQ7G68L2k8R"
subscription_id: "sub_12345678"
course: course1
job: office_worker
os: mac
github_account: hukki
unsubscribe_email_token: k3a49_NwgTsiJS0oHGU2Fw
updated_at: "2026-01-01 00:00:13"
created_at: "2026-01-01 00:00:13"

neverlogin: # 1度もログインしたことがないユーザー
login_name: neverlogin
email: neverlogin@fjord.jp
Expand Down
20 changes: 20 additions & 0 deletions test/system/home/hibernation_history_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

require 'application_system_test_case'

module Home
class HibernationHistoryTest < ApplicationSystemTestCase
test 'show my hibernation history on dashboard' do
visit_with_auth '/', 'hukki'
assert_selector '.card-header__title', text: '休会履歴(1回)'
assert_selector '.user-metas__title', text: '1回目の休会'
end
Comment thread
coderabbitai[bot] marked this conversation as resolved.

test 'should not show hibernation history on dashboard when logged in user never hibernated' do
visit_with_auth '/', 'kimura'
assert_selector '.page-header__title', text: 'ダッシュボード'
assert_no_selector '.card-header__title', text: '休会履歴(1回)'
assert_no_selector '.user-metas__title', text: '1回目の休会'
end
end
end
2 changes: 1 addition & 1 deletion test/system/user/courses_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class User::CoursesTest < ApplicationSystemTestCase
test 'show users sorted by rails course' do
visit_with_auth '/users/courses', 'kimura'
assert_selector('a.tab-nav__item-link.is-active', text: 'Rails')
assert_text 'Railsエンジニアコース(31)'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

既存のテストも理解した上で修正してていいですね!

assert_text 'Railsエンジニアコース(32)'
assert_selector '.users-item', count: 24
assert_link 'kimuramitai'
assert_text 'Kimura Mitai'
Expand Down
Loading
Loading