-
Notifications
You must be signed in to change notification settings - Fork 415
RI-7437 Rework the visuals of the Slow Log page #5154
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
595cde1
feat(ui): update the layout of the slow log page
valkirilov 497fb8f
feat(ui): update the slow log table
valkirilov d448f27
feat(ui): update the visual of the clear slow log popover
valkirilov 83bcab1
test(ui): update slow log tests to use new redis ui table
valkirilov 2ffa2ce
refactor(ui): cleanup unnecessary styles
valkirilov 835799d
feat(ui): replace "clear slo log" popover with a modal
valkirilov 9149c63
refactor(ui): update state names to reflect the modal change
valkirilov fe750a2
refactor(ui): apply comments imporvements
valkirilov 315224d
refactor(ui): cleanup unnecessary markup
valkirilov 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
This file contains hidden or 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,6 @@ | ||
| import styled from 'styled-components' | ||
| import { RiSelect } from 'uiSrc/components/base/forms/select/RiSelect' | ||
|
|
||
| export const StyledSelect = styled(RiSelect)` | ||
| border: none; | ||
| ` |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -32,17 +32,15 @@ | |
| import { AnalyticsViewTab } from 'uiSrc/slices/interfaces/analytics' | ||
|
|
||
| import { FormatedDate } from 'uiSrc/components' | ||
| import { FlexItem, Row } from 'uiSrc/components/base/layout/flex' | ||
| import { Text } from 'uiSrc/components/base/text' | ||
| import { | ||
| defaultValueRender, | ||
| RiSelect, | ||
| } from 'uiSrc/components/base/forms/select/RiSelect' | ||
| import { Col, FlexItem, Row } from 'uiSrc/components/base/layout/flex' | ||
| import { Text, Title } from 'uiSrc/components/base/text' | ||
| import { defaultValueRender } from 'uiSrc/components/base/forms/select/RiSelect' | ||
| import { SlowLog } from 'apiSrc/modules/slow-log/models' | ||
|
|
||
| import { Actions, EmptySlowLog, SlowLogTable } from './components' | ||
|
|
||
| import styles from './styles.module.scss' | ||
| import { StyledSelect } from './SlowLogPage.styles' | ||
|
|
||
| const HIDE_TIMESTAMP_FROM_WIDTH = 850 | ||
| const DEFAULT_COUNT_VALUE = '50' | ||
|
|
@@ -144,85 +142,93 @@ | |
| const isEmptySlowLog = !data.length | ||
|
|
||
| return ( | ||
| <div className={styles.main} data-testid="slow-log-page"> | ||
| <Row className={styles.header} align="center" justify="between"> | ||
| <FlexItem> | ||
| <AnalyticsTabs /> | ||
| </FlexItem> | ||
|
|
||
| <FlexItem> | ||
| {connectionType !== ConnectionType.Cluster && config && ( | ||
| <Text size="xs" color="subdued" data-testid="config-info"> | ||
| Execution time:{' '} | ||
| {numberWithSpaces( | ||
| convertNumberByUnits(slowlogLogSlowerThan, durationUnit), | ||
| )} | ||
| | ||
| {durationUnit === DurationUnits.milliSeconds | ||
| ? DurationUnits.mSeconds | ||
| : DurationUnits.microSeconds} | ||
| , Max length: {numberWithSpaces(slowlogMaxLen)} | ||
| </Text> | ||
| )} | ||
| </FlexItem> | ||
| </Row> | ||
|
|
||
| <Col className={styles.main} data-testid="slow-log-page"> | ||
| <AutoSizer disableHeight> | ||
| {({ width }) => ( | ||
| <div style={{ width }}> | ||
| <Row className={styles.header} align="center" justify="between"> | ||
| <FlexItem> | ||
| <AnalyticsTabs /> | ||
| </FlexItem> | ||
|
|
||
| <FlexItem> | ||
| <Row align="center" gap="xl"> | ||
| {connectionType !== ConnectionType.Cluster && config && ( | ||
| <Text size="s" color="secondary" data-testid="config-info"> | ||
| Execution time:{' '} | ||
| {numberWithSpaces( | ||
| convertNumberByUnits( | ||
| slowlogLogSlowerThan, | ||
| durationUnit, | ||
| ), | ||
| )} | ||
| | ||
| {durationUnit === DurationUnits.milliSeconds | ||
| ? DurationUnits.mSeconds | ||
| : DurationUnits.microSeconds} | ||
| , Max length: {numberWithSpaces(slowlogMaxLen)} | ||
| </Text> | ||
| )} | ||
|
|
||
| <Actions | ||
| width={width} | ||
| isEmptySlowLog={isEmptySlowLog} | ||
| durationUnit={durationUnit} | ||
| onClear={onClearSlowLogs} | ||
| onRefresh={getSlowLogs} | ||
| /> | ||
| </Row> | ||
| </FlexItem> | ||
| </Row> | ||
|
|
||
| <Row | ||
| className={styles.actionsLine} | ||
| align="center" | ||
| justify="between" | ||
| > | ||
| <FlexItem> | ||
| <Row align="center" gap="s"> | ||
| <Title size="L" color="primary"> | ||
| Slow Log | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks weird. You have the title in the tab, and right below it, you have it again
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's what we have in Figma, I didn't make it up myself 🤷♂️ |
||
| </Title> | ||
| </FlexItem> | ||
| <FlexItem> | ||
| <Row align="center" gap="xs"> | ||
| <FlexItem> | ||
| <Text color="subdued"> | ||
| <Text size="s" color="primary"> | ||
| {connectionType === ConnectionType.Cluster | ||
| ? 'Display per node:' | ||
| : 'Display up to:'} | ||
| </Text> | ||
| </FlexItem> | ||
| <FlexItem> | ||
| <RiSelect | ||
| <StyledSelect | ||
| options={countOptions} | ||
| valueRender={defaultValueRender} | ||
| value={count} | ||
| onChange={(value) => setCount(value)} | ||
| className={styles.countSelect} | ||
| data-testid="count-select" | ||
| /> | ||
| </FlexItem> | ||
| {width > HIDE_TIMESTAMP_FROM_WIDTH && ( | ||
| <FlexItem style={{ marginLeft: 12 }}> | ||
| <Text | ||
| size="xs" | ||
| color="subdued" | ||
| size="s" | ||
| color="secondary" | ||
| data-testid="entries-from-timestamp" | ||
| > | ||
| ({data.length} entries | ||
| {lastTimestamp && ( | ||
| <> | ||
| <span> from </span> | ||
| <FormatedDate date={lastTimestamp * 1000} /> | ||
| </> | ||
| )} | ||
| ) | ||
| </Text> | ||
| </FlexItem> | ||
| )} | ||
| </Row> | ||
| </FlexItem> | ||
| <FlexItem> | ||
| <Actions | ||
| width={width} | ||
| isEmptySlowLog={isEmptySlowLog} | ||
| durationUnit={durationUnit} | ||
| onClear={onClearSlowLogs} | ||
| onRefresh={getSlowLogs} | ||
| /> | ||
| </FlexItem> | ||
| </Row> | ||
| </div> | ||
| )} | ||
|
|
@@ -239,7 +245,7 @@ | |
| durationUnit={durationUnit} | ||
| /> | ||
| )} | ||
| </div> | ||
| </Col> | ||
| ) | ||
| } | ||
|
|
||
|
|
||
7 changes: 7 additions & 0 deletions
7
redisinsight/ui/src/pages/slow-log/components/Actions/Actions.styles.ts
This file contains hidden or 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,7 @@ | ||
| import styled from 'styled-components' | ||
|
|
||
| export const StyledInfoIconWrapper = styled.span` | ||
| display: flex; | ||
| align-self: center; | ||
| cursor: pointer; | ||
| ` |
This file contains hidden or 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
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.
I know you've copied this over but this is a weird way to represent a single string value
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, it's the same code that we had so far. I've worked only on the visual representation of the surrounding elements.