Skip to content

Commit 5c46bf9

Browse files
authored
[mwa-actual-links-in-tables] Make links in MWA's tables actual links (#66)
* mwa(front): Make links actual links Make MWA's main table links actual links by using the new LinkValue class. Signed-off-by: Elena Zioga <[email protected]> * mwa(build): Update Dockerfile and README file Update Dockerfile and README file to check out to the latest commit in develop branch from our private Kubeflow repository. Signed-off-by: Elena Zioga <[email protected]> --------- Signed-off-by: Elena Zioga <[email protected]>
1 parent 70702b3 commit 5c46bf9

File tree

5 files changed

+21
-14
lines changed

5 files changed

+21
-14
lines changed

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 ff2ef033a
9+
git checkout 8dcfe792c
1010

1111
# --- Build the backend kubeflow-wheel ---
1212
FROM python:3.7-slim AS backend-kubeflow-wheel

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Requirements:
7575
```bash
7676
# build the common library
7777
cd $KUBEFLOW_REPO/components/crud-web-apps/common/frontend/kubeflow-common-lib
78-
git checkout ff2ef033a
78+
git checkout 8dcfe792c
7979

8080
npm i
8181
npm run build

frontend/src/app/pages/index/config.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {
77
DialogConfig,
88
TableConfig,
99
ComponentValue,
10+
LinkValue,
11+
LinkType,
1012
} from 'kubeflow';
1113
import { StorageUriColumnComponent } from 'src/app/shared/storage-uri-column/storage-uri-column.component';
1214
import { getPredictorExtensionSpec } from 'src/app/shared/utils';
@@ -34,11 +36,11 @@ export const defaultConfig: TableConfig = {
3436
{
3537
matHeaderCellDef: $localize`Name`,
3638
matColumnDef: 'name',
37-
value: new PropertyValue({
38-
field: 'metadata.name',
39-
truncate: false,
39+
value: new LinkValue({
40+
field: 'ui.link',
4041
popoverField: 'metadata.name',
41-
isLink: true,
42+
truncate: true,
43+
linkType: LinkType.Internal,
4244
}),
4345
sort: true,
4446
},

frontend/src/app/pages/index/index.component.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,16 @@ export class IndexComponent implements OnInit, OnDestroy {
122122
* don't allow the user to navigate to the details page of a server
123123
* that is being deleted
124124
*/
125-
if (svc.metadata.deletionTimestamp) {
125+
if (svc.ui.status.phase === STATUS_TYPE.TERMINATING) {
126+
a.event.stopPropagation();
127+
a.event.preventDefault();
126128
this.snack.open(
127129
$localize`Endpoint is being deleted, cannot show details.`,
128130
SnackType.Info,
129131
4000,
130132
);
131-
132133
return;
133134
}
134-
135-
this.router.navigate([
136-
'/details/',
137-
this.currNamespace,
138-
a.data.metadata.name,
139-
]);
140135
break;
141136
}
142137
}
@@ -201,6 +196,10 @@ export class IndexComponent implements OnInit, OnDestroy {
201196
svc.ui.runtimeVersion = predictor.runtimeVersion;
202197
svc.ui.storageUri = predictor.storageUri;
203198
svc.ui.protocolVersion = predictor.protocolVersion;
199+
svc.ui.link = {
200+
text: svc.metadata.name,
201+
url: `/details/${this.currNamespace}/${svc.metadata.name}`,
202+
};
204203
}
205204

206205
private getCopyActionStatus(svc: InferenceServiceIR) {

frontend/src/app/types/kfserving/v1beta1.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Status, STATUS_TYPE, K8sObject, Condition } from 'kubeflow';
22
import { V1ObjectMeta, V1Container, V1PodSpec } from '@kubernetes/client-node';
3+
import { Params } from '@angular/router';
34

45
export interface InferenceServiceIR extends InferenceServiceK8s {
56
// this typed is used in the frontend after parsing the backend response
@@ -14,6 +15,11 @@ export interface InferenceServiceIR extends InferenceServiceK8s {
1415
predictorType?: string;
1516
storageUri?: string;
1617
protocolVersion?: string;
18+
link?: {
19+
text: string;
20+
url: string;
21+
queryParams?: Params | null;
22+
};
1723
};
1824
}
1925

0 commit comments

Comments
 (0)