Skip to content

Commit 46fbb77

Browse files
Merge pull request #2161 from RedisInsight/feature/RI-4106_rework-search
Feature/ri 4106 rework search
2 parents 3cbeb71 + 9fdea69 commit 46fbb77

File tree

60 files changed

+982
-702
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+982
-702
lines changed
Lines changed: 4 additions & 5 deletions
Loading
Lines changed: 29 additions & 0 deletions
Loading

redisinsight/ui/src/assets/img/icons/treeview.svg

Lines changed: 1 addition & 1 deletion
Loading

redisinsight/ui/src/components/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import ShowChildByCondition from './show-child-by-condition'
2626
import RecommendationVoting from './recommendation-voting'
2727
import RecommendationCopyComponent from './recommendation-copy-component'
2828
import FeatureFlagComponent from './feature-flag-component'
29+
import { ModuleNotLoaded, FilterNotAvailable } from './messages'
2930

3031
export {
3132
NavigationMenu,
@@ -59,4 +60,6 @@ export {
5960
RecommendationVoting,
6061
RecommendationCopyComponent,
6162
FeatureFlagComponent,
63+
ModuleNotLoaded,
64+
FilterNotAvailable
6265
}

redisinsight/ui/src/components/keys-summary/KeysSummary.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ describe('KeysSummary', () => {
2828
const { queryByTestId } = render(
2929
<KeysSummary {...instance(mockedProps)} scanned={1} items={[{}]} totalItemsCount={1} />
3030
)
31-
expect(queryByTestId('keys-summary')).toHaveTextContent('Results: 1 key.')
31+
expect(queryByTestId('keys-summary')).toHaveTextContent('Results: 1.')
3232
})
3333

3434
it('should Keys summary show proper text with count > 1', () => {
3535
const { queryByTestId } = render(
3636
<KeysSummary {...instance(mockedProps)} scanned={2} items={[{}, {}]} totalItemsCount={2} />
3737
)
38-
expect(queryByTestId('keys-summary')).toHaveTextContent('Results: 2 keys.')
38+
expect(queryByTestId('keys-summary')).toHaveTextContent('Results: 2.')
3939
})
4040

4141
it('should not render Scan more button if showScanMore = false ', () => {

redisinsight/ui/src/components/keys-summary/KeysSummary.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,13 @@ const KeysSummary = (props: Props) => {
4747
<b>
4848
{'Results: '}
4949
<span data-testid="keys-number-of-results">{numberWithSpaces(resultsLength)}</span>
50-
{` key${resultsLength !== 1 ? 's' : ''}. `}
50+
{'. '}
5151
</b>
5252
<EuiTextColor color="subdued">
5353
{'Scanned '}
5454
<span data-testid="keys-number-of-scanned">{numberWithSpaces(scannedDisplay)}</span>
5555
{' / '}
5656
<span data-testid="keys-total">{nullableNumberWithSpaces(totalItemsCount)}</span>
57-
{' keys'}
5857
<span
5958
className={cx([styles.loading, { [styles.loadingShow]: loading }])}
6059
/>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
import { render } from 'uiSrc/utils/test-utils'
3+
4+
import FilterNotAvailable from './FilterNotAvailable'
5+
6+
describe('FilterNotAvailable', () => {
7+
it('should render', () => {
8+
expect(render(<FilterNotAvailable />)).toBeTruthy()
9+
})
10+
})
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import React from 'react'
2+
3+
import { EuiIcon, EuiText, EuiTitle, EuiSpacer, EuiLink, EuiButton } from '@elastic/eui'
4+
import RedisDbBlueIcon from 'uiSrc/assets/img/icons/redis_db_blue.svg'
5+
6+
import styles from './styles.module.scss'
7+
8+
const GET_STARTED_LINK = 'https://redis.com/try-free/?utm_source=redisinsight&utm_medium=main&utm_campaign=browser_filter'
9+
const LEARN_MORE_LINK = 'https://redis.io/docs/stack/about/?utm_source=redisinsight&utm_medium=main&utm_campaign=browser_filter'
10+
11+
const FilterNotAvailable = () => (
12+
<div className={styles.container}>
13+
<EuiIcon type={RedisDbBlueIcon} size="original" />
14+
<EuiTitle size="m" className={styles.title} data-testid="filter-not-available-title">
15+
<h4>Upgrade your Redis database to version 6 or above</h4>
16+
</EuiTitle>
17+
<EuiText>Filtering by data type is supported in Redis 6 and above.</EuiText>
18+
<EuiSpacer size="m" />
19+
<EuiText color="subdued">Create a free Redis Stack database that supports filtering and extends the core capabilities of open-source Redis.</EuiText>
20+
<EuiSpacer size="l" />
21+
<div className={styles.linksWrapper}>
22+
<EuiButton
23+
fill
24+
color="secondary"
25+
target="_blank"
26+
href={GET_STARTED_LINK}
27+
data-testid="get-started-link"
28+
size="s"
29+
>
30+
Get Started For Free
31+
</EuiButton>
32+
<EuiSpacer size="m" />
33+
<EuiLink
34+
className={styles.link}
35+
external={false}
36+
target="_blank"
37+
color="text"
38+
href={LEARN_MORE_LINK}
39+
data-testid="learn-more-link"
40+
>
41+
Learn More
42+
</EuiLink>
43+
</div>
44+
</div>
45+
)
46+
47+
export default FilterNotAvailable
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import FilterNotAvailable from './FilterNotAvailable'
2+
3+
export default FilterNotAvailable
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.container {
2+
padding: 40px 60px;
3+
text-align: center;
4+
5+
.title {
6+
font-family: 'Graphik', sans-serif;
7+
font-size: 28px;
8+
font-weight: 600;
9+
word-break: break-word;
10+
margin-top: 20px;
11+
margin-bottom: 20px;
12+
}
13+
14+
.linksWrapper {
15+
display: flex;
16+
flex-direction: column;
17+
align-items: center;
18+
19+
.link {
20+
color: var(--wbTextColor) !important;
21+
text-decoration: none !important;
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)