Skip to content
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

登壇者向けお知らせ機能の実装 #1018

Merged
merged 14 commits into from
Jan 9, 2022
Merged

Conversation

oshiro3
Copy link
Contributor

@oshiro3 oshiro3 commented Nov 14, 2021

登壇者向けに通知を送れる機能がほしい #967 を実装してみました。

追加機能としては

  • 管理画面からの SpeakerAnnouncement 一覧
  • 管理画面登壇者一覧からのお知らせ作成(お知らせ自体については運営からのお知らせに準拠)
  • 登壇者の場合はダッシュボードに #{}様へのお知らせ 項目を追加
  • 全登壇者向け通知の作成機能

システム的には coverage が下がってしまったので、特に controller, request 周りでテストの助言いただけると嬉しいです。
image
image
image
image

@dreamkast-cloudnativedays
Copy link
Contributor

@oshiro3 oshiro3 changed the title Add speaker announcement 登壇者向けお知らせ機能の実装 Nov 14, 2021
@oshiro3 oshiro3 marked this pull request as ready for review November 14, 2021 06:54
@oshiro3 oshiro3 requested review from takaishi and jacopen and removed request for takaishi November 14, 2021 06:54
@oshiro3 oshiro3 linked an issue Nov 14, 2021 that may be closed by this pull request
@jacopen
Copy link
Collaborator

jacopen commented Nov 14, 2021

おー素敵!

Copy link
Contributor

@takaishi takaishi left a comment

Choose a reason for hiding this comment

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

登壇者へのお知らせは

  1. 全員に知らせる
  2. 特定の一人に知らせる
  3. 複数人に知らせる

というパターンがあると思うけど、このPRでは2のパターンのみの実装でしょうか?

db/migrate/20211114010021_create_speaker_announcements.rb Outdated Show resolved Hide resolved
db/migrate/20211114010021_create_speaker_announcements.rb Outdated Show resolved Hide resolved
@oshiro3
Copy link
Contributor Author

oshiro3 commented Nov 14, 2021

登壇者へのお知らせは

  1. 全員に知らせる
  2. 特定の一人に知らせる
  3. 複数人に知らせる

というパターンがあると思うけど、このPRでは2のパターンのみの実装でしょうか?

現状はパターン2のみの実装となっていますが、パターン3はロジックで対応できると思います。
が、パターン1についてはちょっと考慮していなかったですね。
今リレーションが speaker-annoounce で 1対多なんですが、パターン1を責任範囲に入れようとすると多対多にするなどの変更が必要になりそうですね。
パターン1のケースがありそうなら修正しますが、どうでしょうか?

@oshiro3 oshiro3 closed this Nov 14, 2021
@oshiro3 oshiro3 reopened this Nov 14, 2021
@dreamkast-cloudnativedays
Copy link
Contributor

@oshiro3
Copy link
Contributor Author

oshiro3 commented Nov 17, 2021

リレーションを多対多に変更し、複数人通知機能に対応し、同時に全登壇者向け通知の作成を追加しました。
今後必要であれば複数人通知を実装できるようにしたつもりです。

@jacopen
Copy link
Collaborator

jacopen commented Nov 20, 2021

ありゃ、SpeakerAgreementでエラーでちゃった
image

@jacopen
Copy link
Collaborator

jacopen commented Nov 20, 2021

E, [2021-11-20T06:17:44.353170 #12] ERROR -- : [6e1a8464-c457-437b-95ce-f5aa9dc329e7] Rendering 500 with exception: undefined local variable or method `speaker_names' for #<SpeakerAnnouncement:0x00007fcffc354200>
143
Did you mean?  speaker_name
142
               speaker_name?
141
               speaker_name=
140
               speaker_name_was
139
               speaker_ids
138
E, [2021-11-20T06:17:44.353337 #12] ERROR -- : [6e1a8464-c457-437b-95ce-f5aa9dc329e7] /usr/local/bundle/gems/activemodel-6.0.3.1/lib/active_model/attribute_methods.rb:432:in `method_missing'
137
/app/app/models/speaker_announcement.rb:18:in `format_speaker_names'
136
/app/app/views/admin/speaker_announcements/index.html.erb:22:in `block (2 levels) in _app_views_admin_speaker_announcements_index_html_erb__1528580361414383112_713740'
135
/usr/local/bundle/gems/activerecord-6.0.3.1/lib/active_record/relation/delegation.rb:87:in `each'
134
/usr/local/bundle/gems/activerecord-6.0.3.1/lib/active_record/relation/delegation.rb:87:in `each'
133
/app/app/views/admin/speaker_announcements/index.html.erb:17:in `block in _app_views_admin_speaker_announcements_index_html_erb__1528580361414383112_713740'
132
/usr/local/bundle/gems/actionview-6.0.3.1/lib/action_view/helpers/capture_helper.rb:45:in `block in capture'
131
/usr/local/bundle/gems/actionview-6.0.3.1/lib/action_view/helpers/capture_helper.rb:209:in `with_output_buffer'
130
/usr/local/bundle/gems/actionview-6.0.3.1/lib/action_view/helpers/capture_helper.rb:45:in `capture'
129
/usr/local/bundle/gems/actionview-6.0.3.1/lib/action_view/helpers/rendering_helper.rb:94:in `_layout_for'

これは以前にレビューしたデータが修正後に影響しているとかなのかなぁ

@oshiro3
Copy link
Contributor Author

oshiro3 commented Nov 21, 2021

一旦GCのためクローズ

@oshiro3 oshiro3 closed this Nov 21, 2021
@oshiro3
Copy link
Contributor Author

oshiro3 commented Nov 21, 2021

GCされたためopen

@oshiro3 oshiro3 reopened this Nov 21, 2021
@dreamkast-cloudnativedays
Copy link
Contributor

@oshiro3
Copy link
Contributor Author

oshiro3 commented Nov 21, 2021

@jacopen
そうですね、migration が更新されていなかったとかの不具合っぽいように感じました。
一旦GCして作り直したところ上記エラーは出ていないようなので、改めて確認お願いします。

app/views/tracks/waiting.html.erb Show resolved Hide resolved
app/controllers/tracks_controller.rb Outdated Show resolved Hide resolved
app/models/speaker_announcement.rb Outdated Show resolved Hide resolved
app/views/admin/speaker_announcements/_form.html.erb Outdated Show resolved Hide resolved
db/migrate/20211114010021_create_speaker_announcements.rb Outdated Show resolved Hide resolved
@oshiro3
Copy link
Contributor Author

oshiro3 commented Dec 1, 2021

検討中の仕様については含めると中身が大きくなりそうなので、一旦スコープ外として別途チケット切って対応しようかと思います。

@oshiro3 oshiro3 requested a review from takaishi December 1, 2021 12:10
@takaishi
Copy link
Contributor

@oshiro3 main branchをmergeしてもらってもいいですか?.ruby-versionが古くて2.7.2のままだったので。

Copy link
Contributor

@takaishi takaishi left a comment

Choose a reason for hiding this comment

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

speaker_namesに関するコメントと、とテストまわりなど細かいコメントをしました。
後、admin/speaker_announcement に対するrequest specがあるとよさそうです!

spec/models/speaker_annoucement_spec.rb Outdated Show resolved Hide resolved
@oshiro3
Copy link
Contributor Author

oshiro3 commented Dec 24, 2021

admin/speaker_announcements の request spec を追加しました。

spec/requests/admin/speaker_announcements_spec.rb Outdated Show resolved Hide resolved
spec/requests/tracks_spec.rb Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Jan 8, 2022

Simplecov Report

Covered Threshold
31.68% 25%

@jacopen jacopen merged commit 3bfa22e into main Jan 9, 2022
@jacopen jacopen deleted the add-speaker-announcement branch January 9, 2022 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

登壇者向けに通知を送れる機能がほしい
4 participants