Skip to content

[RI-7194] Add "Create vector search" wizard #4718

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
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions redisinsight/ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ module.exports = {
'sonarjs/no-duplicate-string': 'off',
'sonarjs/cognitive-complexity': [1, 20],
'sonarjs/no-identical-functions': [0, 5],
'sonarjs/no-nested-template-literals': 'off',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

turned off so we can we can add theme related css inside styled components without an extra wrapper function

'import/order': [
1,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@
grow?: (typeof VALID_GROW_VALUES)[number]
$direction?: (typeof dirValues)[number]
$padding?: (typeof VALID_PADDING_VALUES)[number]
$gap?: GapSizeType
}

export const StyledFlexItem = styled.div<FlexItemProps>`
Expand All @@ -393,6 +394,7 @@
return 'column-reverse'
}
}};
${({ $gap = 'none' }) => ($gap ? flexGroupStyles.gapSizes[$gap] : '')}

Check warning on line 397 in redisinsight/ui/src/components/base/layout/flex/flex.styles.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
${({ grow }) => {
if (!grow) {
return flexItemStyles.growZero
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { IRoute, FeatureFlags, PageNames, Pages } from 'uiSrc/constants'
import {
BrowserPage,
VectorSearchPage,
HomePage,
InstancePage,
RedisCloudDatabasesPage,
Expand All @@ -22,6 +23,7 @@
import { getRouteIncludedByEnv, LAZY_LOAD } from '../config'

const LazyBrowserPage = lazy(() => import('uiSrc/pages/browser'))
const LazyVectorSearchPage = lazy(() => import('uiSrc/pages/vector-search'))

Check warning on line 26 in redisinsight/ui/src/components/main-router/constants/defaultRoutes.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 26 in redisinsight/ui/src/components/main-router/constants/defaultRoutes.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
const LazyHomePage = lazy(() => import('uiSrc/pages/home'))
const LazyWorkbenchPage = lazy(() => import('uiSrc/pages/workbench'))
const LazyPubSubPage = lazy(() => import('uiSrc/pages/pub-sub'))
Expand Down Expand Up @@ -55,6 +57,11 @@
path: Pages.browser(':instanceId'),
component: LAZY_LOAD ? LazyBrowserPage : BrowserPage,
},
{
pageName: PageNames.vectorSearch,
path: Pages.vectorSearch(':instanceId'),
component: LAZY_LOAD ? LazyVectorSearchPage : VectorSearchPage,

Check warning on line 63 in redisinsight/ui/src/components/main-router/constants/defaultRoutes.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
},
{
pageName: PageNames.workbench,
path: Pages.workbench(':instanceId'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
PubSubIcon,
SlowLogIcon,
WorkbenchIcon,
SearchIcon,
GithubIcon,
SettingsIcon,
} from 'uiSrc/components/base/icons'
Expand Down Expand Up @@ -138,6 +139,16 @@ const NavigationMenu = () => {
iconType: WorkbenchIcon,
onboard: ONBOARDING_FEATURES.WORKBENCH_PAGE,
},
{
tooltipText: 'Vector Search',
pageName: PageNames.vectorSearch,
ariaLabel: 'Vector Search',
onClick: () => handleGoPage(Pages.vectorSearch(connectedInstanceId)),
dataTestId: 'vector-search-page-btn',
connectedInstanceId,
isActivePage: activePage === `/${PageNames.vectorSearch}`,
iconType: SearchIcon,
},
{
tooltipText: 'Analysis Tools',
pageName: PageNames.analytics,
Expand Down
3 changes: 3 additions & 0 deletions redisinsight/ui/src/constants/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface IRoute {

export enum PageNames {
workbench = 'workbench',
vectorSearch = 'vector-search',
browser = 'browser',
search = 'search',
slowLog = 'slowlog',
Expand Down Expand Up @@ -49,6 +50,8 @@ export const Pages = {
sentinelDatabases: `${sentinel}/databases`,
sentinelDatabasesResult: `${sentinel}/databases-result`,
browser: (instanceId: string) => `/${instanceId}/${PageNames.browser}`,
vectorSearch: (instanceId: string) =>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just search?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because that's the name of the epic and the target branch
I thought that was the name of the feature

`/${instanceId}/${PageNames.vectorSearch}`,
workbench: (instanceId: string) => `/${instanceId}/${PageNames.workbench}`,
search: (instanceId: string) => `/${instanceId}/${PageNames.search}`,
pubSub: (instanceId: string) => `/${instanceId}/${PageNames.pubSub}`,
Expand Down
1 change: 1 addition & 0 deletions redisinsight/ui/src/pages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from './instance'
export * from './home'
export * from './redis-cluster'
export * from './autodiscover-cloud'
export * from './vector-search'
16 changes: 16 additions & 0 deletions redisinsight/ui/src/pages/vector-search/VectorSearchPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react'

import { VectorSearchCreateIndex } from './create-index/VectorSearchCreateIndex'
import { VectorSearchQuery } from './query/VectorSearchQuery'

export const VectorSearchPage = () => {

Check warning on line 6 in redisinsight/ui/src/pages/vector-search/VectorSearchPage.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
const hasIndexes = false

Check warning on line 7 in redisinsight/ui/src/pages/vector-search/VectorSearchPage.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

if (!hasIndexes) {
return <VectorSearchCreateIndex />

Check warning on line 10 in redisinsight/ui/src/pages/vector-search/VectorSearchPage.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 11 in redisinsight/ui/src/pages/vector-search/VectorSearchPage.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 11 in redisinsight/ui/src/pages/vector-search/VectorSearchPage.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

// TODO: QueryScreen

return <VectorSearchQuery />

Check warning on line 15 in redisinsight/ui/src/pages/vector-search/VectorSearchPage.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import React, { useState } from 'react'
import { useParams } from 'react-router-dom'

import { Stepper } from '@redis-ui/components'
import { Title } from 'uiSrc/components/base/text'
import { Button, SecondaryButton } from 'uiSrc/components/base/forms/buttons'
import { ChevronLeftIcon } from 'uiSrc/components/base/icons'

import { stepContents } from './steps'
import {
CreateIndexContent,
CreateIndexFooter,
CreateIndexHeader,
CreateIndexWrapper,
} from './styles'
import {
CreateSearchIndexParameters,
SampleDataType,
SearchIndexType,
} from './types'

const stepNextButtonTexts = [
'Proceed to adding data',
'Proceed to index',
'Create index',
]

type VectorSearchCreateIndexProps = {
initialStep?: number
}

export const VectorSearchCreateIndex = ({

Check warning on line 32 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
initialStep = 1,

Check warning on line 33 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}: VectorSearchCreateIndexProps) => {
const { instanceId } = useParams<{ instanceId: string }>()

Check warning on line 35 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const [step, setStep] = useState(initialStep)

Check warning on line 36 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const [createSearchIndexParameters, setCreateSearchIndexParameters] =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip: It's ok for now, since it's the first PR in a series, so I'll leave a note only to think about it.

I like the idea you went for a state variable to control this (instead of Redux), but we'll need to prop drill it to every component, in order to access some useful information. Instead of deep prop drilling, we may use React Context, and let it be a "central state storage" for the family of components related to the Vector Search setup.

But we may change this in the next PRs, once we have the other components in place and more vision on the data model itself.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, context will be the way to go if deep sharing of state is needed
this is just a skeleton/wrapper component w/o actual functionality after all

useState<CreateSearchIndexParameters>({
instanceId,
searchIndexType: SearchIndexType.REDIS_QUERY_ENGINE,
sampleDataType: SampleDataType.PRESET_DATA,
dataContent: '',
usePresetVectorIndex: false,
presetVectorIndexName: '',
tags: [],
})

Check warning on line 46 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

const setParameters = (params: Partial<CreateSearchIndexParameters>) => {

Check warning on line 48 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
setCreateSearchIndexParameters((prev) => ({ ...prev, ...params }))

Check warning on line 49 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 49 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 49 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
}

Check warning on line 50 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const showBackButton = step > initialStep

Check warning on line 51 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const StepContent = stepContents[step]

Check warning on line 52 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const onNextClick = () => {

Check warning on line 53 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
const isFinalStep = step === stepContents.length - 1

Check warning on line 54 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
if (isFinalStep) {
alert(
`TODO: trigger index creation for params: ${JSON.stringify(createSearchIndexParameters)}`,
)

Check warning on line 58 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
return

Check warning on line 59 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 60 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 60 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

setStep(step + 1)

Check warning on line 62 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 63 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
const onBackClick = () => {

Check warning on line 64 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
setStep(step - 1)

Check warning on line 65 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 66 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

return (
<CreateIndexWrapper direction="column" justify="between">
<CreateIndexHeader direction="row">
<Title size="M" data-testid="title">
New vector search
</Title>
<Stepper currentStep={step} title="test">
<Stepper.Step>Select a database</Stepper.Step>
<Stepper.Step>Adding data</Stepper.Step>
<Stepper.Step>Create Index</Stepper.Step>
</Stepper>
</CreateIndexHeader>
<CreateIndexContent direction="column" grow={1}>
<StepContent setParameters={setParameters} />
</CreateIndexContent>
<CreateIndexFooter direction="row">
{showBackButton && (

Check warning on line 84 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
<SecondaryButton
iconSide="left"
icon={ChevronLeftIcon}
onClick={onBackClick}
>
Back
</SecondaryButton>

Check warning on line 91 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
)}
<div />
<Button onClick={onNextClick}>{stepNextButtonTexts[step]}</Button>
</CreateIndexFooter>
</CreateIndexWrapper>
)

Check warning on line 97 in redisinsight/ui/src/pages/vector-search/create-index/VectorSearchCreateIndex.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react'

import { FlexItem } from 'uiSrc/components/base/layout/flex'
import { Text } from 'uiSrc/components/base/text'
import { IStepComponent } from '../types'

export const AddDataStep: IStepComponent = ({ setParameters }) => (

Check warning on line 7 in redisinsight/ui/src/pages/vector-search/create-index/steps/AddDataStep.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
<>
<FlexItem direction="column" $gap="m">
<FlexItem direction="row" $gap="m">
<div>Box1</div>
<div>Box2</div>
</FlexItem>
</FlexItem>
<FlexItem direction="column" $gap="m">
<Text>Select sample dataset</Text>
</FlexItem>
<FlexItem direction="column" $gap="m">
<Text>Data content</Text>
<FlexItem direction="row" $gap="m">
<div>Box1</div>
<div>Box2</div>
<div>Box3</div>
</FlexItem>
</FlexItem>
</>

Check warning on line 26 in redisinsight/ui/src/pages/vector-search/create-index/steps/AddDataStep.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react'

import { FlexItem } from 'uiSrc/components/base/layout/flex'
import { Text } from 'uiSrc/components/base/text'
import { IStepComponent } from '../types'

export const CreateIndexStep: IStepComponent = ({ setParameters }) => (

Check warning on line 7 in redisinsight/ui/src/pages/vector-search/create-index/steps/CreateIndexStep.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
<>
<FlexItem direction="column" $gap="m">
<Text>Vector index</Text>
<Text size="S">
Indexes tell Redis how to search your data. Creating an index enables
fast, accurate retrieval across your dataset.
</Text>
</FlexItem>
<FlexItem direction="column" $gap="m">
<Text>Index name</Text>
<Text>Bikes</Text>
</FlexItem>
<FlexItem direction="column" $gap="m">
<FlexItem direction="row" $gap="m">
<div>Box1</div>
<div>Box2</div>
<div>Box3</div>
</FlexItem>
</FlexItem>
</>

Check warning on line 27 in redisinsight/ui/src/pages/vector-search/create-index/steps/CreateIndexStep.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { IStepComponent } from '../types'

export const SelectDatabaseStep: IStepComponent = () => null

Check warning on line 3 in redisinsight/ui/src/pages/vector-search/create-index/steps/SelectDatabaseStep.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 3 in redisinsight/ui/src/pages/vector-search/create-index/steps/SelectDatabaseStep.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { SelectDatabaseStep } from './SelectDatabaseStep'
import { AddDataStep } from './AddDataStep'
import { CreateIndexStep } from './CreateIndexStep'

export const stepContents = [SelectDatabaseStep, AddDataStep, CreateIndexStep]
51 changes: 51 additions & 0 deletions redisinsight/ui/src/pages/vector-search/create-index/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import styled, { css } from 'styled-components'
import { useTheme } from '@redis-ui/styles'
import { FlexGroup, FlexItem } from 'uiSrc/components/base/layout/flex'

export const CreateIndexWrapper = styled(FlexGroup)`
${() => css`
margin-top: ${useTheme().core.space.space250};
margin-bottom: ${useTheme().core.space.space250};
background-color: ${useTheme().semantic.color.background.neutral100};
border-radius: 8px;
`}

Check warning on line 11 in redisinsight/ui/src/pages/vector-search/create-index/styles.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

width: 95%;
margin-left: auto;
margin-right: auto;
`

export const CreateIndexHeader = styled(FlexItem)`
${() => css`
padding: ${useTheme().core.space.space300};
border-color: ${useTheme().color.dusk200};
`}

justify-content: space-between;
border: 1px solid;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
`

export const CreateIndexContent = styled(FlexItem)`
${() => css`
gap: ${useTheme().core.space.space550};
padding: ${useTheme().core.space.space300};
border-color: ${useTheme().color.dusk200};
`}

border-left: 1px solid;
border-right: 1px solid;
`

export const CreateIndexFooter = styled(FlexItem)`
${() => css`
padding: ${useTheme().core.space.space300};
border-color: ${useTheme().color.dusk200};
`}

border: 1px solid;
justify-content: space-between;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
`
32 changes: 32 additions & 0 deletions redisinsight/ui/src/pages/vector-search/create-index/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
export enum SearchIndexType {
REDIS_QUERY_ENGINE = 'redis_query_engine',
VECTOR_SET = 'vector_set',
}

export enum SampleDataType {
PRESET_DATA = 'preset_data',
CUSTOM_DATA = 'custom_data',
}

export type CreateSearchIndexParameters = {
// Select a database step
instanceId: string

// Adding data step
searchIndexType: SearchIndexType
sampleDataType: SampleDataType
dataContent: string

// Create index step
usePresetVectorIndex: boolean
presetVectorIndexName: string
tags: string[]
}

export type StepComponentProps = {
setParameters: (params: Partial<CreateSearchIndexParameters>) => void
}

export interface IStepComponent {
(props: StepComponentProps): JSX.Element | null
}
4 changes: 4 additions & 0 deletions redisinsight/ui/src/pages/vector-search/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { VectorSearchPage } from './VectorSearchPage'

export { VectorSearchPage }
export default VectorSearchPage
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react'

export const VectorSearchQuery = () => {

Check warning on line 3 in redisinsight/ui/src/pages/vector-search/query/VectorSearchQuery.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
// TODO: implement this component
// https://www.figma.com/design/oO2eYRuuLmfzUYLkvCkFhM/Search-page?node-id=645-37412&t=TSwcttCYa4Ld9WzC-4
;
return <h4>TODO</h4>

Check warning on line 7 in redisinsight/ui/src/pages/vector-search/query/VectorSearchQuery.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}
Loading