Skip to content

Commit

Permalink
feat(log): put download log icon into log tab
Browse files Browse the repository at this point in the history
  • Loading branch information
YuryShkoda committed Apr 26, 2023
1 parent a38a9f9 commit 777b3a5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
19 changes: 0 additions & 19 deletions web/src/containers/Studio/internal/components/log/logComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,25 +265,6 @@ const LogComponent = (props: LogComponentProps) => {
</pre>
</div>
)}
<div
style={{
display: 'flex',
justifyContent: 'center',

marginTop: 10
}}
>
<Button
onClick={(evt: SyntheticEvent) => {
download(evt, clearErrorsAndWarningsHtmlWrapping(logBody))
}}
variant="contained"
color="primary"
startIcon={<FileDownloadIcon />}
>
download entire log
</Button>
</div>
</>
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { ErrorOutline, Warning } from '@mui/icons-material'
import { LogObject } from '../../../../../utils'
import FileDownloadIcon from '@mui/icons-material/FileDownload'
import {
LogObject,
download,
clearErrorsAndWarningsHtmlWrapping
} from '../../../../../utils'
import Tooltip from '@mui/material/Tooltip'

interface LogTabProps {
log: LogObject
}

const LogTabWithIcons = (props: LogTabProps) => {
const { errors, warnings } = props.log
const { errors, warnings, body } = props.log

return (
<div
Expand All @@ -24,6 +30,14 @@ const LogTabWithIcons = (props: LogTabProps) => {
{warnings && warnings.length !== 0 && (
<Warning style={{ fontSize: 20, color: 'green' }} />
)}{' '}
<Tooltip
title="Download entire log"
onClick={(evt) => {
download(evt, clearErrorsAndWarningsHtmlWrapping(body))
}}
>
<FileDownloadIcon style={{ fontSize: 20, marginLeft: 20 }} />
</Tooltip>
</div>
)
}
Expand Down

0 comments on commit 777b3a5

Please sign in to comment.