Skip to content

Commit

Permalink
Fix Pipeline/Workspace field in ArtifactList table (kubeflow#3063)
Browse files Browse the repository at this point in the history
* Check for pipeline name in ArtifactCustomProperties

* Move array creation out of map in getRowsFromArtifacts()

* Bump to latest kubeflow/frontend hash to pick up exported function

* Fix package.json

* Run prettier
  • Loading branch information
kwasi authored and Jeffwan committed Dec 9, 2020
1 parent 4509317 commit b3910bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@kubeflow/frontend": "github:kubeflow/frontend#9023682",
"@kubeflow/frontend": "github:kubeflow/frontend#2a39c3f",
"@material-ui/core": "3.7.1",
"@material-ui/icons": "^3.0.1",
"@types/js-yaml": "^3.11.2",
Expand Down
17 changes: 11 additions & 6 deletions frontend/src/pages/ArtifactList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
ArtifactType,
getArtifactCreationTime,
getArtifactTypes,
getResourceProperty,
getResourcePropertyViaFallBack,
GetArtifactsRequest,
} from '@kubeflow/frontend';
import * as React from 'react';
Expand Down Expand Up @@ -56,6 +56,10 @@ interface ArtifactListState {
columns: Column[];
}

const ARTIFACT_PROPERTY_REPOS = [ArtifactProperties, ArtifactCustomProperties];
const PIPELINE_WORKSPACE_FIELDS = ['PIPELINE_NAME', 'WORKSPACE', 'RUN_ID'];
const NAME_FIELDS = ['NAME'];

class ArtifactList extends Page<{}, ArtifactListState> {
private tableRef = React.createRef<CustomTable>();
private api = Api.getInstance();
Expand Down Expand Up @@ -219,11 +223,12 @@ class ArtifactList extends Page<{}, ArtifactListState> {
return {
id: `${type}:${artifact.getId()}`, // Join with colon so we can build the link
otherFields: [
getResourceProperty(artifact, ArtifactProperties.PIPELINE_NAME) ||
getResourceProperty(artifact, ArtifactCustomProperties.WORKSPACE, true) ||
getResourceProperty(artifact, ArtifactCustomProperties.RUN_ID, true),
getResourceProperty(artifact, ArtifactProperties.NAME) ||
getResourceProperty(artifact, ArtifactCustomProperties.NAME, true),
getResourcePropertyViaFallBack(
artifact,
ARTIFACT_PROPERTY_REPOS,
PIPELINE_WORKSPACE_FIELDS,
),
getResourcePropertyViaFallBack(artifact, ARTIFACT_PROPERTY_REPOS, NAME_FIELDS),
artifact.getId(),
type,
artifact.getUri(),
Expand Down

0 comments on commit b3910bf

Please sign in to comment.