Skip to content

Commit

Permalink
Merge pull request #2 from nubank/refactor/general-updates
Browse files Browse the repository at this point in the history
Refactor: Remove delete buttons from JobDetailPage and DatasetDetailPage
  • Loading branch information
Kess220 authored Oct 22, 2024
2 parents d9ec368 + e2f20f4 commit a457e7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 78 deletions.
45 changes: 1 addition & 44 deletions web/src/components/datasets/DatasetDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,14 @@
// SPDX-License-Identifier: Apache-2.0

import * as Redux from 'redux'
import {
Box,
Button,
Divider,
FormControlLabel,
Grid,
Switch,
Tab,
Tabs,
createTheme,
} from '@mui/material'
import { Box, Divider, FormControlLabel, Grid, Switch, Tab, Tabs, createTheme } from '@mui/material'
import { CalendarIcon } from '@mui/x-date-pickers'
import { CircularProgress } from '@mui/material'
import { Dataset, DatasetVersion } from '../../types/api'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { IState } from '../../store/reducers'
import { LineageDataset } from '../../types/lineage'
import { MqInfo } from '../core/info/MqInfo'
import { alpha } from '@mui/material/styles'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { datasetFacetsQualityAssertions, datasetFacetsStatus } from '../../helpers/nodes'
Expand All @@ -43,7 +32,6 @@ import CloseIcon from '@mui/icons-material/Close'
import DatasetInfo from './DatasetInfo'
import DatasetTags from './DatasetTags'
import DatasetVersions from './DatasetVersions'
import Dialog from '../Dialog'
import IconButton from '@mui/material/IconButton'
import ListIcon from '@mui/icons-material/List'
import MQTooltip from '../core/tooltip/MQTooltip'
Expand Down Expand Up @@ -86,13 +74,10 @@ const DatasetDetailPage: FunctionComponent<IProps> = (props) => {
const {
datasets,
dataset,
display,
fetchDataset,
resetDataset,
resetDatasetVersions,
fetchInitialDatasetVersions,
deleteDataset,
dialogToggle,
initVersions,
initVersionsLoading,
lineageDataset,
Expand Down Expand Up @@ -190,34 +175,6 @@ const DatasetDetailPage: FunctionComponent<IProps> = (props) => {
</Box>
</Box>
<Box display={'flex'} alignItems={'center'}>
<Box mr={1}>
<Button
variant='outlined'
size={'small'}
sx={{
borderColor: theme.palette.error.main,
color: theme.palette.error.main,
'&:hover': {
borderColor: alpha(theme.palette.error.main, 0.3),
backgroundColor: alpha(theme.palette.error.main, 0.3),
},
}}
onClick={() => {
props.dialogToggle('')
}}
>
{i18next.t('datasets.dialog_delete')}
</Button>
<Dialog
dialogIsOpen={display.dialogIsOpen}
dialogToggle={dialogToggle}
title={i18next.t('jobs.dialog_confirmation_title')}
ignoreWarning={() => {
deleteDataset(lineageDataset.name, lineageDataset.namespace)
props.dialogToggle('')
}}
/>
</Box>
<IconButton onClick={() => setSearchParams({})}>
<CloseIcon fontSize={'small'} />
</IconButton>
Expand Down
36 changes: 2 additions & 34 deletions web/src/components/jobs/JobDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import { Job, Run } from '../../types/api'
import { LineageJob } from '../../types/lineage'
import { MqInfo } from '../core/info/MqInfo'
import { Nullable } from '../../types/util/Nullable'
import { alpha, createTheme } from '@mui/material/styles'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { createTheme } from '@mui/material/styles'
import {
deleteJob,
dialogToggle,
Expand All @@ -41,7 +41,6 @@ import { truncateText } from '../../helpers/text'
import { useNavigate, useSearchParams } from 'react-router-dom'
import { useTheme } from '@emotion/react'
import CloseIcon from '@mui/icons-material/Close'
import Dialog from '../Dialog'
import IconButton from '@mui/material/IconButton'
import JobTags from './JobTags'
import MQTooltip from '../core/tooltip/MQTooltip'
Expand Down Expand Up @@ -81,9 +80,6 @@ const JobDetailPage: FunctionComponent<IProps> = (props) => {
jobs,
fetchLatestRuns,
resetRuns,
deleteJob,
dialogToggle,
display,
tabIndex,
setTabIndex,
fetchJob,
Expand Down Expand Up @@ -179,35 +175,7 @@ const JobDetailPage: FunctionComponent<IProps> = (props) => {
)}
</Box>
<Box display={'flex'} alignItems={'center'}>
<Box mr={1}>
<Button
variant='outlined'
size={'small'}
sx={{
borderColor: theme.palette.error.main,
color: theme.palette.error.main,
'&:hover': {
borderColor: alpha(theme.palette.error.main, 0.3),
backgroundColor: alpha(theme.palette.error.main, 0.3),
},
}}
onClick={() => {
props.dialogToggle('')
}}
>
{i18next.t('jobs.dialog_delete')}
</Button>
<Dialog
dialogIsOpen={display.dialogIsOpen}
dialogToggle={dialogToggle}
title={i18next.t('jobs.dialog_confirmation_title')}
ignoreWarning={() => {
deleteJob(job.name, job.namespace)
props.dialogToggle('')
}}
/>
</Box>
<Box mr={1}>
<Box mr={4}>
<Button
size={'small'}
variant='outlined'
Expand Down

0 comments on commit a457e7b

Please sign in to comment.