forked from cloudfoundry/stratos
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- https://xd.adobe.com/spec/dcd4203c-d334-462e-7921-ea6c3ef41151-aae5/screen/a2ea0108-1ae5-418f-8153-bc2a1fe985d5/Filter/ - Include optional labels list component - Fix issue where search term was not capitalised - Improve typing
- Loading branch information
1 parent
cc927da
commit d9bc3f7
Showing
24 changed files
with
426 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...custom/kubernetes/list-types/kubernetes-labels-cell/kubernetes-labels-cell.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<app-chips [chips]="chipsConfig"></app-chips> |
Empty file.
45 changes: 45 additions & 0 deletions
45
...tom/kubernetes/list-types/kubernetes-labels-cell/kubernetes-labels-cell.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { KubernetesStatus } from '../../../../../../../../../custom-src/frontend/app/custom/kubernetes/store/kube.types'; | ||
import { BaseTestModules } from '../../../../../test-framework/core-test.helper'; | ||
import { KubernetesLabelsCellComponent } from './kubernetes-labels-cell.component'; | ||
|
||
describe('KubernetesLabelsCellComponent', () => { | ||
let component: KubernetesLabelsCellComponent; | ||
let fixture: ComponentFixture<KubernetesLabelsCellComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [KubernetesLabelsCellComponent], | ||
imports: BaseTestModules | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(KubernetesLabelsCellComponent); | ||
component = fixture.componentInstance; | ||
component.row = { | ||
metadata: { | ||
labels: {}, | ||
namespace: 'test', | ||
name: 'test', | ||
uid: 'test' | ||
}, | ||
status: { | ||
phase: KubernetesStatus.ACTIVE | ||
}, | ||
spec: { | ||
containers: [], | ||
nodeName: 'test', | ||
schedulerName: 'test', | ||
initContainers: [] | ||
} | ||
}; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
26 changes: 26 additions & 0 deletions
26
...p/custom/kubernetes/list-types/kubernetes-labels-cell/kubernetes-labels-cell.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
import { AppChip } from '../../../../shared/components/chips/chips.component'; | ||
import { TableCellCustom } from '../../../../shared/components/list/list.types'; | ||
import { KubeAPIResource } from '../../store/kube.types'; | ||
|
||
|
||
@Component({ | ||
selector: 'app-kubernetes-labels-cell', | ||
templateUrl: './kubernetes-labels-cell.component.html', | ||
styleUrls: ['./kubernetes-labels-cell.component.scss'] | ||
}) | ||
export class KubernetesLabelsCellComponent extends TableCellCustom<KubeAPIResource> implements OnInit { | ||
|
||
chipsConfig: AppChip<KubeAPIResource>[]; | ||
|
||
constructor() { | ||
super(); | ||
} | ||
|
||
ngOnInit() { | ||
this.chipsConfig = Object.entries(this.row.metadata.labels).map(([key, value]) => ({ | ||
value: `${key}:${value}` | ||
})); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...rnetes/list-types/kubernetes-nodes/kubernetes-node-ips/kubernetes-node-ips.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<mat-icon matTooltip="{{tooltip}}">language</mat-icon> |
5 changes: 5 additions & 0 deletions
5
...rnetes/list-types/kubernetes-nodes/kubernetes-node-ips/kubernetes-node-ips.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mat-icon { | ||
font-size: 20px; | ||
height: 20px; | ||
width: 20px; | ||
} |
46 changes: 46 additions & 0 deletions
46
...tes/list-types/kubernetes-nodes/kubernetes-node-ips/kubernetes-node-ips.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { BaseTestModules } from '../../../../../../test-framework/core-test.helper'; | ||
import { KubernetesNodeIpsComponent } from './kubernetes-node-ips.component'; | ||
|
||
describe('KubernetesNodeIpsComponent', () => { | ||
let component: KubernetesNodeIpsComponent; | ||
let fixture: ComponentFixture<KubernetesNodeIpsComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [KubernetesNodeIpsComponent], | ||
imports: BaseTestModules | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(KubernetesNodeIpsComponent); | ||
component = fixture.componentInstance; | ||
component.row = { | ||
metadata: { | ||
labels: {}, | ||
namespace: 'test', | ||
name: 'test', | ||
uid: 'test' | ||
}, | ||
status: { | ||
conditions: [], | ||
addresses: [], | ||
images: [] | ||
}, | ||
spec: { | ||
containers: [], | ||
nodeName: 'test', | ||
schedulerName: 'test', | ||
initContainers: [] | ||
} | ||
}; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
26 changes: 26 additions & 0 deletions
26
...bernetes/list-types/kubernetes-nodes/kubernetes-node-ips/kubernetes-node-ips.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
import { TableCellCustom } from '../../../../../shared/components/list/list.types'; | ||
import { KubernetesAddressExternal, KubernetesAddressInternal, KubernetesNode } from '../../../store/kube.types'; | ||
|
||
@Component({ | ||
selector: 'app-kubernetes-node-ips', | ||
templateUrl: './kubernetes-node-ips.component.html', | ||
styleUrls: ['./kubernetes-node-ips.component.scss'] | ||
}) | ||
export class KubernetesNodeIpsComponent extends TableCellCustom<KubernetesNode> implements OnInit { | ||
|
||
tooltip: string; | ||
|
||
constructor() { | ||
super(); | ||
} | ||
|
||
ngOnInit() { | ||
this.tooltip = this.row.status.addresses | ||
.filter(address => address.type === KubernetesAddressInternal || address.type === KubernetesAddressExternal) | ||
.map(address => address.address) | ||
.join(', '); | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
.../list-types/kubernetes-nodes/kubernetes-node-labels/kubernetes-node-labels.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<mat-icon matTooltip="{{labels}}">info</mat-icon> |
5 changes: 5 additions & 0 deletions
5
.../list-types/kubernetes-nodes/kubernetes-node-labels/kubernetes-node-labels.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mat-icon { | ||
font-size: 20px; | ||
height: 20px; | ||
width: 20px; | ||
} |
46 changes: 46 additions & 0 deletions
46
...st-types/kubernetes-nodes/kubernetes-node-labels/kubernetes-node-labels.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { BaseTestModules } from '../../../../../../test-framework/core-test.helper'; | ||
import { KubernetesNodeLabelsComponent } from './kubernetes-node-labels.component'; | ||
|
||
describe('KubernetesNodeLabelsComponent', () => { | ||
let component: KubernetesNodeLabelsComponent; | ||
let fixture: ComponentFixture<KubernetesNodeLabelsComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [KubernetesNodeLabelsComponent], | ||
imports: BaseTestModules | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(KubernetesNodeLabelsComponent); | ||
component = fixture.componentInstance; | ||
component.row = { | ||
metadata: { | ||
labels: {}, | ||
namespace: 'test', | ||
name: 'test', | ||
uid: 'test' | ||
}, | ||
status: { | ||
conditions: [], | ||
addresses: [], | ||
images: [] | ||
}, | ||
spec: { | ||
containers: [], | ||
nodeName: 'test', | ||
schedulerName: 'test', | ||
initContainers: [] | ||
} | ||
}; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
25 changes: 25 additions & 0 deletions
25
...es/list-types/kubernetes-nodes/kubernetes-node-labels/kubernetes-node-labels.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
import { TableCellCustom } from '../../../../../shared/components/list/list.types'; | ||
import { KubernetesNode } from '../../../store/kube.types'; | ||
|
||
@Component({ | ||
selector: 'app-kubernetes-node-labels', | ||
templateUrl: './kubernetes-node-labels.component.html', | ||
styleUrls: ['./kubernetes-node-labels.component.scss'] | ||
}) | ||
export class KubernetesNodeLabelsComponent extends TableCellCustom<KubernetesNode> implements OnInit { | ||
|
||
labels: string; | ||
|
||
constructor() { | ||
super(); | ||
} | ||
|
||
ngOnInit() { | ||
this.labels = Object.entries(this.row.metadata.labels) | ||
.map(([key, value]) => `${key}:${value}`) | ||
.join(', '); | ||
} | ||
|
||
} |
8 changes: 4 additions & 4 deletions
8
...s/list-types/kubernetes-nodes/kubernetes-node-link/kubernetes-node-link.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...rnetes/list-types/kubernetes-nodes/kubernetes-node-link/kubernetes-node-link.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...t-types/kubernetes-nodes/kubernetes-node-pressure/kubernetes-node-pressure.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<ng-container *ngIf="errors.length; else noErrors"> | ||
<div *ngFor="let error of errors" class="pressure"> | ||
<mat-icon class="pressure__icon">info</mat-icon> | ||
{{ error }} | ||
</div> | ||
</ng-container> | ||
<ng-template #noErrors> | ||
None | ||
</ng-template> |
12 changes: 12 additions & 0 deletions
12
...t-types/kubernetes-nodes/kubernetes-node-pressure/kubernetes-node-pressure.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.pressure { | ||
align-items: center; | ||
display: flex; | ||
|
||
&__icon { | ||
color: red; | ||
font-size: 20px; | ||
height: 20px; | ||
margin-right: 4px; | ||
width: 20px; | ||
} | ||
} |
Oops, something went wrong.