Skip to content

Commit 19e9d22

Browse files
committed
Display full runID and check icon when copied
Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com>
1 parent fcbbc07 commit 19e9d22

4 files changed

Lines changed: 18 additions & 8 deletions

File tree

web/src/components/core/copy/MqCopy.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright 2018-2023 contributors to the Marquez project
22
// SPDX-License-Identifier: Apache-2.0
33

4+
import { Check } from '@mui/icons-material'
45
import { Snackbar } from '@mui/material'
56
import ContentCopyIcon from '@mui/icons-material/ContentCopy'
67
import IconButton from '@mui/material/IconButton'
@@ -13,6 +14,7 @@ interface MqCopyProps {
1314

1415
const MqEmpty: React.FC<MqCopyProps> = ({ string }) => {
1516
const [open, setOpen] = React.useState(false)
17+
const [hasCopied, setHasCopied] = React.useState(false)
1618
const handleClose = (event: React.SyntheticEvent | Event, reason?: string) => {
1719
if (reason === 'clickaway') {
1820
return
@@ -28,12 +30,13 @@ const MqEmpty: React.FC<MqCopyProps> = ({ string }) => {
2830
event.stopPropagation()
2931
navigator.clipboard.writeText(string)
3032
setOpen(true)
33+
setHasCopied(true)
3134
}}
3235
aria-label='copy'
3336
size={'small'}
3437
color={'primary'}
3538
>
36-
<ContentCopyIcon fontSize={'small'} />
39+
{hasCopied ? <Check fontSize={'small'} /> : <ContentCopyIcon fontSize={'small'} />}
3740
</IconButton>
3841
</MQTooltip>
3942
<Snackbar

web/src/components/datasets/DatasetVersions.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,7 @@ const DatasetVersions: FunctionComponent<DatasetVersionsProps & DispatchProps> =
9292
<ArrowBackIosRounded fontSize={'small'} />
9393
</IconButton>
9494
</Box>
95-
<DatasetInfo
96-
dataset={dataset}
97-
datasetFields={infoView.fields}
98-
facets={infoView.facets}
99-
/>
95+
<DatasetInfo dataset={dataset} datasetFields={infoView.fields} facets={infoView.facets} />
10096
</>
10197
)
10298
}

web/src/components/jobs/Runs.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { formatUpdatedAt } from '../../helpers'
2424
import { runStateColor } from '../../helpers/nodes'
2525
import { stopWatchDuration } from '../../helpers/time'
2626
import { useTheme } from '@emotion/react'
27+
import MQTooltip from '../core/tooltip/MQTooltip'
2728
import MqCode from '../core/code/MqCode'
2829
import MqCopy from '../core/copy/MqCopy'
2930
import MqEmpty from '../core/empty/MqEmpty'
@@ -156,7 +157,11 @@ const Runs: FunctionComponent<RunsProps & DispatchProps> = (props) => {
156157
>
157158
<TableCell align='left'>
158159
<Box display={'flex'} alignItems={'center'}>
159-
{run.id.substring(0, 8)}...
160+
<MQTooltip title={run.id}>
161+
<Box>
162+
<MqText font={'mono'}>{run.id.substring(0, 8)}...</MqText>
163+
</Box>
164+
</MQTooltip>
160165
<MqCopy string={run.id} />
161166
</Box>
162167
</TableCell>

web/src/routes/events/Events.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,13 @@ const Events: React.FC<EventsProps> = ({
296296
>
297297
<TableCell align='left'>
298298
<Box display={'flex'} alignItems={'center'}>
299-
<MqText font={'mono'}>{event.run.runId.substring(0, 8)}...</MqText>
299+
<MQTooltip title={event.run.runId}>
300+
<Box>
301+
<MqText font={'mono'}>
302+
{event.run.runId.substring(0, 8)}...
303+
</MqText>
304+
</Box>
305+
</MQTooltip>
300306
<MqCopy string={event.run.runId} />
301307
</Box>
302308
</TableCell>

0 commit comments

Comments
 (0)