feat: Added notifications outbox to admin panel
This commit is contained in:
@@ -1,20 +1,31 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { AdminCommService } from '../admin-comm.service';
|
||||
import { Notification } from 'src/app/types/notification';
|
||||
import { Group } from 'src/app/types/group';
|
||||
import { LocalStorageService } from 'src/app/services/local-storage.service';
|
||||
import { ToolbarService } from '../toolbar/toolbar.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-notifications',
|
||||
templateUrl: './notifications.component.html',
|
||||
styleUrls: ['./notifications.component.scss']
|
||||
})
|
||||
export class NotificationsComponent implements OnInit {
|
||||
export class NotificationsComponent implements OnInit, OnDestroy {
|
||||
|
||||
groups!: Group[]
|
||||
|
||||
constructor (private readonly acs: AdminCommService, readonly ls: LocalStorageService) { }
|
||||
constructor (private readonly acs: AdminCommService, readonly ls: LocalStorageService, private toolbar: ToolbarService, private router: Router, private route: ActivatedRoute ) {
|
||||
this.toolbar.comp = this
|
||||
this.toolbar.menu = [
|
||||
{ title: "Wysłane", fn: "outbox", icon: "outbox" }
|
||||
]
|
||||
}
|
||||
|
||||
outbox() {
|
||||
this.router.navigate(["outbox"], { relativeTo: this.route })
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.acs.notif.getGroups().subscribe((v) => {
|
||||
@@ -22,6 +33,15 @@ export class NotificationsComponent implements OnInit {
|
||||
})
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.toolbar.comp = undefined
|
||||
this.toolbar.menu = undefined
|
||||
}
|
||||
|
||||
public inbox() {
|
||||
|
||||
}
|
||||
|
||||
success?: { sent: number; possible: number; };
|
||||
|
||||
form = new FormGroup<NotificationForm>({
|
||||
|
||||
Reference in New Issue
Block a user