Skip to content

Commit

Permalink
fix duplicate breadcrumbs and heading in job def detail
Browse files Browse the repository at this point in the history
  • Loading branch information
dlqqq committed Oct 7, 2022
1 parent d0e2e1c commit 45bbde6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/mainviews/detail-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function DetailView(props: IDetailViewProps): JSX.Element {
>
{props.model.detailType === 'Job'
? trans.__('Notebook Jobs')
: trans.__('Notebook Definitions')}
: trans.__('Notebook Job Definitions')}
</Link>
<Typography color="text.primary">
{props.model.detailType === 'Job'
Expand Down
29 changes: 1 addition & 28 deletions src/mainviews/job-definition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ import React from 'react';
import { IJobDefinitionModel, JobsView } from '../model';
import { useTranslator } from '../hooks';
import { TextFieldStyled, timestampLocalize } from './job-detail';
import { Heading } from '../components/heading';
import { SchedulerService } from '../handler';
import cronstrue from 'cronstrue';

import {
Breadcrumbs,
Button,
Card,
CardContent,
Link,
Stack,
TextFieldProps,
Typography
TextFieldProps
} from '@mui/material';

export interface IJobDefinitionProps {
Expand All @@ -41,27 +37,6 @@ export function JobDefinition(props: IJobDefinitionProps): JSX.Element {
// Do nothing; let the errors or nothing display instead
}

const DefinitionBreadcrumbsStyled = (
<div role="presentation">
<Breadcrumbs aria-label="breadcrumb">
<Link
underline="hover"
color="inherit"
onClick={(
_:
| React.MouseEvent<HTMLAnchorElement, MouseEvent>
| React.MouseEvent<HTMLSpanElement, MouseEvent>
): void => props.setView('ListJobs')}
>
{trans.__('Notebook Job Definitions')}
</Link>
<Typography color="text.primary">
{props.model.name ?? props.model.definitionId}
</Typography>
</Breadcrumbs>
</div>
);

const DefinitionButtonBar = (
<Stack direction="row" gap={2} justifyContent="flex-end" flexWrap={'wrap'}>
<Button
Expand Down Expand Up @@ -138,8 +113,6 @@ export function JobDefinition(props: IJobDefinitionProps): JSX.Element {

return (
<>
{DefinitionBreadcrumbsStyled}
<Heading level={1}>{trans.__('Job Detail')}</Heading>
{DefinitionButtonBar}
{JobDefinition}
</>
Expand Down
2 changes: 1 addition & 1 deletion src/notebook-jobs-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class NotebookJobsPanel extends VDomRenderer<JobsModel> {
<DetailView
app={this._app}
model={{
id: this.model.jobDetailModel.jobId,
id: '4210321b-019f-4be8-9870-702f4f1093e9',
detailType: 'JobDefinition'
//detailType: 'Job'
}}
Expand Down

0 comments on commit 45bbde6

Please sign in to comment.