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

ブログ(articles)が公開されたら、管理者、メンター、現役一般受講生、現役研修生に通知する #7615

Merged
merged 9 commits into from Apr 24, 2024

Conversation

hirano-vm4
Copy link
Contributor

@hirano-vm4 hirano-vm4 commented Mar 29, 2024

Issue

概要

ブログ(articles)が公開された際、管理者、メンター、現役一般受講生、現役研修生にメール・サイト内通知が飛ぶ機能を実装するRPです。

変更確認方法

  1. feature/article-publication-notificationsをローカルに取り込む
  2. bin/setupを実行
  3. foreman start -f Procfile.devでサーバーを立ち上げる
  4. komagataアカウントでログインし http://localhost:3000/articles/new にアクセス
  5. 「タイトル」「本文」にテスト等入力し、ページ下部にある「公開する」を押して保存が完了するまで待つ
  6. komagataアカウントのまま、投稿者には通知がされないことをサイト内通知で確認(ページ右上の通知ボタンを押して未読部分を確認してください)
  7. machida(管理者) mentormentaro(メンター) kensyu(研修生) kimura(受講生) でそれぞれログインしてサイト内通知がきていること・通知からブログ詳細に飛べることを確認
  8. メール通知を確認
  1. komagataアカウントでログインし、 http://localhost:3000/articles のブログ一覧に行って今回投稿したブログの詳細に入り、ページ下部にある「削除」を押して消す
  2. machida(管理者) mentormentaro(メンター) kensyu(研修生) kimura(受講生) いずれかでログインして通知を開き、サイト内通知が削除されていることを確認

レビュー参考資料

通知のトリガーからの流れを把握しやすくなるように図を作成したので参考資料として添付します。

スクリーンショット 2024-03-29 20 04 14

Screenshot

変更前

新機能のためなし

変更後

ブログ(article)の投稿
ページ下部の「公開する」を押して保存
スクリーンショット 2024-04-02 17 39 48

通知を確認

スクリーンショット 2024-04-02 17 42 58

rails/mailers/activity_mailer/create_article のプレビュー

スクリーンショット 2024-04-02 17 44 25

/letter_opene
スクリーンショット 2024-04-02 17 45 06

@hirano-vm4 hirano-vm4 self-assigned this Mar 29, 2024
@hirano-vm4 hirano-vm4 force-pushed the feature/article-publication-notifications branch from d23619d to 9eb1e36 Compare April 2, 2024 07:52
@hirano-vm4 hirano-vm4 marked this pull request as ready for review April 3, 2024 06:01
@hirano-vm4
Copy link
Contributor Author

メモ📝 ブログ削除後に、メール通知のリンクをユーザーが踏んだ場合の処理

ブログが削除された場合、ユーザーが削除後にメール通知のブログリンクを踏んだ際、ブログ一覧へリダイレクトされ、アラートでユーザーにブログがないことを知らせる処理をしていた。

しかし、こちらのIssueで「通知からリンクへ飛ぶ際に作品が削除されていた場合は404エラーを返す」という仕様にする確認がなされているため、以下のコミットで変更。

75b7805

@hirano-vm4 hirano-vm4 force-pushed the feature/article-publication-notifications branch from ea10f83 to 28ecdd0 Compare April 3, 2024 08:00
@hirano-vm4 hirano-vm4 force-pushed the feature/article-publication-notifications branch from 28ecdd0 to ff33b8f Compare April 3, 2024 10:39
@hirano-vm4
Copy link
Contributor Author

@a-terumoto-gs

お疲れ様です🙏
お忙しい中、申し訳ありませんがレビューをお願いすることは可能でしょうか🙆?

急ぎではありませんので、無理ないタイミングで全く問題ありません!(1~2週間後とかでもOKです)

ご検討のほど、よろしくお願いいたします🙇‍♂️

@hirano-vm4
Copy link
Contributor Author

@a-terumoto-gs

お忙しい中すいません🙏こちらいかがでしょうか?

@a-terumoto-gs
Copy link
Contributor

a-terumoto-gs commented Apr 12, 2024

@hirano-vm4
お疲れ様です!
返信が遅れて大変申し訳ございません!
来週中をめどに対応させていただきます!
よろしくお願いいたしますm(__)m

Copy link
Contributor

@a-terumoto-gs a-terumoto-gs left a comment

Choose a reason for hiding this comment

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

お疲れ様です!確認できました(*'▽')
特に問題ないと思いましたので、わたしからはApproveとさせていただきます。
確認方法や参考資料をわかりやすくまとめてくださっていて、大変ありがたかったです!

@hirano-vm4
Copy link
Contributor Author

@a-terumoto-gs

お忙しん中、確認いただきありがとうございました🙏引き続きよろしくお願いします!

@komagata

こちらチームメンバーによるレビューが終わりました!お忙しいところ、恐れ入りますがレビューをお願いいたします🙏

Copy link
Member

@komagata komagata left a comment

Choose a reason for hiding this comment

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

確認させていただきました。OKです~👌

@@ -0,0 +1,8 @@
# frozen_string_literal: true

class ArticleNotificationDestroyer
Copy link
Member

Choose a reason for hiding this comment

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

この処理をクラスにしたのいいですね!(名前も)

@@ -170,4 +170,12 @@ def no_correct_answer

ActivityMailer.with(question:, receiver:).no_correct_answer
end

def create_article
Copy link
Member

Choose a reason for hiding this comment

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

mailのpreviewもしっかり追加しているのナイスです~

@komagata komagata merged commit 090993e into main Apr 24, 2024
5 checks passed
@komagata komagata deleted the feature/article-publication-notifications branch April 24, 2024 02:30
@komagata komagata mentioned this pull request Apr 24, 2024
11 tasks
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.

None yet

3 participants