Skip to content

Commit 766fef9

Browse files
authored
UI: Make KWA's main table responsive and add toolbar (#1982)
* UI: Make KWA's main table responsive and add toolbar * Add a top row toolbar with the title of the app and the button to create a new Experiment. * Replace the card with a responsive table that shows the items. The component also has a paginator. Signed-off-by: Elena Zioga <[email protected]> * build: Update Dockerfile and README file Update Dockerfile and README file to check out to the commit in master branch from the Kubeflow repository that includes the corresponding changes. Signed-off-by: Elena Zioga <[email protected]> Signed-off-by: Elena Zioga <[email protected]>
1 parent aee2109 commit 766fef9

File tree

6 files changed

+33
-35
lines changed

6 files changed

+33
-35
lines changed

cmd/new-ui/v1beta1/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN apt-get update && apt-get install git -y
66
WORKDIR /kf
77
RUN git clone https://github.com/kubeflow/kubeflow.git && \
88
cd kubeflow && \
9-
git checkout ecb72c2
9+
git checkout c4ca7a9
1010

1111
# --- Build the frontend kubeflow library ---
1212
FROM node:12 AS frontend-kubeflow-lib

pkg/new-ui/v1beta1/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ You can build the common library with:
4242
```bash
4343
cd /tmp && git clone https://github.com/kubeflow/kubeflow.git \
4444
&& cd kubeflow \
45-
&& git checkout ecb72c2 \
45+
&& git checkout c4ca7a9 \
4646
&& cd components/crud-web-apps/common/frontend/kubeflow-common-lib
4747

4848
# build the common library module

pkg/new-ui/v1beta1/frontend/src/app/pages/experiments/config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import {
1919
import { ExperimentOptimalTrialComponent } from './optimal-trial/experiment-optimal-trial.component';
2020

2121
export const experimentsTableConfig: TableConfig = {
22-
title: 'Experiments',
23-
newButtonText: 'NEW EXPERIMENT',
2422
columns: [
2523
{
2624
matHeaderCellDef: 'Status',
Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
<lib-namespace-select
2-
*ngIf="(ns.dashboardConnected$ | async) === dashboardDisconnectedState"
3-
namespacesUrl="/katib/fetch_namespaces"
4-
></lib-namespace-select>
1+
<div class="lib-content-wrapper">
2+
<lib-title-actions-toolbar title="Experiments" [buttons]="buttons" i18n-title>
3+
<lib-namespace-select
4+
*ngIf="(ns.dashboardConnected$ | async) === dashboardDisconnectedState"
5+
namespacesUrl="/katib/fetch_namespaces"
6+
></lib-namespace-select>
7+
</lib-title-actions-toolbar>
58

6-
<lib-resource-table
7-
[config]="config"
8-
[data]="experiments"
9-
[trackByFn]="trackByFn"
10-
(actionsEmitter)="reactToAction($event)"
11-
></lib-resource-table>
9+
<div class="page-padding lib-flex-grow lib-overflow-auto">
10+
<lib-table
11+
[config]="config"
12+
[data]="experiments"
13+
[trackByFn]="trackByFn"
14+
(actionsEmitter)="reactToAction($event)"
15+
>
16+
</lib-table>
17+
</div>
18+
</div>

pkg/new-ui/v1beta1/frontend/src/app/pages/experiments/experiments.component.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
TemplateValue,
1919
ActionEvent,
2020
DashboardState,
21+
ToolbarButton,
2122
} from 'kubeflow';
2223

2324
import { KWABackendService } from 'src/app/services/backend.service';
@@ -42,6 +43,17 @@ export class ExperimentsComponent implements OnInit, OnDestroy {
4243
private subs = new Subscription();
4344
private poller: ExponentialBackoff;
4445

46+
buttons: ToolbarButton[] = [
47+
new ToolbarButton({
48+
text: `New Experiment`,
49+
icon: 'add',
50+
stroked: true,
51+
fn: () => {
52+
this.router.navigate(['/new']);
53+
},
54+
}),
55+
];
56+
4557
constructor(
4658
private backend: KWABackendService,
4759
private confirmDialog: ConfirmDialogService,
@@ -73,9 +85,6 @@ export class ExperimentsComponent implements OnInit, OnDestroy {
7385
reactToAction(a: ActionEvent) {
7486
const exp = a.data as Experiment;
7587
switch (a.action) {
76-
case 'newResourceButton': // TODO: could also use enums here
77-
this.router.navigate(['/new']);
78-
break;
7988
case 'name:link':
8089
this.router.navigate([`/experiment/${exp.name}`]);
8190
break;
Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,12 @@
11
import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
3-
import { MatCardModule } from '@angular/material/card';
4-
import {
5-
NamespaceSelectModule,
6-
ResourceTableModule,
7-
ConfirmDialogModule,
8-
} from 'kubeflow';
9-
3+
import { KubeflowModule } from 'kubeflow';
104
import { ExperimentsComponent } from './experiments.component';
115
import { ExperimentOptimalTrialModule } from './optimal-trial/experiment-optimal-trial.module';
126

137
@NgModule({
148
declarations: [ExperimentsComponent],
15-
imports: [
16-
CommonModule,
17-
NamespaceSelectModule,
18-
ResourceTableModule,
19-
20-
ConfirmDialogModule,
21-
ExperimentOptimalTrialModule,
22-
MatCardModule,
23-
ConfirmDialogModule,
24-
MatCardModule,
25-
],
9+
imports: [CommonModule, ExperimentOptimalTrialModule, KubeflowModule],
2610
exports: [ExperimentsComponent],
2711
})
2812
export class ExperimentsModule {}

0 commit comments

Comments
 (0)