Skip to content
Snippets Groups Projects
Verified Commit ebd6d1aa authored by Alex ORLUC's avatar Alex ORLUC
Browse files

fix message header

parent c8959816
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ import { HttpClient } from '@angular/common/http'; ...@@ -4,6 +4,7 @@ import { HttpClient } from '@angular/common/http';
import { LANG } from '../../translate.component'; import { LANG } from '../../translate.component';
import { NotificationService } from '../../notification.service'; import { NotificationService } from '../../notification.service';
import {MatPaginator, MatTableDataSource, MatSort, MatSidenav } from '@angular/material'; import {MatPaginator, MatTableDataSource, MatSort, MatSidenav } from '@angular/material';
import { HeaderService } from '../../../service/header.service';
declare function $j(selector: any): any; declare function $j(selector: any): any;
...@@ -15,7 +16,6 @@ declare var angularGlobals: any; ...@@ -15,7 +16,6 @@ declare var angularGlobals: any;
}) })
export class PrioritiesAdministrationComponent implements OnInit { export class PrioritiesAdministrationComponent implements OnInit {
/*HEADER*/ /*HEADER*/
titleHeader : string;
@ViewChild('snav') public sidenavLeft : MatSidenav; @ViewChild('snav') public sidenavLeft : MatSidenav;
@ViewChild('snav2') public sidenavRight : MatSidenav; @ViewChild('snav2') public sidenavRight : MatSidenav;
...@@ -40,7 +40,7 @@ export class PrioritiesAdministrationComponent implements OnInit { ...@@ -40,7 +40,7 @@ export class PrioritiesAdministrationComponent implements OnInit {
this.dataSource.filter = filterValue; this.dataSource.filter = filterValue;
} }
constructor(changeDetectorRef: ChangeDetectorRef, media: MediaMatcher, public http: HttpClient, private notify: NotificationService) { constructor(changeDetectorRef: ChangeDetectorRef, media: MediaMatcher, public http: HttpClient, private notify: NotificationService, private headerService: HeaderService) {
$j("link[href='merged_css.php']").remove(); $j("link[href='merged_css.php']").remove();
this.mobileQuery = media.matchMedia('(max-width: 768px)'); this.mobileQuery = media.matchMedia('(max-width: 768px)');
this._mobileQueryListener = () => changeDetectorRef.detectChanges(); this._mobileQueryListener = () => changeDetectorRef.detectChanges();
...@@ -52,7 +52,7 @@ export class PrioritiesAdministrationComponent implements OnInit { ...@@ -52,7 +52,7 @@ export class PrioritiesAdministrationComponent implements OnInit {
} }
ngOnInit(): void { ngOnInit(): void {
window['MainHeaderComponent'].refreshTitle(this.lang.administration + ' ' + this.lang.priorities); this.headerService.headerMessage = this.lang.administration + ' ' + this.lang.priorities;
window['MainHeaderComponent'].setSnav(this.sidenavLeft); window['MainHeaderComponent'].setSnav(this.sidenavLeft);
window['MainHeaderComponent'].setSnavRight(null); window['MainHeaderComponent'].setSnavRight(null);
......
...@@ -5,6 +5,7 @@ import { Router, ActivatedRoute } from '@angular/router'; ...@@ -5,6 +5,7 @@ import { Router, ActivatedRoute } from '@angular/router';
import { LANG } from '../../translate.component'; import { LANG } from '../../translate.component';
import { NotificationService } from '../../notification.service'; import { NotificationService } from '../../notification.service';
import { MatSidenav } from '@angular/material'; import { MatSidenav } from '@angular/material';
import { HeaderService } from '../../../service/header.service';
declare function $j(selector: any): any; declare function $j(selector: any): any;
...@@ -18,7 +19,6 @@ declare var angularGlobals: any; ...@@ -18,7 +19,6 @@ declare var angularGlobals: any;
export class PriorityAdministrationComponent implements OnInit { export class PriorityAdministrationComponent implements OnInit {
/*HEADER*/ /*HEADER*/
titleHeader : string;
@ViewChild('snav') public sidenavLeft : MatSidenav; @ViewChild('snav') public sidenavLeft : MatSidenav;
@ViewChild('snav2') public sidenavRight : MatSidenav; @ViewChild('snav2') public sidenavRight : MatSidenav;
...@@ -39,7 +39,7 @@ export class PriorityAdministrationComponent implements OnInit { ...@@ -39,7 +39,7 @@ export class PriorityAdministrationComponent implements OnInit {
default_priority: false default_priority: false
}; };
constructor(changeDetectorRef: ChangeDetectorRef, media: MediaMatcher, public http: HttpClient, private route: ActivatedRoute, private router: Router, private notify: NotificationService) { constructor(changeDetectorRef: ChangeDetectorRef, media: MediaMatcher, public http: HttpClient, private route: ActivatedRoute, private router: Router, private notify: NotificationService, private headerService: HeaderService) {
$j("link[href='merged_css.php']").remove(); $j("link[href='merged_css.php']").remove();
this.mobileQuery = media.matchMedia('(max-width: 768px)'); this.mobileQuery = media.matchMedia('(max-width: 768px)');
this._mobileQueryListener = () => changeDetectorRef.detectChanges(); this._mobileQueryListener = () => changeDetectorRef.detectChanges();
...@@ -57,14 +57,13 @@ export class PriorityAdministrationComponent implements OnInit { ...@@ -57,14 +57,13 @@ export class PriorityAdministrationComponent implements OnInit {
this.route.params.subscribe((params) => { this.route.params.subscribe((params) => {
if (typeof params['id'] == "undefined") { if (typeof params['id'] == "undefined") {
window['MainHeaderComponent'].refreshTitle(this.lang.priorityCreation); this.headerService.headerMessage = this.lang.priorityCreation;
window['MainHeaderComponent'].setSnav(this.sidenavLeft); window['MainHeaderComponent'].setSnav(this.sidenavLeft);
window['MainHeaderComponent'].setSnavRight(null); window['MainHeaderComponent'].setSnavRight(null);
this.creationMode = true; this.creationMode = true;
this.loading = false; this.loading = false;
} else { } else {
window['MainHeaderComponent'].refreshTitle(this.lang.priorityModification);
window['MainHeaderComponent'].setSnav(this.sidenavLeft); window['MainHeaderComponent'].setSnav(this.sidenavLeft);
window['MainHeaderComponent'].setSnavRight(null); window['MainHeaderComponent'].setSnavRight(null);
...@@ -73,6 +72,7 @@ export class PriorityAdministrationComponent implements OnInit { ...@@ -73,6 +72,7 @@ export class PriorityAdministrationComponent implements OnInit {
this.http.get(this.coreUrl + "rest/priorities/" + this.id) this.http.get(this.coreUrl + "rest/priorities/" + this.id)
.subscribe((data: any) => { .subscribe((data: any) => {
this.priority = data.priority; this.priority = data.priority;
this.headerService.headerMessage = this.lang.priorityModification + " <small>" + this.priority.label + "</small>";
this.priority.useDoctypeDelay = this.priority.delays != null; this.priority.useDoctypeDelay = this.priority.delays != null;
if (this.priority.working_days === true) { if (this.priority.working_days === true) {
this.priority.working_days = "true"; this.priority.working_days = "true";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment