-
Notifications
You must be signed in to change notification settings - Fork 28
Add multiple branches support inside the experiments table #3735
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
Changes from all commits
e45414a
11ca634
f8fefdd
1974c1e
e89bb63
b4a3b68
3b472ca
28c3d2b
7b533f9
cb6589c
2161709
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import cx from 'classnames' | ||
| import React from 'react' | ||
| import styles from '../styles.module.scss' | ||
|
|
||
| interface PreviousCommitsRowProps { | ||
| isBranchesView?: boolean | ||
| nbColumns: number | ||
| } | ||
|
|
||
| export const PreviousCommitsRow: React.FC<PreviousCommitsRowProps> = ({ | ||
| isBranchesView, | ||
| nbColumns | ||
| }) => ( | ||
| <thead> | ||
| <tr className={cx(styles.previousCommitsRow)}> | ||
| <th className={cx(styles.previousCommitsText, styles.experimentsTd)}> | ||
| {isBranchesView ? 'Other Branches' : 'Previous Commits'} | ||
| </th> | ||
| <th colSpan={nbColumns - 1}></th> | ||
| </tr> | ||
| </thead> | ||
| ) |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a way to view how the different branch tables look on my end? Looking at the code, I'm not seeing a way to do this, but I might be missing something :) From your demo, it looks like the experiment column shadow might be missing but I can't confirm this since, as mentioned, I'm not sure how to test how things look.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently adding a story to see it. Otherwise, you have to manually add branches to the rows (we can duplicate the non workspace rows we send to |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,26 +5,29 @@ import { EXPERIMENT_WORKSPACE_ID } from 'dvc/src/cli/dvc/contract' | |
| import { ExperimentGroup } from './ExperimentGroup' | ||
| import { BatchSelectionProp, RowContent } from './Row' | ||
| import { WorkspaceRowGroup } from './WorkspaceRowGroup' | ||
| import { PreviousCommitsRow } from './PreviousCommitsRow' | ||
| import styles from '../styles.module.scss' | ||
| import { InstanceProp, RowProp } from '../../../util/interfaces' | ||
| import { ExperimentsState } from '../../../store' | ||
|
|
||
| export const TableBody: React.FC< | ||
| RowProp & | ||
| InstanceProp & | ||
| BatchSelectionProp & { | ||
| root: HTMLElement | null | ||
| tableHeaderHeight: number | ||
| } | ||
| > = ({ | ||
| interface TableBodyProps extends RowProp, InstanceProp, BatchSelectionProp { | ||
| root: HTMLElement | null | ||
| tableHeaderHeight: number | ||
| showPreviousRow?: boolean | ||
| isLast?: boolean | ||
| } | ||
|
|
||
| export const TableBody: React.FC<TableBodyProps> = ({ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar blocks of code found in 3 locations. Consider refactoring. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar blocks of code found in 2 locations. Consider refactoring. |
||
| row, | ||
| instance, | ||
| contextMenuDisabled, | ||
| projectHasCheckpoints, | ||
| hasRunningExperiment, | ||
| batchRowSelection, | ||
| root, | ||
| tableHeaderHeight | ||
| tableHeaderHeight, | ||
| showPreviousRow, | ||
| isLast | ||
| }) => { | ||
| const contentProps = { | ||
| batchRowSelection, | ||
|
|
@@ -54,22 +57,17 @@ export const TableBody: React.FC< | |
| </WorkspaceRowGroup> | ||
| ) : ( | ||
| <> | ||
| {row.index === 2 && row.depth === 0 && ( | ||
| <tbody> | ||
| <tr className={cx(styles.previousCommitsRow, styles.experimentsTr)}> | ||
| <td | ||
| className={cx(styles.previousCommitsText, styles.experimentsTd)} | ||
| > | ||
| {isBranchesView ? 'Other Branches' : 'Previous Commits'} | ||
| </td> | ||
| <td colSpan={row.getAllCells().length - 1}></td> | ||
| </tr> | ||
| </tbody> | ||
| {showPreviousRow && row.depth === 0 && ( | ||
| <PreviousCommitsRow | ||
| isBranchesView={isBranchesView} | ||
| nbColumns={row.getAllCells().length} | ||
| /> | ||
| )} | ||
| <tbody | ||
| className={cx(styles.rowGroup, { | ||
| [styles.experimentGroup]: row.depth > 0, | ||
| [styles.expandedGroup]: row.getIsExpanded() && row.subRows.length > 0 | ||
| [styles.expandedGroup]: row.getIsExpanded() && row.subRows.length > 0, | ||
| [styles.lastRowGroup]: isLast | ||
| })} | ||
| > | ||
| {content} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.