Skip to content
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

#RI-2390 - rework tooltip about db index #462

Merged
merged 1 commit into from Mar 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -23,6 +23,7 @@ import {
htmlIdGenerator,
EuiLink,
keys,
EuiCallOut,
} from '@elastic/eui'
import { capitalize, isEmpty, pick } from 'lodash'
import ReactDOM from 'react-dom'
Expand Down Expand Up @@ -556,16 +557,6 @@ const AddStandaloneForm = (props: Props) => {
</EuiToolTip>
)

const AppendDbIndex = () => (
<EuiToolTip
anchorClassName="inputAppendIcon"
position="right"
content="Select the Redis logical database to work with in Browser and Workbench."
>
<EuiIcon type="iInCircle" style={{ cursor: 'pointer' }} />
</EuiToolTip>
)

const AppendEndpoints = () => (
<EuiToolTip
title="Host:port"
Expand Down Expand Up @@ -731,18 +722,27 @@ const AddStandaloneForm = (props: Props) => {
<EuiFlexGroup
className={flexGroupClassName}
>
<EuiFlexItem className={flexItemClassName}>
<EuiCallOut>
<EuiText size="s" data-testid="db-index-message">
When the database is added, you can select logical databases only in CLI.
To work with other logical databases in Browser and Workbench, add another database with the same host and port,
but a different database index.
</EuiText>
</EuiCallOut>
</EuiFlexItem>
<EuiFlexItem className={cx(
flexItemClassName,
styles.dbInput,
{ [styles.dbInputBig]: !flexItemClassName }
)}
>
<EuiFormRow label="Database Index" helpText="Should not exceed 15.">
<EuiFormRow label="Select the Redis logical database" helpText="Should not exceed 15.">
<EuiFieldNumber
name="db"
id="db"
data-testid="db"
style={{ width: '100%' }}
style={{ width: 120 }}
placeholder="Enter Database Index"
value={formik.values.db ?? '0'}
maxLength={6}
Expand All @@ -755,7 +755,6 @@ const AddStandaloneForm = (props: Props) => {
type="text"
min={0}
max={MAX_DATABASE_INDEX_NUMBER}
append={<AppendDbIndex />}
/>
</EuiFormRow>
</EuiFlexItem>
Expand Down