Skip to content

Commit

Permalink
[mwa-actual-links-in-tables] Make links in MWA's tables actual links (#…
Browse files Browse the repository at this point in the history
…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 <elena@arrikto.com>

* 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 <elena@arrikto.com>

---------

Signed-off-by: Elena Zioga <elena@arrikto.com>
  • Loading branch information
elenzio9 authored Feb 22, 2023
1 parent 70702b3 commit 5c46bf9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN apt-get update && apt-get install git -y
WORKDIR /kf
RUN git clone https://github.com/kubeflow/kubeflow.git && \
cd kubeflow && \
git checkout ff2ef033a
git checkout 8dcfe792c

# --- Build the backend kubeflow-wheel ---
FROM python:3.7-slim AS backend-kubeflow-wheel
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Requirements:
```bash
# build the common library
cd $KUBEFLOW_REPO/components/crud-web-apps/common/frontend/kubeflow-common-lib
git checkout ff2ef033a
git checkout 8dcfe792c

npm i
npm run build
Expand Down
10 changes: 6 additions & 4 deletions frontend/src/app/pages/index/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
DialogConfig,
TableConfig,
ComponentValue,
LinkValue,
LinkType,
} from 'kubeflow';
import { StorageUriColumnComponent } from 'src/app/shared/storage-uri-column/storage-uri-column.component';
import { getPredictorExtensionSpec } from 'src/app/shared/utils';
Expand Down Expand Up @@ -34,11 +36,11 @@ export const defaultConfig: TableConfig = {
{
matHeaderCellDef: $localize`Name`,
matColumnDef: 'name',
value: new PropertyValue({
field: 'metadata.name',
truncate: false,
value: new LinkValue({
field: 'ui.link',
popoverField: 'metadata.name',
isLink: true,
truncate: true,
linkType: LinkType.Internal,
}),
sort: true,
},
Expand Down
15 changes: 7 additions & 8 deletions frontend/src/app/pages/index/index.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,16 @@ export class IndexComponent implements OnInit, OnDestroy {
* don't allow the user to navigate to the details page of a server
* that is being deleted
*/
if (svc.metadata.deletionTimestamp) {
if (svc.ui.status.phase === STATUS_TYPE.TERMINATING) {
a.event.stopPropagation();
a.event.preventDefault();
this.snack.open(
$localize`Endpoint is being deleted, cannot show details.`,
SnackType.Info,
4000,
);

return;
}

this.router.navigate([
'/details/',
this.currNamespace,
a.data.metadata.name,
]);
break;
}
}
Expand Down Expand Up @@ -201,6 +196,10 @@ export class IndexComponent implements OnInit, OnDestroy {
svc.ui.runtimeVersion = predictor.runtimeVersion;
svc.ui.storageUri = predictor.storageUri;
svc.ui.protocolVersion = predictor.protocolVersion;
svc.ui.link = {
text: svc.metadata.name,
url: `/details/${this.currNamespace}/${svc.metadata.name}`,
};
}

private getCopyActionStatus(svc: InferenceServiceIR) {
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/app/types/kfserving/v1beta1.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Status, STATUS_TYPE, K8sObject, Condition } from 'kubeflow';
import { V1ObjectMeta, V1Container, V1PodSpec } from '@kubernetes/client-node';
import { Params } from '@angular/router';

export interface InferenceServiceIR extends InferenceServiceK8s {
// this typed is used in the frontend after parsing the backend response
Expand All @@ -14,6 +15,11 @@ export interface InferenceServiceIR extends InferenceServiceK8s {
predictorType?: string;
storageUri?: string;
protocolVersion?: string;
link?: {
text: string;
url: string;
queryParams?: Params | null;
};
};
}

Expand Down

0 comments on commit 5c46bf9

Please sign in to comment.