Skip to content

Commit 131632c

Browse files
author
Roman.Sergeenko
committed
#RI-2088 - codeql fe fixes
1 parent a60e331 commit 131632c

File tree

7 files changed

+17
-25
lines changed

7 files changed

+17
-25
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ main, latest, release/* ]
16+
branches: [ main, latest, release/*, feature/codeql-fe-fixes ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
1919
branches: [ main ]

redisinsight/main.dev.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,10 @@ export const createWindow = async (splash: BrowserWindow | null) => {
179179
webPreferences: {
180180
nodeIntegration: true,
181181
nodeIntegrationInWorker: true,
182-
webSecurity: false,
182+
webSecurity: true,
183183
contextIsolation: false,
184184
spellcheck: true,
185-
allowRunningInsecureContent: true,
186-
enableRemoteModule: true,
185+
allowRunningInsecureContent: false,
187186
scrollBounce: true,
188187
},
189188
});

redisinsight/ui/src/pages/browser/components/rejson-details/JSONArray/JSONArray.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,9 @@ class JSONArrayComponent extends Component<Props, State> {
228228
}
229229

230230
onClickSetKVPair = () => {
231+
const { addNewKeyValuePair } = this.state
231232
this.setState({
232-
addNewKeyValuePair: !this.state.addNewKeyValuePair,
233+
addNewKeyValuePair: !addNewKeyValuePair,
233234
newValue: '',
234235
error: ''
235236
})
@@ -299,11 +300,12 @@ class JSONArrayComponent extends Component<Props, State> {
299300
const {
300301
shouldRejsonDataBeDownloaded,
301302
handleFetchVisualisationResults,
303+
value
302304
} = this.props
303305

304306
if (!shouldRejsonDataBeDownloaded) {
305307
this.setState({
306-
value: this.props.value,
308+
value,
307309
openIndex: true,
308310
})
309311
return

redisinsight/ui/src/pages/browser/components/rejson-details/JSONObject/JSONObject.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,9 @@ class JSONObject extends React.Component<Props, State> {
179179
}
180180

181181
onClickSetKVPair = () => {
182+
const { addNewKeyValuePair } = this.state
182183
this.setState({
183-
addNewKeyValuePair: !this.state.addNewKeyValuePair,
184+
addNewKeyValuePair: !addNewKeyValuePair,
184185
newKey: '',
185186
newValue: '',
186187
})
@@ -286,11 +287,11 @@ class JSONObject extends React.Component<Props, State> {
286287
onJSONKeyExpandAndCollapse(!openIndex, path)
287288

288289
if (!openIndex) {
289-
const { shouldRejsonDataBeDownloaded } = this.props
290+
const { shouldRejsonDataBeDownloaded, value } = this.props
290291

291292
if (!shouldRejsonDataBeDownloaded) {
292293
this.setState({
293-
value: this.props.value,
294+
value,
294295
openIndex: true,
295296
})
296297
return

redisinsight/ui/src/pages/browser/components/rejson-details/RejsonDetails/RejsonDetails.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ export interface Props {
6262

6363
interface State {
6464
path: string | undefined;
65-
data: JSONArrayValue | IJSONDocument | IJSONDocument[];
66-
openIndex: number;
67-
prevPath: string;
68-
currentPath: string;
69-
dataContainer: object;
7065
addRootKVPair: boolean;
7166
newRootKey: string | undefined;
7267
newRootValue: JSONScalarValue | JSONArrayValue | IJSONObject;
@@ -78,11 +73,6 @@ class RejsonDetails extends React.Component<Props, State> {
7873
super(props)
7974
this.state = {
8075
path: '',
81-
data: this.props.data,
82-
openIndex: -1,
83-
prevPath: '',
84-
currentPath: '',
85-
dataContainer: {},
8676
addRootKVPair: false,
8777
newRootKey: '',
8878
newRootValue: '',
@@ -132,8 +122,9 @@ class RejsonDetails extends React.Component<Props, State> {
132122
}
133123

134124
onClickSetRootKVPair = () => {
125+
const { addRootKVPair } = this.state
135126
this.setState({
136-
addRootKVPair: !this.state.addRootKVPair,
127+
addRootKVPair: !addRootKVPair,
137128
})
138129
}
139130

@@ -213,7 +204,7 @@ class RejsonDetails extends React.Component<Props, State> {
213204
const error: string = this.validateRootKVPair()
214205

215206
if (error === '') {
216-
let updatedPath = '.'
207+
let updatedPath
217208

218209
body.operation = 'update'
219210
body.value = newRootValue as string
@@ -603,7 +594,7 @@ class RejsonDetails extends React.Component<Props, State> {
603594
)
604595
)}
605596
<>
606-
{data && data !== null ? (
597+
{data ? (
607598
this.renderResultArray(data as string)
608599
) : (
609600
<JSONScalar

redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceForm/InstanceForm.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,7 @@ const AddStandaloneForm = (props: Props) => {
260260
&& values.tlsClientAuthRequired
261261
&& values.selectedTlsClientCertId === ''
262262
) {
263-
errs.selectedTlsClientCertId
264-
=== fieldDisplayNames.selectedTlsClientCertId
263+
errs.selectedTlsClientCertId = fieldDisplayNames.selectedTlsClientCertId
265264
}
266265
if (
267266
values.tls

redisinsight/ui/src/telemetry/segment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class SegmentTelemetryService implements ITelemetryService {
3131
return pageObject
3232
}
3333

34-
constructor(private _sourceWriteKey: string) {
34+
constructor(private readonly _sourceWriteKey: string) {
3535
this._sourceWriteKey = _sourceWriteKey
3636
}
3737

0 commit comments

Comments
 (0)