Skip to content
Snippets Groups Projects
Commit 7110881e authored by Labros Papadopoulos's avatar Labros Papadopoulos
Browse files

party registration workflow

parent ebea643a
No related branches found
No related tags found
1 merge request!11Party registration workflow
Pipeline #6005 failed
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AppService } from '../../services/app.service';
import { AuthService } from 'src/app/shared/services/auth.service';
@Component({
selector: 'app-redirect',
......@@ -11,24 +12,47 @@ export class RedirectComponent implements OnInit {
constructor(
private appService: AppService,
private router: Router
private router: Router,
private authService: AuthService
) { }
ngOnInit() {
let isTestbedProvider = false;
for(var val of this.authService.portalUserJWT.realm_access.roles){
if (val ==='TESTBED_PROVIDER') {
isTestbedProvider=true
}
}
//TODO insert redirection logic
const activePortal = localStorage.getItem('active_portal')
if (activePortal === 'services') {
if (isTestbedProvider){
this.router.navigate(['services', 'individual_update'])
}
else {
this.router.navigate(['services', 'services_marketplace'])
}
}
else if (activePortal === 'resources') {
this.router.navigate(['resources', 'resource_catalogs'])
}
else if (activePortal === 'testing') {
if (isTestbedProvider){
this.router.navigate(['testing', 'individual_update'])
} else {
this.router.navigate(['testing', 'service_test_specs'])
}
}
else if (activePortal === 'products') {
this.router.navigate(['products', 'marketplace'])
if (isTestbedProvider){
this.router.navigate(['products', 'individual_update'])
} else {
this.router.navigate(['products', 'marketplace'])
}
}
else {
......
......@@ -14,6 +14,7 @@ import { ApiConfiguration as ResourceCatalogAPIconfig} from 'src/app/openApis/re
import { ApiConfiguration as ResourceInventoryAPIconfig} from 'src/app/openApis/resourceInventoryManagement/api-configuration'
import { ApiConfiguration as resourcePoolManagementAPIconfig} from 'src/app/openApis/resourcePoolManagement/api-configuration'
import { ApiConfiguration as ProductCatalogAPIconfig} from 'src/app/openApis/productCatalogManagement/api-configuration'
import { ApiConfiguration as GeographicSiteManagementAPIconfig} from 'src/app/openApis/geographicSiteManagement/api-configuration'
import { NavigationEnd, NavigationStart, Router } from '@angular/router';
import { filter, first } from 'rxjs/operators';
......@@ -40,8 +41,9 @@ export class AppService {
private tmfResourceCatalogConfig: ResourceCatalogAPIconfig,
private tmfResourceInventoryConfig: ResourceInventoryAPIconfig,
private resourcePoolManagementAPIconfig: resourcePoolManagementAPIconfig,
private tmfProductCatalogConfig: ProductCatalogAPIconfig
) {
private tmfProductCatalogConfig: ProductCatalogAPIconfig,
private tmfGeographicSiteConfig: GeographicSiteManagementAPIconfig
) {
this.setAPIurls()
this.recognizePortalDomain()
}
......@@ -64,6 +66,7 @@ export class AppService {
this.serviceTestManagementAPIconfig.rootUrl = this.config.APITMFURL
this.resourcePoolManagementAPIconfig.rootUrl = this.config.APITMFURL
this.tmfProductCatalogConfig.rootUrl = this.config.APITMFURL
this.tmfGeographicSiteConfig.rootUrl = this.config.APITMFURL
}
//recognition of which portal is used (services/testing/product)
......
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