Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
gky360 committed Oct 1, 2019
1 parent 555dee9 commit 3ab70e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/ExperimentsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ReactTable from 'react-table';
import * as uiPropTypes from '../store/uiPropTypes';
import {
argValue2string,
getResultGroupName,
getGrandParentDirectoryName,
getLastLogDict,
sortMethod,
sortKeys,
Expand Down Expand Up @@ -147,7 +147,7 @@ const ExperimentsTable = (props) => {
nameColumns.unshift({
Header: '',
id: 'group',
accessor: (p) => getResultGroupName(p),
accessor: (p) => getGrandParentDirectoryName(p),
Filter: (
<ResultFilter
projectId={project.id}
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/containers/PlotContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ import LogVisualizer from '../components/LogVisualizer';
import SideBar from '../components/SideBar';
import ResultTypeSelector from '../components/ResultTypeSelector';
import { defaultProjectStatus, defaultProjectConfig } from '../constants';
import { startPolling, stopPolling, getResultGroupName, displayResultNameFull } from '../utils';
import {
startPolling,
stopPolling,
getGrandParentDirectoryName,
displayResultNameFull,
} from '../utils';

class PlotContainer extends React.Component {
componentDidMount() {
Expand Down Expand Up @@ -204,7 +209,7 @@ PlotContainer.propTypes = {
const getTargetTextForFilter = (project, result, filterKey) => {
switch (filterKey) {
case 'group':
return getResultGroupName(result);
return getGrandParentDirectoryName(result);
case 'name':
return displayResultNameFull(project, result);
default:
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ export const getRelativeResultPathName = (project = {}, result = {}) =>
export const getGrandParentDirectoryName = (result = {}) =>
path.basename(path.resolve(result.pathName, '..'));

export const getResultGroupName = (result = {}) => getGrandParentDirectoryName(result);

export const displayResultNameFull = (project = {}, result = {}) =>
result.name || getRelativeResultPathName(project, result);

Expand Down

0 comments on commit 3ab70e6

Please sign in to comment.