Skip to content

Commit

Permalink
[UI] Hide empty resource op manifest tab in run details page (#3713)
Browse files Browse the repository at this point in the history
* Hide manifest tab when empty

* fix unit tests

* Fix tests
  • Loading branch information
Bobgy authored May 8, 2020
1 parent eab5d31 commit c5ceaf5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
8 changes: 4 additions & 4 deletions frontend/src/pages/RunDetails.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ const STEP_TABS = {
INPUT_OUTPUT: 1,
ML_METADATA: 2,
VOLUMES: 3,
MANIFEST: 4,
LOGS: 5,
POD: 6,
EVENTS: 7,
LOGS: 4,
POD: 5,
EVENTS: 6,
MANIFEST: 7,
};

const NODE_DETAILS_SELECTOR = '[data-testid="run-details-node-details"]';
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/pages/RunDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ enum SidePaneTab {
INPUT_OUTPUT,
ML_METADATA,
VOLUMES,
MANIFEST,
LOGS,
POD,
EVENTS,
MANIFEST,
}

interface SelectedNodeDetails {
Expand Down Expand Up @@ -312,10 +312,14 @@ class RunDetails extends Page<RunDetailsInternalProps, RunDetailsState> {
'Input/Output',
'ML Metadata',
'Volumes',
'Manifest',
'Logs',
'Pod',
'Events',
// NOTE: it's only possible to conditionally add a tab at the end
...(WorkflowParser.getNodeManifest(workflow, selectedNodeId)
.length > 0
? ['Manifest']
: []),
]}
selectedTab={sidepanelSelectedTab}
onSwitch={this._loadSidePaneTab.bind(this)}
Expand Down
19 changes: 5 additions & 14 deletions frontend/src/pages/__snapshots__/RunDetails.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -562,14 +562,13 @@ exports[`RunDetails logs tab does not load logs if clicked node status is skippe
>
<MD2Tabs
onSwitch={[Function]}
selectedTab={5}
selectedTab={4}
tabs={
Array [
"Artifacts",
"Input/Output",
"ML Metadata",
"Volumes",
"Manifest",
"Logs",
"Pod",
"Events",
Expand Down Expand Up @@ -681,14 +680,13 @@ exports[`RunDetails logs tab keeps side pane open and on same tab when logs chan
>
<MD2Tabs
onSwitch={[Function]}
selectedTab={5}
selectedTab={4}
tabs={
Array [
"Artifacts",
"Input/Output",
"ML Metadata",
"Volumes",
"Manifest",
"Logs",
"Pod",
"Events",
Expand Down Expand Up @@ -800,14 +798,13 @@ exports[`RunDetails logs tab loads and shows logs in side pane 1`] = `
>
<MD2Tabs
onSwitch={[Function]}
selectedTab={5}
selectedTab={4}
tabs={
Array [
"Artifacts",
"Input/Output",
"ML Metadata",
"Volumes",
"Manifest",
"Logs",
"Pod",
"Events",
Expand Down Expand Up @@ -919,14 +916,13 @@ exports[`RunDetails logs tab switches to logs tab in side pane 1`] = `
>
<MD2Tabs
onSwitch={[Function]}
selectedTab={5}
selectedTab={4}
tabs={
Array [
"Artifacts",
"Input/Output",
"ML Metadata",
"Volumes",
"Manifest",
"Logs",
"Pod",
"Events",
Expand Down Expand Up @@ -1045,7 +1041,6 @@ exports[`RunDetails opens side panel when graph node is clicked 1`] = `
"Input/Output",
"ML Metadata",
"Volumes",
"Manifest",
"Logs",
"Pod",
"Events",
Expand Down Expand Up @@ -1290,7 +1285,6 @@ exports[`RunDetails shows clicked node message in side panel 1`] = `
"Input/Output",
"ML Metadata",
"Volumes",
"Manifest",
"Logs",
"Pod",
"Events",
Expand Down Expand Up @@ -1742,7 +1736,6 @@ exports[`RunDetails switches to inputs/outputs tab in side pane 1`] = `
"Input/Output",
"ML Metadata",
"Volumes",
"Manifest",
"Logs",
"Pod",
"Events",
Expand Down Expand Up @@ -1879,14 +1872,13 @@ exports[`RunDetails switches to manifest tab in side pane 1`] = `
>
<MD2Tabs
onSwitch={[Function]}
selectedTab={4}
selectedTab={7}
tabs={
Array [
"Artifacts",
"Input/Output",
"ML Metadata",
"Volumes",
"Manifest",
"Logs",
"Pod",
"Events",
Expand Down Expand Up @@ -2038,7 +2030,6 @@ exports[`RunDetails switches to volumes tab in side pane 1`] = `
"Input/Output",
"ML Metadata",
"Volumes",
"Manifest",
"Logs",
"Pod",
"Events",
Expand Down

0 comments on commit c5ceaf5

Please sign in to comment.