Changeset 8e74e2f for Farmatiko/ClientApp/src/app/admin
- Timestamp:
- 11/16/20 03:55:10 (4 years ago)
- Branches:
- master
- Children:
- db484c9
- Parents:
- 8b13eb2
- Location:
- Farmatiko/ClientApp/src/app/admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/ClientApp/src/app/admin/admin.component.html
r8b13eb2 r8e74e2f 12 12 <div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse"> 13 13 <ul class="navbar-nav flex-grow"> 14 <li>Administration panel</li> 14 <li>Administration panel:</li> 15 <li> Logged as <p *ngIf="head">{{adminHead.Name}}</p> </li> 16 <li (click)="logout()" class="btn btn-link"><a>Logout</a></li> 15 17 </ul> 16 18 </div> … … 18 20 </nav> 19 21 </header> 20 <mat-tab-group mat-stretch-tabs >22 <mat-tab-group mat-stretch-tabs dynamicHeight> 21 23 <mat-tab label="Claiming requests"> 22 24 <div class="wrapper"> -
Farmatiko/ClientApp/src/app/admin/admin.component.ts
r8b13eb2 r8e74e2f 7 7 import { EditPharmacyHeadDialogComponent } from '../dialogs/edit-pharmacy-head-dialog/edit-pharmacy-head-dialog.component'; 8 8 import { PharmacyDialogComponent } from '../dialogs/pharmacy-dialog/pharmacy-dialog.component'; 9 import { PharmacyHeadDialogComponent } from '../nav-menu/dialogs/pharmacy-head-dialog/pharmacy-head-dialog.component'; 9 import { PharmacyHeadDialogComponent } from '../dialogs/pharmacy-head-dialog/pharmacy-head-dialog.component'; 10 import { AuthService } from '../shared/services/auth.service'; 10 11 11 12 … … 19 20 public requests: IPharmacyHeadRequest[] = []; 20 21 public head: IPharmacyHead = { 21 PharmacyMedicines: null,22 Pharmacy: null,23 22 Email: '', 24 23 Passwd: '', 25 24 Name: '' 26 25 }; 26 public adminHead: IPharmacyHead; 27 27 28 constructor(private dataService: DataService, private dialog: MatDialog, private snackBar: MatSnackBar, private router: Router) {28 constructor(private dataService: DataService, private authService: AuthService, private dialog: MatDialog, private snackBar: MatSnackBar, private router: Router) { 29 29 30 30 } 31 31 32 32 ngOnInit(): void { 33 this.authService.getUser() 34 .subscribe((data) => { 35 console.log(data); 36 this.adminHead = data; 37 }, 38 (err: any) => console.log(err), 39 () => console.log('User data retrieved')); 40 33 41 this.dataService.getPharmacyHeads() 34 42 .subscribe((pHeads: IPharmacyHead[]) => { … … 39 47 40 48 this.dataService.getClaimingRequests() 41 .subscribe((pRequests: IPharmacyHeadRequest[]) => {42 this.requests = pRequests;43 },44 (err: any) => console.log(err),45 () => console.log("PharmacyHead data retrieved"));49 .subscribe((pRequests: IPharmacyHeadRequest[]) => { 50 this.requests = pRequests; 51 }, 52 (err: any) => console.log(err), 53 () => console.log("PharmacyHead data retrieved")); 46 54 } 47 55 … … 57 65 () => console.log("PharmacyHead inserted")); 58 66 this.head = { 59 PharmacyMedicines: null,60 Pharmacy: null,61 67 Email: '', 62 68 Passwd: '', … … 83 89 dialogRef.afterClosed().subscribe((editedHead: IPharmacyHead) => { 84 90 if(editedHead){ 91 console.log(editedHead); 85 92 this.heads = this.heads.filter(x => x !== eHead); 86 93 this.heads.push(editedHead); … … 142 149 } 143 150 151 logout() { 152 this.authService.logout(); 153 } 154 144 155 openSnackBar(message: string, action: string) : MatSnackBarRef<SimpleSnackBar> { 145 156 return this.snackBar.open(message, action, {
Note:
See TracChangeset
for help on using the changeset viewer.