Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4330a91
#RI-3377 - Display cluster overview
egor-zalenski Aug 31, 2022
d7aa532
#RI-3377 - fix pr comments
egor-zalenski Aug 31, 2022
84f2a1c
Merge pull request #1097 from RedisInsight/fe/feature/RI-3377_Display…
egor-zalenski Aug 31, 2022
c6586d2
Merge pull request #1098 from RedisInsight/feature/RI-3377_Display_cl…
egor-zalenski Aug 31, 2022
95b8f76
Merge branch 'main' into feature/RI-2743_Enhanced_overview
egor-zalenski Aug 31, 2022
dc271a3
changed to capital letter
vlad-dargel Sep 2, 2022
7b28443
#RI-3366 - add primary node statistics table
rsergeenko Sep 2, 2022
fce6c5c
Merge branch 'feature/RI-2743_Enhanced_overview' into fe/feature/RI-3…
rsergeenko Sep 2, 2022
9e244df
#RI-3366 - fix tests
rsergeenko Sep 2, 2022
d919851
Merge pull request #1108 from RedisInsight/fe/feature/RI-3366_cluster…
rsergeenko Sep 2, 2022
b1d6664
#RI-3492 - fix some ui issues
rsergeenko Sep 6, 2022
351670d
Merge pull request #1121 from RedisInsight/fe/bugfix/RI-3492
vlad-dargel Sep 6, 2022
4de1b66
add test for primary node statistics
vlad-dargel Sep 9, 2022
4169706
finish tests
vlad-dargel Sep 12, 2022
6e76e7e
Merge pull request #1145 from RedisInsight/e2e/feature/enhanced-overv…
vlad-dargel Sep 13, 2022
06f6b4c
Merge branch 'main' into feature/RI-2743_Enhanced_overview
Sep 15, 2022
92cb8df
#RI-3368 - add memory & keys charts for cluster details
rsergeenko Sep 15, 2022
bbda5ad
Merge pull request #1159 from RedisInsight/fe/feature/RI-3368_memory_…
rsergeenko Sep 15, 2022
1b1e257
#RI-3477 - add colors to the overview table
rsergeenko Sep 16, 2022
09070f2
Merge pull request #1160 from RedisInsight/fe/feature/RI-3477_colors-…
rsergeenko Sep 16, 2022
ebc1b05
#RI-3550 - fix donut chart rendering with 0 values
rsergeenko Sep 19, 2022
ae80bbe
Merge pull request #1173 from RedisInsight/fe/bugfix/RI-3550_no-data-…
rsergeenko Sep 19, 2022
c63c016
#RI-3551 - change default width for donuts
rsergeenko Sep 19, 2022
233b9db
Merge pull request #1174 from RedisInsight/fe/bugfix/RI-3551_donut-width
rsergeenko Sep 19, 2022
00ace7f
Merge branch 'main' into feature/RI-2743_Enhanced_overview
rsergeenko Sep 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
'rehype-stringify': '<rootDir>/redisinsight/__mocks__/rehypeStringify.js',
'unist-util-visit': '<rootDir>/redisinsight/__mocks__/unistUtilsVisit.js',
'react-children-utilities': '<rootDir>/redisinsight/__mocks__/react-children-utilities.js',
d3: '<rootDir>/node_modules/d3/dist/d3.min.js',
},
setupFiles: [
'<rootDir>/redisinsight/ui/src/setup-env.ts',
Expand All @@ -38,6 +39,11 @@ module.exports = {
transformIgnorePatterns: [
'node_modules/(?!(monaco-editor|react-monaco-editor)/)',
],
// TODO: add tests for plugins
modulePathIgnorePatterns: [
'<rootDir>/redisinsight/ui/src/packages',
'<rootDir>/redisinsight/ui/src/mocks',
],
coverageThreshold: {
global: {
statements: 70,
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
"@testing-library/user-event": "^14.4.3",
"@types/axios": "^0.14.0",
"@types/classnames": "^2.2.11",
"@types/d3": "^7.4.0",
"@types/date-fns": "^2.6.0",
"@types/detect-port": "^1.3.0",
"@types/electron-store": "^3.2.0",
Expand Down Expand Up @@ -216,6 +217,7 @@
"buffer": "^6.0.3",
"classnames": "^2.3.1",
"connection-string": "^4.3.2",
"d3": "^7.6.1",
"date-fns": "^2.16.1",
"detect-port": "^1.3.0",
"electron-context-menu": "^3.1.0",
Expand Down
25 changes: 25 additions & 0 deletions redisinsight/ui/src/assets/img/overview/input.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions redisinsight/ui/src/assets/img/overview/key.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions redisinsight/ui/src/assets/img/overview/measure.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions redisinsight/ui/src/assets/img/overview/memory.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions redisinsight/ui/src/assets/img/overview/output.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions redisinsight/ui/src/assets/img/overview/time.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions redisinsight/ui/src/assets/img/overview/user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
.euiPopoverTitle {
text-transform: none !important;
}

.euiButton {
min-width: 93px !important;

&:focus {
text-decoration: none !important;
}
}
}

.container {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React from 'react'
import reactRouterDom from 'react-router-dom'
import { AnalyticsViewTab } from 'uiSrc/slices/interfaces/analytics'
import { act, fireEvent, render, screen } from 'uiSrc/utils/test-utils'
import AnalyticsTabs from './AnalyticsTabs'

jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useHistory: () => ({
push: jest.fn,
}),
}))

describe('StreamTabs', () => {
it('should render', () => {
expect(render(<AnalyticsTabs />)).toBeTruthy()
})

it('click on clusterDetails tab should call History push with /cluster-details path ', async () => {
const pushMock = jest.fn()
reactRouterDom.useHistory = jest.fn().mockReturnValue({ push: pushMock })

render(<AnalyticsTabs />)

await act(() => {
fireEvent.click(screen.getByTestId(`analytics-tab-${AnalyticsViewTab.ClusterDetails}`))
})

expect(pushMock).toHaveBeenCalledTimes(1)
expect(pushMock).toHaveBeenCalledWith('/instanceId/analytics/cluster-details')
})
it('click on SlowLog tab should call History push with /slowlog path ', async () => {
const pushMock = jest.fn()
reactRouterDom.useHistory = jest.fn().mockReturnValue({ push: pushMock })

render(<AnalyticsTabs />)

await act(() => {
fireEvent.click(screen.getByTestId(`analytics-tab-${AnalyticsViewTab.SlowLog}`))
})

expect(pushMock).toHaveBeenCalledTimes(1)
expect(pushMock).toHaveBeenCalledWith('/instanceId/analytics/slowlog')
})
})
49 changes: 49 additions & 0 deletions redisinsight/ui/src/components/analytics-tabs/AnalyticsTabs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React, { useCallback } from 'react'
import { EuiTab, EuiTabs } from '@elastic/eui'
import { useDispatch, useSelector } from 'react-redux'
import { useParams, useHistory } from 'react-router-dom'

import { Pages } from 'uiSrc/constants'
import { AnalyticsViewTab } from 'uiSrc/slices/interfaces/analytics'
import { analyticsSettingsSelector, setAnalyticsViewTab } from 'uiSrc/slices/analytics/settings'

import { analyticsViewTabs } from './constants'

const AnalyticsTabs = () => {
const { viewTab } = useSelector(analyticsSettingsSelector)
const history = useHistory()

const { instanceId } = useParams<{ instanceId: string }>()

const dispatch = useDispatch()

const onSelectedTabChanged = (id: AnalyticsViewTab) => {
if (id === AnalyticsViewTab.ClusterDetails) {
history.push(Pages.clusterDetails(instanceId))
}
if (id === AnalyticsViewTab.SlowLog) {
history.push(Pages.slowLog(instanceId))
}
dispatch(setAnalyticsViewTab(id))
}

const renderTabs = useCallback(() =>
[...analyticsViewTabs].map(({ id, label }) => (
<EuiTab
isSelected={viewTab === id}
onClick={() => onSelectedTabChanged(id)}
key={id}
data-testid={`analytics-tab-${id}`}
>
{label}
</EuiTab>
)), [viewTab])

return (
<>
<EuiTabs className="tabs-active-borders" data-test-subj="analytics-tabs">{renderTabs()}</EuiTabs>
</>
)
}

export default AnalyticsTabs
17 changes: 17 additions & 0 deletions redisinsight/ui/src/components/analytics-tabs/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { AnalyticsViewTab } from 'uiSrc/slices/interfaces/analytics'

interface AnalyticsTabs {
id: AnalyticsViewTab,
label: string,
}

export const analyticsViewTabs: AnalyticsTabs[] = [
{
id: AnalyticsViewTab.ClusterDetails,
label: 'Overview',
},
{
id: AnalyticsViewTab.SlowLog,
label: 'Slow Log',
},
]
3 changes: 3 additions & 0 deletions redisinsight/ui/src/components/analytics-tabs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import AnalyticsTabs from './AnalyticsTabs'

export default AnalyticsTabs
Loading