Update 0.0.3:
-delen van agenda toegevoegd -popup aangepast -accepteren van uitnodiging toegevoegd
This commit is contained in:
@@ -48,9 +48,7 @@ tui-avatar {
|
||||
font-size: 0.8125rem;
|
||||
line-height: 1.25rem;
|
||||
padding: 0.25rem 0.75rem;
|
||||
margin-left: 4px;
|
||||
margin-right: 20px;
|
||||
margin-bottom: 8px;
|
||||
margin: 20px 20px 8px 4px;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||
import {Router, RouterLink, RouterLinkActive, RouterModule} from '@angular/router';
|
||||
import {TuiAvatar, TuiChevron,} from '@taiga-ui/kit';
|
||||
import {AuthService} from '../../services/auth.service';
|
||||
import {User} from '../../models/user';
|
||||
import {TuiButton, TuiDropdown} from '@taiga-ui/core';
|
||||
import {TuiActiveZone, TuiObscured} from '@taiga-ui/cdk';
|
||||
import {environment} from '../../../environments/environment';
|
||||
import {Company} from '../../models/company';
|
||||
import {CompanyService} from '../../services/company.service';
|
||||
import {TuiSelectModule} from '@taiga-ui/legacy';
|
||||
import {UserService} from '../../services/user.service';
|
||||
import {AppUserDto, CompanyDTO} from '../../models/app-user-dto';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@@ -18,12 +18,13 @@ import {TuiSelectModule} from '@taiga-ui/legacy';
|
||||
styleUrl: './home.component.scss'
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
user: User
|
||||
user: AppUserDto;
|
||||
fullName: string
|
||||
companies: Company[]
|
||||
companies: CompanyDTO[];
|
||||
currentCompany: CompanyDTO;
|
||||
|
||||
getInitials(): string {
|
||||
this.user = this.authService.getUserInfo();
|
||||
this.user = this.userService.userValue
|
||||
this.fullName = this.user.firstName + ' ' + this.user.lastName;
|
||||
return this.fullName.split(' ').map((n) => n[0]).join('').substring(0, 2);
|
||||
}
|
||||
@@ -44,29 +45,23 @@ export class HomeComponent implements OnInit {
|
||||
this.open = active && this.open;
|
||||
}
|
||||
|
||||
constructor(private authService: AuthService, private router: Router, private companyService: CompanyService) {
|
||||
constructor(private authService: AuthService, private router: Router, private userService: UserService) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
if (!this.authService.isAuthenticated()) {
|
||||
if (!this.userService.userValue) {
|
||||
this.router.navigate(['login']);
|
||||
} else {
|
||||
this.companyService.getCompanies().subscribe(
|
||||
response => {
|
||||
this.companies = response
|
||||
this.authService.setCurrentCompany(response[0])
|
||||
console.log(this.companies)
|
||||
}
|
||||
)
|
||||
this.companies = this.userService.userValue.companies.map(a => a.company)
|
||||
this.currentCompany = this.companies[0];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
logout() {
|
||||
this.authService.logout();
|
||||
this.userService.clearUser();
|
||||
this.router.navigate(['login']);
|
||||
}
|
||||
|
||||
protected readonly environment = environment;
|
||||
currentCompany: Company;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user