[#43682] Include date alerts in notification center

https://community.openproject.org/work_packages/43682
pull/11521/head
Dmitrii 2 years ago
parent 3a269a5ac2
commit f809061c09
  1. 8
      app/models/queries/notifications/filters/reason_filter.rb
  2. 3
      config/locales/js-en.yml
  3. 4
      frontend/src/app/features/in-app-notifications/center/in-app-notification-center.component.ts
  4. 6
      frontend/src/app/features/in-app-notifications/center/menu/menu.component.ts
  5. 14
      frontend/src/app/spot/icon-font/src/date-alert.svg
  6. 855
      frontend/src/app/spot/styles/sass/common/icon.sass
  7. 427
      frontend/src/assets/fonts/openproject_icon/openproject-icon-font.svg
  8. BIN
      frontend/src/assets/fonts/openproject_icon/openproject-icon-font.ttf
  9. BIN
      frontend/src/assets/fonts/openproject_icon/openproject-icon-font.woff
  10. BIN
      frontend/src/assets/fonts/openproject_icon/openproject-icon-font.woff2
  11. 856
      frontend/src/global_styles/fonts/_openproject_icon_definitions.sass
  12. 1
      frontend/src/global_styles/fonts/_openproject_icon_font.lsg

@ -27,8 +27,10 @@
#++
class Queries::Notifications::Filters::ReasonFilter < Queries::Notifications::Filters::NotificationFilter
REASONS = Notification.reasons.except(:date_alert_start_date, :date_alert_due_date).merge(date_alert: [10, 11])
def allowed_values
Notification.reasons.keys.map { |reason| [reason, reason] }
REASONS.keys.map { |reason| [reason, reason] }
end
def type
@ -36,7 +38,7 @@ class Queries::Notifications::Filters::ReasonFilter < Queries::Notifications::Fi
end
def where
id_values = values.map { |value| Notification.reasons[value] }
operator_strategy.sql_for_field(id_values, self.class.model.table_name, :reason)
id_values = values.map { |value| REASONS[value] }
operator_strategy.sql_for_field(id_values.flatten, self.class.model.table_name, :reason)
end
end

@ -618,10 +618,11 @@ en:
menu:
accountable: 'Accountable'
by_project: 'Unread by project'
by_reason: 'Involvement'
by_reason: 'Reason'
inbox: 'Inbox'
mentioned: 'Mentioned'
watched: 'Watcher'
date_alert: 'Date alert'
settings:
change_notification_settings: 'To view and change your notification settings, <a target="_blank" href="%{url}">click here</a>'
title: "Notification settings"

@ -79,6 +79,10 @@ export class InAppNotificationCenterComponent implements OnInit {
key: 'watched',
title: this.I18n.t('js.notifications.menu.watched'),
},
{
key: 'date_alert',
title: this.I18n.t('js.notifications.menu.date_alert'),
},
];
selectedFilter = this.reasonMenuItems.find((item) => item.key === this.uiRouterGlobals.params.name)?.title;

@ -92,6 +92,12 @@ export class IanMenuComponent implements OnInit {
icon: 'watching',
...getUiLinkForFilters({ filter: 'reason', name: 'watched' }),
},
{
key: 'date_alert',
title: this.I18n.t('js.notifications.menu.date_alert'),
icon: 'date-alert',
...getUiLinkForFilters({ filter: 'reason', name: 'date_alert' }),
},
];
notificationsByProject$ = this.ianMenuService.notificationsByProject$.pipe(

@ -0,0 +1,14 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.9272 5.03835C15.3117 3.65388 17.5632 3.65388 18.9617 5.03835C20.3461 6.42281 20.3461 8.6883 18.9617 10.0728C17.5632 11.4572 15.3257 11.4572 13.9272 10.0728C12.5428 8.67431 12.5428 6.42281 13.9272 5.03835ZM16.8688 5.03835H16.1276C15.9178 5.03835 15.8899 5.16421 15.8899 5.23413V5.30405L16.0437 8.08697C16.0717 8.28275 16.1556 8.3247 16.3094 8.3247H16.701C16.8548 8.3247 16.9387 8.28275 16.9527 8.07298L17.1065 5.38796L17.1205 5.30405V5.23413C17.1205 5.16421 17.0925 5.03835 16.8688 5.03835ZM15.806 9.52737C15.806 9.90495 16.1136 10.2126 16.5052 10.2126C16.8828 10.2126 17.2044 9.90495 17.2044 9.52737C17.2044 9.1358 16.8968 8.82814 16.5052 8.82814C16.1136 8.82814 15.806 9.1358 15.806 9.52737Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.8886 10.2222C12.3306 9.47941 12 8.5561 12 7.55556L8.74074 7.55556V5.77778H5.8963V7.55556H4V20H18.2222V11.6302C17.922 11.7614 17.6045 11.8603 17.2741 11.9227V19.1111H4.94815V10.2222H12.8886ZM6.84444 6.66667H7.79259V8.44444H6.84444V6.66667Z" fill="black"/>
<path d="M16.3259 11.9985C15.6446 11.9806 15.0014 11.8094 14.4296 11.5181V12.8889H16.3259V11.9985Z" fill="black"/>
<path d="M10.637 12.8889H8.74074V11.1111H10.637V12.8889Z" fill="black"/>
<path d="M13.4815 12.8889H11.5852V11.1111H13.4815V12.8889Z" fill="black"/>
<path d="M5.8963 15.5556V13.7778H7.79259V15.5556H5.8963Z" fill="black"/>
<path d="M10.637 15.5556H8.74074V13.7778H10.637V15.5556Z" fill="black"/>
<path d="M13.4815 15.5556H11.5852V13.7778H13.4815V15.5556Z" fill="black"/>
<path d="M14.4296 15.5556V13.7778H16.3259V15.5556H14.4296Z" fill="black"/>
<path d="M5.8963 18.2222V16.4444H7.79259V18.2222H5.8963Z" fill="black"/>
<path d="M10.637 18.2222H8.74074V16.4444H10.637V18.2222Z" fill="black"/>
<path d="M13.4815 18.2222H11.5852V16.4444H13.4815V18.2222Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 184 KiB

@ -71,6 +71,7 @@
<li><span class="icon icon-custom-development"></span>custom-development</li>
<li><span class="icon icon-custom-fields"></span>custom-fields</li>
<li><span class="icon icon-cut"></span>cut</li>
<li><span class="icon icon-date-alert"></span>date-alert</li>
<li><span class="icon icon-delete-folder"></span>delete-folder</li>
<li><span class="icon icon-delete"></span>delete</li>
<li><span class="icon icon-dependency"></span>dependency</li>

Loading…
Cancel
Save