Skip to content
Permalink
Browse files
upgrade helix-front to Angular 6.1 (#2083)
Fix security vulnerabilities in helix-front dependencies.
Upgrade helix-front dependencies to improve contributor productivity.
  • Loading branch information
micahstubbs committed Jun 1, 2022
1 parent 5909a8a commit a0999cd6e6dc221c5c4291900a898082f36f364c
Show file tree
Hide file tree
Showing 24 changed files with 13,916 additions and 8,742 deletions.

This file was deleted.

@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
@@ -0,0 +1,131 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"helix-front": {
"root": "",
"sourceRoot": "client",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/public",
"index": "client/index.html",
"main": "client/main.ts",
"tsConfig": "client/tsconfig.app.json",
"polyfills": "client/polyfills.ts",
"assets": [
"client/assets",
"client/favicon.ico"
],
"styles": [
"client/styles.scss",
"client/theme.scss"
],
"scripts": []
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "client/environments/environment.ts",
"with": "client/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "helix-front:build",
"proxyConfig": "./proxy.conf.json"
},
"configurations": {
"production": {
"browserTarget": "helix-front:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "helix-front:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "client/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "client/polyfills.ts",
"tsConfig": "client/tsconfig.spec.json",
"scripts": [],
"styles": [
"client/styles.scss",
"client/theme.scss"
],
"assets": [
"client/assets",
"client/favicon.ico"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": []
}
}
}
},
"helix-front-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "helix-front:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": []
}
}
}
}
},
"defaultProject": "helix-front",
"schematics": {
"@schematics/angular:component": {
"prefix": "hi",
"styleext": "scss"
},
"@schematics/angular:directive": {
"prefix": "hi"
}
}
}
@@ -1,3 +1,5 @@

import {map} from 'rxjs/operators';
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material';
@@ -42,8 +44,8 @@ export class ClusterDetailComponent implements OnInit {

ngOnInit() {
this.clusterService.can().subscribe(data => this.can = data);
this.route.params
.map(p => p.name)
this.route.params.pipe(
map(p => p.name))
.subscribe(name => {
this.clusterName = name;
this.loadCluster();
@@ -1,3 +1,5 @@

import {map} from 'rxjs/operators';
import { Injectable } from '@angular/core';

import { Cluster } from './cluster.model';
@@ -8,21 +10,21 @@ export class ClusterService extends HelixService {

public getAll() {
return this
.request('/clusters')
.map(data => {
.request('/clusters').pipe(
map(data => {
return data
.clusters
.sort()
.map(name => <Cluster>({name: name}));
});
}));
}

public get(name: string) {
return this
.request(`/clusters/${ name }`)
.map(data => {
.request(`/clusters/${ name }`).pipe(
map(data => {
return new Cluster(data);
});
}));
}

public create(name: string) {
@@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { map } from 'rxjs/operators'

import { HelixService } from '../../core/helix.service';
import { Controller } from './controller.model';
@@ -9,15 +10,15 @@ export class ControllerService extends HelixService {
public get(clusterName: string) {
return this
.request(`/clusters/${clusterName}/controller`)
.map(data => {
.pipe(map(data => {
return new Controller(
data.controller,
clusterName,
data.LIVE_INSTANCE,
data.SESSION_ID,
data.HELIX_VERSION
);
});
}));
}

}
@@ -1,7 +1,10 @@

import {throwError as observableThrowError, Observable } from 'rxjs';

import {catchError} from 'rxjs/operators';
import { Injectable } from '@angular/core';
import { HttpHeaders, HttpClient, HttpResponse } from '@angular/common/http';
import { Router } from '@angular/router';
import { Observable } from 'rxjs/Rx';

import { Settings } from './settings';

@@ -13,10 +16,10 @@ export class HelixService {
private http: HttpClient
) { }

public can(): Observable<boolean> {
public can(): Observable<any> {
return this.http
.get(`${ Settings.userAPI }/can`, { headers: this.getHeaders() })
.catch(this.errorHandler);
.get(`${ Settings.userAPI }/can`, { headers: this.getHeaders() }).pipe(
catchError(this.errorHandler));
}

protected request(path: string, helix?: string): Observable<any> {
@@ -29,8 +32,8 @@ export class HelixService {
.get(
`${Settings.helixAPI}${helix}${path}`,
{ headers: this.getHeaders() }
)
.catch(this.errorHandler);
).pipe(
catchError(this.errorHandler));
}

protected post(path: string, data: string): Observable<any> {
@@ -39,8 +42,8 @@ export class HelixService {
`${Settings.helixAPI}${this.getHelixKey()}${path}`,
data,
{ headers: this.getHeaders() }
)
.catch(this.errorHandler);
).pipe(
catchError(this.errorHandler));
}

protected put(path: string, data: string): Observable<any> {
@@ -49,17 +52,17 @@ export class HelixService {
`${Settings.helixAPI}${this.getHelixKey()}${path}`,
data,
{ headers: this.getHeaders() }
)
.catch(this.errorHandler);
).pipe(
catchError(this.errorHandler));
}

protected delete(path: string): Observable<any> {
return this.http
.delete(
`${Settings.helixAPI}${this.getHelixKey()}${path}`,
{ headers: this.getHeaders() }
)
.catch(this.errorHandler);
).pipe(
catchError(this.errorHandler));
}

protected getHelixKey(): string {
@@ -91,6 +94,6 @@ export class HelixService {
}
}

return Observable.throw(message);
return observableThrowError(message);
}
}
@@ -1,7 +1,9 @@

import {catchError} from 'rxjs/operators';
import { Injectable } from '@angular/core';
import { HttpHeaders, HttpClient, HttpResponse } from '@angular/common/http';
import { Router } from '@angular/router';
import { Observable } from 'rxjs/Rx';
import { Observable } from 'rxjs';

import { Settings } from './settings';

@@ -15,8 +17,8 @@ export class UserService {

public getCurrentUser(): Observable<string | object> {
return this.http
.get(`${ Settings.userAPI }/current`, { headers: this.getHeaders() })
.catch(_ => _);
.get(`${ Settings.userAPI }/current`, { headers: this.getHeaders() }).pipe(
catchError(_ => _));
}

public login(username: string, password: string): Observable<object> {
@@ -7,6 +7,7 @@ import {
} from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { Observable, Subscription } from 'rxjs';
import { map } from 'rxjs/operators';

import * as _ from 'lodash';
import { VisNode, VisNodes, VisEdges, VisNetworkService, VisNetworkData, VisNetworkOptions } from 'ngx-vis';
@@ -142,7 +143,7 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy {

// load data
this.route.parent.params
.map(p => p.name)
.pipe(map(p => p.name))
.subscribe(name => {
this.clusterName = name;
this.fetchResources();

0 comments on commit a0999cd

Please sign in to comment.