notification
This commit is contained in:
parent
7c386dc588
commit
42a78a213b
|
@ -17,7 +17,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div style="float: right; margin: 30px 15px 0 0;">
|
<div style="float: right; margin: 30px 15px 0 0;">
|
||||||
<i class="fa ui-icon-stop ui-status-icon ui-status-success"></i>Up
|
<i class="fa ui-icon-stop ui-status-icon ui-status-success"></i>Up
|
||||||
<i class="fa ui-icon-stop ui-status-icon ui-status-fatal"></i>Dwon
|
<i class="fa ui-icon-stop ui-status-icon ui-status-fatal"></i>Down
|
||||||
<i class="fa ui-icon-stop ui-status-icon ui-status-warn"></i>Warn
|
<i class="fa ui-icon-stop ui-status-icon ui-status-warn"></i>Warn
|
||||||
<i class="fa ui-icon-stop ui-status-icon ui-status-error"></i>Error
|
<i class="fa ui-icon-stop ui-status-icon ui-status-error"></i>Error
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<h1>Notifications</h1>
|
<h1>Notifications</h1>
|
||||||
|
<div>
|
||||||
|
<a href="javascript:void(0)" (click)="onMarkAllAsRead()">Mark all as read</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<p-table [value]="notifications" selectionMode="single" (onRowSelect)="onRowSelect($event)" [resizableColumns]="true">
|
<p-table [value]="notifications" selectionMode="single" (onRowSelect)="onRowSelect($event)" [resizableColumns]="true">
|
||||||
<ng-template pTemplate="body" let-notification let-rowIndex="rowIndex" >
|
<ng-template pTemplate="body" let-notification let-rowIndex="rowIndex" >
|
||||||
<tr [pSelectableRow]="notification" [ngStyle]="notification.confirmDate ? '' : {'background-color': 'lightblue'}">
|
<tr [pSelectableRow]="notification" [ngStyle]="notification.confirmDate ? '' : {'background-color': 'lightblue'}">
|
||||||
|
|
|
@ -22,6 +22,7 @@ export class NotificationComponent implements OnInit, AfterContentInit {
|
||||||
|
|
||||||
pageSize = '12';
|
pageSize = '12';
|
||||||
totalLength = 0;
|
totalLength = 0;
|
||||||
|
currPage = 0;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
@ -55,7 +56,7 @@ export class NotificationComponent implements OnInit, AfterContentInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterContentInit() {
|
ngAfterContentInit() {
|
||||||
this.getNotifications(0);
|
this.getNotifications(this.currPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateData(noti: Notification) {
|
updateData(noti: Notification) {
|
||||||
|
@ -79,6 +80,7 @@ export class NotificationComponent implements OnInit, AfterContentInit {
|
||||||
sortDirection: 'descending'
|
sortDirection: 'descending'
|
||||||
};
|
};
|
||||||
this.listStore.dispatch(new ListStore.ReadAllByMember({ member, pageParams }));
|
this.listStore.dispatch(new ListStore.ReadAllByMember({ member, pageParams }));
|
||||||
|
this.currPage = pageIndex;
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
@ -95,4 +97,21 @@ export class NotificationComponent implements OnInit, AfterContentInit {
|
||||||
onPaging(e) {
|
onPaging(e) {
|
||||||
this.getNotifications(e.page);
|
this.getNotifications(e.page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMarkAllAsRead() {
|
||||||
|
this.listStore.select(AuthSelector.select('member')).subscribe(
|
||||||
|
(member: Member) => {
|
||||||
|
const pageParams: PageParams = {
|
||||||
|
pageNo: this.currPage + '',
|
||||||
|
countPerPage: this.pageSize,
|
||||||
|
sortCol: 'id',
|
||||||
|
sortDirection: 'descending'
|
||||||
|
};
|
||||||
|
this.listStore.dispatch(new ListStore.MarkAllAsRead({ member, pageParams }));
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<div class="ui-g-12 ui-md-7 ui-g-nopad">
|
<div class="ui-g-12 ui-md-7 ui-g-nopad">
|
||||||
<div style="float: right; margin-top: 30px;">
|
<div style="float: right; margin-top: 30px;">
|
||||||
<i class="fa ui-icon-stop ui-status-icon ui-status-success"></i>Up
|
<i class="fa ui-icon-stop ui-status-icon ui-status-success"></i>Up
|
||||||
<i class="fa ui-icon-stop ui-status-icon ui-status-fatal"></i>Dwon
|
<i class="fa ui-icon-stop ui-status-icon ui-status-fatal"></i>Down
|
||||||
<i class="fa ui-icon-stop ui-status-icon ui-status-warn"></i>Warn
|
<i class="fa ui-icon-stop ui-status-icon ui-status-warn"></i>Warn
|
||||||
<i class="fa ui-icon-stop ui-status-icon ui-status-error"></i>Error
|
<i class="fa ui-icon-stop ui-status-icon ui-status-error"></i>Error
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user