-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add production/consumption to topic list and topic overview #2789
Draft
acass91
wants to merge
20
commits into
provectus:master
Choose a base branch
from
acass91:iss-2709-display-topic-throughput-stats
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
11cc607
Add production/consumption to topic list and topic overview
acass91 aff8d06
Merge branch 'master' into iss-2709-display-topic-throughput-stats
acass91 2757d56
Merge branch 'master' into iss-2709-display-topic-throughput-stats
acass91 c475b31
Fix linting issues
acass91 a9d3e4d
Revert use of semicolons and quotes
acass91 4398a31
Fix failing tests
acass91 0a2fca2
Fix typo causing lint error
acass91 ebaf0b4
Improve code coverage for throughput code
acass91 618b72a
Merge branch 'master' into iss-2709-display-topic-throughput-stats
acass91 d328731
Merge branch 'master' of github.com:acass91/kafka-ui into iss-2709-di…
acass91 c4f6fe2
Add ThroughputCell component
acass91 c630c52
Apply suggestions from code review
acass91 76dc394
Inline the throughput code
acass91 528c888
Merge branch 'master' into iss-2709-display-topic-throughput-stats
acass91 e2d2923
Update tests
acass91 fe03d78
;wMerge branch 'master' of github.com:acass91/kafka-ui into iss-2709-…
acass91 3051a7d
Add up/down arrows to throughput cell
acass91 96d7b6e
Merge branch 'master' into iss-2709-display-topic-throughput-stats
David-DB88 d4052ee
change arrow icons like in design
David-DB88 7da7d4f
refactoring ThroughputCell component
David-DB88 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
kafka-ui-react-app/src/components/Topics/List/ThroughputCell.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,71 @@ | ||
import React from 'react'; | ||
import { CellContext } from '@tanstack/react-table'; | ||
import { Topic } from 'generated-sources'; | ||
import BytesFormatted from 'components/common/BytesFormatted/BytesFormatted'; | ||
import CircleArrowDownIcon from 'components/common/Icons/CircleArrowDownIcon'; | ||
import CircleArrowUpIcon from 'components/common/Icons/CircleArrowUpIcon'; | ||
import styled from 'styled-components'; | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
span { | ||
display: flex; | ||
align-items: center; | ||
&:first-child { | ||
margin-right: 10px; | ||
} | ||
& > svg { | ||
margin-right: 5px; | ||
} | ||
} | ||
`; | ||
export const ThroughputCell: React.FC<CellContext<Topic, unknown>> = ({ | ||
row: { original }, | ||
}) => { | ||
const production = original.bytesInPerSec; | ||
const consumption = original.bytesOutPerSec; | ||
|
||
if (production === undefined && consumption === undefined) { | ||
return ( | ||
<Wrapper> | ||
<span> | ||
<CircleArrowDownIcon /> | ||
N/A | ||
</span> | ||
<span> | ||
<CircleArrowUpIcon /> | ||
N/A | ||
</span> | ||
</Wrapper> | ||
); | ||
} | ||
if (production === undefined) { | ||
return ( | ||
<Wrapper> | ||
<span> | ||
<CircleArrowUpIcon /> <BytesFormatted value={consumption} /> | ||
</span> | ||
</Wrapper> | ||
); | ||
} | ||
if (consumption === undefined) { | ||
return ( | ||
<Wrapper> | ||
<span> | ||
<CircleArrowDownIcon /> <BytesFormatted value={production} /> | ||
</span> | ||
</Wrapper> | ||
); | ||
} | ||
|
||
return ( | ||
<Wrapper> | ||
<span> | ||
<CircleArrowDownIcon /> <BytesFormatted value={production} /> | ||
</span> | ||
<span> | ||
<CircleArrowUpIcon /> <BytesFormatted value={consumption} /> | ||
</span> | ||
</Wrapper> | ||
); | ||
}; |
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
26 changes: 26 additions & 0 deletions
26
kafka-ui-react-app/src/components/common/Icons/ArrowUpIcon.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,26 @@ | ||
import React from 'react'; | ||
|
||
const ArrowUpIcon: React.FC = () => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="8" | ||
height="10" | ||
viewBox="0 0 8 10" | ||
> | ||
{/* Font Awesome Pro 6.1.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. */} | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M4 10C3.44772 10 3 9.55228 3 9L3 1C3 0.447714 3.44772 -3.97973e-07 4 -3.49691e-07C4.55229 -3.01409e-07 5 0.447715 5 1L5 9C5 9.55228 4.55228 10 4 10Z" | ||
fill="#73848C" | ||
/> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M7.70711 4.70711C7.31658 5.09763 6.68342 5.09763 6.29289 4.70711L4 2.41421L1.70711 4.70711C1.31658 5.09763 0.683418 5.09763 0.292893 4.70711C-0.097631 4.31658 -0.0976309 3.68342 0.292893 3.29289L3.29289 0.292893C3.68342 -0.0976318 4.31658 -0.0976318 4.70711 0.292893L7.70711 3.29289C8.09763 3.68342 8.09763 4.31658 7.70711 4.70711Z" | ||
fill="#73848C" | ||
/> | ||
</svg> | ||
); | ||
|
||
export default ArrowUpIcon; |
28 changes: 28 additions & 0 deletions
28
kafka-ui-react-app/src/components/common/Icons/CircleArrowDownIcon.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,28 @@ | ||
import React from 'react'; | ||
|
||
const CircleArrowDownIcon: React.FC = () => { | ||
return ( | ||
<svg | ||
width="16" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<circle cx="8" cy="8" r="8" fill="#E3E6E8" /> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M8 3C8.55228 3 9 3.44772 9 4L9 12C9 12.5523 8.55229 13 8 13C7.44772 13 7 12.5523 7 12L7 4C7 3.44772 7.44772 3 8 3Z" | ||
fill="#73848C" | ||
/> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M4.29289 8.29289C4.68342 7.90237 5.31658 7.90237 5.70711 8.29289L8 10.5858L10.2929 8.29289C10.6834 7.90237 11.3166 7.90237 11.7071 8.29289C12.0976 8.68342 12.0976 9.31658 11.7071 9.70711L8.70711 12.7071C8.31658 13.0976 7.68342 13.0976 7.29289 12.7071L4.29289 9.70711C3.90237 9.31658 3.90237 8.68342 4.29289 8.29289Z" | ||
fill="#73848C" | ||
/> | ||
</svg> | ||
); | ||
}; | ||
export default CircleArrowDownIcon; |
28 changes: 28 additions & 0 deletions
28
kafka-ui-react-app/src/components/common/Icons/CircleArrowUpIcon.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,28 @@ | ||
import React from 'react'; | ||
|
||
const CircleArrowUpIcon: React.FC = () => { | ||
return ( | ||
<svg | ||
width="16" | ||
height="17" | ||
viewBox="0 0 16 17" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<circle cx="8" cy="8.25781" r="8" fill="#E3E6E8" /> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M8 13.2578C7.44772 13.2578 7 12.8101 7 12.2578L7 4.25781C7 3.70553 7.44772 3.25781 8 3.25781C8.55229 3.25781 9 3.70553 9 4.25781L9 12.2578C9 12.8101 8.55228 13.2578 8 13.2578Z" | ||
fill="#73848C" | ||
/> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M11.7071 7.96492C11.3166 8.35544 10.6834 8.35544 10.2929 7.96492L8 5.67203L5.70711 7.96492C5.31658 8.35544 4.68342 8.35544 4.29289 7.96492C3.90237 7.57439 3.90237 6.94123 4.29289 6.5507L7.29289 3.55071C7.68342 3.16018 8.31658 3.16018 8.70711 3.55071L11.7071 6.55071C12.0976 6.94123 12.0976 7.57439 11.7071 7.96492Z" | ||
fill="#73848C" | ||
/> | ||
</svg> | ||
); | ||
}; | ||
export default CircleArrowUpIcon; |
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
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 can refactor this part in a tiny component. and use it in this conditions.
one question why are we checking
if (production === undefined)
instead ofif(!production)
.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.
@Mgrdich i just change conditions take a look please if its normal ?