Finish edit capabilities and add adding capabilities
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
<input type="text" aria-label="Your Name" (keyup.enter)="login()" [(ngModel)]="name">
|
||||
</div>
|
||||
<div *ngIf="isLoggedIn">
|
||||
<select [(ngModel)]="selectedCalendar" (change)="getEvents()">
|
||||
<select [(ngModel)]="selectedCalendar" (change)="handleCalendarChange()">
|
||||
<option value="" disabled selected hidden>Select calendar</option>
|
||||
<option>public</option>
|
||||
<option>members</option>
|
||||
<option>management</option>
|
||||
</select>
|
||||
<app-events-table [events]="this.events"></app-events-table>
|
||||
<app-events-table [events]="this.events" [selectedCalendar]="getCalendarId(selectedCalendar)"></app-events-table>
|
||||
</div>
|
||||
|
||||
@@ -49,4 +49,22 @@ export class AdminComponent implements OnInit {
|
||||
this.isLoggedIn = true;
|
||||
this.getEvents();
|
||||
}
|
||||
|
||||
handleCalendarChange() {
|
||||
this.events = [];
|
||||
this.getEvents();
|
||||
}
|
||||
|
||||
getCalendarId(text: string): number {
|
||||
switch(text) {
|
||||
case 'public':
|
||||
return 1;
|
||||
case 'members':
|
||||
return 2;
|
||||
case 'management':
|
||||
return 3;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user