Skip to content

Commit

Permalink
fix(deployments): remove unused imports and properties
Browse files Browse the repository at this point in the history
Remove unused HTTP-related imports and properties as DeploymentsService now delegates all of this
work to DeploymentApiService

related to openshiftio/openshift.io#2925
  • Loading branch information
andrewazores committed Apr 12, 2018
1 parent 47dbbcc commit 4125b9c
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/app/space/create/deployments/services/deployments.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import {
OnDestroy
} from '@angular/core';

import {
Headers,
Http,
Response
} from '@angular/http';
import { Response } from '@angular/http';

import {
Observable,
Expand All @@ -19,10 +15,6 @@ import {
Subscription
} from 'rxjs';

import { AuthenticationService } from 'ngx-login-client';

import { WIT_API_URL } from 'ngx-fabric8-wit';

import { NotificationsService } from 'app/shared/notifications.service';
import {
Logger,
Expand Down Expand Up @@ -201,31 +193,20 @@ export class DeploymentsService implements OnDestroy {
static readonly FRONT_LOAD_SAMPLES: number = 15;
static readonly FRONT_LOAD_WINDOW_WIDTH: number = DeploymentsService.FRONT_LOAD_SAMPLES * DeploymentsService.POLL_RATE_MS;

private readonly headers: Headers = new Headers({ 'Content-Type': 'application/json' });
private readonly apiUrl: string;

private readonly appsObservables: Map<string, Observable<Application[]>> = new Map<string, Observable<Application[]>>();
private readonly envsObservables: Map<string, Observable<EnvironmentStat[]>> = new Map<string, Observable<EnvironmentStat[]>>();
private readonly timeseriesSubjects: Map<string, Subject<TimeseriesData[]>> = new Map<string, Subject<TimeseriesData[]>>();

private readonly serviceSubscriptions: Subscription[] = [];

constructor(
private readonly http: Http,
private readonly apiService: DeploymentApiService,
private readonly auth: AuthenticationService,
private readonly logger: Logger,
private readonly errorHandler: ErrorHandler,
private readonly notifications: NotificationsService,
@Inject(WIT_API_URL) private readonly witUrl: string,
@Inject(TIMER_TOKEN) private readonly pollTimer: Observable<void>,
@Inject(TIMESERIES_SAMPLES_TOKEN) private readonly timeseriesSamples: number
) {
if (this.auth.getToken() != null) {
this.headers.set('Authorization', `Bearer ${this.auth.getToken()}`);
}
this.apiUrl = witUrl + 'deployments/spaces/';
}
) { }

ngOnDestroy(): void {
this.serviceSubscriptions.forEach((sub: Subscription) => {
Expand Down

0 comments on commit 4125b9c

Please sign in to comment.