Skip to content

Commit

Permalink
Merge pull request #7697 from fjordllc/feature/report-100-over-dashbo…
Browse files Browse the repository at this point in the history
…ard-warning

未チェックの日報が100件超えたらメンターのダッシュボードに警告を出すようにした
  • Loading branch information
komagata authored May 1, 2024
2 parents 37d3dc3 + 91153e3 commit 6271fd7
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/javascript/stylesheets/application.sass
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@import application/blocks/dashboard/dashboard-categories-item
@import application/blocks/dashboard/dashboard-contents
@import application/blocks/dashboard/welcome-message
@import application/blocks/dashboard/unchecked-report-alert

@import application/blocks/event/event-main-actions
@import application/blocks/event/event-meta
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.unchecked-report-alert__header
background-color: var(--danger)
padding: .125rem 1rem

.unchecked-report-alert__header-title
+text-block(.75rem 1.4, 700)
color: var(--reversal-text)

.unchecked-report-alert__inner
padding: .25rem 1rem
display: flex
align-items: center
gap: .5rem

.unchecked-report-alert__icon
font-size: 2rem

.unchecked-report-alert__message
+text-block(.8125rem 1.4, center)
flex: 1

.unchecked-report-alert__message-link
color: var(--danger-text)

.unchecked-report-alert__count
margin-inline:.125rem

.unchecked-report-alert__count-number
font-size: 1.25rem
margin-right: .0625rem
7 changes: 3 additions & 4 deletions app/views/home/_mentor_dashboard.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
.dashboard-contents__col.is-sub.is-only-mentor
.dashboard-contents__categories
.dashboard-category
- if current_user.active_practices.present?
header.dashboard-category__header
h2.dashboard-category__title
| 提出物状況
- unchecked_report_count = Cache.unchecked_report_count
- if unchecked_report_count > 100
= render 'unchecked_report_alert', unchecked_report_count: unchecked_report_count
.dashboard-category__body
#js-products(data-title="#{title}" data-selected-tab="unassigned" data-mentor-login="#{mentor_login?}" data-current-user-id="#{current_user.id}")
.dashboard-contents__col.is-main
Expand Down
16 changes: 16 additions & 0 deletions app/views/home/_unchecked_report_alert.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.dashboard-category__body
.a-card.is-danger.unchecked-report-alert
header.unchecked-report-alert__header
h2.unchecked-report-alert__header-title
| 日報が100件を超えました。
.unchecked-report-alert__inner
.unchecked-report-alert__icon
i.fa-regular.fa-triangle-exclamation
.unchecked-report-alert__message
= link_to '/reports/unchecked', class: 'unchecked-report-alert__message-link' do
| 未チェックの日報が
strong.unchecked-report-alert__count
span.unchecked-report-alert__count-number
| #{unchecked_report_count}
| 件
| あります。

0 comments on commit 6271fd7

Please sign in to comment.