Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split out Kube code (with Helm & Workloads) into it's own package #475

Merged
merged 104 commits into from
Oct 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
cd44987
Ensure filename/no filename text in connect by file dialog is aligned…
richard-cox Jul 28, 2020
f627688
Add typed entity access and `custom-src` removal to change log (#4496)
richard-cox Aug 7, 2020
d7102e7
Fixes #4335: Create Stratos static web site with better documentation…
Aug 7, 2020
50617f7
Fix and update customization docs (#4478)
richard-cox Aug 7, 2020
b713c78
Update base README, point to website (#4488)
richard-cox Aug 7, 2020
e12f60f
Update developer docs (#4489)
richard-cox Aug 7, 2020
4209358
Fix docs (#4497)
richard-cox Aug 7, 2020
dc2d6d6
Ensure images dependent on techPreview flag are included in imagelist…
richard-cox Aug 18, 2020
4df1516
Improve clean-symlinks script (#4509)
nwmac Aug 18, 2020
3a8cd74
Change nginx ciphers and make configurable via helm chart values (#4507)
nwmac Aug 18, 2020
200726c
Update version to 4.0.1, add change log (#4514)
richard-cox Aug 18, 2020
0285873
Fix deploy from gitlab using a group's repo (#4479)
richard-cox Aug 20, 2020
ad64761
Add additional time ranges to base metrics range selector (#4480)
richard-cox Aug 20, 2020
d27a12d
Add some time saving comments to cf permissions checker (#4508)
richard-cox Aug 20, 2020
8da357a
Move tab-nav and xsrf module source files to the src folder (#4518)
nwmac Aug 21, 2020
286d508
Fix GitHub branch limit (#4510)
richard-cox Aug 21, 2020
9a70ea6
Remove use of nodejs util module (#4521)
nwmac Aug 21, 2020
77d5a20
Remove dependencies between store and core that have crept in (#4517)
nwmac Aug 21, 2020
027f9c3
Fix store testing package (#4520)
nwmac Aug 21, 2020
5214f9f
Fix the position of the header guide array (#4524)
richard-cox Aug 24, 2020
009c203
Metrics: Ensure trailing slashes are ignored when comparing URLs (#4527)
nwmac Aug 24, 2020
da6285c
Remove imports of the form 'frontend/....' (#4519)
nwmac Aug 24, 2020
307fc20
Move endpopints-health-check.ts (#4530)
nwmac Aug 24, 2020
0aefbb1
Add UMD Ids to external modules in store package (#4522)
nwmac Aug 24, 2020
55f2244
Improvements & more checks to autoscaler scheduled date tests (#4535)
richard-cox Aug 25, 2020
a0b338a
Remove api driven views (#4537)
nwmac Aug 25, 2020
0ea6632
Remove logger service and action history (#4538)
nwmac Aug 25, 2020
5eb7f0e
Add support for API keys (#4515)
ikapelyukhin Aug 25, 2020
68d5df7
Update moment imports to remove warning when building library (#4534)
nwmac Aug 25, 2020
3c157d1
Improve presentation and fix issue with development versions
nwmac Aug 25, 2020
46732d8
Merge remote-tracking branch 'origin/improve-monocular-ui' into helm-…
nwmac Aug 25, 2020
641ccf8
WIP
richard-cox Aug 26, 2020
d845669
Fix Helm upgrade bug (#4544)
nwmac Aug 26, 2020
303bbb7
Add support for Helm Upgrade and Helm history
nwmac Aug 27, 2020
62d1a77
Remove console logging
nwmac Aug 27, 2020
d2dbafd
Add comment
nwmac Aug 27, 2020
cc8e2ac
Minor tweaks following self-review
nwmac Aug 27, 2020
dc24e61
Merge remote-tracking branch 'origin/master' into helm-hub
richard-cox Aug 27, 2020
ac18f0b
WIP
richard-cox Aug 27, 2020
d665348
Merge remote-tracking branch 'origin/master' into helm-hub
richard-cox Aug 28, 2020
adcd11a
fix install button
richard-cox Aug 28, 2020
43b2c33
Fix actual helm install
richard-cox Aug 28, 2020
a0ab8b6
Remove helm repos view
richard-cox Aug 28, 2020
f6f2d9f
Store api_keys.last_used in UTC (#4541)
ikapelyukhin Sep 1, 2020
fd2ee0f
Show per endpoint type actions in endpoints table
richard-cox Aug 28, 2020
ffd0de0
Tidy up registration step
richard-cox Sep 1, 2020
8042df9
Tidy up provider interceptor pattern
richard-cox Sep 1, 2020
7916f8a
Tidy up services, fix charts list filter by repo/helm hub
richard-cox Sep 1, 2020
7247090
Add endpoint unRegisterable, make helm types sub types, tidy up
richard-cox Sep 1, 2020
412fbf2
Remove debug logging
nwmac Sep 2, 2020
c8250ee
Merge remote-tracking branch 'origin/master' into helm-features
nwmac Sep 2, 2020
cffb053
Fix whitespace
nwmac Sep 2, 2020
b560761
Add UI for Stratos API Keys (#4523)
richard-cox Sep 2, 2020
20d79e0
Minor tidy ups
nwmac Sep 2, 2020
d1915b8
Merge remote-tracking branch 'origin/master' into helm-features
nwmac Sep 2, 2020
545669a
Add basic e2e tests for API Keys (#4536)
richard-cox Sep 2, 2020
4c09409
Fix compile issue
nwmac Sep 2, 2020
9dcdcce
Fixed versions again, and bugs following subtype split
richard-cox Sep 2, 2020
043c5fd
Merge remote-tracking branch 'origin/master' into helm-hub
richard-cox Sep 2, 2020
509e018
Fix unit tests
richard-cox Sep 2, 2020
e815dc4
Add db migration script to update existing helm endpoints with repo s…
richard-cox Sep 2, 2020
3726821
Bump docusaurus version and add support for versioning (#4506)
richard-cox Sep 3, 2020
9e7e679
Fix front-end unit tests
nwmac Sep 3, 2020
b63e39a
API Keys: Make feature configurable for different user types (#4540)
ikapelyukhin Sep 4, 2020
c767913
Add docs for UAA SSO user permissions management (#4554)
richard-cox Sep 4, 2020
cfbfab8
Add basic developers guide for working with helm (#4511)
richard-cox Sep 4, 2020
0f2e499
Always show upgrade button
nwmac Sep 7, 2020
bb89eb5
Minor entity store type updates
richard-cox Sep 7, 2020
6af9d88
Enable/disable API keys UI given API keys config setting (#4559)
richard-cox Sep 7, 2020
6409469
Convert unRegisterable to registeredLimit
richard-cox Sep 7, 2020
559ecc4
Changes following review
richard-cox Sep 8, 2020
1744b9a
Merge remote-tracking branch 'origin/master' into helm-hub
richard-cox Sep 8, 2020
150da8a
Fix display of helm type in favourite cards
richard-cox Sep 8, 2020
857c54c
Multiple Fixes
richard-cox Sep 8, 2020
b844e8c
Align icons in workload summary page
richard-cox Sep 8, 2020
a987ee7
Enable linting for all packages (#4561)
richard-cox Sep 8, 2020
14125c2
Fix lint failures
richard-cox Sep 8, 2020
f5eb911
Merge remote-tracking branch 'origin/master' into helm-features
nwmac Sep 9, 2020
ed15df6
Address PR feedback
nwmac Sep 9, 2020
ac5625a
Revert
nwmac Sep 9, 2020
7114563
Remove description when checking for similar charts
nwmac Sep 10, 2020
e85f7c2
Only show button when the helm chart is available
nwmac Sep 10, 2020
051338a
Bump angular json schema form (#4564)
nwmac Sep 10, 2020
ef00d18
Docs: Update internal versions & Automate future updates (#4558)
richard-cox Sep 10, 2020
a357a83
Merge remote-tracking branch 'origin/helm-features' into helm-hub
richard-cox Sep 10, 2020
77869e1
Improve types, start work on helm hub upgrade
richard-cox Sep 10, 2020
19c6363
Fixes following merge
richard-cox Sep 10, 2020
d97a270
Merge remote-tracking branch 'origin/master' into helm-hub
richard-cox Sep 10, 2020
520aae9
Remove TODOs
richard-cox Sep 10, 2020
ab83546
Merge remote-tracking branch 'upstream/master' into merge-upstream
richard-cox Sep 10, 2020
b8b019a
Merge fixes, remove fdescribe already in master
richard-cox Sep 10, 2020
058fb38
Fix linting
richard-cox Sep 10, 2020
557778d
Merge remote-tracking branch 'origin/helm-hub' into create-kube-package
richard-cox Sep 10, 2020
2b0772a
Merge remote-tracking branch 'origin/merge-upstream' into create-kube…
richard-cox Sep 10, 2020
853b1be
Create kubernetes package
richard-cox Sep 10, 2020
6ef4327
Fix imports
richard-cox Sep 11, 2020
f9f78cf
Fix unit tests
richard-cox Sep 11, 2020
fdf6538
Merge remote-tracking branch 'origin/master' into create-kube-package
richard-cox Sep 17, 2020
bfccf06
Fixes following review
richard-cox Sep 17, 2020
6ef9d74
Merge remote-tracking branch 'origin/master' into create-kube-package
richard-cox Sep 21, 2020
8b0bf54
Fix unit tests
richard-cox Sep 21, 2020
3540db9
Merge remote-tracking branch 'origin/master' into create-kube-package
richard-cox Sep 25, 2020
2228579
Merge remote-tracking branch 'origin/master' into create-kube-package
nwmac Oct 2, 2020
d68fc84
Fix theming for suse login
nwmac Oct 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add UI for Stratos API Keys (cloudfoundry#4523)
* Add backend support for API keys

* Add last_used field to API keys

* Add base api keys page

* Add basic api key entity framework (untested)

* Add a basic api keys list (untested, need to wire in properties/columns + actions)

* Fix entity type related issues

* Add basic way to create api key

* Wire in delete to list

* Improve 'no api keys' ux

* Final tidy up

* Other fixes

* Fix unit tests

* Add 'Last Used' column to API keys list

* Don't flash up 'no entries' when we haven't loaded api keys yet

* Fix last used sorting
- takes into account timezone
- use cacheing to cater for often called sort

* Fix unit test after changes in master

* Fix after moment change

* Remove now unrequired sorting of api key last used date via moment

Co-authored-by: Ivan Kapelyukhin <ikapelyukhin@suse.com>
  • Loading branch information
richard-cox and ikapelyukhin authored Sep 2, 2020
commit b560761d2213af3cb756abc6bd7351da44d06947
1 change: 1 addition & 0 deletions src/frontend/packages/core/src/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const appRoutes: Routes = [
},
{ path: 'about', loadChildren: () => import('./features/about/about.module').then(m => m.AboutModule) },
{ path: 'user-profile', loadChildren: () => import('./features/user-profile/user-profile.module').then(m => m.UserProfileModule) },
{ path: 'api-keys', loadChildren: () => import('./features/api-keys/api-keys.module').then(m => m.ApiKeysModule) },
{ path: 'events', loadChildren: () => import('./features/event-page/event-page.module').then(m => m.EventPageModule) },
{
path: 'errors/:endpointId',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div class="key-dialog__loading-wrapper">
<mat-progress-bar class="key-dialog__loading"
[color]="(hasErrored$ | async) && !(isBusy$ | async) ? 'warn' : 'primary'"
[mode]="(isBusy$ | async) ? 'indeterminate' : 'solid'">
</mat-progress-bar>
</div>
<div class="key-dialog">
<div class="key-dialog__title">
<h2 mat-dialog-title>
Create an API Key
</h2>
</div>
<div>
</div>
<div [formGroup]="formGroup">
<mat-form-field>
<input matInput placeholder="Description" formControlName="comment" required>
</mat-form-field>
</div>

<app-dialog-error message="{{hasErrored$ | async}}" [show]="(hasErrored$ | async) && !(isBusy$ | async)">
</app-dialog-error>
<mat-dialog-actions class="key-dialog__actions">
<button [mat-dialog-close]="true" mat-button color="warn" [disabled]="(isBusy$ | async)">Cancel</button>
<button (click)="submit()" [disabled]="(isBusy$ | async) || !formGroup.valid" mat-button
color="primary">Create</button>
</mat-dialog-actions>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.key-dialog {
&__loading {
left: 0;
position: absolute;
right: 0;
top: 0;
&-wrapper {
position: relative;
margin: 0 -24px;
transform: translateY(-24px);
}
}

&__title {
display: flex;
h2 {
flex: 1;
}
}

&__actions {
justify-content: flex-end;
}

mat-form-field {
width: 100%;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MatDialogRef } from '@angular/material/dialog';

import { BaseTestModules } from '../../../../test-framework/core-test.helper';
import { AddApiKeyDialogComponent } from './add-api-key-dialog.component';

describe('AddApiKeyDialogComponent', () => {
let component: AddApiKeyDialogComponent;
let fixture: ComponentFixture<AddApiKeyDialogComponent>;

const mockDialogRef = {
close: () => { }
};

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
...BaseTestModules,
],
declarations: [AddApiKeyDialogComponent],
providers: [
{
provide: MatDialogRef,
useValue: mockDialogRef
}
]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(AddApiKeyDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { Component, OnDestroy } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { BehaviorSubject, Subscription } from 'rxjs';
import { filter, first, map, pairwise, tap } from 'rxjs/operators';

import { ApiKey } from '../../../../../store/src/apiKey.types';
import { entityCatalog } from '../../../../../store/src/entity-catalog/entity-catalog';
import { RequestInfoState } from '../../../../../store/src/reducers/api-request-reducer/types';
import { stratosEntityCatalog } from '../../../../../store/src/stratos-entity-catalog';
import { NormalizedResponse } from '../../../../../store/src/types/api.types';
import { safeUnsubscribe } from '../../../core/utils.service';

@Component({
selector: 'app-add-api-key-dialog',
templateUrl: './add-api-key-dialog.component.html',
styleUrls: ['./add-api-key-dialog.component.scss']
})
export class AddApiKeyDialogComponent implements OnDestroy {

private hasErrored = new BehaviorSubject(null);
public hasErrored$ = this.hasErrored.asObservable();
private isBusy = new BehaviorSubject(false)
public isBusy$ = this.isBusy.asObservable();

private sub: Subscription;

public formGroup: FormGroup;

constructor(
private fb: FormBuilder,
public dialogRef: MatDialogRef<ApiKey>,
) {
this.formGroup = this.fb.group({
comment: ['', Validators.required],
});
}

ngOnDestroy(): void {
safeUnsubscribe(this.sub);
}

submit() {
this.sub = stratosEntityCatalog.apiKey.api.create<RequestInfoState>(this.formGroup.controls.comment.value).pipe(
tap(() => {
this.isBusy.next(true);
this.hasErrored.next(null);
}),
pairwise(),
filter(([oldR, newR]) => oldR.creating && !newR.creating),
map(([, newR]) => newR),
tap(state => {
if (state.error) {
this.hasErrored.next(`Failed to create key: ${state.message}`);
this.isBusy.next(false);
} else {
const response: NormalizedResponse<ApiKey> = state.response;
const entityKey = entityCatalog.getEntityKey(stratosEntityCatalog.apiKey.actions.create(''));
this.dialogRef.close(response.entities[entityKey][response.result[0]])
}
}),
first()
).subscribe()
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<app-page-header>
<h1>API Keys</h1>
<div class="page-header-right">
<button id="stratos-api-key" mat-icon-button (click)="addApiKey()" matTooltip="Create API Key">
<mat-icon>add</mat-icon>
</button>
</div>
</app-page-header>

<div class="keys-page__new" *ngIf="keyDetails$ | async as keyDetails">

<mat-card class="autoscaler-credential__card">
<mat-card-header>
<mat-icon>vpn_key</mat-icon>New API Key
</mat-card-header>
<mat-card-content>
<p>Your API Key has been successfully created. Use the following information to connect to Stratos.</p>
<p><i>Please safely record these details, there is no later way to view them</i></p>
<ul>
<li>Secret: {{keyDetails.secret}}</li>
</ul>
<button (click)="clearKeyDetails()" mat-button color="warn">Close</button>
</mat-card-content>
</mat-card>
</div>

<app-list *ngIf="(hasKeys$ | async) === true"></app-list>
<app-no-content-message *ngIf="(hasKeys$ | async) === false" icon="vpn_key" [firstLine]="'You have no API keys'"
[secondLine]="{
text: ''
}" [toolbarLink]="{
text: 'Create an API key'
}" toolbarAlign="stratos-api-key"></app-no-content-message>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.keys-page {
&__new {
mat-card {
margin-bottom: 24px;
mat-card-header {
align-items: center;
display: flex;
margin-bottom: 15px;
mat-icon {
margin-right: 5px;
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MatDialogRef } from '@angular/material/dialog';

import { BaseTestModules } from '../../../../test-framework/core-test.helper';
import { TabNavService } from '../../../tab-nav.service';
import { ApiKeysPageComponent } from './api-keys-page.component';

describe('ApiKeysPageComponent', () => {
let component: ApiKeysPageComponent;
let fixture: ComponentFixture<ApiKeysPageComponent>;

const mockDialogRef = {
close: () => { }
};

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
...BaseTestModules,
],
declarations: [ApiKeysPageComponent],
providers: [
{
provide: MatDialogRef,
useValue: mockDialogRef
},
TabNavService
]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(ApiKeysPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { Component } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { Observable, Subject } from 'rxjs';
import { first, map, startWith } from 'rxjs/operators';

import { stratosEntityCatalog } from '../../../../../store/src/stratos-entity-catalog';
import { ApiKeyListConfigService } from '../../../shared/components/list/list-types/apiKeys/apiKey-list-config.service';
import { ListConfig } from '../../../shared/components/list/list.component.types';
import { AddApiKeyDialogComponent } from '../add-api-key-dialog/add-api-key-dialog.component';

@Component({
selector: 'app-api-keys-page',
templateUrl: './api-keys-page.component.html',
styleUrls: ['./api-keys-page.component.scss'],
providers: [{
provide: ListConfig,
useClass: ApiKeyListConfigService,
}]
})
export class ApiKeysPageComponent {

public keyDetails = new Subject<string>();
public keyDetails$ = this.keyDetails.asObservable();
public hasKeys$: Observable<Boolean>;

constructor(
private dialog: MatDialog,
) {
this.hasKeys$ = stratosEntityCatalog.apiKey.store.getPaginationService().entities$.pipe(
map(entities => entities && !!entities.length),
startWith(null),
)
}

addApiKey() {
this.showDialog().pipe(first()).subscribe(key => {
this.keyDetails.next(key);
})
}

clearKeyDetails() {
this.keyDetails.next();
}

private showDialog(): Observable<string> {
return this.dialog.open(AddApiKeyDialogComponent, {
disableClose: true,
}).afterClosed().pipe(
map(newApiKey => {
if (newApiKey && newApiKey.guid) {
stratosEntityCatalog.apiKey.api.getMultiple();
return newApiKey;
}
return null;
})
);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { NgModule } from '@angular/core';

import { CoreModule } from '../../core/core.module';
import { SharedModule } from '../../shared/shared.module';
import { ApiKeysPageComponent } from './api-keys-page/api-keys-page.component';
import { ApiKeysRoutingModule } from './api-keys.routing';
import { AddApiKeyDialogComponent } from './add-api-key-dialog/add-api-key-dialog.component';


@NgModule({
imports: [
CoreModule,
SharedModule,
ApiKeysRoutingModule,
],
declarations: [
ApiKeysPageComponent,
AddApiKeyDialogComponent
]
})
export class ApiKeysModule { }

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { ApiKeysPageComponent } from './api-keys-page/api-keys-page.component';

const apiKeys: Routes = [
{
path: '',
component: ApiKeysPageComponent
},
];

@NgModule({
imports: [
RouterModule.forChild(apiKeys),
]
})
export class ApiKeysRoutingModule { }
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h1>Endpoints</h1>
[routerLink]="'/endpoints/new/'" matTooltip="Register Endpoint">
<mat-icon>add</mat-icon>
</button>
<button id="stratos-add-endpoint" *appUserPermission="canRegisterEndpoint" mat-icon-button
<button id="stratos-restore-backup" *appUserPermission="canRegisterEndpoint" mat-icon-button
[routerLink]="'/endpoints/backup-restore'" matTooltip="Backup/Restore Endpoints">
<mat-icon>settings_backup_restore</mat-icon>
</button>
Expand Down
Loading