-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(frontend): fix analyzer results in trace DAG #2674
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to consider cleaning up nodes to not have to be connected to all of this state and such, maybe something to think latter on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, agree with that. I have been thinking about that for a while. We need to parse everything (span related) and inject it in the data object.