-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(frontend): fix analyzer results in trace DAG (#2674)
- Loading branch information
Showing
15 changed files
with
183 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
web/src/components/Visualization/components/DAG/AnalyzerResults.styled.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import {ExclamationCircleFilled} from '@ant-design/icons'; | ||
import {Typography} from 'antd'; | ||
import styled, {css} from 'styled-components'; | ||
|
||
export const Body = styled.div` | ||
margin-top: 5px; | ||
position: relative; | ||
`; | ||
|
||
export const Connector = styled.div` | ||
background-color: ${({theme}) => theme.color.error}; | ||
height: 2px; | ||
left: -26px; | ||
position: absolute; | ||
top: 49px; | ||
width: 26px; | ||
z-index: 9; | ||
`; | ||
|
||
export const Container = styled.div` | ||
background-color: ${({theme}) => theme.color.white}; | ||
border: ${({theme}) => `2px solid ${theme.color.error}`}; | ||
border-radius: 10px; | ||
font-size: ${({theme}) => theme.size.xs}; | ||
height: 100px; | ||
padding: 10px; | ||
position: absolute; | ||
right: -210px; | ||
top: -32px; | ||
width: 200px; | ||
`; | ||
|
||
export const Content = styled.div` | ||
height: 100%; | ||
overflow-y: scroll; | ||
::-webkit-scrollbar { | ||
display: none; | ||
} | ||
`; | ||
|
||
export const ErrorIcon = styled(ExclamationCircleFilled)<{$isAbsolute?: boolean}>` | ||
color: ${({theme}) => theme.color.error}; | ||
${({$isAbsolute}) => | ||
$isAbsolute && | ||
css` | ||
position: absolute; | ||
right: 10px; | ||
top: 5px; | ||
`} | ||
`; | ||
|
||
export const Text = styled(Typography.Text)` | ||
color: inherit; | ||
`; | ||
|
||
export const Title = styled(Typography.Title)` | ||
&& { | ||
margin-bottom: 0; | ||
} | ||
`; |
44 changes: 44 additions & 0 deletions
44
web/src/components/Visualization/components/DAG/AnalyzerResults.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import {Space} from 'antd'; | ||
import {useRef} from 'react'; | ||
|
||
import useOnClickOutside from 'hooks/useOnClickOutside'; | ||
import {TLintBySpanContent} from 'services/Span.service'; | ||
import * as S from './AnalyzerResults.styled'; | ||
|
||
interface IProps { | ||
lintErrors: TLintBySpanContent[]; | ||
onClose(): void; | ||
} | ||
|
||
const AnalyzerResults = ({lintErrors, onClose}: IProps) => { | ||
const ref = useRef(null); | ||
useOnClickOutside(ref, onClose); | ||
|
||
return ( | ||
<S.Container className="nowheel nodrag" ref={ref}> | ||
<S.Connector /> | ||
<S.Content> | ||
<Space> | ||
<S.ErrorIcon /> | ||
<S.Title level={4}>Analyzer errors</S.Title> | ||
</Space> | ||
<S.Body> | ||
{lintErrors.map(lintError => ( | ||
<div key={lintError.ruleName}> | ||
<S.Text strong>{lintError.ruleName}</S.Text> | ||
|
||
{lintError.errors.map((error, index) => ( | ||
// eslint-disable-next-line react/no-array-index-key | ||
<div key={index}> | ||
<S.Text type="secondary">- {error}</S.Text> | ||
</div> | ||
))} | ||
</div> | ||
))} | ||
</S.Body> | ||
</S.Content> | ||
</S.Container> | ||
); | ||
}; | ||
|
||
export default AnalyzerResults; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.