2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing,
12 * software distributed under the License is distributed on an
13 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 * KIND, either express or implied. See the License for the
15 * specific language governing permissions and limitations
19 import { Component, OnInit } from '@angular/core';
20 import {merge, Observable} from "rxjs";
21 import {map, tap} from "rxjs/operators";
22 import {ActivatedRoute} from "@angular/router";
25 selector: 'app-manage-roles',
26 templateUrl: './manage-roles.component.html',
27 styleUrls: ['./manage-roles.component.scss']
29 export class ManageRolesComponent implements OnInit {
31 roleId$:Observable<string>
33 constructor(private route : ActivatedRoute) { }
38 onChildActivate(componentReference) {
39 // console.log("Activating "+componentReference+" - "+JSON.stringify(componentReference,getCircularReplacer()))
40 if (componentReference.roleIdEvent!=null) {
41 let componentEmit : Observable<string> = componentReference.roleIdEvent.pipe(
42 tap(userid=>console.log("Event "+componentReference.class+" "+userid)),
43 map((userid: string) => this.getSubPath(userid)));
44 if (this.roleId$!=null) {
45 this.roleId$ = merge(this.roleId$, componentEmit)
47 this.roleId$ = componentEmit;
52 getSubPath(userid:string) {
53 if (userid!=null && userid.length>0) {