diff --git a/docs/core/components/notification-history.component.md b/docs/core/components/notification-history.component.md index b1ee768e4b..e5f9dfdfeb 100644 --- a/docs/core/components/notification-history.component.md +++ b/docs/core/components/notification-history.component.md @@ -26,3 +26,8 @@ The main purpose of the [Notification history component](../../core/components/n | --- | --- | --- | --- | | menuPositionX | `string` | "after" | Custom choice for opening the menu at the bottom. Can be `before` or `after`. | | menuPositionY | `string` | "below" | Custom choice for opening the menu at the bottom. Can be `above` or `below`. | +| maxNotifications | `number` | 5 | Maximum number of notifications to display. The rest will remain hidden until load more is clicked. | + +## See also + +* [Notification Service](../../core/services/notification.service.md) diff --git a/docs/core/services/notification.service.md b/docs/core/services/notification.service.md index 09d38a60a5..6a0f1e166c 100644 --- a/docs/core/services/notification.service.md +++ b/docs/core/services/notification.service.md @@ -120,3 +120,12 @@ You can also change the default 5000 ms adding the following configuration in th ```json "notificationDefaultDuration" : "7000" ``` + +#### Notification types + +| Name | Description | +| --- | --- | +| info | To notify messages. It will be displayed with an info icon next to it. | +| warn | To notify warning messages. It will be displayed with a warning icon next to it. | +| error | To notify errors. It will be displayed with an error icon next to it. | +| recursive | To notify recursive messages. If a message is prompt to duplicate an existing notification and you don't want to overload the notification history component with the same message use the recursive type. I.e. notifications coming from an API call that are triggered every time a component is initialized. It will be displayed with an info icon next to it. | diff --git a/lib/core/i18n/en.json b/lib/core/i18n/en.json index f5b836f360..9ee3742ee2 100644 --- a/lib/core/i18n/en.json +++ b/lib/core/i18n/en.json @@ -6,10 +6,11 @@ "UNCLAIM": "RELEASE", "START PROCESS": "START PROCESS", "NOTIFICATIONS": { - "NO_MESSAGE": "No messages", + "NO_MESSAGE": "You have no notifications at this time.", "TITLE": "Notifications", "MARK_AS_READ": "Mark all as read", - "SYSTEM": "System" + "SYSTEM": "System", + "LOAD_MORE": "Load more" }, "FORM": { "START_FORM": { diff --git a/lib/core/material.module.ts b/lib/core/material.module.ts index 7344f427d9..81840d4daa 100644 --- a/lib/core/material.module.ts +++ b/lib/core/material.module.ts @@ -43,6 +43,7 @@ import { MatTableModule } from '@angular/material/table'; import { MatTabsModule } from '@angular/material/tabs'; import { MatToolbarModule } from '@angular/material/toolbar'; import { MatTooltipModule } from '@angular/material/tooltip'; +import { MatBadgeModule } from '@angular/material/badge'; @NgModule({ imports: [ @@ -51,7 +52,7 @@ import { MatTooltipModule } from '@angular/material/tooltip'; MatInputModule, MatListModule, MatNativeDateModule, MatOptionModule, MatProgressSpinnerModule, MatRadioModule, MatRippleModule, MatSelectModule, MatSlideToggleModule, MatTableModule, MatTabsModule, MatMenuModule, MatProgressBarModule, MatSidenavModule, MatSnackBarModule, MatToolbarModule, - MatTooltipModule, MatDatetimepickerModule, MatNativeDatetimeModule, MatExpansionModule + MatTooltipModule, MatDatetimepickerModule, MatNativeDatetimeModule, MatExpansionModule, MatBadgeModule ], exports: [ MatAutocompleteModule, MatButtonModule, MatCardModule, MatCheckboxModule, @@ -59,7 +60,7 @@ import { MatTooltipModule } from '@angular/material/tooltip'; MatInputModule, MatListModule, MatNativeDateModule, MatOptionModule, MatProgressSpinnerModule, MatRadioModule, MatRippleModule, MatSelectModule, MatSlideToggleModule, MatTableModule, MatTabsModule, MatMenuModule, MatProgressBarModule, MatSidenavModule, MatSnackBarModule, MatToolbarModule, - MatTooltipModule, MatDatetimepickerModule, MatNativeDatetimeModule, MatExpansionModule + MatTooltipModule, MatDatetimepickerModule, MatNativeDatetimeModule, MatExpansionModule, MatBadgeModule ] }) export class MaterialModule {} diff --git a/lib/core/notifications/components/notification-history.component.html b/lib/core/notifications/components/notification-history.component.html index b8388b66dd..679f583419 100644 --- a/lib/core/notifications/components/notification-history.component.html +++ b/lib/core/notifications/components/notification-history.component.html @@ -1,34 +1,73 @@