3f78ba1f3d
- AuthenticationService->AuthService - removed underscore-directories - put site related stuff into site/ - same for projector - auth service went into a core/ directory, used by site and projector - the alert is now not global anymore. Every view can have its own alert - make the auth service query users/whoami for the current user - made a new OpenSlides service for managing the startup ... A lot todo ...
35 lines
861 B
TypeScript
35 lines
861 B
TypeScript
import { Component, OnInit, Input } from '@angular/core';
|
|
|
|
import { Alert, AlertType } from './alert';
|
|
|
|
@Component({
|
|
selector: 'alert',
|
|
templateUrl: './alert.component.html',
|
|
styleUrls: ['./alert.component.css']
|
|
})
|
|
export class AlertComponent implements OnInit {
|
|
@Input() alert: Alert;
|
|
|
|
constructor() { }
|
|
|
|
ngOnInit() { }
|
|
|
|
removeAlert(alert: Alert) {
|
|
this.alert = undefined;
|
|
}
|
|
|
|
cssClass(alert: Alert) {
|
|
// return css class based on alert type
|
|
switch (alert.type) {
|
|
case AlertType.Success:
|
|
return 'alert alert-success';
|
|
case AlertType.Error:
|
|
return 'alert alert-danger';
|
|
case AlertType.Info:
|
|
return 'alert alert-info';
|
|
case AlertType.Warning:
|
|
return 'alert alert-warning';
|
|
}
|
|
}
|
|
}
|