47 lines
1.8 KiB
TypeScript
47 lines
1.8 KiB
TypeScript
|
|
import { afterNextRender, Component, inject, viewChild } from '@angular/core';
|
||
|
|
import { AngularMaterialModule } from '../../shared/module/angular-material.module';
|
||
|
|
import { MatAccordion } from '@angular/material/expansion';
|
||
|
|
import { UserPreferences } from '../../core/models/user-preference';
|
||
|
|
import { CommonModule } from '@angular/common';
|
||
|
|
import { ActivatedRoute } from '@angular/router';
|
||
|
|
import { UserPreferencesService } from '../../core/services/user-preference.service';
|
||
|
|
import { ReactiveFormsModule } from '@angular/forms';
|
||
|
|
import { ApplicationComponent } from '../application/application.component';
|
||
|
|
import { GoodsComponent } from '../goods/goods.component';
|
||
|
|
import { HolderComponent } from '../holder/holder.component';
|
||
|
|
import { ShippingComponent } from '../shipping/shipping.component';
|
||
|
|
import { TravelPlanComponent } from '../travel-plan/travel-plan.component';
|
||
|
|
|
||
|
|
@Component({
|
||
|
|
selector: 'app-view-carnet',
|
||
|
|
imports: [AngularMaterialModule, CommonModule, ReactiveFormsModule,
|
||
|
|
ApplicationComponent, HolderComponent, GoodsComponent, TravelPlanComponent, ShippingComponent],
|
||
|
|
templateUrl: './view-carnet.component.html',
|
||
|
|
styleUrl: './view-carnet.component.scss'
|
||
|
|
})
|
||
|
|
export class ViewCarnetComponent {
|
||
|
|
accordion = viewChild.required(MatAccordion);
|
||
|
|
isViewMode = true;
|
||
|
|
headerid: number = 0;
|
||
|
|
applicationName: string = '';
|
||
|
|
userPreferences: UserPreferences;
|
||
|
|
|
||
|
|
private route = inject(ActivatedRoute);
|
||
|
|
|
||
|
|
constructor(userPrefenceService: UserPreferencesService) {
|
||
|
|
this.userPreferences = userPrefenceService.getPreferences();
|
||
|
|
|
||
|
|
afterNextRender(() => {
|
||
|
|
// Open all panels
|
||
|
|
this.accordion().openAll();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
ngOnInit(): void {
|
||
|
|
const idParam = this.route.snapshot.paramMap.get('headerid');
|
||
|
|
this.headerid = idParam ? parseInt(idParam, 10) : 0;
|
||
|
|
|
||
|
|
this.applicationName = this.route.snapshot.queryParamMap.get('applicationname') || '';
|
||
|
|
}
|
||
|
|
}
|