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

未読通知が100件以上の場合、通知ベル上のカウントが「99+」になるようにした #7584

Draft
wants to merge 66 commits into
base: main
Choose a base branch
from

Conversation

masyuko0222
Copy link
Contributor

@masyuko0222 masyuko0222 commented Mar 22, 2024

Issue

概要

画面右上の通知ベルには、未読通知数が表示されています。
以下の画像は、未読通知が200件ある状態ですが表示は「99」となってしまっています。これを「99+」という表示にしたい。
image

View側ではちゃんと未読通知件数が99件より多いと、表示は「99+」になる実装になっています。

const count = notifications.length
return count > 99 ? '99+' : String(count)


原因は取得する未読通知のリミットが99となっていたためです。今回の修正箇所はここです。

scope :by_read_status, ->(status) { status == 'unread' ? unreads.with_avatar.limit(99) : with_avatar }


変更確認方法

  1. bug/counts_icon_of_unread_notificationsをローカルに取り込む。
  2. 以下のコード:1.upto(25)1.upto(200)に一時的に書き換える。
    <% 1.upto(25) do |i| %>
    notification_for_pagination<%= i %>: # 通知ページのページネーション動作確認のための通知
  3. rails db:seedでseedsデータを投入する。(サーバ起動中でも実行可能です)
  4. ユーザーhatsunoでログインをして、通知ベルの未読通知の表示を確認する。
  • 通知ベルの未読通知数が「99+」になっていること
  • 未読通知が1件以上99件以下の場合は、通知ベルの未読通知数がその件数「1~99」を表示していること。
  • 未読通知が0件の場合は、通知ベルの未読通知数が表示されていないこと。

Screenshot

未読通知の件数が100件以上の場合

変更前

image

変更後

image

関連Issue・PR

a-kuroki-gs and others added 30 commits February 29, 2024 19:44
…tions-graph

GithubのContributionが表示されないバグを修正
ダッシュボードの近日開催のイベントのリンクの文字色が休みの場合と開催の場合の色が逆になってたのを修正した
個人のポートフォリオページのデザイン崩れ修正
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
hirano-vm4 and others added 6 commits March 22, 2024 14:22
…invalid-account-name-when-retire

Discordアカウント名が不正だと退会時にエラーが発生する不具合を修正
…n-to-react

bookmark-buttonをVueからReactに置き換え
@masyuko0222 masyuko0222 self-assigned this Mar 25, 2024
a-kuroki-gs and others added 19 commits March 25, 2024 11:16
お問い合わせのタブが増えたので、その分を修正
一覧画面のViewにのみリンクを追加
要素を正しくネストさせるために、共通しているコードもひとまず分割する
共通部分のファイル名は_inquiry_commonにする
お問い合わせ一覧・個別ページを作成
@masyuko0222 masyuko0222 force-pushed the bug/counts_icon_of_unread_notifications branch from 22ecb33 to 9986ca9 Compare March 25, 2024 13:54
@masyuko0222 masyuko0222 force-pushed the bug/counts_icon_of_unread_notifications branch from 9986ca9 to 3087aad Compare March 25, 2024 14:04
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.

8 participants