-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
特別イベント一覧、定期イベント一覧に、直近(近日開催)のイベント一覧を表示する。 #7272
特別イベント一覧、定期イベント一覧に、直近(近日開催)のイベント一覧を表示する。 #7272
Conversation
976c6a0
to
1c58590
Compare
6d34959
to
cc6410e
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
bdb3241
to
454c050
Compare
@machida 以下は、Event・RegularEvent共にdestroy_allをした後の画面になります。 横1366 縦728横758 縦700イベントがない場合は、後者のように「◯◯開催のイベントはありません」とウィンドウサイズに限らず、表示したいと思っていました。 お手数ですがご確認よろしくお願いいたします。 |
@masyuko0222 |
6d277cf
to
9b25ab6
Compare
@machida
|
@masyuko0222 デザイン崩れを修正しましたー |
@machida @junohm410 |
@masyuko0222 |
8792fbc
to
47c4178
Compare
@junohm410
また、コミットメッセージについてもありがとうございます。 |
クラスの定数で定義してしまうと、取得タイミングで常に固定されてしまうため、メソッド内に移動
Viewで使うとき使いやすいし、コンストラクタの引数にあっても違和感はないため
RegularEvent自身は今後のイベント日を知っていても違和感はないので、わざわざ別クラスに責任を持たせる必要が無いと思ったため。
Dateクラスを利用すると検索時にUTCに変換してくれずバグになるため。
selectだと、SQLのselectが期待されてしまうため、勘違いさせないように。
UpcomingEventsGroupクラスを作成していたが、近日開催イベントであるUpcomingEvent自体がその作成を担っても違和感はないため。
Structだと内部でしか使わないことを想定されるが、ContorllerでViewに渡すためにStructを使ってしまってる感じだったので変更した。 クラスもあまり増やしたくなかったので、シンプルにハッシュに変えた。 あと利用していないkeyが潜んでいたのでそれも消した。
・クラスとして定義することで、どのような構造かすぐにわかるようにした。 ・また、副作用がないので、利用者からはUpcomingEventのメンバに見えるようにした。 - 参考:https://docs.komagata.org/5630
・UpcomingEventの責務として、外部に公開しておくべきメソッドのため。 ・.upcoming_events_groupsの内部で利用されているため、テストはそちらで担保する。 - テストコード見やすくするために、コード順も少し変えた。
a20e780
to
bdc7b96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
長いやりとり大変お疲れさまでした。
とってもコードが良くなったと思います!
Issue
参考にしたIssue(PR)
概要
特別イベント一覧(
/events
)、定期イベント一覧(/regular_events
・/regular_events?target=not_finished
)にも、「近日開催のイベント」一覧を表示させました。ダッシュボード(
/
)に表示されている「近日開催のイベント」一覧を参考にしていますが、デザインは異なるものを実装します。ダッシュボード(
/
)の例変更確認方法
feature/list_upcoming_events_on_special_and_regular_events_pages
をローカルに取り込むbin/rails db:reset
でDBをクリーンアップするforeman start -f Procfile.dev
で起動するkimura
でログインをする/events
)/regular_events
)/regular_events?target=not_finished
)※上記以外のイベントが表示されていても問題ありません。
Screenshot
※新しい機能のため、変更後のScreenshotsのみを貼ります。
※
/events
・/regular_events
・/regular_events?target=not_finished
の画面変更点は同じです。※下のスクリーンショットは
/events
ページのものとなります。