Skip to content

Commit b5a0730

Browse files
Merge pull request #2604 from RedisInsight/fe/feature/RI-4969
#RI-4969 - rename cloudId url parameter
2 parents 6ac74ca + 4360807 commit b5a0730

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

redisinsight/ui/src/components/global-url-handler/GlobalUrlHandler.spec.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ beforeEach(() => {
3838
store.clearActions()
3939
})
4040

41-
const fromUrl = 'redisinsight://databases/connect?redisUrl=redis://default:password@localhost:6379&databaseAlias=My Name&redirect=workbench?guidePath=/quick-guides/document/introduction.md&cloudId=1232&subscriptionType=fixed&planMemoryLimit=30&memoryLimitMeasurementUnit=mb&free=true&target=_blank'
41+
const fromUrl = 'redisinsight://databases/connect?redisUrl=redis://default:password@localhost:6379&databaseAlias=My Name&redirect=workbench?guidePath=/quick-guides/document/introduction.md&cloudBdbId=1232&subscriptionType=fixed&planMemoryLimit=30&memoryLimitMeasurementUnit=mb&free=true&target=_blank'
4242

4343
describe('GlobalUrlHandler', () => {
4444
beforeEach(() => {
@@ -84,6 +84,8 @@ describe('GlobalUrlHandler', () => {
8484
const fromParams = new URLSearchParams(actionUrl.search)
8585
// @ts-ignore
8686
const urlProperties = Object.fromEntries(fromParams) || {}
87+
urlProperties.cloudId = urlProperties.cloudBdbId
88+
delete urlProperties.cloudBdbId
8789

8890
expect(store.getActions()).toEqual([
8991
setUrlProperties(urlProperties),
@@ -115,6 +117,8 @@ describe('GlobalUrlHandler', () => {
115117
const fromParams = new URLSearchParams(actionUrl.search)
116118
// @ts-ignore
117119
const urlProperties = Object.fromEntries(fromParams) || {}
120+
urlProperties.cloudId = urlProperties.cloudBdbId
121+
delete urlProperties.cloudBdbId
118122

119123
const expectedActions = [
120124
setUrlProperties(urlProperties),
@@ -159,6 +163,8 @@ describe('GlobalUrlHandler', () => {
159163
const fromParams = new URLSearchParams(actionUrl.search)
160164
// @ts-ignore
161165
const urlProperties = Object.fromEntries(fromParams) || {}
166+
urlProperties.cloudId = urlProperties.cloudBdbId
167+
delete urlProperties.cloudBdbId
162168

163169
const expectedActions = [
164170
setUrlProperties(urlProperties),

redisinsight/ui/src/components/global-url-handler/GlobalUrlHandler.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ const GlobalUrlHandler = () => {
3636

3737
// @ts-ignore
3838
const urlProperties = Object.fromEntries(fromParams) || {}
39+
40+
// rename cloudBdbId to cloudId
41+
urlProperties.cloudId = urlProperties.cloudBdbId
42+
delete urlProperties.cloudBdbId
43+
3944
dispatch(setUrlProperties(urlProperties))
4045
dispatch(setFromUrl(null))
4146

0 commit comments

Comments
 (0)