Skip to content

Commit f3d7af9

Browse files
committed
Merge remote-tracking branch 'origin/v2-master' into apps-filter-box-tweak
2 parents 0e6bfc5 + 7948017 commit f3d7af9

File tree

75 files changed

+702
-270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+702
-270
lines changed

docs/status_updates.md

+12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
Weekly status updates are published here.
44

5+
## 30th November 2018
6+
7+
A quieter week for the Stratos team - with some out on vacation as we head towards the festive season.
8+
9+
PRs this week:
10+
11+
- Make the table multi actions more obvious [\#3251](https://github.com/cloudfoundry-incubator/stratos/pull/3251)
12+
- Hide app vars tab if user is not a space developer [\#3247](https://github.com/cloudfoundry-incubator/stratos/pull/3247)
13+
- Improve resilience of e2e tests [\#3246](https://github.com/cloudfoundry-incubator/stratos/pull/3246)
14+
- App Wall filter and sort controls size tweaks [\#3243](https://github.com/cloudfoundry-incubator/stratos/pull/3243)
15+
- Deploy App: Add notification toast [\#3242](https://github.com/cloudfoundry-incubator/stratos/pull/3242)
16+
517
## 23rd November 2018
618

719
We've been continuing to test Stratos 2.2.0 and improving test automation and E2E test reliability.
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Component, Inject, ViewEncapsulation } from '@angular/core';
2-
import { Router } from '@angular/router';
32
import { Store } from '@ngrx/store';
3+
44
import { Customizations, CustomizationsMetadata } from '../../core/customizations.types';
5+
import { StratosLoginComponent } from '../../core/extension/extension-service';
56
import { LoginPageComponent } from '../../features/login/login-page/login-page.component';
67
import { AppState } from '../../store/app-state';
7-
import { StratosLoginComponent } from '../../core/extension/extension-service';
88

99
@StratosLoginComponent()
1010
@Component({
@@ -17,9 +17,8 @@ export class AcmeLoginComponent extends LoginPageComponent {
1717

1818
constructor(
1919
store: Store<AppState>,
20-
router: Router,
2120
@Inject(Customizations) public config: CustomizationsMetadata
2221
) {
23-
super(store, router);
24-
}
22+
super(store);
23+
}
2524
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<mat-card>
2+
<b>ACME Support Info</b>
3+
<app-metadata-item iconFont="stratos-icons" icon="products" label="Documentation">
4+
<a target="_balnk" noopener noreferrer href="https://docs.cloudfoundry.org/">https://docs.cloudfoundry.org</a>
5+
</app-metadata-item>
6+
<app-metadata-item icon="language" label="Online Support">
7+
<a target="_balnk" noopener noreferrer href="https://www.suse.com">https://www.suse.com</a>
8+
</app-metadata-item>
9+
<app-metadata-item icon="email" label="Contact Support by Email">
10+
<a href="mailto:" noopener noreferrer>[email protected]</a>
11+
</app-metadata-item>
12+
</mat-card>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mat-card {
2+
margin-bottom: 24px;
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { AcmeSupportInfoComponent } from './acme-support-info.component';
4+
import { CoreModule } from '../../core/core.module';
5+
import { SharedModule } from '../../shared/shared.module';
6+
7+
describe('AcmeSupportInfoComponent', () => {
8+
let component: AcmeSupportInfoComponent;
9+
let fixture: ComponentFixture<AcmeSupportInfoComponent>;
10+
11+
beforeEach(async(() => {
12+
TestBed.configureTestingModule({
13+
declarations: [ AcmeSupportInfoComponent ],
14+
imports: [
15+
CoreModule,
16+
SharedModule
17+
]
18+
})
19+
.compileComponents();
20+
}));
21+
22+
beforeEach(() => {
23+
fixture = TestBed.createComponent(AcmeSupportInfoComponent);
24+
component = fixture.componentInstance;
25+
fixture.detectChanges();
26+
});
27+
28+
it('should create', () => {
29+
expect(component).toBeTruthy();
30+
});
31+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-acme-support-info',
5+
templateUrl: './acme-support-info.component.html',
6+
styleUrls: ['./acme-support-info.component.scss']
7+
})
8+
export class AcmeSupportInfoComponent {
9+
10+
constructor() { }
11+
12+
}

examples/custom-src/frontend/app/custom/custom.module.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ import { SharedModule } from '../shared/shared.module';
66
import { AcmeLoginComponent } from './acme-login/acme-login.component';
77
import { AppTabExtensionComponent } from './app-tab-extension/app-tab-extension.component';
88
import { AppActionExtensionComponent } from './app-action-extension/app-action-extension.component';
9+
import { AcmeSupportInfoComponent } from './acme-support-info/acme-support-info.component';
910

1011
const AcmeCustomizations: CustomizationsMetadata = {
1112
copyright: '&copy; 2018 ACME Corp',
1213
hasEula: true,
14+
supportInfoComponent: AcmeSupportInfoComponent,
1315
};
1416

1517
@NgModule({
@@ -21,13 +23,15 @@ const AcmeCustomizations: CustomizationsMetadata = {
2123
declarations: [
2224
AcmeLoginComponent,
2325
AppTabExtensionComponent,
24-
AppActionExtensionComponent
26+
AppActionExtensionComponent,
27+
AcmeSupportInfoComponent
2528
],
2629
entryComponents: [
2730
AcmeLoginComponent,
2831
// You must specify the tab and action as an entry components
2932
AppTabExtensionComponent,
30-
AppActionExtensionComponent
33+
AppActionExtensionComponent,
34+
AcmeSupportInfoComponent
3135
],
3236
providers: [
3337
{ provide: Customizations, useValue: AcmeCustomizations }

src/frontend/app/app.module.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { RouterStateSerializer, StoreRouterConnectingModule } from '@ngrx/router
77
import { AppComponent } from './app.component';
88
import { RouteModule } from './app.routing';
99
import { CoreModule } from './core/core.module';
10-
import { DynamicExtenstionRoutes } from './core/extension/dynamic-extension-routes';
10+
import { DynamicExtensionRoutes } from './core/extension/dynamic-extension-routes';
1111
import { ExtensionService } from './core/extension/extension-service';
1212
import { getGitHubAPIURL, GITHUB_API_URL } from './core/github.helpers';
1313
import { CustomImportModule } from './custom-import.module';
@@ -83,7 +83,7 @@ export class CustomRouterStateSerializer
8383
providers: [
8484
LoggedInService,
8585
ExtensionService,
86-
DynamicExtenstionRoutes,
86+
DynamicExtensionRoutes,
8787
{ provide: GITHUB_API_URL, useFactory: getGitHubAPIURL },
8888
{ provide: RouterStateSerializer, useClass: CustomRouterStateSerializer } // Create action for router navigation
8989
],

src/frontend/app/core/customizations.types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export interface CustomizationsMetadata {
77
hasEula?: boolean;
88
copyright?: string;
99
logoText?: string;
10+
supportInfoComponent?: any;
1011
}
1112

1213
export const Customizations = new InjectionToken<CustomizationsMetadata>('Stratos customizations');

src/frontend/app/core/extension/dynamic-extension-routes.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Injectable } from '@angular/core';
2-
import { CanActivate, Router, RouterStateSnapshot, ActivatedRouteSnapshot, Route } from '@angular/router';
2+
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';
33
import { Observable } from 'rxjs';
4+
45
import { getRoutesFromExtensions, StratosRouteType } from './extension-service';
56

67
/**
@@ -18,13 +19,13 @@ import { getRoutesFromExtensions, StratosRouteType } from './extension-service';
1819
*/
1920

2021
@Injectable()
21-
export class DynamicExtenstionRoutes implements CanActivate {
22-
constructor(private router: Router) {}
22+
export class DynamicExtensionRoutes implements CanActivate {
23+
constructor(private router: Router) { }
2324

2425
canActivate(
2526
route: ActivatedRouteSnapshot,
2627
state: RouterStateSnapshot
27-
): Observable<boolean>|Promise<boolean>|boolean {
28+
): Observable<boolean> | Promise<boolean> | boolean {
2829
const childRoutes = this.getChildRoutes(route.parent.routeConfig);
2930
// Remove the last route (which is us, the '**' route)
3031
let newChildRoutes = childRoutes.splice(0, childRoutes.length - 1);
@@ -42,6 +43,7 @@ export class DynamicExtenstionRoutes implements CanActivate {
4243
// Update the route config and navigate again to the same route that was intercepted
4344
this.setChildRoutes(route.parent.routeConfig, newChildRoutes);
4445
this.router.navigateByUrl(state.url);
46+
4547
return false;
4648
}
4749

src/frontend/app/features/about/about-page/about-page.component.html

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<button [routerLink]="['eula']" mat-button mat-raised-button color="primary">View EULA</button>
1313
</mat-card>
1414

15+
<template #supportInfoContainer></template>
16+
1517
<mat-card *ngIf="(sessionData$ | async) as session" class="about-page__card">
1618
<app-metadata-item icon="web_asset" label="Stratos Version">{{ session.version.proxy_version }}</app-metadata-item>
1719
<app-metadata-item icon="person" label="User">{{ session.user.name }}</app-metadata-item>

src/frontend/app/features/about/about-page/about-page.component.scss

+6-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
margin-bottom: 24px;
1818
text-align: center;
1919
}
20-
&__card {
21-
margin-bottom: 24px;
22-
z-index: 1;
23-
}
2420
&__eula {
2521
align-items: center;
2622
display: flex;
@@ -46,3 +42,9 @@
4642
margin-right: 8px;
4743
}
4844
}
45+
46+
// Cards on the about page should have spacing below each card
47+
.mat-card {
48+
margin-bottom: 24px;
49+
z-index: 1;
50+
}

src/frontend/app/features/about/about-page/about-page.component.ts

+34-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
import { Component, Inject, OnInit } from '@angular/core';
1+
import {
2+
Component,
3+
ComponentFactory,
4+
ComponentFactoryResolver,
5+
ComponentRef,
6+
Inject,
7+
OnDestroy,
8+
OnInit,
9+
ViewChild,
10+
ViewContainerRef
11+
} from '@angular/core';
212
import { Store } from '@ngrx/store';
313
import { Observable } from 'rxjs';
414
import { filter, map } from 'rxjs/operators';
@@ -12,14 +22,20 @@ import { SessionData } from '../../../store/types/auth.types';
1222
templateUrl: './about-page.component.html',
1323
styleUrls: ['./about-page.component.scss']
1424
})
15-
export class AboutPageComponent implements OnInit {
25+
export class AboutPageComponent implements OnInit, OnDestroy {
1626

1727
sessionData$: Observable<SessionData>;
1828
versionNumber$: Observable<string>;
1929
userIsAdmin$: Observable<boolean>;
2030

21-
constructor(private store: Store<AppState>, @Inject(Customizations) public customizations: CustomizationsMetadata) { }
31+
@ViewChild('supportInfoContainer', { read: ViewContainerRef }) supportInfoContainer;
2232

33+
componentRef: ComponentRef<any>;
34+
35+
constructor(
36+
private store: Store<AppState>,
37+
private resolver: ComponentFactoryResolver,
38+
@Inject(Customizations) public customizations: CustomizationsMetadata) { }
2339
ngOnInit() {
2440
this.sessionData$ = this.store.select(s => s.auth).pipe(
2541
filter(auth => !!(auth && auth.sessionData)),
@@ -36,6 +52,21 @@ export class AboutPageComponent implements OnInit {
3652
return versionNumber.split('-')[0];
3753
})
3854
);
55+
56+
this.addSupportInfo();
3957
}
4058

59+
ngOnDestroy() {
60+
if (this.componentRef) {
61+
this.componentRef.destroy();
62+
}
63+
}
64+
65+
addSupportInfo() {
66+
this.supportInfoContainer.clear();
67+
if (this.customizations.supportInfoComponent) {
68+
const factory: ComponentFactory<any> = this.resolver.resolveComponentFactory(this.customizations.supportInfoComponent);
69+
this.componentRef = this.supportInfoContainer.createComponent(factory);
70+
}
71+
}
4172
}

src/frontend/app/features/applications/applications.routing.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { NgModule } from '@angular/core';
22
import { RouterModule, Routes } from '@angular/router';
33

4+
import { DynamicExtensionRoutes } from '../../core/extension/dynamic-extension-routes';
5+
import { StratosActionType, StratosTabType } from '../../core/extension/extension-service';
6+
import { PageNotFoundComponentComponent } from '../../core/page-not-found-component/page-not-found-component.component';
47
import {
58
AddServiceInstanceComponent,
69
} from '../../shared/components/add-service-instance/add-service-instance/add-service-instance.component';
@@ -25,9 +28,6 @@ import { DeployApplicationModule } from './deploy-application/deploy-application
2528
import { EditApplicationComponent } from './edit-application/edit-application.component';
2629
import { AddRouteStepperComponent } from './routes/add-route-stepper/add-route-stepper.component';
2730
import { SshApplicationComponent } from './ssh-application/ssh-application.component';
28-
import { DynamicExtenstionRoutes } from '../../core/extension/dynamic-extension-routes';
29-
import { StratosActionType, StratosTabType, extensionsActionRouteKey } from '../../core/extension/extension-service';
30-
import { PageNotFoundComponentComponent } from '../../core/page-not-found-component/page-not-found-component.component';
3131

3232
const applicationsRoutes: Routes = [
3333
{
@@ -94,7 +94,7 @@ const applicationsRoutes: Routes = [
9494
{
9595
path: '**',
9696
component: PageNotFoundComponentComponent,
97-
canActivate: [DynamicExtenstionRoutes],
97+
canActivate: [DynamicExtensionRoutes],
9898
data: {
9999
stratosRouteGroup: StratosTabType.Application
100100
}
@@ -108,7 +108,7 @@ const applicationsRoutes: Routes = [
108108
{
109109
path: '**',
110110
component: PageNotFoundComponentComponent,
111-
canActivate: [DynamicExtenstionRoutes],
111+
canActivate: [DynamicExtensionRoutes],
112112
data: {
113113
stratosRouteGroup: StratosActionType.Application
114114
}
@@ -120,7 +120,7 @@ const applicationsRoutes: Routes = [
120120
{
121121
path: '**',
122122
component: PageNotFoundComponentComponent,
123-
canActivate: [DynamicExtenstionRoutes],
123+
canActivate: [DynamicExtensionRoutes],
124124
data: {
125125
stratosRouteGroup: StratosActionType.Applications
126126
}

src/frontend/app/features/applications/deploy-application/deploy-application-step3/deploy-application-step3.component.ts

+11-16
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
of as observableOf,
99
Subscription,
1010
} from 'rxjs';
11-
import { filter, first, map, startWith, tap } from 'rxjs/operators';
11+
import { filter, first, map, startWith } from 'rxjs/operators';
1212

1313
import { safeUnsubscribe } from '../../../../core/utils.service';
1414
import {
@@ -99,26 +99,21 @@ export class DeployApplicationStep3Component implements OnDestroy {
9999
if (this.deployer && !this.deployer.deploying) {
100100
this.deployer.close();
101101
} else {
102-
this.setupCompetionNofication();
102+
this.setupCompletionNotification();
103103
}
104104
}
105105

106-
private setupCompetionNofication() {
106+
private setupCompletionNotification() {
107107
this.deployer.status$.pipe(
108-
tap(status => {
109-
if (!status.deploying) {
110-
if (status.error) {
111-
this.snackBar.open(status.errorMsg, 'Dismiss');
112-
} else {
113-
const ref = this.snackBar.open('Application deployment complete', 'View', { duration: 5000 });
114-
ref.onAction().subscribe(() => { this.goToAppSummary(); });
115-
}
116-
}
117-
}),
118-
map((status: any) => status.deploying),
119-
filter(deploying => !deploying),
108+
filter(status => !status.deploying),
120109
first()
121-
).subscribe(() => {
110+
).subscribe(status => {
111+
if (status.error) {
112+
this.snackBar.open(status.errorMsg, 'Dismiss');
113+
} else {
114+
const ref = this.snackBar.open('Application deployment complete', 'View', { duration: 5000 });
115+
ref.onAction().subscribe(() => { this.goToAppSummary(); });
116+
}
122117
this.deployer.close();
123118
});
124119
}

src/frontend/app/features/applications/routes/add-route-stepper/add-route-stepper.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<h1>Create Route</h1>
33
</app-page-header>
44
<app-steppers [cancel]="step1.appUrl">
5-
<app-step title="Create Route" [onNext]="step1.submit" [valid]="step1.validate()" cancelButtonText="Cancel" finishButtonText="Submit">
5+
<app-step title="Create Route" [onNext]="step1.submit" [valid]="step1.validate()" cancelButtonText="Cancel" [finishButtonText]="step1.addRouteMode.submitLabel">
66
<app-add-routes #step1></app-add-routes>
77
</app-step>
88
</app-steppers>

0 commit comments

Comments
 (0)