Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Pipeline/Workspace field in ArtifactList table #3063

Merged
merged 5 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
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