Skip to content
This repository has been archived by the owner on Jun 21, 2018. It is now read-only.

Commit

Permalink
Notifications page fix (#54) (#55)
Browse files Browse the repository at this point in the history
* Removed validation from telegram contact

* Notifications page duplicates in list fix

* Type added to Uniqlist
  • Loading branch information
melnikk committed Dec 27, 2016
1 parent 6c183dc commit 592065d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 11 additions & 2 deletions static/app/controllers/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,27 @@ export interface INotification {
}

export class Notification {
idstr: string;
throttled: boolean;
timestamp: Timestamp;
send_fail: number;
trigger: string
contact: INotificationContact;

constructor(public json: string){
var notification = <INotification>JSON.parse(json);
this.idstr = notification.timestamp + notification.contact.id + notification.event.trigger_id + notification.event.sub_id
this.trigger = notification.trigger.name;
this.timestamp = new Timestamp(notification.timestamp);
this.send_fail = notification.send_fail;
this.throttled = notification.throttled;
this.contact = notification.contact;
}

id():string{
return this.idstr;
}

}

export interface INotificationsScope extends ng.IScope {
Expand All @@ -50,7 +59,7 @@ export class NotificationsController {
});
});
}

remove(notification: Notification){
this.api.notification.remove(notification.json).then((data) => {
if(data.result > 0){
Expand Down
4 changes: 3 additions & 1 deletion static/notifications.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<tbody>
<tr>
<th>Timestamp</th>
<th>Trigger</th>
<th colspan="2">Contact</th>
<th>Throttled</th>
<th>Fails</th>
Expand All @@ -12,6 +13,7 @@
<td>
<moira-timestamp timestamp="notification.timestamp"></moira-timestamp>
</td>
<td ng-bind="notification.trigger"></td>
<td ng-bind="notification.contact.type"></td>
<td ng-bind="notification.contact.value"></td>
<td ng-bind="notification.throttled"></td>
Expand All @@ -20,4 +22,4 @@
</tr>
</tbody>
</table>
</div>
</div>

0 comments on commit 592065d

Please sign in to comment.