Skip to content

Commit 0848e03

Browse files
authored
[kwa-kfp-component] Introduce KWA's frontend component for kfp links (#1991)
* Introduce the kfp-run component as a distinct component. * Make the pipeline button a link. Signed-off-by: Elena Zioga <[email protected]> Signed-off-by: Elena Zioga <[email protected]>
1 parent 0ee6062 commit 0848e03

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<a
2+
*ngIf="trialKfpRunUrl"
3+
class="svg-color-enabled"
4+
[href]="trialKfpRunUrl"
5+
target="_blank"
6+
rel="noopener noreferrer"
7+
>
8+
<mat-icon svgIcon="pipeline-centered"> </mat-icon>
9+
</a>
10+
11+
<div *ngIf="!trialKfpRunUrl" class="svg-color-disabled" matTooltip="No KFP run">
12+
<mat-icon svgIcon="pipeline-centered"> </mat-icon>
13+
</div>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.svg-color-enabled {
2+
color: #1e88e5;
3+
}
4+
5+
.svg-color-disabled {
6+
color: rgba(0, 0, 0, 0.26);
7+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { MatIconModule } from '@angular/material/icon';
3+
import { MatIconTestingModule } from '@angular/material/icon/testing';
4+
5+
import { KfpRunComponent } from './kfp-run.component';
6+
7+
describe('KfpRunComponent', () => {
8+
let component: KfpRunComponent;
9+
let fixture: ComponentFixture<KfpRunComponent>;
10+
11+
beforeEach(async () => {
12+
await TestBed.configureTestingModule({
13+
imports: [MatIconModule, MatIconTestingModule],
14+
declarations: [KfpRunComponent],
15+
}).compileComponents();
16+
});
17+
18+
beforeEach(() => {
19+
fixture = TestBed.createComponent(KfpRunComponent);
20+
component = fixture.componentInstance;
21+
fixture.detectChanges();
22+
});
23+
24+
it('should create', () => {
25+
expect(component).toBeTruthy();
26+
});
27+
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Component } from '@angular/core';
2+
import { TableColumnComponent } from 'kubeflow/lib/resource-table/component-value/component-value.component';
3+
4+
@Component({
5+
selector: 'app-kfp-run',
6+
templateUrl: './kfp-run.component.html',
7+
styleUrls: ['./kfp-run.component.scss'],
8+
})
9+
export class KfpRunComponent implements TableColumnComponent {
10+
constructor() {}
11+
12+
trialKfpRunUrl: string = '';
13+
14+
set element(experiment: any) {
15+
if (experiment?.['kfp run']) {
16+
this.trialKfpRunUrl = `/pipeline/#/runs/details/${experiment['kfp run']}`;
17+
} else {
18+
this.trialKfpRunUrl = '';
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)