Commit e7fb2320 authored by descamps's avatar descamps
Browse files

KDE - 13/04 - Changement routing absolu à relatif

parent 62750d63
......@@ -113,7 +113,7 @@ export class ListProfileComponent extends SidenavPage<ProfileDescription> implem
sedaUrl: string = this.pastisConfig.pastisPathPrefix + (this.isStandalone ? '' : this.startupService.getTenantIdentifier()) + this.pastisConfig.sedaUrl;
newProfileUrl: string = this.pastisConfig.pastisPathPrefix + (this.isStandalone ? '' : this.startupService.getTenantIdentifier() ) + this.pastisConfig.pastisNewProfile;
newProfileUrl: string = this.pastisConfig.pastisNewProfile;
docPath = this.isStandalone ? 'assets/doc/Standalone - Documentation APP - PASTIS.pdf' : 'assets/doc/VITAM UI - Documentation APP - PASTIS.pdf';
......@@ -143,7 +143,7 @@ export class ListProfileComponent extends SidenavPage<ProfileDescription> implem
constructor(private profileService: ProfileService, private noticeService: NoticeService,
private router: Router, private dialog: MatDialog,
private startupService: StartupService, private pastisConfig: PastisConfiguration,
route: ActivatedRoute, globalEventService: GlobalEventService,
private route: ActivatedRoute, globalEventService: GlobalEventService,
private dataGeneriquePopupService: DataGeneriquePopupService, private translateService: TranslateService,
private toggleService: ToggleSidenavService) {
super(route, globalEventService);
......@@ -215,7 +215,7 @@ export class ListProfileComponent extends SidenavPage<ProfileDescription> implem
}
editProfile(element: ProfileDescription) {
this.router.navigate([this.pastisConfig.pastisPathPrefix + (this.isStandalone ? '' : this.startupService.getTenantIdentifier()) + this.pastisConfig.pastisEditPage, element.id], {state: element, skipLocationChange: false});
this.router.navigate([this.pastisConfig.pastisEditPage, element.id], {state: element, relativeTo: this.route,skipLocationChange: false});
}
uploadProfile(files: File[]): void {
......@@ -227,9 +227,7 @@ export class ListProfileComponent extends SidenavPage<ProfileDescription> implem
this._uploadProfileSub = this.profileService.uploadProfile(formData).subscribe( (response: any) => {
if (response) {
console.log('File submited! Reponse is : ', response);
this.router.navigateByUrl(this.pastisConfig.pastisPathPrefix + (this.isStandalone ? '' : this.startupService.getTenantIdentifier() ) + this.pastisConfig.pastisNewProfile, { state: response });
}
this.router.navigate([this.pastisConfig.pastisNewProfile], { state: response, relativeTo: this.route}); }
});
this.subscriptions.push(this._uploadProfileSub);
}
......@@ -256,8 +254,7 @@ export class ListProfileComponent extends SidenavPage<ProfileDescription> implem
this.profileService.createProfile(this.pastisConfig.createProfileByTypeUrl, result.action).subscribe((response: ProfileResponse) => {
if (response) {
console.log('File submited! Reponse is : ', response);
this.router.navigateByUrl(this.pastisConfig.pastisPathPrefix + (this.isStandalone ? '' : this.startupService.getTenantIdentifier() ) + this.pastisConfig.pastisNewProfile, {state: response});
}
this.router.navigate([this.pastisConfig.pastisNewProfile], { state: response,relativeTo: this.route}); }
});
}
}
......
import {AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild} from '@angular/core';
import {MatDialog} from '@angular/material/dialog';
import {MatTab, MatTabGroup, MatTabHeader} from '@angular/material/tabs';
import {Router} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router';
import {Observable} from 'rxjs';
import {StartupService} from 'ui-frontend-common';
import {ConfirmActionComponent} from '../../../../../vitamui-library/src/lib/components/confirm-action/confirm-action.component';
import {
ConfirmActionComponent
} from '../../../../../vitamui-library/src/lib/components/confirm-action/confirm-action.component';
import {environment} from '../../../environments/environment';
import {PastisConfiguration} from '../../core/classes/pastis-configuration';
import {ProfileService} from '../../core/services/profile.service';
import {FileNode} from '../../models/file-node';
import {ProfileDescription} from '../../models/profile-description.model';
import {ProfileResponse} from '../../models/profile-response';
import {ProfileInformationTabComponent} from './profile-information-tab/profile-information-tab/profile-information-tab.component';
import {
ProfileInformationTabComponent
} from './profile-information-tab/profile-information-tab/profile-information-tab.component';
@Component({
selector: 'profile-preview',
......@@ -46,8 +49,9 @@ export class ProfilePreviewComponent implements AfterViewInit {
}
}
constructor(private matDialog: MatDialog, private router: Router, private startupService: StartupService,
private pastisConfig: PastisConfiguration, private profileService: ProfileService) {
constructor(private matDialog: MatDialog, private router: Router,
private pastisConfig: PastisConfiguration, private profileService: ProfileService,
private route : ActivatedRoute) {
}
ngAfterViewInit() {
......@@ -110,10 +114,7 @@ export class ProfilePreviewComponent implements AfterViewInit {
}
editProfile(inputProfile: ProfileDescription) {
this.router.navigate([this.pastisConfig.pastisPathPrefix + (this.isStandalone ? '' : this.startupService.getTenantIdentifier()) + this.pastisConfig.pastisEditPage, inputProfile.id], {
state: inputProfile,
skipLocationChange: false
});
this.router.navigate([this.pastisConfig.pastisEditPage, inputProfile.id], {state: inputProfile,relativeTo: this.route ,skipLocationChange: false});
}
downloadProfile(inputProfile: ProfileDescription) {
......
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
import {MatDialog} from '@angular/material/dialog';
import {Router} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router';
import {LangChangeEvent, TranslateService} from '@ngx-translate/core';
import {FileUploader} from 'ng2-file-upload';
import {NgxUiLoaderService} from 'ngx-ui-loader';
......@@ -88,7 +88,7 @@ export class PastisPopupOptionComponent implements OnInit, OnDestroy {
constructor(private router: Router, private profileService: ProfileService,
public dialog: MatDialog, private noticeService: NoticeService,
private translateService: TranslateService, private loaderService: NgxUiLoaderService,
private notificationService: NotificationService) { }
private notificationService: NotificationService, private route: ActivatedRoute) { }
ngOnInit(): void {
constantToTranslate.call(this, this.editProfile);
......@@ -108,7 +108,8 @@ export class PastisPopupOptionComponent implements OnInit, OnDestroy {
}
goToSedaView() {
window.open(this.sedaUrl);
const url = this.router.serializeUrl(this.router.createUrlTree(['sedaview'], {relativeTo: this.route}));
window.open(url, '_blank');
}
uploadProfile(files: File[]): void {
......@@ -121,7 +122,7 @@ export class PastisPopupOptionComponent implements OnInit, OnDestroy {
if (response) {
console.log('File submited! Reponse is : ', response);
this.router.navigateByUrl(this.newProfileUrl, { state: response });
this.router.navigate([this.newProfileUrl], { state: response, relativeTo: this.route});
}
});
}
......
{
"sedaUrl": "/sedaview",
"pastisEditPage": "/edit",
"pastisNewProfile": "/new",
"pastisEditPage": "edit",
"pastisNewProfile": "new",
"pastisPathPrefix": "",
"getAllProfilesUrl": "/getprofiles",
"editProfileUrl": "/edit",
......
{
"sedaUrl": "/sedaview",
"pastisEditPage": "/edit",
"pastisNewProfile": "/new",
"pastisEditPage": "edit",
"pastisNewProfile": "new",
"pastisPathPrefix": "/pastis/tenant/",
"getAllProfilesUrl": "/pastis/getprofiles",
"editProfileUrl": "/pastis/edit",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment