Skip to content

Commit 3bb117e

Browse files
committed
#RI-5378 - rename prop
1 parent 375a05e commit 3bb117e

File tree

13 files changed

+36
-36
lines changed

13 files changed

+36
-36
lines changed

redisinsight/ui/src/pages/browser/modules/key-details/components/hash-details/HashDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const HashDetails = (props: Props) => {
5858
)}
5959
{isAddItemPanelOpen && (
6060
<div className={cx('formFooterBar', 'contentActive')}>
61-
<AddHashFields onCancel={closeAddItemPanel} />
61+
<AddHashFields closePanel={closeAddItemPanel} />
6262
</div>
6363
)}
6464
</div>

redisinsight/ui/src/pages/browser/modules/key-details/components/hash-details/add-hash-fields/AddHashFields.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
2-
import { fireEvent, render, screen } from 'uiSrc/utils/test-utils'
32
import { instance, mock } from 'ts-mockito'
3+
import { fireEvent, render, screen } from 'uiSrc/utils/test-utils'
44
import AddHashFields, { Props } from './AddHashFields'
55

66
const HASH_FIELD = 'hash-field'

redisinsight/ui/src/pages/browser/modules/key-details/components/hash-details/add-hash-fields/AddHashFields.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { stringToBuffer } from 'uiSrc/utils'
2525
import { AddFieldsToHashDto } from 'apiSrc/modules/browser/dto/hash.dto'
2626

2727
export interface Props {
28-
onCancel: (isCancelled?: boolean) => void
28+
closePanel: (isCancelled?: boolean) => void
2929
}
3030

3131
export interface IHashFieldState {
@@ -41,7 +41,7 @@ export const INITIAL_HASH_FIELD_STATE: IHashFieldState = {
4141
}
4242

4343
const AddHashFields = (props: Props) => {
44-
const { onCancel } = props
44+
const { closePanel } = props
4545
const dispatch = useDispatch()
4646
const [fields, setFields] = useState<IHashFieldState[]>([{ ...INITIAL_HASH_FIELD_STATE }])
4747
const { loading } = useSelector(updateHashValueStateSelector)
@@ -90,7 +90,7 @@ const AddHashFields = (props: Props) => {
9090
}
9191

9292
const onSuccessAdded = () => {
93-
onCancel()
93+
closePanel()
9494
sendEventTelemetry({
9595
event: getBasedOnViewTypeEvent(
9696
viewType,
@@ -202,7 +202,7 @@ const AddHashFields = (props: Props) => {
202202
<EuiFlexGroup justifyContent="flexEnd" gutterSize="l">
203203
<EuiFlexItem grow={false}>
204204
<div>
205-
<EuiButton color="secondary" onClick={() => onCancel(true)} data-testid="cancel-fields-btn">
205+
<EuiButton color="secondary" onClick={() => closePanel(true)} data-testid="cancel-fields-btn">
206206
<EuiTextColor color="default">Cancel</EuiTextColor>
207207
</EuiButton>
208208
</div>

redisinsight/ui/src/pages/browser/modules/key-details/components/list-details/ListDetails.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ const ListDetails = (props: Props) => {
7575
)}
7676
{isAddItemPanelOpen && (
7777
<div className={cx('formFooterBar', 'contentActive')}>
78-
<AddListElements onCancel={closeAddItemPanel} />
78+
<AddListElements closePanel={closeAddItemPanel} />
7979
</div>
8080
)}
8181
{isRemoveItemPanelOpen && (
8282
<div className={cx('formFooterBar', styles.contentActive)}>
83-
<RemoveListElements onCancel={closeRemoveItemPanel} onRemoveKey={onRemoveKey} />
83+
<RemoveListElements closePanel={closeRemoveItemPanel} onRemoveKey={onRemoveKey} />
8484
</div>
8585
)}
8686
</div>

redisinsight/ui/src/pages/browser/modules/key-details/components/list-details/add-list-elements/AddListElements.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { PushElementToListDto } from 'apiSrc/modules/browser/dto'
2525
import styles from '../styles.module.scss'
2626

2727
export interface Props {
28-
onCancel: (isCancelled?: boolean) => void
28+
closePanel: (isCancelled?: boolean) => void
2929
}
3030

3131
export enum ListElementDestination {
@@ -48,7 +48,7 @@ const optionsDestinations: EuiSuperSelectOption<string>[] = [
4848
]
4949

5050
const AddListElements = (props: Props) => {
51-
const { onCancel } = props
51+
const { closePanel } = props
5252

5353
const [element, setElement] = useState<string>('')
5454
const [destination, setDestination] = useState<ListElementDestination>(TAIL_DESTINATION)
@@ -66,7 +66,7 @@ const AddListElements = (props: Props) => {
6666
}, [])
6767

6868
const onSuccessAdded = () => {
69-
onCancel()
69+
closePanel()
7070
sendEventTelemetry({
7171
event: getBasedOnViewTypeEvent(
7272
viewType,
@@ -138,7 +138,7 @@ const AddListElements = (props: Props) => {
138138
<EuiFlexGroup justifyContent="flexEnd" gutterSize="l">
139139
<EuiFlexItem grow={false}>
140140
<div>
141-
<EuiButton color="secondary" onClick={() => onCancel(true)} data-testid="cancel-members-btn">
141+
<EuiButton color="secondary" onClick={() => closePanel(true)} data-testid="cancel-members-btn">
142142
<EuiTextColor color="default">Cancel</EuiTextColor>
143143
</EuiButton>
144144
</div>

redisinsight/ui/src/pages/browser/modules/key-details/components/list-details/remove-list-elements/RemoveListElements.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import {
4040
import styles from './styles.module.scss'
4141

4242
export interface Props {
43-
onCancel: (isCancelled?: boolean) => void
43+
closePanel: (isCancelled?: boolean) => void
4444
onRemoveKey: () => void
4545
}
4646

@@ -56,7 +56,7 @@ const optionsDestinations: EuiSuperSelectOption<string>[] = [
5656
]
5757

5858
const RemoveListElements = (props: Props) => {
59-
const { onCancel, onRemoveKey } = props
59+
const { closePanel, onRemoveKey } = props
6060

6161
const [count, setCount] = useState<string>('')
6262
const [destination, setDestination] = useState<ListElementDestination>(TAIL_DESTINATION)
@@ -122,7 +122,7 @@ const RemoveListElements = (props: Props) => {
122122

123123
const onSuccessRemoved = (newTotal: number) => {
124124
if (newTotal <= 0) onRemoveKey()
125-
onCancel()
125+
closePanel()
126126
sendEventTelemetry({
127127
event: getBasedOnViewTypeEvent(
128128
viewType,
@@ -278,7 +278,7 @@ const RemoveListElements = (props: Props) => {
278278
<EuiFlexGroup justifyContent="flexEnd" gutterSize="l">
279279
<EuiFlexItem grow={false}>
280280
<div>
281-
<EuiButton color="secondary" onClick={() => onCancel(true)} data-testid="cancel-elements-btn">
281+
<EuiButton color="secondary" onClick={() => closePanel(true)} data-testid="cancel-elements-btn">
282282
<EuiTextColor color="default">Cancel</EuiTextColor>
283283
</EuiButton>
284284
</div>

redisinsight/ui/src/pages/browser/modules/key-details/components/set-details/SetDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const SetDetails = (props: Props) => {
5858
)}
5959
{isAddItemPanelOpen && (
6060
<div className={cx('formFooterBar', 'contentActive')}>
61-
<AddSetMembers onCancel={closeAddItemPanel} />
61+
<AddSetMembers closePanel={closeAddItemPanel} />
6262
</div>
6363
)}
6464
</div>

redisinsight/ui/src/pages/browser/modules/key-details/components/set-details/add-set-members/AddSetMembers.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import AddItemsActions from 'uiSrc/pages/browser/components/add-items-actions/Ad
2222
import { AddZsetFormConfig as config } from 'uiSrc/pages/browser/components/add-key/constants/fields-config'
2323

2424
export interface Props {
25-
onCancel: (isCancelled?: boolean) => void
25+
closePanel: (isCancelled?: boolean) => void
2626
}
2727

2828
export interface ISetMemberState {
@@ -36,7 +36,7 @@ export const INITIAL_SET_MEMBER_STATE: ISetMemberState = {
3636
}
3737

3838
const AddSetMembers = (props: Props) => {
39-
const { onCancel } = props
39+
const { closePanel } = props
4040
const dispatch = useDispatch()
4141
const [members, setMembers] = useState<ISetMemberState[]>([{ ...INITIAL_SET_MEMBER_STATE }])
4242
const { loading } = useSelector(setSelector)
@@ -50,7 +50,7 @@ const AddSetMembers = (props: Props) => {
5050
}, [members.length])
5151

5252
const onSuccessAdded = () => {
53-
onCancel()
53+
closePanel()
5454
sendEventTelemetry({
5555
event: getBasedOnViewTypeEvent(
5656
viewType,
@@ -170,7 +170,7 @@ const AddSetMembers = (props: Props) => {
170170
>
171171
<EuiFlexGroup justifyContent="flexEnd" gutterSize="l">
172172
<EuiFlexItem grow={false}>
173-
<EuiButton color="secondary" onClick={() => onCancel(true)} data-testid="cancel-members-btn">
173+
<EuiButton color="secondary" onClick={() => closePanel(true)} data-testid="cancel-members-btn">
174174
<EuiTextColor color="default">Cancel</EuiTextColor>
175175
</EuiButton>
176176
</EuiFlexItem>

redisinsight/ui/src/pages/browser/modules/key-details/components/stream-details/StreamDetails.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ const StreamDetails = (props: Props) => {
7070
{isAddItemPanelOpen && (
7171
<div className={cx('formFooterBar', 'contentActive')}>
7272
{streamViewType === StreamViewType.Data && (
73-
<AddStreamEntries onCancel={closeAddItemPanel} />
73+
<AddStreamEntries closePanel={closeAddItemPanel} />
7474
)}
7575
{STREAM_ADD_GROUP_VIEW_TYPES.includes(streamViewType!) && (
76-
<AddStreamGroup onCancel={closeAddItemPanel} />
76+
<AddStreamGroup closePanel={closeAddItemPanel} />
7777
)}
7878
</div>
7979
)}

redisinsight/ui/src/pages/browser/modules/key-details/components/stream-details/add-stream-entity/AddStreamEntries.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import StreamEntryFields from './StreamEntryFields/StreamEntryFields'
1717
import styles from './styles.module.scss'
1818

1919
export interface Props {
20-
onCancel: (isCancelled?: boolean) => void
20+
closePanel: (isCancelled?: boolean) => void
2121
}
2222

2323
const AddStreamEntries = (props: Props) => {
24-
const { onCancel } = props
24+
const { closePanel } = props
2525
const { lastEntry } = useSelector(streamDataSelector)
2626
const { name: keyName = '' } = useSelector(selectedKeyDataSelector) ?? { name: undefined }
2727
const { viewType } = useSelector(keysSelector)
@@ -75,7 +75,7 @@ const AddStreamEntries = (props: Props) => {
7575
}
7676

7777
const onSuccessAdded = () => {
78-
onCancel()
78+
closePanel()
7979
sendEventTelemetry({
8080
event: getBasedOnViewTypeEvent(
8181
viewType,
@@ -130,7 +130,7 @@ const AddStreamEntries = (props: Props) => {
130130
<EuiFlexGroup justifyContent="flexEnd" gutterSize="l">
131131
<EuiFlexItem grow={false}>
132132
<div>
133-
<EuiButton color="secondary" onClick={() => onCancel(true)} data-testid="cancel-members-btn">
133+
<EuiButton color="secondary" onClick={() => closePanel(true)} data-testid="cancel-members-btn">
134134
<EuiTextColor color="default">Cancel</EuiTextColor>
135135
</EuiButton>
136136
</div>

0 commit comments

Comments
 (0)