TSK-580 Add master domain option for classification screens
This commit is contained in:
parent
71cedd85de
commit
b1cc34a71c
|
@ -24,8 +24,6 @@ import { ClassificationTypesService } from 'app/administration/services/classifi
|
|||
// tslint:disable:max-line-length
|
||||
import { ClassificationCategoriesService } from 'app/administration/services/classification-categories-service/classification-categories.service';
|
||||
// tslint:enable:max-line-length
|
||||
import { DomainServiceMock } from 'app/services/domain/domain.service.mock';
|
||||
import { DomainService } from 'app/services/domain/domain.service';
|
||||
import { CustomFieldsService } from 'app/services/custom-fields/custom-fields.service';
|
||||
import { configureTests } from 'app/app.test.configuration';
|
||||
|
||||
|
@ -55,10 +53,7 @@ describe('ClassificationDetailsComponent', () => {
|
|||
imports: [FormsModule, HttpClientModule, RouterTestingModule.withRoutes(routes), AngularSvgIconModule],
|
||||
declarations: [ClassificationDetailsComponent, SpinnerComponent, DummyDetailComponent],
|
||||
providers: [MasterAndDetailService, RequestInProgressService, ClassificationsService, HttpClient, ErrorModalService, AlertService,
|
||||
TreeService, ClassificationTypesService, ClassificationCategoriesService, {
|
||||
provide: DomainService,
|
||||
useClass: DomainServiceMock
|
||||
},
|
||||
TreeService, ClassificationTypesService, ClassificationCategoriesService,
|
||||
CustomFieldsService]
|
||||
})
|
||||
};
|
||||
|
|
|
@ -57,7 +57,6 @@ describe('ClassificationListComponent', () => {
|
|||
let fixture: ComponentFixture<ClassificationListComponent>;
|
||||
const treeNodes: Array<TreeNodeModel> = new Array(new TreeNodeModel());
|
||||
const classificationTypes: Array<string> = new Array<string>('type1', 'type2');
|
||||
let classificationsSpy, classificationsTypesSpy;
|
||||
let classificationsService, classificationTypesService;
|
||||
|
||||
beforeEach(done => {
|
||||
|
@ -78,8 +77,8 @@ describe('ClassificationListComponent', () => {
|
|||
|
||||
classificationsService = TestBed.get(ClassificationsService);
|
||||
classificationTypesService = TestBed.get(ClassificationTypesService);
|
||||
classificationsSpy = spyOn(classificationsService, 'getClassifications').and.returnValue(Observable.of(treeNodes));
|
||||
classificationsTypesSpy = spyOn(classificationTypesService, 'getClassificationTypes')
|
||||
spyOn(classificationsService, 'getClassifications').and.returnValue(Observable.of(treeNodes));
|
||||
spyOn(classificationTypesService, 'getClassificationTypes')
|
||||
.and.returnValue(Observable.of(classificationTypes));
|
||||
fixture.detectChanges();
|
||||
done();
|
||||
|
|
|
@ -9,7 +9,6 @@ import { HttpClientModule } from '@angular/common/http';
|
|||
import { DomainService } from 'app/services/domain/domain.service';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
|
||||
import { DomainServiceMock } from 'app/services/domain/domain.service.mock';
|
||||
import { AngularSvgIconModule } from 'angular-svg-icon';
|
||||
import { HttpModule } from '@angular/http';
|
||||
import { configureTests } from 'app/app.test.configuration';
|
||||
|
@ -25,10 +24,7 @@ describe('ImportExportComponent', () => {
|
|||
testBed.configureTestingModule({
|
||||
declarations: [ImportExportComponent],
|
||||
imports: [HttpClientModule, AngularSvgIconModule, HttpModule],
|
||||
providers: [WorkbasketService, ClassificationDefinitionService, WorkbasketDefinitionService, AlertService, {
|
||||
provide: DomainService,
|
||||
useClass: DomainServiceMock
|
||||
},
|
||||
providers: [WorkbasketService, ClassificationDefinitionService, WorkbasketDefinitionService, AlertService,
|
||||
ErrorModalService]
|
||||
})
|
||||
};
|
||||
|
@ -42,8 +38,8 @@ describe('ImportExportComponent', () => {
|
|||
});
|
||||
|
||||
afterEach(() => {
|
||||
document.body.removeChild(debugElement);
|
||||
});
|
||||
document.body.removeChild(debugElement);
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
|
|
|
@ -22,8 +22,6 @@ import { SavingWorkbasketService, SavingInformation } from 'app/administration/s
|
|||
import { WorkbasketService } from 'app/services/workbasket/workbasket.service';
|
||||
import { AlertService } from 'app/services/alert/alert.service';
|
||||
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
|
||||
import { DomainService } from 'app/services/domain/domain.service';
|
||||
import { DomainServiceMock } from 'app/services/domain/domain.service.mock';
|
||||
import { CustomFieldsService } from 'app/services/custom-fields/custom-fields.service';
|
||||
import { configureTests } from 'app/app.test.configuration';
|
||||
|
||||
|
@ -70,10 +68,6 @@ describe('AccessItemsComponent', () => {
|
|||
declarations: [SpinnerComponent, AccessItemsComponent, GeneralMessageModalComponent, TaskanaTypeAheadComponent],
|
||||
imports: [FormsModule, AngularSvgIconModule, HttpClientModule, HttpModule, ReactiveFormsModule],
|
||||
providers: [WorkbasketService, AlertService, ErrorModalService, SavingWorkbasketService, RequestInProgressService,
|
||||
{
|
||||
provide: DomainService,
|
||||
useClass: DomainServiceMock
|
||||
},
|
||||
CustomFieldsService]
|
||||
|
||||
})
|
||||
|
|
|
@ -26,8 +26,6 @@ import { GeneralMessageModalComponent } from 'app/shared/general-message-modal/g
|
|||
import { IconTypeComponent } from 'app/administration/components/type-icon/icon-type.component';
|
||||
import { SelectWorkBasketPipe } from 'app/shared/pipes/selectedWorkbasket/seleted-workbasket.pipe';
|
||||
import { LinksWorkbasketSummary } from 'app/models/links-workbasket-summary';
|
||||
import { DomainService } from 'app/services/domain/domain.service';
|
||||
import { DomainServiceMock } from 'app/services/domain/domain.service.mock';
|
||||
import { configureTests } from 'app/app.test.configuration';
|
||||
|
||||
|
||||
|
@ -62,10 +60,7 @@ describe('DistributionTargetsComponent', () => {
|
|||
declarations: [DistributionTargetsComponent, SpinnerComponent, GeneralMessageModalComponent,
|
||||
FilterComponent, SelectWorkBasketPipe, IconTypeComponent, DualListComponent],
|
||||
providers: [WorkbasketService, AlertService, SavingWorkbasketService, ErrorModalService, RequestInProgressService,
|
||||
{
|
||||
provide: DomainService,
|
||||
useClass: DomainServiceMock
|
||||
}]
|
||||
]
|
||||
})
|
||||
};
|
||||
configureTests(configure).then(testBed => {
|
||||
|
|
|
@ -9,7 +9,6 @@ import { RouterTestingModule } from '@angular/router/testing';
|
|||
import { Observable } from 'rxjs/Observable';
|
||||
import { Component, Input, forwardRef } from '@angular/core';
|
||||
import { Routes } from '@angular/router';
|
||||
import { AppModule } from 'app/app.module'
|
||||
|
||||
import { Workbasket } from 'app/models/workbasket';
|
||||
import { ICONTYPES } from 'app/models/type';
|
||||
|
@ -26,8 +25,6 @@ import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
|
|||
import { SavingWorkbasketService, SavingInformation } from 'app/administration/services/saving-workbaskets/saving-workbaskets.service';
|
||||
import { AlertService } from 'app/services/alert/alert.service';
|
||||
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
|
||||
import { DomainService } from 'app/services/domain/domain.service';
|
||||
import { DomainServiceMock } from 'app/services/domain/domain.service.mock';
|
||||
import { CustomFieldsService } from 'app/services/custom-fields/custom-fields.service';
|
||||
import { configureTests } from 'app/app.test.configuration';
|
||||
|
||||
|
@ -90,10 +87,6 @@ describe('InformationComponent', () => {
|
|||
HttpModule,
|
||||
RouterTestingModule.withRoutes(routes)],
|
||||
providers: [WorkbasketService, AlertService, SavingWorkbasketService, ErrorModalService, RequestInProgressService,
|
||||
{
|
||||
provide: DomainService,
|
||||
useClass: DomainServiceMock
|
||||
},
|
||||
CustomFieldsService]
|
||||
|
||||
})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Component, Input, forwardRef } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed, } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, } from '@angular/core/testing';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { Router, Routes } from '@angular/router';
|
||||
import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';
|
||||
|
@ -11,7 +11,6 @@ import { Observable } from 'rxjs/Observable';
|
|||
import { Workbasket } from 'app/models/workbasket';
|
||||
import { WorkbasketSummary } from 'app/models/workbasket-summary';
|
||||
import { WorkbasketSummaryResource } from 'app/models/workbasket-summary-resource';
|
||||
import { ACTION } from 'app/models/action';
|
||||
import { WorkbasketAccessItemsResource } from 'app/models/workbasket-access-items-resource';
|
||||
import { ICONTYPES } from 'app/models/type';
|
||||
import { Links } from 'app/models/links';
|
||||
|
@ -37,8 +36,6 @@ import { RemoveNoneTypePipe } from 'app/shared/pipes/removeNoneType/remove-none-
|
|||
import { SelectWorkBasketPipe } from 'app/shared/pipes/selectedWorkbasket/seleted-workbasket.pipe';
|
||||
import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
|
||||
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
|
||||
import { DomainService } from 'app/services/domain/domain.service';
|
||||
import { DomainServiceMock } from 'app/services/domain/domain.service.mock';
|
||||
import { CustomFieldsService } from 'app/services/custom-fields/custom-fields.service';
|
||||
import { configureTests } from 'app/app.test.configuration';
|
||||
@Component({
|
||||
|
@ -112,10 +109,7 @@ describe('WorkbasketDetailsComponent', () => {
|
|||
DistributionTargetsComponent, FilterComponent, DualListComponent, DummyDetailComponent,
|
||||
TaskanaTypeAheadComponent, SelectWorkBasketPipe],
|
||||
providers: [WorkbasketService, MasterAndDetailService, ErrorModalService, RequestInProgressService,
|
||||
AlertService, SavingWorkbasketService, {
|
||||
provide: DomainService,
|
||||
useClass: DomainServiceMock
|
||||
},
|
||||
AlertService, SavingWorkbasketService,
|
||||
CustomFieldsService]
|
||||
})
|
||||
};
|
||||
|
|
|
@ -13,11 +13,8 @@ import { OrientationService } from './services/orientation/orientation.service';
|
|||
import { SelectedRouteService } from './services/selected-route/selected-route';
|
||||
|
||||
import { NavBarComponent } from './components/nav-bar/nav-bar.component';
|
||||
import { DomainServiceMock } from 'app/services/domain/domain.service.mock';
|
||||
import { DomainService } from 'app/services/domain/domain.service';
|
||||
|
||||
|
||||
fdescribe('AppComponent', () => {
|
||||
describe('AppComponent', () => {
|
||||
|
||||
let app, fixture, debugElement;
|
||||
|
||||
|
@ -36,11 +33,7 @@ fdescribe('AppComponent', () => {
|
|||
HttpClientModule,
|
||||
SharedModule
|
||||
],
|
||||
providers: [ErrorModalService, RequestInProgressService, AlertService, OrientationService, SelectedRouteService,
|
||||
{
|
||||
provide: DomainService,
|
||||
useClass: DomainServiceMock
|
||||
}]
|
||||
providers: [ErrorModalService, RequestInProgressService, AlertService, OrientationService, SelectedRouteService]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AppComponent);
|
||||
|
|
|
@ -11,6 +11,8 @@ import {
|
|||
} from '@angular/platform-browser-dynamic/testing';
|
||||
import { TaskanaEngineServiceMock } from './services/taskana-engine/taskana-engine.mock.service';
|
||||
import { TaskanaEngineService } from './services/taskana-engine/taskana-engine.service';
|
||||
import { DomainService } from './services/domain/domain.service';
|
||||
import { DomainServiceMock } from './services/domain/domain.service.mock';
|
||||
|
||||
export const configureTests = (configure: (testBed: TestBed) => void) => {
|
||||
const testBed = getTestBed();
|
||||
|
@ -22,7 +24,10 @@ export const configureTests = (configure: (testBed: TestBed) => void) => {
|
|||
}
|
||||
|
||||
configure(testBed);
|
||||
testBed.configureTestingModule({ providers: [{ provide: TaskanaEngineService, useClass: TaskanaEngineServiceMock }] });
|
||||
testBed.configureTestingModule({
|
||||
providers: [{ provide: TaskanaEngineService, useClass: TaskanaEngineServiceMock },
|
||||
{ provide: DomainService, useClass: DomainServiceMock }]
|
||||
});
|
||||
|
||||
return testBed.compileComponents().then(() => testBed);
|
||||
};
|
||||
|
|
|
@ -13,17 +13,17 @@
|
|||
<h2 class="navbar-brand no-margin"> {{title}}</h2>
|
||||
</ul>
|
||||
</div>
|
||||
<div *ngIf="selectedRoute.indexOf('workbaskets') !== -1 || selectedRoute.indexOf('classifications') !== -1" class="pull-right domain-form">
|
||||
<div *ngIf="showDomainSelector()" class="pull-right domain-form">
|
||||
<div class="dropdown clearfix btn-group">
|
||||
<label class="control-label hidden-xs">Working on </label>
|
||||
<button type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
{{selectedDomain}}
|
||||
{{selectedDomain? selectedDomain: 'MASTER DOMAIN'}}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu" aria-labelledby="dropdownMenu">
|
||||
<li>
|
||||
<a *ngFor="let domain of domains" (click)="switchDomain(domain)">
|
||||
<label>{{domain}}</label>
|
||||
<label>{{domain? domain: 'MASTER DOMAIN'}}</label>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -1,24 +1,20 @@
|
|||
import { Routes } from '@angular/router';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { AngularSvgIconModule } from 'angular-svg-icon';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { SharedModule } from 'app/shared/shared.module';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
import { NavBarComponent } from './nav-bar.component';
|
||||
import { UserInformationComponent } from 'app/components/user-information/user-information.component';
|
||||
|
||||
import { SelectedRouteService } from 'app/services/selected-route/selected-route';
|
||||
import { DomainService } from 'app/services/domain/domain.service';
|
||||
import { DomainServiceMock } from 'app/services/domain/domain.service.mock';
|
||||
import { BusinessAdminGuard } from 'app/guards/business-admin-guard';
|
||||
import { MonitorGuard } from 'app/guards/monitor-guard';
|
||||
import { WindowRefService } from 'app/services/window/window.service';
|
||||
import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
|
||||
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
|
||||
|
||||
import { UserInfoModel } from 'app/models/user-info';
|
||||
import { configureTests } from 'app/app.test.configuration';
|
||||
|
||||
describe('NavBarComponent', () => {
|
||||
|
@ -40,10 +36,8 @@ describe('NavBarComponent', () => {
|
|||
RouterTestingModule.withRoutes(routes),
|
||||
SharedModule
|
||||
],
|
||||
providers: [SelectedRouteService, {
|
||||
provide: DomainService,
|
||||
useClass: DomainServiceMock
|
||||
},
|
||||
providers: [
|
||||
SelectedRouteService,
|
||||
BusinessAdminGuard,
|
||||
MonitorGuard,
|
||||
WindowRefService,
|
||||
|
|
|
@ -88,6 +88,12 @@ export class NavBarComponent implements OnInit, OnDestroy {
|
|||
this.window.nativeWindow.location.href = environment.taskanaRestUrl + '/login?logout';
|
||||
}
|
||||
|
||||
showDomainSelector(): boolean {
|
||||
return this.selectedRoute.indexOf('administration') !== -1
|
||||
|| this.selectedRoute.indexOf('workbaskets') !== -1
|
||||
|| this.selectedRoute.indexOf('classifications') !== -1
|
||||
}
|
||||
|
||||
private setTitle(value: string = 'workbaskets') {
|
||||
if (value.indexOf('workbaskets') === 0) {
|
||||
this.title = this.titleWorkbaskets;
|
||||
|
|
|
@ -11,7 +11,7 @@ export class DomainGuard implements CanActivate {
|
|||
constructor(private domainService: DomainService, private errorModalService: ErrorModalService) { }
|
||||
|
||||
canActivate() {
|
||||
return this.domainService.getDomains(true).map(domain => {
|
||||
return this.domainService.getDomains().map(domain => {
|
||||
return true;
|
||||
}).catch(() => {
|
||||
this.errorModalService.triggerError(new ErrorModel(
|
||||
|
|
|
@ -9,7 +9,6 @@ export class DomainServiceMock {
|
|||
|
||||
private domainSelectedValue;
|
||||
private domainSelected = new BehaviorSubject<string>('DOMAIN_A');
|
||||
private domainSwitched = new Subject<string>();
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
@ -34,12 +33,13 @@ export class DomainServiceMock {
|
|||
getSelectedDomainValue() {
|
||||
}
|
||||
|
||||
getSwitchedDomain(): Observable<string> {
|
||||
return this.domainSwitched.asObservable();
|
||||
addMasterDomain() {
|
||||
}
|
||||
|
||||
removeMasterDomain() {
|
||||
}
|
||||
|
||||
switchDomain(value: string) {
|
||||
this.selectDomain(value)
|
||||
this.domainSwitched.next(value)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import { TestBed, inject } from '@angular/core/testing';
|
||||
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { DomainService } from './domain.service';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { Routes } from '@angular/router';
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
||||
import { DomainService } from './domain.service';
|
||||
import { RequestInProgressService } from '../requestInProgress/request-in-progress.service';
|
||||
import { SelectedRouteService } from '../selected-route/selected-route';
|
||||
|
||||
@Component({
|
||||
selector: 'taskana-dummy-detail',
|
||||
|
@ -25,7 +26,7 @@ describe('DomainService', () => {
|
|||
HttpClientModule,
|
||||
RouterTestingModule.withRoutes(routes)
|
||||
],
|
||||
providers: [HttpClient, DomainService, RequestInProgressService],
|
||||
providers: [HttpClient, DomainService, RequestInProgressService, SelectedRouteService],
|
||||
declarations: [DummyDetailComponent]
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,34 +5,51 @@ import { environment } from '../../../environments/environment';
|
|||
import { Router } from '@angular/router';
|
||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||
import { RequestInProgressService } from '../requestInProgress/request-in-progress.service';
|
||||
import { Subject } from 'rxjs/Subject';
|
||||
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
||||
import { SelectedRouteService } from '../selected-route/selected-route';
|
||||
|
||||
@Injectable()
|
||||
export class DomainService {
|
||||
|
||||
url = environment.taskanaRestUrl + '/v1/domains';
|
||||
|
||||
private domainRestValue: Array<string> = new Array<string>();
|
||||
private domainValue: Array<string> = new Array<string>();
|
||||
private domainSelectedValue;
|
||||
private domainSelected = new BehaviorSubject<string>('');
|
||||
private domainSwitched = new Subject<string>();
|
||||
private dataObs$ = new ReplaySubject<Array<string>>(1);
|
||||
private hasMasterDomain = false;
|
||||
|
||||
constructor(
|
||||
private httpClient: HttpClient,
|
||||
private router: Router,
|
||||
private requestInProgressService: RequestInProgressService) {
|
||||
private requestInProgressService: RequestInProgressService,
|
||||
private selectedRouteService: SelectedRouteService) {
|
||||
this.selectedRouteService.getSelectedRoute().subscribe((value: string) => {
|
||||
if (value.indexOf('workbaskets') === 0) {
|
||||
this.hasMasterDomain = false
|
||||
this.removeMasterDomain();
|
||||
if (this.domainSelectedValue === '') {
|
||||
this.selectDomain(this.domainValue[0]);
|
||||
}
|
||||
} else if (value.indexOf('classifications') === 0) {
|
||||
this.hasMasterDomain = true;
|
||||
this.addMasterDomain();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// GET
|
||||
getDomains(forceRefresh = false): Observable<string[]> {
|
||||
if (forceRefresh) {
|
||||
if (!this.dataObs$.observers.length || forceRefresh) {
|
||||
this.httpClient.get<string[]>(this.url).subscribe(
|
||||
domains => {
|
||||
this.dataObs$.next(domains);
|
||||
if (!this.domainSelectedValue && domains && domains.length > 0) {
|
||||
this.domainSelectedValue = domains[0];
|
||||
this.selectDomain(domains[0]);
|
||||
this.domainRestValue = domains;
|
||||
this.domainValue = domains;
|
||||
this.dataObs$.next(this.hasMasterDomain ? this.addEmptyDomain(domains) : domains);
|
||||
if (this.domainSelectedValue === undefined && this.domainValue.length > 0) {
|
||||
this.selectDomain(this.domainValue[0]);
|
||||
}
|
||||
},
|
||||
error => {
|
||||
|
@ -49,10 +66,6 @@ export class DomainService {
|
|||
return this.domainSelected.asObservable();
|
||||
}
|
||||
|
||||
getSwitchedDomain(): Observable<string> {
|
||||
return this.domainSwitched.asObservable();
|
||||
}
|
||||
|
||||
selectDomain(value: string) {
|
||||
// this.requestInProgressService.setRequestInProgress(true);
|
||||
this.domainSelectedValue = value;
|
||||
|
@ -61,7 +74,6 @@ export class DomainService {
|
|||
|
||||
switchDomain(value: string) {
|
||||
this.selectDomain(value);
|
||||
this.domainSwitched.next(value);
|
||||
this.router.navigate([this.getNavigationUrl()]);
|
||||
}
|
||||
|
||||
|
@ -73,6 +85,26 @@ export class DomainService {
|
|||
return this.domainSelectedValue;
|
||||
}
|
||||
|
||||
addMasterDomain() {
|
||||
if (this.domainValue.some(domain => domain !== '')) {
|
||||
this.dataObs$.next(this.addEmptyDomain(this.domainRestValue));
|
||||
}
|
||||
}
|
||||
|
||||
removeMasterDomain() {
|
||||
if (this.domainValue.some(domain => domain === '')) {
|
||||
this.domainValue = this.domainRestValue;
|
||||
this.dataObs$.next(this.domainValue);
|
||||
}
|
||||
}
|
||||
|
||||
private addEmptyDomain(domains: Array<string>): Array<string> {
|
||||
this.domainValue = Object.assign([], domains);
|
||||
this.domainValue.unshift('');
|
||||
return this.domainValue;
|
||||
}
|
||||
|
||||
|
||||
private getNavigationUrl(): string {
|
||||
if (this.router.url.indexOf('workbaskets') !== -1) {
|
||||
return 'administration/workbaskets';
|
||||
|
|
|
@ -10,7 +10,7 @@ export class SelectedRouteService {
|
|||
|
||||
private detailRoutes: Array<string> = ['workbaskets', 'classifications', 'monitor', 'workplace'];
|
||||
|
||||
constructor(private route: ActivatedRoute, private router: Router) { }
|
||||
constructor(private router: Router) { }
|
||||
|
||||
|
||||
selectRoute(value) {
|
||||
|
|
|
@ -193,7 +193,7 @@ export class WorkbasketService {
|
|||
query += requiredPermission ? `${this.REQUIREDPERMISSION}=${requiredPermission}&` : '';
|
||||
query += page ? `${this.PAGE}=${page}&` : '';
|
||||
query += pageSize ? `${this.PAGESIZE}=${pageSize}&` : '';
|
||||
query += domain ? `${this.DOMAIN}=${domain}&` : '';
|
||||
query += domain !== undefined ? `${this.DOMAIN}=${domain}&` : '';
|
||||
|
||||
if (query.lastIndexOf('&') === query.length - 1) {
|
||||
query = query.slice(0, query.lastIndexOf('&'))
|
||||
|
|
Loading…
Reference in New Issue