Skip to content

Commit 000e939

Browse files
authored
RI-6890: UI enhancements (#4422)
* remove the sm console component * rename Upgrade -> Upgrade plan; remove the background in the whole section * rename admin console -> Redis Cloud Admin
1 parent 957bb75 commit 000e939

File tree

7 files changed

+12
-41
lines changed

7 files changed

+12
-41
lines changed

redisinsight/ui/src/components/database-overview/DatabaseOverview.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('DatabaseOverview', () => {
4848
expect(container.querySelector('[data-test-subj="overview-total-memory"]')).toHaveTextContent('45 MB')
4949
expect(container.querySelector('[data-test-subj="overview-total-keys"]')).toBeInTheDocument()
5050
expect(container.querySelector('[data-test-subj="overview-connected-clients"]')).toBeInTheDocument()
51-
expect(queryByRole('button', { name: 'Upgrade' })).not.toBeInTheDocument()
51+
expect(queryByRole('button', { name: 'Upgrade plan' })).not.toBeInTheDocument()
5252
})
5353

5454
it('should render auto-refresh component', () => {
@@ -73,7 +73,7 @@ describe('DatabaseOverview', () => {
7373
const { container, queryByRole } = render(<DatabaseOverview />, { store: mockedStore })
7474

7575
expect(container.querySelector('[data-test-subj="overview-total-memory"]')).toHaveTextContent('45 MB / 75 MB (60.3%)')
76-
expect(queryByRole('button', { name: 'Upgrade' })).toBeInTheDocument()
76+
expect(queryByRole('button', { name: 'Upgrade plan' })).toBeInTheDocument()
7777
})
7878

7979
it('should show not show upgrade button for flexible subscriptions', () => {
@@ -92,7 +92,7 @@ describe('DatabaseOverview', () => {
9292
const { container, queryByRole } = render(<DatabaseOverview />, { store: mockedStore })
9393

9494
expect(container.querySelector('[data-test-subj="overview-total-memory"]')).toHaveTextContent('45 MB / 75 MB (60.3%)')
95-
expect(queryByRole('button', { name: 'Upgrade' })).not.toBeInTheDocument()
95+
expect(queryByRole('button', { name: 'Upgrade plan' })).not.toBeInTheDocument()
9696
})
9797

9898
test.each([
@@ -117,7 +117,7 @@ describe('DatabaseOverview', () => {
117117
const { container, queryByRole } = render(<DatabaseOverview />, { store: mockedStore })
118118

119119
expect(container.querySelector('[data-test-subj="overview-total-memory"]')).toHaveTextContent('45 MB / 75 MB (60.3%)')
120-
const upgradeBtn = queryByRole('button', { name: 'Upgrade' })
120+
const upgradeBtn = queryByRole('button', { name: 'Upgrade plan' })
121121
expect(upgradeBtn).toBeInTheDocument()
122122

123123
upgradeBtn?.click()

redisinsight/ui/src/components/database-overview/DatabaseOverview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ const DatabaseOverview = () => {
141141
}}
142142
data-testid="upgrade-ri-db-button"
143143
>
144-
Upgrade
144+
Upgrade plan
145145
</EuiButton>
146146
</EuiFlexItem>
147147
)}

redisinsight/ui/src/components/database-overview/styles.module.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
.itemContainer {
1818
height: 42px;
1919
border-radius: 8px;
20-
background: var(--euiColorEmptyShade);
2120
align-items: center;
2221
justify-content: center;
2322
margin-left: 6px;

redisinsight/ui/src/components/instance-header/InstanceHeader.spec.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ describe('InstanceHeader', () => {
164164
})
165165

166166
expect(screen.queryByTestId('my-redis-db-btn')).not.toBeInTheDocument()
167-
expect(screen.queryByTestId('admin-console-breadcrumb-btn')).toBeInTheDocument()
168167
})
169168

170169
it('should show cloud user profile if env dependant flag is off and cloud profile is present', async () => {

redisinsight/ui/src/components/instance-header/InstanceHeader.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { appFeatureFlagsFeaturesSelector } from 'uiSrc/slices/app/features'
2929
import { isAnyFeatureEnabled } from 'uiSrc/utils/features'
3030
import { getConfig } from 'uiSrc/config'
3131
import { appReturnUrlSelector } from 'uiSrc/slices/app/url-handling'
32-
import { SmConsoleLink } from 'uiSrc/components/instance-header/components/SmConsoleLink'
3332
import { CloudUserProfile } from 'uiSrc/components/instance-header/components/CloudUserProfile'
3433
import InstancesNavigationPopover from './components/instances-navigation-popover'
3534
import styles from './styles.module.scss'
@@ -117,7 +116,7 @@ const InstanceHeader = ({ onChangeDbIndex }: Props) => {
117116
<EuiFlexItem style={{ overflow: 'hidden' }} grow={false}>
118117
<div className={styles.breadcrumbsContainer} data-testid="breadcrumbs-container">
119118
<div>
120-
<FeatureFlagComponent name={FeatureFlags.envDependent} otherwise={<SmConsoleLink />}>
119+
<FeatureFlagComponent name={FeatureFlags.envDependent}>
121120
<EuiToolTip
122121
position="bottom"
123122
content={server?.buildType === BuildType.RedisStack ? 'Edit database' : 'Redis Databases'}
@@ -137,9 +136,11 @@ const InstanceHeader = ({ onChangeDbIndex }: Props) => {
137136
<div style={{ flex: 1, overflow: 'hidden' }}>
138137
<div style={{ maxWidth: '100%' }}>
139138
<EuiFlexGroup gutterSize="none" alignItems="center" responsive={false}>
140-
<EuiFlexItem grow={false}>
141-
<EuiText className={styles.divider}>/</EuiText>
142-
</EuiFlexItem>
139+
<FeatureFlagComponent name={FeatureFlags.envDependent}>
140+
<EuiFlexItem grow={false}>
141+
<EuiText className={styles.divider}>/</EuiText>
142+
</EuiFlexItem>
143+
</FeatureFlagComponent>
143144
{returnUrlBase && returnUrl && (
144145
<FeatureFlagComponent
145146
name={FeatureFlags.envDependent}

redisinsight/ui/src/components/instance-header/components/SmConsoleLink.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.

redisinsight/ui/src/components/instance-header/components/user-profile/UserProfile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ const UserProfile = (props: Props) => {
158158
href={riConfig.app.smConsoleRedirect}
159159
data-testid="cloud-admin-console-link"
160160
>
161-
<EuiText>Back to admin console</EuiText>
161+
<EuiText>Back to Redis Cloud Admin console</EuiText>
162162
<EuiIcon type={CloudIcon} style={{ fill: 'none' }} viewBox="-1 0 30 20" strokeWidth={1.8} />
163163
</EuiLink>
164164
)}

0 commit comments

Comments
 (0)