Skip to content

Commit

Permalink
Upgrade to latest patternfly-ng
Browse files Browse the repository at this point in the history
Backports PR #1011
  • Loading branch information
Chris Houseknecht authored Aug 9, 2018
1 parent 10aec31 commit 077ebfa
Show file tree
Hide file tree
Showing 38 changed files with 1,190 additions and 1,868 deletions.
60 changes: 30 additions & 30 deletions galaxyui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,41 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^5.2.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"core-js": "^2.4.1",
"patternfly": "^3.48.4",
"patternfly-ng": "^3.3.4",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"
"@angular/animations": "^6.1.1",
"@angular/common": "^6.1.1",
"@angular/compiler": "^6.1.1",
"@angular/core": "^6.1.1",
"@angular/forms": "^6.1.1",
"@angular/http": "^6.1.1",
"@angular/platform-browser": "^6.1.1",
"@angular/platform-browser-dynamic": "^6.1.1",
"@angular/router": "^6.1.1",
"core-js": "^2.5.7",
"patternfly": "^3.54.1",
"patternfly-ng": "4.2.0",
"rxjs": "^6.2.2",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.6.8",
"@angular/cli": "6.0.5",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/jasmine": "~2.8.3",
"@angular-devkit/build-angular": "~0.7.2",
"@angular/cli": "6.1.2",
"@angular/compiler-cli": "^6.1.1",
"@angular/language-service": "^6.1.1",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"@types/node": "~10.5.5",
"codelyzer": "^4.4.2",
"jasmine-core": "~3.1.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma": "~2.0.5",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"prettier": "1.14.0",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.5.3"
"karma-coverage-istanbul-reporter": "^2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^1.2.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": ">=2.7.2 <2.10.0"
}
}
14 changes: 7 additions & 7 deletions galaxyui/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import { NavigationEnd, NavigationStart, Router } from '@angular/router';
import { BsModalService } from 'ngx-bootstrap/modal';
import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service';

import { AboutModalConfig } from 'patternfly-ng/modal/about-modal-config';
import { AboutModalEvent } from 'patternfly-ng/modal/about-modal-event';
import { NavigationItemConfig } from 'patternfly-ng/navigation/navigation-item-config';
import { AboutModalConfig, AboutModalEvent } from 'patternfly-ng/modal';

import { VerticalNavigationItem } from 'patternfly-ng/navigation/vertical-navigation/vertical-navigation-item';
import { Notification } from 'patternfly-ng/notification';
import { NotificationService } from 'patternfly-ng/notification/notification-service/notification.service';

Expand Down Expand Up @@ -59,7 +59,7 @@ export class AppComponent implements OnInit {
});
}

navItems: NavigationItemConfig[] = [];
navItems: VerticalNavigationItem[] = [];
modalRef: BsModalRef;
authenticated = false;
username: string = null;
Expand Down Expand Up @@ -115,7 +115,7 @@ export class AppComponent implements OnInit {
iconStyleClass: 'fa fa-users',
url: '/community',
},
] as NavigationItemConfig[];
] as VerticalNavigationItem[];

this.apiRootService.get().subscribe(apiInfo => {
this.aboutConfig.productInfo.push({ name: 'Server Version', value: apiInfo.server_version });
Expand Down Expand Up @@ -192,12 +192,12 @@ export class AppComponent implements OnInit {
this.removeNavButtons();
}

onItemClicked($event: NavigationItemConfig): void {
onItemClicked($event: VerticalNavigationItem): void {
console.log('item clicked');
console.log($event);
}

onNavigation($event: NavigationItemConfig): void {
onNavigation($event: VerticalNavigationItem): void {
console.log('navigation started');
console.log($event);
}
Expand Down
13 changes: 5 additions & 8 deletions galaxyui/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';

import { HttpClientModule, HttpClientXsrfModule } from '@angular/common/http';

import { ModalModule, NavigationModule } from 'patternfly-ng';
import { ToastNotificationModule, VerticalNavigationModule } from 'patternfly-ng';

import { BsDropdownModule, ModalModule as BsModalModule, TooltipModule } from 'ngx-bootstrap';
import { BsDropdownModule, ModalModule, TooltipModule } from 'ngx-bootstrap';

import { NotificationService } from 'patternfly-ng/notification/notification-service/notification.service';
import { NotificationModule } from 'patternfly-ng/notification/notification.module';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
Expand Down Expand Up @@ -50,16 +49,14 @@ import { VendorsModule } from './vendors/vendors.module';
}),
TooltipModule,
BrowserModule,
NavigationModule,
VerticalNavigationModule,
BsDropdownModule.forRoot(),
BsModalModule.forRoot(),
NotificationModule,
ModalModule.forRoot(),
HomeModule,
LoginModule,
MyContentModule,
// MyImportsModule,
// SearchModule,
ModalModule,
ToastNotificationModule,
ContentDetailModule,
ExceptionPagesModule,
VendorsModule,
Expand Down
37 changes: 22 additions & 15 deletions galaxyui/src/app/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { Injectable } from '@angular/core';

import { HttpClient, HttpHeaders } from '@angular/common/http';

import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { Observable, of } from 'rxjs';

import { map } from 'rxjs/operators';

import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';

Expand Down Expand Up @@ -33,19 +34,23 @@ export class AuthService implements CanActivate {
if (this.meCache) {
return of(this.meCache);
}
return this.http.get<IMe>(this.meUrl, { headers: this.headers }).map(result => {
this.meCache = result;
return result;
});
return this.http.get<IMe>(this.meUrl, { headers: this.headers }).pipe(
map(result => {
this.meCache = result;
return result;
}),
);
}

logout(): Observable<any> {
this.meCache = null;
return this.http.post('/api/v1/account/logout', {}, { headers: this.headers }).map(result => {
this.meCache = null;
this.redirectUrl = '/home';
return result;
});
return this.http.post('/api/v1/account/logout', {}, { headers: this.headers }).pipe(
map(result => {
this.meCache = null;
this.redirectUrl = '/home';
return result;
}),
);
}

checkPermissions(route: ActivatedRouteSnapshot): boolean {
Expand Down Expand Up @@ -73,9 +78,11 @@ export class AuthService implements CanActivate {
observer.complete();
});
}
return this.http.get<IMe>(this.meUrl, { headers: this.headers }).map(result => {
this.meCache = result;
return this.checkPermissions(route);
});
return this.http.get<IMe>(this.meUrl, { headers: this.headers }).pipe(
map(result => {
this.meCache = result;
return this.checkPermissions(route);
}),
);
}
}
19 changes: 11 additions & 8 deletions galaxyui/src/app/authors/authors.resolver.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Injectable } from '@angular/core';

import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';

import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';

import { Namespace } from '../resources/namespaces/namespace';
import { NamespaceService } from '../resources/namespaces/namespace.service';
Expand All @@ -25,13 +26,15 @@ export class NamespaceDetailResolver implements Resolve<Namespace> {
const params = {
name__iexact: namespace,
};
return this.namespaceService.query(params).map(results => {
if (results && results.length) {
return results[0] as Namespace;
} else {
return {} as Namespace;
}
});
return this.namespaceService.query(params).pipe(
map(results => {
if (results && results.length) {
return results[0] as Namespace;
} else {
return {} as Namespace;
}
}),
);
}
}

Expand Down
3 changes: 1 addition & 2 deletions galaxyui/src/app/content-detail/content-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { ActivatedRoute, Router } from '@angular/router';

import * as moment from 'moment';

import { Observable } from 'rxjs/Observable';
import { forkJoin } from 'rxjs/observable/forkJoin';
import { forkJoin, Observable } from 'rxjs';

import { EmptyStateConfig } from 'patternfly-ng/empty-state/empty-state-config';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Injectable } from '@angular/core';

import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';

import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';

import { Content } from '../resources/content/content';
import { ContentService } from '../resources/content/content.service';
Expand Down Expand Up @@ -39,7 +40,7 @@ export class RepositoryResolver implements Resolve<Repository> {
name__iexact: repository,
provider_namespace__namespace__name__iexact: namespace,
};
return this.repositoryService.query(params).map(results => results[0]);
return this.repositoryService.query(params).pipe(map(results => results[0]));
}
}

Expand All @@ -51,6 +52,6 @@ export class NamespaceResolver implements Resolve<Namespace> {
const params = {
name__iexact: namespace,
};
return this.namespaceService.query(params).map(results => results[0]);
return this.namespaceService.query(params).pipe(map(results => results[0]));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ import { FilterType } from 'patternfly-ng/filter/filter-type';
import { PaginationConfig } from 'patternfly-ng/pagination/pagination-config';
import { PaginationEvent } from 'patternfly-ng/pagination/pagination-event';

import { Observable } from 'rxjs/Observable';
import { forkJoin } from 'rxjs/observable/forkJoin';
import { forkJoin, Observable } from 'rxjs';

@Component({
selector: 'module-utils-detail',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ import { FilterType } from 'patternfly-ng/filter/filter-type';
import { PaginationConfig } from 'patternfly-ng/pagination/pagination-config';
import { PaginationEvent } from 'patternfly-ng/pagination/pagination-event';

import { Observable } from 'rxjs/Observable';
import { forkJoin } from 'rxjs/observable/forkJoin';
import { forkJoin, Observable } from 'rxjs';

@Component({
selector: 'modules-detail',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import { FilterType } from 'patternfly-ng/filter/filter-type';
import { PaginationConfig } from 'patternfly-ng/pagination/pagination-config';
import { PaginationEvent } from 'patternfly-ng/pagination/pagination-event';

import { Observable } from 'rxjs/Observable';
import { forkJoin } from 'rxjs/observable/forkJoin';
import { forkJoin, Observable } from 'rxjs';

@Component({
selector: 'plugins-detail',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import { FilterType } from 'patternfly-ng/filter/filter-type';
import { PaginationConfig } from 'patternfly-ng/pagination/pagination-config';
import { PaginationEvent } from 'patternfly-ng/pagination/pagination-event';

import { Observable } from 'rxjs/Observable';
import { forkJoin } from 'rxjs/observable/forkJoin';
import { forkJoin, Observable } from 'rxjs';

@Component({
selector: 'roles-detail',
Expand Down
2 changes: 1 addition & 1 deletion galaxyui/src/app/home/home.resolver.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';

import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';

import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

import { ContentBlock } from '../resources/content-blocks/content-block';
import { ContentBlocksService } from '../resources/content-blocks/content-blocks.service';
Expand Down
16 changes: 9 additions & 7 deletions galaxyui/src/app/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import { ActivatedRoute, ParamMap } from '@angular/router';

import { CardConfig } from 'patternfly-ng/card/basic-card/card-config';

import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

import 'rxjs/add/operator/switchMap';
import { switchMap } from 'rxjs/operators';

import { AuthService } from '../auth/auth.service';

Expand All @@ -50,11 +50,13 @@ export class LoginComponent implements OnInit {

this.redirectUrl = this.authService.redirectUrl;

this.errorParam = this.route.paramMap.switchMap((params: ParamMap) => {
return new Observable<boolean>(observer => {
return observer.next(params.get('error') === 'true' ? true : false);
});
});
this.errorParam = this.route.paramMap.pipe(
switchMap((params: ParamMap) => {
return new Observable<boolean>(observer => {
return observer.next(params.get('error') === 'true' ? true : false);
});
}),
);

this.errorParam.subscribe(result => {
if (result) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { ListEvent } from 'patternfly-ng/list/list-event';
import { cloneDeep } from 'lodash';
import { BsModalRef } from 'ngx-bootstrap';

import { Observable } from 'rxjs/Observable';
import { forkJoin } from 'rxjs/observable/forkJoin';
import { forkJoin, Observable } from 'rxjs';

import { Namespace } from '../../resources/namespaces/namespace';
import { ProviderSourceService } from '../../resources/provider-namespaces/provider-source.service';
Expand Down
4 changes: 2 additions & 2 deletions galaxyui/src/app/my-content/my-content.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { MyContentRoutingModule } from './my-content.routing.module';

import { BsDropdownConfig, BsDropdownModule } from 'ngx-bootstrap';

import { ModalModule } from 'ngx-bootstrap/modal';
import { TooltipModule } from 'ngx-bootstrap/tooltip';
import { ModalModule } from 'patternfly-ng';
import { ActionModule } from 'patternfly-ng/action/action.module';
import { EmptyStateModule } from 'patternfly-ng/empty-state/empty-state.module';
import { FilterModule } from 'patternfly-ng/filter/filter.module';
Expand Down Expand Up @@ -55,7 +55,7 @@ import { NamespaceRepositoryActionComponent } from './namespace-list/content/rep
imports: [
ActionModule,
BsDropdownModule.forRoot(),
ModalModule,
ModalModule.forRoot(),
CommonModule,
EmptyStateModule,
FilterModule,
Expand Down
Loading

0 comments on commit 077ebfa

Please sign in to comment.