</tr>
<tr>
<td>
- <small class="date">{{ notification.timestamp | date: 'medium' }}</small>
+ <small class="date">{{ notification.timestamp | cdDate }}</small>
</td>
</tr>
</table>
@import '../../../../styles/popover.scss';
.icon-col {
- width: 70px !important;
+ width: 50px !important;
+ font-size: 10px;
}
import { PopoverModule } from 'ngx-bootstrap/popover';
import { NotificationService } from '../../../shared/services/notification.service';
+import { SharedModule } from '../../../shared/shared.module';
import { NotificationsComponent } from './notifications.component';
describe('NotificationsComponent', () => {
beforeEach(
async(() => {
TestBed.configureTestingModule({
- imports: [PopoverModule.forRoot()],
+ imports: [PopoverModule.forRoot(), SharedModule],
declarations: [NotificationsComponent],
providers: [{ provide: NotificationService, useValue: fakeService }]
}).compileComponents();
import { Component, OnInit } from '@angular/core';
+import * as _ from 'lodash';
+
import { NotificationType } from '../../../shared/enum/notification-type.enum';
import { CdNotification } from '../../../shared/models/cd-notification';
import { NotificationService } from '../../../shared/services/notification.service';
}
ngOnInit() {
- this.notificationService.data$.subscribe((notifications) => {
- this.notifications = notifications;
+ this.notificationService.data$.subscribe((notifications: CdNotification[]) => {
+ this.notifications = _.orderBy(notifications, ['timestamp'], ['desc']);
});
}
case NotificationType.error:
return 'fa-exclamation-triangle';
case NotificationType.info:
- return 'text-info';
+ return 'fa-info';
case NotificationType.success:
return 'fa-check';
}
::ng-deep .popover-content {
padding: 0px 0px;
height: auto;
- max-height: 700px;
+ max-height: 70vh;
overflow-x: hidden;
}