Skip to content

Commit

Permalink
Display full runID and check icon when copied (#2940)
Browse files Browse the repository at this point in the history
Signed-off-by: Willy Lulciuc <[email protected]>
  • Loading branch information
wslulciuc authored Oct 22, 2024
1 parent fcbbc07 commit b85b954
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
5 changes: 4 additions & 1 deletion web/src/components/core/copy/MqCopy.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2018-2023 contributors to the Marquez project
// SPDX-License-Identifier: Apache-2.0

import { Check } from '@mui/icons-material'
import { Snackbar } from '@mui/material'
import ContentCopyIcon from '@mui/icons-material/ContentCopy'
import IconButton from '@mui/material/IconButton'
Expand All @@ -13,6 +14,7 @@ interface MqCopyProps {

const MqEmpty: React.FC<MqCopyProps> = ({ string }) => {
const [open, setOpen] = React.useState(false)
const [hasCopied, setHasCopied] = React.useState(false)
const handleClose = (event: React.SyntheticEvent | Event, reason?: string) => {
if (reason === 'clickaway') {
return
Expand All @@ -28,12 +30,13 @@ const MqEmpty: React.FC<MqCopyProps> = ({ string }) => {
event.stopPropagation()
navigator.clipboard.writeText(string)
setOpen(true)
setHasCopied(true)
}}
aria-label='copy'
size={'small'}
color={'primary'}
>
<ContentCopyIcon fontSize={'small'} />
{hasCopied ? <Check fontSize={'small'} /> : <ContentCopyIcon fontSize={'small'} />}
</IconButton>
</MQTooltip>
<Snackbar
Expand Down
6 changes: 1 addition & 5 deletions web/src/components/datasets/DatasetVersions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,7 @@ const DatasetVersions: FunctionComponent<DatasetVersionsProps & DispatchProps> =
<ArrowBackIosRounded fontSize={'small'} />
</IconButton>
</Box>
<DatasetInfo
dataset={dataset}
datasetFields={infoView.fields}
facets={infoView.facets}
/>
<DatasetInfo dataset={dataset} datasetFields={infoView.fields} facets={infoView.facets} />
</>
)
}
Expand Down
7 changes: 6 additions & 1 deletion web/src/components/jobs/Runs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { formatUpdatedAt } from '../../helpers'
import { runStateColor } from '../../helpers/nodes'
import { stopWatchDuration } from '../../helpers/time'
import { useTheme } from '@emotion/react'
import MQTooltip from '../core/tooltip/MQTooltip'
import MqCode from '../core/code/MqCode'
import MqCopy from '../core/copy/MqCopy'
import MqEmpty from '../core/empty/MqEmpty'
Expand Down Expand Up @@ -156,7 +157,11 @@ const Runs: FunctionComponent<RunsProps & DispatchProps> = (props) => {
>
<TableCell align='left'>
<Box display={'flex'} alignItems={'center'}>
{run.id.substring(0, 8)}...
<MQTooltip title={run.id}>
<Box>
<MqText font={'mono'}>{run.id.substring(0, 8)}...</MqText>
</Box>
</MQTooltip>
<MqCopy string={run.id} />
</Box>
</TableCell>
Expand Down
8 changes: 7 additions & 1 deletion web/src/routes/events/Events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,13 @@ const Events: React.FC<EventsProps> = ({
>
<TableCell align='left'>
<Box display={'flex'} alignItems={'center'}>
<MqText font={'mono'}>{event.run.runId.substring(0, 8)}...</MqText>
<MQTooltip title={event.run.runId}>
<Box>
<MqText font={'mono'}>
{event.run.runId.substring(0, 8)}...
</MqText>
</Box>
</MQTooltip>
<MqCopy string={event.run.runId} />
</Box>
</TableCell>
Expand Down

0 comments on commit b85b954

Please sign in to comment.