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
37a218c
#RI-6265 - update home page
rsergeenko Nov 5, 2024
6030dcb
#RI-6265 - fix tests
rsergeenko Nov 5, 2024
91623b3
remove tests
mariasergeenko Nov 6, 2024
410c3a6
add port
mariasergeenko Nov 6, 2024
91587c2
Merge branch 'main' into e2e/feature/RI-6265_update-list-of-databases
mariasergeenko Nov 6, 2024
b09be46
update delete
mariasergeenko Nov 6, 2024
189f7cd
update
mariasergeenko Nov 6, 2024
f535aec
Merge remote-tracking branch 'origin/main' into e2e/feature/RI-6265_u…
mariasergeenko Nov 7, 2024
aa0cf5b
change delete method
mariasergeenko Nov 7, 2024
2c4565a
change search db test
mariasergeenko Nov 7, 2024
e1ec2b0
Merge remote-tracking branch 'origin/main' into fe/feature/RI-6265_up…
mariasergeenko Nov 7, 2024
cd8b63c
Merge branch 'fe/feature/RI-6265_update-list-of-databases' into e2e/f…
mariasergeenko Nov 7, 2024
022ab95
Merge pull request #4070 from RedisInsight/e2e/feature/RI-6265_update…
mariasergeenko Nov 7, 2024
e56b6fa
#RI-6268 - change add database forms
rsergeenko Nov 11, 2024
07e6445
Merge pull request #4078 from RedisInsight/fe/feature/RI-6268_update-…
vlad-dargel Nov 12, 2024
63d8225
Merge branch 'main' into fe/feature/RI-6265_update-list-of-databases
vlad-dargel Nov 12, 2024
bce69e9
Merge branch 'main' into fe/feature/RI-6265_update-list-of-databases
vlad-dargel Nov 12, 2024
2ea29b1
#RI-6309 - 6313 - defect fixing
rsergeenko Nov 12, 2024
cbe857e
Merge pull request #4080 from RedisInsight/bugfix/feature/RI-6268
rsergeenko Nov 12, 2024
6ded30c
#RI-6313 - add table borders
rsergeenko Nov 12, 2024
1fa4727
#RI-6313 - change refresh instances on success import, refresh import…
rsergeenko Nov 13, 2024
359401c
Merge branch 'main' into fe/feature/RI-6265_update-list-of-databases
vlad-dargel Nov 13, 2024
03e2dd3
Merge branch 'main' into fe/feature/RI-6265_update-list-of-databases
vlad-dargel Nov 13, 2024
21ccdb8
Merge branch 'main' into fe/feature/RI-6265_update-list-of-databases
vlad-dargel Nov 13, 2024
b51401f
Merge branch 'main' into fe/feature/RI-6265_update-list-of-databases
vlad-dargel Nov 14, 2024
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
3 changes: 3 additions & 0 deletions redisinsight/ui/src/assets/img/icons/star.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions redisinsight/ui/src/assets/img/oauth/cloud_centered.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions redisinsight/ui/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import GlobalSubscriptions from './global-subscriptions'
import MonitorWrapper from './monitor'
import PagePlaceholder from './page-placeholder'
import BulkActionsConfig from './bulk-actions-config'
import ImportDatabasesDialog from './import-databases-dialog'
import OnboardingTour from './onboarding-tour'
import CodeBlock from './code-block'
import ShowChildByCondition from './show-child-by-condition'
Expand Down Expand Up @@ -67,7 +66,6 @@ export {
ShortcutsFlyout,
PagePlaceholder,
BulkActionsConfig,
ImportDatabasesDialog,
OnboardingTour,
CodeBlock,
ShowChildByCondition,
Expand Down
22 changes: 11 additions & 11 deletions redisinsight/ui/src/components/item-list/ItemList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import {
EuiTableFieldDataColumnType,
EuiTableSelectionType,
PropertySort,
EuiBasicTableProps
} from '@elastic/eui'
import cx from 'classnames'
import React, { useEffect, useRef, useState } from 'react'
import { Maybe, Nullable } from 'uiSrc/utils'
import { Maybe } from 'uiSrc/utils'
import { findColumn, getColumnWidth, hideColumn } from './utils'

import { ActionBar, DeleteAction, ExportAction } from './components'
Expand All @@ -16,13 +17,14 @@ import styles from './styles.module.scss'

export interface Props<T> {
width: number
editedInstance: Nullable<T>
columns: EuiTableFieldDataColumnType<T>[]
columnsToHide?: string[]
onDelete: (ids: T[]) => void
hideExport?: boolean
onExport?: (ids: T[], withSecrets: boolean) => void
onWheel: () => void
rowProps?: EuiBasicTableProps<T>['rowProps']
getSelectableItems?: (item: T) => boolean
loading: boolean
data: T[]
onTableChange: ({ sort, page }: Criteria<T>) => void
Expand All @@ -37,7 +39,8 @@ function ItemList<T extends { id: string; visible?: boolean }>({
hideExport = false,
onExport,
onWheel,
editedInstance,
rowProps,
getSelectableItems,
loading,
data: instances,
onTableChange,
Expand Down Expand Up @@ -143,7 +146,10 @@ function ItemList<T extends { id: string; visible?: boolean }>({
}

const selectionValue: EuiTableSelectionType<T> = {
onSelectionChange: (selected: T[]) => setSelection(selected)
selectable: (item) => (getSelectableItems ? getSelectableItems?.(item) : true),
onSelectionChange: (selected: T[]) => {
setSelection(selected)
}
}

const handleResetSelection = () => {
Expand All @@ -159,12 +165,6 @@ function ItemList<T extends { id: string; visible?: boolean }>({
tableRef.current?.setSelection([])
}

const toggleSelectedRow = (instance: T) => ({
className: cx({
'euiTableRow-isSelected': instance?.id === editedInstance?.id
})
})

const actionMsg = (action: string) => `
Selected
${' '}
Expand All @@ -183,7 +183,7 @@ function ItemList<T extends { id: string; visible?: boolean }>({
loading={loading}
message={message}
columns={columns ?? []}
rowProps={toggleSelectedRow}
rowProps={rowProps}
sorting={{ sort }}
selection={selectionValue}
onWheel={onWheel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ describe('NavigationMenu', () => {
expect(screen.getByTestId('settings-page-btn')).toBeTruthy()
})

it('should render cloud link', () => {
const { container } = render(<NavigationMenu />)

const createCloudLink = container.querySelector('[data-test-subj="create-cloud-nav-link"]')
expect(createCloudLink).toBeTruthy()
})

it('should render github btn with proper link', () => {
(appInfoSelector as jest.Mock).mockImplementation(() => ({
...mockAppInfoSelector,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { FeatureFlagComponent } from 'uiSrc/components'

import { appContextSelector } from 'uiSrc/slices/app/context'
import { AppWorkspace } from 'uiSrc/slices/interfaces'
import CreateCloud from './components/create-cloud'
import HelpMenu from './components/help-menu/HelpMenu'
import NotificationMenu from './components/notifications-center'

Expand Down Expand Up @@ -309,6 +310,7 @@ const NavigationMenu = () => {
</div>
<div className={styles.bottomContainer}>
<FeatureFlagComponent name={FeatureFlags.disabledByEnv} enabledByDefault>
<CreateCloud />
<NotificationMenu />
</FeatureFlagComponent>
<HelpMenu />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from 'react'
import { cloneDeep } from 'lodash'
import { cleanup, mockedStore, render, fireEvent } from 'uiSrc/utils/test-utils'

import { setSSOFlow } from 'uiSrc/slices/instances/cloud'
import { OAuthSocialAction, OAuthSocialSource } from 'uiSrc/slices/interfaces'
import { setSocialDialogState } from 'uiSrc/slices/oauth/cloud'
import CreateCloud from './CreateCloud'

jest.mock('uiSrc/slices/app/features', () => ({
...jest.requireActual('uiSrc/slices/app/features'),
appFeatureFlagsFeaturesSelector: jest.fn().mockReturnValue({
cloudSso: {
flag: true
}
}),
}))

let store: typeof mockedStore
beforeEach(() => {
cleanup()
store = cloneDeep(mockedStore)
store.clearActions()
})

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

it('should call proper actions on click cloud button', () => {
const { container } = render(<CreateCloud />)
const createCloudLink = container.querySelector('[data-test-subj="create-cloud-nav-link"]')

fireEvent.click(createCloudLink as Element)

expect(store.getActions()).toEqual([
setSSOFlow(OAuthSocialAction.Create),
setSocialDialogState(OAuthSocialSource.NavigationMenu)
])
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React from 'react'
import cx from 'classnames'
import { EuiIcon, EuiLink, EuiToolTip } from '@elastic/eui'

import { OAuthSsoHandlerDialog } from 'uiSrc/components'
import { OAuthSocialAction, OAuthSocialSource } from 'uiSrc/slices/interfaces'
import { EXTERNAL_LINKS } from 'uiSrc/constants/links'
import CloudIcon from 'uiSrc/assets/img/oauth/cloud_centered.svg?react'

import { getUtmExternalLink } from 'uiSrc/utils/links'
import styles from '../../styles.module.scss'

const CreateCloud = () => (
<EuiToolTip
content="Create FREE Redis Cloud database"
position="right"
>
<span className={cx(styles.iconNavItem)}>
<OAuthSsoHandlerDialog>
{(ssoCloudHandlerClick) => (
<EuiLink
external={false}
onClick={(e) => {
ssoCloudHandlerClick(e,
{ source: OAuthSocialSource.NavigationMenu, action: OAuthSocialAction.Create })
}}
className={styles.cloudLink}
href={getUtmExternalLink(EXTERNAL_LINKS.tryFree, { campaign: 'navigation_menu' })}
target="_blank"
data-test-subj="create-cloud-nav-link"
>
<EuiIcon
className={styles.cloudIcon}
type={CloudIcon}
data-testid="cloud-db-icon"
/>
</EuiLink>
)}
</OAuthSsoHandlerDialog>
</span>
</EuiToolTip>
)

export default CreateCloud
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import CreateCloud from './CreateCloud'

export default CreateCloud
13 changes: 13 additions & 0 deletions redisinsight/ui/src/components/navigation-menu/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,16 @@ $sideBarWidth: 60px;
background-color: #465282 !important;
}
}

.cloudLink {
border-radius: 8px;
border: 1px solid #8BA2FF;
max-width: 44px;
max-height: 44px;

.cloudIcon {
fill:none;
max-width: 26px;
color: #BDC3D7;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react'
import { EuiButton, EuiText } from '@elastic/eui'
import { EuiButton, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'
import { useDispatch, useSelector } from 'react-redux'
import { useHistory } from 'react-router-dom'
import { find } from 'lodash'
Expand Down Expand Up @@ -108,11 +108,15 @@ const OAuthAutodiscovery = (props: Props) => {
{(form: React.ReactNode) => (
<>
<EuiText className={styles.text} color="subdued">
Auto-discover subscriptions and add your databases.
<br />
Discover subscriptions and add your databases.
A new Redis Cloud account will be created for you if you don’t have one.
</EuiText>
<EuiSpacer size="xl" />
<EuiText>Get started with</EuiText>
<EuiTitle className={styles.title} size="l"><h3>Redis Cloud account</h3></EuiTitle>
<EuiSpacer size="xl" />
{form}
<EuiSpacer size="xxl" />
<div className={styles.containerAgreement}>
<OAuthAgreement size="s" />
</div>
Expand Down
Loading
Loading