Skip to content

Commit da5e4f9

Browse files
committed
#RI-6320 - rename feature flag
1 parent 46dcc77 commit da5e4f9

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

redisinsight/ui/src/constants/featureFlags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ export enum FeatureFlags {
77
disabledByEnv = 'disabledByEnv',
88
rdi = 'redisDataIntegration',
99
hashFieldExpiration = 'hashFieldExpiration',
10-
cloudDatabaseInTheList = 'cloudDatabaseInTheList',
10+
enhancedCloudUI = 'enhancedCloudUI',
1111
}

redisinsight/ui/src/pages/home/HomePage.spec.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jest.mock('uiSrc/slices/content/create-redis-buttons', () => ({
2222
jest.mock('uiSrc/slices/app/features', () => ({
2323
...jest.requireActual('uiSrc/slices/app/features'),
2424
appFeatureFlagsFeaturesSelector: jest.fn().mockReturnValue({
25-
cloudDatabaseInTheList: {
25+
enhancedCloudUI: {
2626
flag: false
2727
}
2828
}),
@@ -41,8 +41,6 @@ describe('HomePage', () => {
4141
it('should render insights trigger', async () => {
4242
await render(<HomePage />)
4343

44-
screen.debug(undefined, 100_000)
45-
4644
expect(screen.getByTestId('insights-trigger')).toBeInTheDocument()
4745
})
4846

@@ -54,7 +52,7 @@ describe('HomePage', () => {
5452

5553
it('should not render free cloud db with feature flag disabled', async () => {
5654
(appFeatureFlagsFeaturesSelector as jest.Mock).mockReturnValueOnce({
57-
cloudDatabaseInTheList: {
55+
enhancedCloudUI: {
5856
flag: false
5957
}
6058
})
@@ -65,7 +63,7 @@ describe('HomePage', () => {
6563

6664
it('should render free cloud db with feature flag enabled', async () => {
6765
(appFeatureFlagsFeaturesSelector as jest.Mock).mockReturnValueOnce({
68-
cloudDatabaseInTheList: {
66+
enhancedCloudUI: {
6967
flag: true
7068
}
7169
})

redisinsight/ui/src/pages/home/HomePage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const HomePage = () => {
5959
const { instance: sentinelInstance } = useSelector(sentinelSelector)
6060
const { action, dbConnection } = useSelector(appRedirectionSelector)
6161
const { data: createDbContent } = useSelector(contentSelector)
62-
const { [FeatureFlags.cloudDatabaseInTheList]: cloudDatabaseInTheList } = useSelector(appFeatureFlagsFeaturesSelector)
62+
const { [FeatureFlags.enhancedCloudUI]: enhancedCloudUIFeature } = useSelector(appFeatureFlagsFeaturesSelector)
6363

6464
const {
6565
loading,
@@ -75,7 +75,7 @@ const HomePage = () => {
7575

7676
const { contextInstanceId } = useSelector(appContextSelector)
7777

78-
const predefinedInstances = cloudDatabaseInTheList?.flag && createDbContent?.cloud_list_of_databases ? [
78+
const predefinedInstances = enhancedCloudUIFeature?.flag && createDbContent?.cloud_list_of_databases ? [
7979
{ id: CREATE_CLOUD_DB_ID, ...createDbContent.cloud_list_of_databases } as Instance
8080
] : []
8181
const isInstanceExists = instances.length > 0 || predefinedInstances.length > 0

redisinsight/ui/src/pages/home/components/database-list-header/DatabaseListHeader.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const mockedProps = mock<Props>()
99
jest.mock('uiSrc/slices/app/features', () => ({
1010
...jest.requireActual('uiSrc/slices/app/features'),
1111
appFeatureFlagsFeaturesSelector: jest.fn().mockReturnValue({
12-
cloudDatabaseInTheList: {
12+
enhancedCloudUI: {
1313
flag: false
1414
}
1515
}),
@@ -45,7 +45,7 @@ describe('DatabaseListHeader', () => {
4545

4646
it('should not show promo cloud button with disabled feature flag', () => {
4747
(appFeatureFlagsFeaturesSelector as jest.Mock).mockReturnValueOnce({
48-
cloudDatabaseInTheList: {
48+
enhancedCloudUI: {
4949
flag: true
5050
}
5151
})
@@ -57,7 +57,7 @@ describe('DatabaseListHeader', () => {
5757

5858
it('should show promo cloud button with enabled feature flag', () => {
5959
(appFeatureFlagsFeaturesSelector as jest.Mock).mockReturnValueOnce({
60-
cloudDatabaseInTheList: {
60+
enhancedCloudUI: {
6161
flag: false
6262
}
6363
})

redisinsight/ui/src/pages/home/components/database-list-header/DatabaseListHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ const DatabaseListHeader = ({ onAddInstance }: Props) => {
3838
const [promoData, setPromoData] = useState<ContentCreateRedis>()
3939

4040
const { theme } = useContext(ThemeContext)
41-
const { [FeatureFlags.cloudDatabaseInTheList]: cloudDatabaseInTheListFeature } = featureFlags
42-
const isShowPromoBtn = !cloudDatabaseInTheListFeature?.flag
41+
const { [FeatureFlags.enhancedCloudUI]: enhancedCloudUIFeature } = featureFlags
42+
const isShowPromoBtn = !enhancedCloudUIFeature?.flag
4343

4444
useEffect(() => {
4545
if (loading || !data || isEmpty(data)) {

redisinsight/ui/src/slices/app/features.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const initialState: StateAppFeatures = {
4444
[FeatureFlags.rdi]: {
4545
flag: false
4646
},
47-
[FeatureFlags.cloudDatabaseInTheList]: {
47+
[FeatureFlags.enhancedCloudUI]: {
4848
flag: false
4949
}
5050
}

0 commit comments

Comments
 (0)