Skip to content

Commit 3638904

Browse files
committed
Merge branch 'release/2.52.0' into e2e/bugfix/remove-rdi-server-mocked
2 parents 14a5675 + 3aacf4b commit 3638904

File tree

12 files changed

+81
-33
lines changed

12 files changed

+81
-33
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ jobs:
675675
- release/*-linux.yml
676676
macosx:
677677
executor: macos
678-
resource_class: macos.x86.medium.gen2
678+
resource_class: macos.m1.medium.gen1
679679
parameters:
680680
env:
681681
description: Build environment (stage || prod)

redisinsight/ui/src/components/oauth/oauth-user-profile/OAuthUserProfile.spec.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { loadSubscriptionsRedisCloud, setSSOFlow } from 'uiSrc/slices/instances/
1313
import { OAuthSocialAction, OAuthSocialSource } from 'uiSrc/slices/interfaces'
1414
import { MOCK_OAUTH_USER_PROFILE } from 'uiSrc/mocks/data/oauth'
1515

16+
import { appInfoSelector } from 'uiSrc/slices/app/info'
1617
import OAuthUserProfile, { Props } from './OAuthUserProfile'
1718

1819
const mockedProps = mock<Props>()
@@ -24,6 +25,13 @@ jest.mock('uiSrc/slices/oauth/cloud', () => ({
2425
}),
2526
}))
2627

28+
jest.mock('uiSrc/slices/app/info', () => ({
29+
...jest.requireActual('uiSrc/slices/app/info'),
30+
appInfoSelector: jest.fn().mockReturnValue({
31+
server: {}
32+
})
33+
}))
34+
2735
jest.mock('uiSrc/telemetry', () => ({
2836
...jest.requireActual('uiSrc/telemetry'),
2937
sendEventTelemetry: jest.fn(),
@@ -49,6 +57,18 @@ describe('OAuthUserProfile', () => {
4957
expect(screen.queryByTestId('user-profile-btn')).not.toBeInTheDocument()
5058
})
5159

60+
it('should not render sign in button if no profile and mas build', () => {
61+
(appInfoSelector as jest.Mock).mockReturnValueOnce({
62+
server: {
63+
packageType: 'mas'
64+
}
65+
})
66+
render(<OAuthUserProfile {...mockedProps} />)
67+
68+
expect(screen.queryByTestId('cloud-sign-in-btn')).not.toBeInTheDocument()
69+
expect(screen.queryByTestId('user-profile-btn')).not.toBeInTheDocument()
70+
})
71+
5272
it('should render profile button', () => {
5373
(oauthCloudUserSelector as jest.Mock).mockReturnValue({
5474
data: {}

redisinsight/ui/src/components/oauth/oauth-user-profile/OAuthUserProfile.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import { OAuthSocialAction, OAuthSocialSource } from 'uiSrc/slices/interfaces'
1616
import { getTruncatedName } from 'uiSrc/utils'
1717
import { fetchSubscriptionsRedisCloud, setSSOFlow } from 'uiSrc/slices/instances/cloud'
1818
import { Pages } from 'uiSrc/constants'
19+
import { appInfoSelector } from 'uiSrc/slices/app/info'
20+
import { PackageType } from 'uiSrc/constants/env'
1921
import styles from './styles.module.scss'
2022

2123
export interface Props {
@@ -26,6 +28,7 @@ const OAuthUserProfile = (props: Props) => {
2628
const { source } = props
2729
const [selectingAccountId, setSelectingAccountId] = useState<number>()
2830
const { data } = useSelector(oauthCloudUserSelector)
31+
const { server } = useSelector(appInfoSelector)
2932

3033
const [isProfileOpen, setIsProfileOpen] = useState(false)
3134
const [isImportLoading, setIsImportLoading] = useState(false)
@@ -34,6 +37,8 @@ const OAuthUserProfile = (props: Props) => {
3437
const history = useHistory()
3538

3639
if (!data) {
40+
if (server?.packageType === PackageType.Mas) return null
41+
3742
return (
3843
<div className={styles.wrapper}>
3944
<OAuthSignInButton source={source} />

redisinsight/ui/src/components/virtual-table/styles.module.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,6 @@ $footerHeight: 38px;
191191

192192
:global(.ReactVirtualized__Table__headerRow) {
193193
border: 1px solid var(--separatorColorLight) !important;
194-
// fix border alignment, need to investigate why this happens
195-
padding: 0 !important;
196194
}
197195

198196
:global(.ReactVirtualized__Table__rowColumn) {
@@ -218,6 +216,11 @@ $footerHeight: 38px;
218216

219217
:global(.ReactVirtualized__Table__headerColumn) {
220218
border-right-color: var(--separatorColorLight) !important;
219+
220+
&:last-child {
221+
// fix border alignment, need to investigate why this happens
222+
margin-left: -2px !important;
223+
}
221224
}
222225
}
223226
}
@@ -253,7 +256,6 @@ $footerHeight: 38px;
253256
}
254257

255258
.value-table-separate-border {
256-
// border-right-color: var(--tableLightestBorderColor) !important;
257259
box-sizing: content-box;
258260
}
259261

redisinsight/ui/src/constants/commandsVersions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ export const CommandsVersions = {
99
since: '7.0',
1010
},
1111
HASH_TTL: {
12-
since: '7.4'
12+
since: '7.3'
1313
},
1414
}

redisinsight/ui/src/constants/env.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,15 @@ export enum BuildType {
99
Electron = 'ELECTRON',
1010
DockerOnPremise = 'DOCKER_ON_PREMISE'
1111
}
12+
13+
export enum PackageType {
14+
Flatpak = 'flatpak',
15+
Snap = 'snap',
16+
UnknownLinux = 'unknown-linux',
17+
AppImage = 'app-image',
18+
Mas = 'mas',
19+
UnknownDarwin = 'unknown-darwin',
20+
WindowsStore = 'windows-store',
21+
UnknownWindows = 'unknown-windows',
22+
Unknown = 'unknown',
23+
}

redisinsight/ui/src/utils/errors.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
import { AxiosError } from 'axios'
2-
import { capitalize, isEmpty, isString, isArray, set } from 'lodash'
2+
import { capitalize, isEmpty, isString, isArray, set, isNumber } from 'lodash'
33
import React from 'react'
44
import { EuiSpacer } from '@elastic/eui'
55
import { CustomErrorCodes } from 'uiSrc/constants'
66
import { DEFAULT_ERROR_MESSAGE } from 'uiSrc/utils'
77
import { CustomError } from 'uiSrc/slices/interfaces'
88
import { EXTERNAL_LINKS } from 'uiSrc/constants/links'
99

10-
export const getRdiValidationMessage = (message: string = '', loc?: string[]): string => {
10+
export const getRdiValidationMessage = (message: string = '', loc?: Array<string | number>): string => {
1111
// first item is always "body"
1212
if (!loc || !isArray(loc) || loc.length < 2) {
1313
return message
1414
}
15+
1516
const [, ...rest] = loc
16-
const field = rest.pop() as string
17-
const path = rest.join('/')
17+
const formattedLoc = rest.reduce<string[]>((acc, curr, idx) => {
18+
if (isNumber(curr)) {
19+
acc[acc.length - 1] += `[${curr}]`
20+
} else {
21+
acc.push(curr)
22+
}
23+
return acc
24+
}, [])
25+
26+
const field = formattedLoc.pop() as string
27+
const path = formattedLoc.join('/')
1828
const words = message.split(' ')
1929

2030
words[0] = path ? `${field} in ${path}` : field

redisinsight/ui/src/utils/monaco/monarchTokens/cypherTokens.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { monaco as monacoEditor } from 'react-monaco-editor'
22
import { FUNCTIONS, KEYWORDS, OPERATORS } from 'uiSrc/constants/monaco/cypher/monacoCypher'
33

44
const STRING_DOUBLE = 'string.double'
5-
const functions = FUNCTIONS.map((f) => f.name)
5+
const functions = FUNCTIONS.map((f) => f.label)
66

77
export const getCypherMonarchTokensProvider = (): monacoEditor.languages.IMonarchLanguage => (
88
{

redisinsight/ui/src/utils/tests/errors.spec.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ describe('parseCustomError', () => {
122122
)
123123
})
124124

125-
const getRdiValidationMessageTests: Array<[[Maybe<string>, string[]], string]> = [
125+
const getRdiValidationMessageTests: Array<[[Maybe<string>, Array<string | number>], string]> = [
126126
[[undefined, []], ''],
127127
[['Custom message', []], 'Custom message'],
128128
[['Input is required', ['field']], 'Input is required'],
@@ -135,6 +135,23 @@ const getRdiValidationMessageTests: Array<[[Maybe<string>, string[]], string]> =
135135
['Input should be a valid integer, unable to parse string as an integer', ['body', 'targets', 'my-redis', 'connection']],
136136
'Connection in targets/my-redis should be a valid integer, unable to parse string as an integer'
137137
],
138+
[
139+
['Input should be a valid integer, unable to parse string as an integer', ['body', 'targets', 'my-redis', 0]],
140+
'My-redis[0] in targets should be a valid integer, unable to parse string as an integer'
141+
],
142+
[['Input required', ['body', 'targets', 0]], 'Targets[0] required'],
143+
[
144+
['Input should be a valid integer, unable to parse string as an integer', ['body', 'targets', 'my-redis', 2, 'db', 'password']],
145+
'Password in targets/my-redis[2]/db should be a valid integer, unable to parse string as an integer'
146+
],
147+
[
148+
['Input should be a valid integer, unable to parse string as an integer', ['body', 'targets', 'my-redis', 2, 'password']],
149+
'Password in targets/my-redis[2] should be a valid integer, unable to parse string as an integer'
150+
],
151+
[
152+
['Input should be a valid integer, unable to parse string as an integer', ['body', 'targets', 'my-redis', 2, 'password', 0]],
153+
'Password[0] in targets/my-redis[2] should be a valid integer, unable to parse string as an integer'
154+
],
138155
]
139156

140157
describe('getRdiValidationMessage', () => {

tests/e2e/desktop.runner.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import testcafe from 'testcafe';
1212
} })
1313
.src((process.env.TEST_FILES || 'tests/electron/**/*.e2e.ts').split('\n'))
1414
.browsers(['electron'])
15-
// Skipped because screenshots don't work for electron app on linux
1615
.screenshots({
1716
path: './report/screenshots/',
1817
takeOnFails: true,

0 commit comments

Comments
 (0)