TSK-454 Domain switching bug

This commit is contained in:
Martin Rojas Miguel Angel 2018-04-19 15:19:39 +02:00 committed by Holger Hagen
parent fdfb9b65d0
commit cb20dd1ccb
18 changed files with 136 additions and 44 deletions

View File

@ -26,9 +26,9 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group required"> <div class="form-group required">
<label for="classification-key" class="control-label">Key</label> <label for="classification-key" class="control-label">Key</label>
<input type="text" required #key="ngModel" class="form-control" id="classification-key" placeholder="Key" [(ngModel)]="classification.key" <input type="text" required #key="ngModel" [disabled]="action!== 'CREATE'? true : false" class="form-control" id="classification-key"
name="classification.key"> placeholder="Key" [(ngModel)]="classification.key" name="classification.key">
<div *ngIf="!key.valid" class="required-text"> <div *ngIf="!key.valid && action === 'CREATE'" class="required-text">
* Key is required * Key is required
</div> </div>
</div> </div>

View File

@ -45,6 +45,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
private classificationRemoveSubscription: Subscription; private classificationRemoveSubscription: Subscription;
private selectedClassificationSubscription: Subscription; private selectedClassificationSubscription: Subscription;
private categoriesSubscription: Subscription; private categoriesSubscription: Subscription;
private domainSubscription: Subscription;
constructor(private classificationsService: ClassificationsService, constructor(private classificationsService: ClassificationsService,
private route: ActivatedRoute, private route: ActivatedRoute,
@ -66,7 +67,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
.subscribe(classificationIdSelected => { .subscribe(classificationIdSelected => {
this.classification = undefined; this.classification = undefined;
if (classificationIdSelected) { if (classificationIdSelected) {
this.getClassificationInformation(classificationIdSelected); this.fillClassificationInformation(classificationIdSelected);
} }
}); });
@ -80,7 +81,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
if (id === 'undefined') { if (id === 'undefined') {
id = undefined; id = undefined;
} }
this.getClassificationInformation(id); this.fillClassificationInformation(id);
} }
if (id && id !== '') { if (id && id !== '') {
@ -111,6 +112,11 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
} }
removeClassification() { removeClassification() {
if (!this.classification || !this.classification.classificationId) {
this.errorModalService.triggerError(
new ErrorModel('There is no classification selected', 'Please check if you are creating a classification'));
return false;
}
this.requestInProgressService.setRequestInProgress(true); this.requestInProgressService.setRequestInProgress(true);
this.treeService.setRemovedNodeId(this.classification.classificationId); this.treeService.setRemovedNodeId(this.classification.classificationId);
@ -147,6 +153,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
.putClassification(this.classification._links.self.href, this.classification) .putClassification(this.classification._links.self.href, this.classification)
.subscribe((classification: ClassificationDefinition) => { .subscribe((classification: ClassificationDefinition) => {
this.classification = classification; this.classification = classification;
this.classificationsService.selectClassification(classification.classificationId);
this.afterRequest(); this.afterRequest();
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${classification.key} was saved successfully`)); this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, `Classification ${classification.key} was saved successfully`));
}, error => { }, error => {
@ -176,7 +183,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
this.classificationsService.selectClassification(id); this.classificationsService.selectClassification(id);
} }
private getClassificationInformation(classificationIdSelected: string) { private fillClassificationInformation(classificationIdSelected: string) {
if (this.action === ACTION.CREATE) { // CREATE if (this.action === ACTION.CREATE) { // CREATE
this.initClassificationCreation(classificationIdSelected); this.initClassificationCreation(classificationIdSelected);
} else { } else {
@ -186,6 +193,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
this.classification = classification; this.classification = classification;
this.classificationClone = { ...this.classification }; this.classificationClone = { ...this.classification };
this.requestInProgress = false; this.requestInProgress = false;
this.checkDomainAndRedirect();
}); });
} }
} }
@ -208,6 +216,14 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
this.classificationClone = { ...this.classification }; this.classificationClone = { ...this.classification };
} }
private checkDomainAndRedirect() {
this.domainSubscription = this.domainService.getSelectedDomain().subscribe(domain => {
if (this.classification && this.classification.domain !== domain) {
this.backClicked();
}
});
}
ngOnDestroy(): void { ngOnDestroy(): void {
if (this.masterAndDetailSubscription) { this.masterAndDetailSubscription.unsubscribe(); } if (this.masterAndDetailSubscription) { this.masterAndDetailSubscription.unsubscribe(); }
@ -218,6 +234,6 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
if (this.classificationRemoveSubscription) { this.classificationRemoveSubscription.unsubscribe(); } if (this.classificationRemoveSubscription) { this.classificationRemoveSubscription.unsubscribe(); }
if (this.selectedClassificationSubscription) { this.selectedClassificationSubscription.unsubscribe(); } if (this.selectedClassificationSubscription) { this.selectedClassificationSubscription.unsubscribe(); }
if (this.categoriesSubscription) { this.categoriesSubscription.unsubscribe(); } if (this.categoriesSubscription) { this.categoriesSubscription.unsubscribe(); }
if (this.domainSubscription) { this.domainSubscription.unsubscribe(); }
} }
} }

View File

@ -84,9 +84,6 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
this.classificationServiceSubscription = this.classificationService.getClassifications(true) this.classificationServiceSubscription = this.classificationService.getClassifications(true)
.subscribe((classifications: Array<TreeNodeModel>) => { .subscribe((classifications: Array<TreeNodeModel>) => {
this.requestInProgress = false; this.requestInProgress = false;
if (!classifications.length) {
return null;
}
this.classifications = classifications; this.classifications = classifications;
this.classificationTypeServiceSubscription = this.classificationTypeService.getClassificationTypes() this.classificationTypeServiceSubscription = this.classificationTypeService.getClassificationTypes()
.subscribe((classificationsTypes: Array<string>) => { .subscribe((classificationsTypes: Array<string>) => {

View File

@ -1,5 +1,3 @@
<taskana-spinner [isRunning]="requestInProgress" isModal="true"
class="floating"></taskana-spinner>
<div *ngIf="workbasket" id="wb-information" class="panel panel-default"> <div *ngIf="workbasket" id="wb-information" class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<div class="pull-right"> <div class="pull-right">

View File

@ -47,7 +47,6 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
distributionTargetsClone: Array<WorkbasketSummary>; distributionTargetsClone: Array<WorkbasketSummary>;
distributionTargetsSelectedClone: Array<WorkbasketSummary>; distributionTargetsSelectedClone: Array<WorkbasketSummary>;
requestInProgress = false;
requestInProgressLeft = false; requestInProgressLeft = false;
requestInProgressRight = false; requestInProgressRight = false;
modalErrorMessage: string; modalErrorMessage: string;
@ -119,10 +118,9 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
onSave() { onSave() {
this.requestInProgressService.setRequestInProgress(true); this.requestInProgressService.setRequestInProgress(true);
this.requestInProgress = true;
this.workbasketService.updateWorkBasketsDistributionTargets( this.workbasketService.updateWorkBasketsDistributionTargets(
this.distributionTargetsSelectedResource._links.self.href, this.getSeletedIds()).subscribe(response => { this.distributionTargetsSelectedResource._links.self.href, this.getSeletedIds()).subscribe(response => {
this.requestInProgress = false; this.requestInProgressService.setRequestInProgress(false);
this.distributionTargetsSelected = response._embedded ? response._embedded.distributionTargets : []; this.distributionTargetsSelected = response._embedded ? response._embedded.distributionTargets : [];
this.distributionTargetsSelectedClone = Object.assign([], this.distributionTargetsSelected); this.distributionTargetsSelectedClone = Object.assign([], this.distributionTargetsSelected);
this.distributionTargetsClone = Object.assign([], this.distributionTargetsLeft); this.distributionTargetsClone = Object.assign([], this.distributionTargetsLeft);
@ -132,7 +130,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
}, },
error => { error => {
this.errorModalService.triggerError(new ErrorModel(`There was error while saving your workbasket's distribution targets`, error)) this.errorModalService.triggerError(new ErrorModel(`There was error while saving your workbasket's distribution targets`, error))
this.requestInProgress = false; this.requestInProgressService.setRequestInProgress(false);
return false; return false;
} }
) )

View File

@ -37,6 +37,7 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
private routeSubscription: Subscription; private routeSubscription: Subscription;
private masterAndDetailSubscription: Subscription; private masterAndDetailSubscription: Subscription;
private permissionSubscription: Subscription; private permissionSubscription: Subscription;
private domainSubscription: Subscription;
constructor(private service: WorkbasketService, constructor(private service: WorkbasketService,
private route: ActivatedRoute, private route: ActivatedRoute,
@ -104,7 +105,9 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
if (!workbasketIdSelected && this.action === ACTION.CREATE) { // CREATE if (!workbasketIdSelected && this.action === ACTION.CREATE) { // CREATE
this.workbasket = new Workbasket(undefined); this.workbasket = new Workbasket(undefined);
this.workbasket.domain = this.domainService.getSelectedDomainValue(); this.domainSubscription = this.domainService.getSelectedDomain().subscribe(domain => {
this.workbasket.domain = domain;
});
this.requestInProgress = false; this.requestInProgress = false;
} else if (!workbasketIdSelected && this.action === ACTION.COPY) { // COPY } else if (!workbasketIdSelected && this.action === ACTION.COPY) { // COPY
this.workbasket = { ...this.workbasketCopy }; this.workbasket = { ...this.workbasketCopy };
@ -115,15 +118,25 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
this.workbasketSubscription = this.service.getWorkBasket(workbasketIdSelected).subscribe(workbasket => { this.workbasketSubscription = this.service.getWorkBasket(workbasketIdSelected).subscribe(workbasket => {
this.workbasket = workbasket; this.workbasket = workbasket;
this.requestInProgress = false; this.requestInProgress = false;
this.checkDomainAndRedirect();
}); });
} }
} }
private checkDomainAndRedirect() {
this.domainSubscription = this.domainService.getSelectedDomain().subscribe(domain => {
if (this.workbasket && this.workbasket.domain !== domain) {
this.backClicked();
}
});
}
ngOnDestroy(): void { ngOnDestroy(): void {
if (this.workbasketSelectedSubscription) { this.workbasketSelectedSubscription.unsubscribe(); } if (this.workbasketSelectedSubscription) { this.workbasketSelectedSubscription.unsubscribe(); }
if (this.workbasketSubscription) { this.workbasketSubscription.unsubscribe(); } if (this.workbasketSubscription) { this.workbasketSubscription.unsubscribe(); }
if (this.routeSubscription) { this.routeSubscription.unsubscribe(); } if (this.routeSubscription) { this.routeSubscription.unsubscribe(); }
if (this.masterAndDetailSubscription) { this.masterAndDetailSubscription.unsubscribe(); } if (this.masterAndDetailSubscription) { this.masterAndDetailSubscription.unsubscribe(); }
if (this.permissionSubscription) { this.permissionSubscription.unsubscribe(); } if (this.permissionSubscription) { this.permissionSubscription.unsubscribe(); }
if (this.domainSubscription) { this.domainSubscription.unsubscribe(); }
} }
} }

View File

@ -15,18 +15,18 @@
<taskana-icon-type class="vertical-align" [type]="workbasket.type" [selected]="workbasket.workbasketId === selectedId"></taskana-icon-type> <taskana-icon-type class="vertical-align" [type]="workbasket.type" [selected]="workbasket.workbasketId === selectedId"></taskana-icon-type>
</dl> </dl>
<dl class="col-xs-10"> <dl class="col-xs-10">
<dt>{{workbasket.name}}, <dt data-toggle="tooltip" title="{{workbasket.name}}">{{workbasket.name}},
<i>{{workbasket.key}} </i> <i data-toggle="tooltip" title="{{workbasket.key}}">{{workbasket.key}} </i>
</dt> </dt>
<dd>{{workbasket.description}} &nbsp;</dd> <dd data-toggle="tooltip" title="{{workbasket.description}}">{{workbasket.description}} &nbsp;</dd>
<dd>{{workbasket.owner}} &nbsp;</dd> <dd data-toggle="tooltip" title="{{workbasket.owner}}">{{workbasket.owner}} &nbsp;</dd>
</dl> </dl>
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
<taskana-spinner [isRunning]="requestInProgress"></taskana-spinner> <taskana-spinner [isRunning]="requestInProgress"></taskana-spinner>
</div> </div>
<taskana-pagination [(workbasketsResource)]="workbasketsResource" (changePage)="changePage($event)"></taskana-pagination> <taskana-pagination [(workbasketsResource)]="workbasketsResource" (changePage)="changePage($event)"></taskana-pagination>
</div> </div>

View File

@ -9,12 +9,13 @@ import { NoAccessComponent } from './administration/workbasket/details/noAccess/
import { ClassificationListComponent } from './administration/classification/master/list/classification-list.component'; import { ClassificationListComponent } from './administration/classification/master/list/classification-list.component';
import { ClassificationDetailsComponent } from 'app/administration/classification/details/classification-details.component'; import { ClassificationDetailsComponent } from 'app/administration/classification/details/classification-details.component';
import { EnvironmentUrlGuard } from 'app/guards/environment-url-guard'; import { EnvironmentUrlGuard } from 'app/guards/environment-url-guard';
import { DomainGuard } from 'app/guards/domain-guard';
const appRoutes: Routes = [ const appRoutes: Routes = [
{ {
path: 'administration/workbaskets', path: 'administration/workbaskets',
component: MasterAndDetailComponent, component: MasterAndDetailComponent,
canActivate: [EnvironmentUrlGuard], canActivate: [EnvironmentUrlGuard, DomainGuard],
children: [ children: [
{ {
path: '', path: '',
@ -41,7 +42,7 @@ const appRoutes: Routes = [
{ {
path: 'administration/classifications', path: 'administration/classifications',
component: MasterAndDetailComponent, component: MasterAndDetailComponent,
canActivate: [EnvironmentUrlGuard], canActivate: [EnvironmentUrlGuard, DomainGuard],
children: [ children: [
{ {
path: '', path: '',

View File

@ -73,6 +73,7 @@ import { DomainService } from './services/domain/domain.service';
* Guards * Guards
*/ */
import { EnvironmentUrlGuard } from './guards/environment-url-guard'; import { EnvironmentUrlGuard } from './guards/environment-url-guard';
import { DomainGuard } from './guards/domain-guard';
const MODULES = [ const MODULES = [
BrowserModule, BrowserModule,
@ -142,7 +143,8 @@ const DECLARATIONS = [
TreeService, TreeService,
ClassificationTypesService, ClassificationTypesService,
ClassificationCategoriesService, ClassificationCategoriesService,
EnvironmentUrlGuard EnvironmentUrlGuard,
DomainGuard
], ],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })

View File

@ -0,0 +1,22 @@
import { Observable } from 'rxjs/Observable';
import { HttpClient } from '@angular/common/http';
import { CanActivate } from '@angular/router';
import { Injectable } from '@angular/core';
import { DomainService } from 'app/services/domain/domain.service';
import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
import { ErrorModel } from 'app/models/modal-error';
@Injectable()
export class DomainGuard implements CanActivate {
constructor(private domainService: DomainService, private errorModalService: ErrorModalService) { }
canActivate() {
return this.domainService.getDomains().map(domain => {
return true;
}).catch(() => {
this.errorModalService.triggerError(new ErrorModel(
'There was an error, please contact with your administrator', 'There was an error getting Domains'))
return Observable.of(false)
});
}
}

View File

@ -3,7 +3,7 @@ import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { environment } from 'environments/environment'; import { environment } from 'environments/environment';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { ReplaySubject } from 'rxjs/ReplaySubject';
@Injectable() @Injectable()
export class ClassificationCategoriesService { export class ClassificationCategoriesService {
@ -14,10 +14,21 @@ export class ClassificationCategoriesService {
'Authorization': 'Basic VEVBTUxFQURfMTpURUFNTEVBRF8x' 'Authorization': 'Basic VEVBTUxFQURfMTpURUFNTEVBRF8x'
}) })
}; };
private dataObs$ = new ReplaySubject<Array<string>>(1);
constructor(private httpClient: HttpClient) { } constructor(private httpClient: HttpClient) { }
getCategories(): Observable<Array<string>> { getCategories(forceRefresh = false): Observable<Array<string>> {
return this.httpClient.get<Array<string>>(this.url, this.httpOptions); if (!this.dataObs$.observers.length || forceRefresh) {
this.httpClient.get<Array<string>>(this.url, this.httpOptions).subscribe(
data => this.dataObs$.next(data),
error => {
this.dataObs$.error(error);
this.dataObs$ = new ReplaySubject(1);
}
);
}
return this.dataObs$;
}; };
} }

View File

@ -4,6 +4,7 @@ import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject'; import { Subject } from 'rxjs/Subject';
import { environment } from 'environments/environment'; import { environment } from 'environments/environment';
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { ReplaySubject } from 'rxjs/ReplaySubject';
@Injectable() @Injectable()
export class ClassificationTypesService { export class ClassificationTypesService {
@ -16,11 +17,23 @@ export class ClassificationTypesService {
}; };
private classificationTypeSelectedValue = 'TASK'; private classificationTypeSelectedValue = 'TASK';
private classificationTypeSelected = new BehaviorSubject<string>(this.classificationTypeSelectedValue); private classificationTypeSelected = new BehaviorSubject<string>(this.classificationTypeSelectedValue);
private dataObs$ = new ReplaySubject<Array<string>>(1);
constructor(private httpClient: HttpClient) { } constructor(private httpClient: HttpClient) { }
getClassificationTypes(): Observable<Array<string>> { getClassificationTypes(forceRefresh = false): Observable<Array<string>> {
return this.httpClient.get<Array<string>>(this.url, this.httpOptions);
if (!this.dataObs$.observers.length || forceRefresh) {
this.httpClient.get<Array<string>>(this.url, this.httpOptions).subscribe(
data => this.dataObs$.next(data),
error => {
this.dataObs$.error(error);
this.dataObs$ = new ReplaySubject(1);
}
);
}
return this.dataObs$;
}; };
selectClassificationType(id: string) { selectClassificationType(id: string) {

View File

@ -29,7 +29,6 @@ export class ClassificationsService {
}) })
}; };
private classificationRef: Observable<ClassificationResource>;
private classificationTypes: Array<string>; private classificationTypes: Array<string>;
constructor( constructor(
@ -42,14 +41,9 @@ export class ClassificationsService {
getClassifications(forceRequest = false): Observable<any> { getClassifications(forceRequest = false): Observable<any> {
return this.domainService.getSelectedDomain().mergeMap(domain => { return this.domainService.getSelectedDomain().mergeMap(domain => {
const classificationTypes = this.classificationTypeService.getSelectedClassificationType(); const classificationTypes = this.classificationTypeService.getSelectedClassificationType();
if (!forceRequest && this.classificationRef) { return this.getClassificationObservable(this.httpClient.get<ClassificationResource>(
return this.getClassificationObservable(this.classificationRef)
}
this.classificationRef = this.httpClient.get<ClassificationResource>(
`${environment.taskanaRestUrl}/v1/classifications/?domain=${domain}`, `${environment.taskanaRestUrl}/v1/classifications/?domain=${domain}`,
this.httpOptions) this.httpOptions));
return this.getClassificationObservable(this.classificationRef);
}).do(() => { }).do(() => {
this.domainService.domainChangedComplete(); this.domainService.domainChangedComplete();

View File

@ -1,6 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Subject } from 'rxjs/Subject';
@Injectable() @Injectable()
export class DomainServiceMock { export class DomainServiceMock {
@ -8,6 +9,7 @@ export class DomainServiceMock {
private domainSelectedValue; private domainSelectedValue;
private domainSelected = new BehaviorSubject<string>('DOMAIN_A'); private domainSelected = new BehaviorSubject<string>('DOMAIN_A');
private domainSwitched = new Subject<string>();
constructor() { constructor() {
} }
@ -32,6 +34,12 @@ export class DomainServiceMock {
getSelectedDomainValue() { getSelectedDomainValue() {
} }
getSwitchedDomain(): Observable<string> {
return this.domainSwitched.asObservable();
}
switchDomain(value: string) {
this.selectDomain(value)
this.domainSwitched.next(value)
}
} }

View File

@ -5,6 +5,7 @@ import { environment } from '../../../environments/environment';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { RequestInProgressService } from '../requestInProgress/request-in-progress.service'; import { RequestInProgressService } from '../requestInProgress/request-in-progress.service';
import { Subject } from 'rxjs/Subject';
@Injectable() @Injectable()
export class DomainService { export class DomainService {
@ -19,6 +20,7 @@ export class DomainService {
}; };
private domainSelectedValue; private domainSelectedValue;
private domainSelected = new BehaviorSubject<string>(''); private domainSelected = new BehaviorSubject<string>('');
private domainSwitched = new Subject<string>();
constructor( constructor(
private httpClient: HttpClient, private httpClient: HttpClient,
@ -40,13 +42,22 @@ export class DomainService {
return this.domainSelected.asObservable(); return this.domainSelected.asObservable();
} }
getSwitchedDomain(): Observable<string> {
return this.domainSwitched.asObservable();
}
selectDomain(value: string) { selectDomain(value: string) {
this.requestInProgressService.setRequestInProgress(true); this.requestInProgressService.setRequestInProgress(true);
// this.router.navigate(['']);
this.domainSelectedValue = value; this.domainSelectedValue = value;
this.domainSelected.next(value); this.domainSelected.next(value);
} }
switchDomain(value: string) {
this.selectDomain(value);
this.domainSwitched.next(value);
this.router.navigate([this.getNavigationUrl()]);
}
domainChangedComplete() { domainChangedComplete() {
this.requestInProgressService.setRequestInProgress(false); this.requestInProgressService.setRequestInProgress(false);
} }
@ -54,4 +65,12 @@ export class DomainService {
getSelectedDomainValue() { getSelectedDomainValue() {
return this.domainSelectedValue; return this.domainSelectedValue;
} }
private getNavigationUrl(): string {
if (this.router.url.indexOf('workbaskets') !== -1) {
return 'administration/workbaskets';
} else if (this.router.url.indexOf('classifications') !== -1) {
return 'administration/classifications';
}
}
} }

View File

@ -6,7 +6,7 @@ import { ErrorModel } from 'app/models/modal-error';
@Injectable() @Injectable()
export class ErrorModalService { export class ErrorModalService {
public errorTriggered = new Subject<ErrorModel>(); private errorTriggered = new Subject<ErrorModel>();
constructor() { } constructor() { }

View File

@ -24,7 +24,7 @@
</button> </button>
<ul class="dropdown-menu dropdown-menu" aria-labelledby="dropdownMenu"> <ul class="dropdown-menu dropdown-menu" aria-labelledby="dropdownMenu">
<li> <li>
<a *ngFor="let domain of domains" (click)="selectDomain(domain)"> <a *ngFor="let domain of domains" (click)="switchDomain(domain)">
{{domain}} {{domain}}
</a> </a>
</li> </li>

View File

@ -54,8 +54,8 @@ export class NavBarComponent implements OnInit, OnDestroy {
}); });
} }
selectDomain(domain) { switchDomain(domain) {
this.domainService.selectDomain(domain); this.domainService.switchDomain(domain);
} }
toogleNavBar() { toogleNavBar() {