Skip to content

Commit

Permalink
Change title from 'Start a new run' to 'Start recurring run' as appro…
Browse files Browse the repository at this point in the history
…priate (#73)
  • Loading branch information
rileyjbauer authored and k8s-ci-robot committed Nov 6, 2018
1 parent 28e42fd commit 6260577
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion frontend/src/pages/ExperimentDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class ExperimentDetails extends Page<{}, ExperimentDetailsState> {
recurringRunsManagerOpen: false,
runListToolbarProps: {
actions: this._runListToolbarActions,
breadcrumbs: [{ displayName: 'Experiment runs', href: '' }],
breadcrumbs: [{ displayName: 'Runs', href: '' }],
topLevelToolbar: false,
},
// TODO: remove
Expand Down
25 changes: 14 additions & 11 deletions frontend/src/pages/NewRun.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class NewRun extends Page<{}, NewRunState> {
actions: [],
breadcrumbs: [
{ displayName: 'Experiments', href: RoutePage.EXPERIMENTS },
{ displayName: 'Start a new run', href: RoutePage.NEW_RUN }
{ displayName: 'Start a new run', href: '' }
]
};
}
Expand Down Expand Up @@ -238,30 +238,33 @@ class NewRun extends Page<{}, NewRunState> {

let experiment: ApiExperiment | undefined;
let experimentName: string | undefined;
const breadcrumbs = [{ displayName: 'Experiments', href: RoutePage.EXPERIMENTS }];
if (experimentId) {
try {
experiment = await Apis.experimentServiceApi.getExperiment(experimentId);
experimentName = experiment.name;
const breadcrumbs = [
{ displayName: 'Experiments', href: RoutePage.EXPERIMENTS },
{
displayName: experimentName!,
href: RoutePage.EXPERIMENT_DETAILS.replace(':' + RouteParams.experimentId, experimentId),
},
{ displayName: 'Start a new run', href: RoutePage.NEW_RUN }
];
this.props.updateToolbar({ actions: this.props.toolbarProps.actions, breadcrumbs });
breadcrumbs.push({
displayName: experimentName!,
href: RoutePage.EXPERIMENT_DETAILS.replace(':' + RouteParams.experimentId, experimentId),
});
} catch (err) {
await this.showPageError(`Error: failed to get associated experiment: ${experimentId}.`, err);
logger.error(`Failed to get associated experiment ${experimentId}`, err);
}
}

const isRecurringRun = urlParser.get(QUERY_PARAMS.isRecurring) === '1';
breadcrumbs.push({
displayName: isRecurringRun ? 'Start a recurring run' : 'Start a new run',
href: '',
});
this.props.updateToolbar({ actions: this.props.toolbarProps.actions, breadcrumbs });

this.setState({
experiment,
experimentName,
isFirstRunInExperiment: urlParser.get(QUERY_PARAMS.firstRunInExperiment) === '1',
isRecurringRun: urlParser.get(QUERY_PARAMS.isRecurring) === '1',
isRecurringRun,
});

this._validate();
Expand Down

0 comments on commit 6260577

Please sign in to comment.