Skip to content

Commit 048ade0

Browse files
authored
Merge pull request #1378 from RedisInsight/fe/bugfix/RI-3791_fix-cancel
#RI-3791 - fix telemetry event
2 parents 06196bc + 2263873 commit 048ade0

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

redisinsight/ui/src/pages/browser/components/browser-right-panel/BrowserRightPanel.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ const BrowserRightPanel = (props: Props) => {
141141
/>
142142
)}
143143
{isCreateIndexPanelOpen && every([!isAddKeyPanelOpen, !isBulkActionsPanelOpen], Boolean) && (
144-
<CreateRedisearchIndex onClosePanel={onCloseRedisearchPanel} />
144+
<CreateRedisearchIndex
145+
onCreateIndex={closePanel}
146+
onClosePanel={onCloseRedisearchPanel}
147+
/>
145148
)}
146149
</>
147150
)

redisinsight/ui/src/pages/browser/components/create-redisearch-index/CreateRedisearchIndex.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import styles from './styles.module.scss'
3131

3232
export interface Props {
3333
onClosePanel: () => void
34+
onCreateIndex: () => void
3435
}
3536

3637
const keyTypeOptions = KEY_TYPE_OPTIONS.map((item) => {
@@ -52,7 +53,7 @@ const fieldTypeOptions = FIELD_TYPE_OPTIONS.map(({ value, text }) => ({
5253

5354
const initialFieldValue = (id = 0) => ({ id, identifier: '', fieldType: fieldTypeOptions[0].value })
5455

55-
const CreateRedisearchIndex = ({ onClosePanel }: Props) => {
56+
const CreateRedisearchIndex = ({ onClosePanel, onCreateIndex }: Props) => {
5657
const { viewType } = useSelector(keysSelector)
5758
const { loading } = useSelector(createIndexStateSelector)
5859
const { id: instanceId } = useSelector(connectedInstanceSelector)
@@ -117,7 +118,7 @@ const CreateRedisearchIndex = ({ onClosePanel }: Props) => {
117118
}
118119
})
119120

120-
onClosePanel()
121+
onCreateIndex()
121122
}
122123

123124
const isClearDisabled = (item: any): boolean => fields.length === 1 && !(item.identifier.length)

redisinsight/ui/src/pages/browser/components/create-redisearch-index/CreateRedisearchIndexWrapper.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ import styles from './styles.module.scss'
1515

1616
export interface Props {
1717
onClosePanel: () => void
18+
onCreateIndex: () => void
1819
}
1920

20-
const CreateRedisearchIndexWrapper = ({ onClosePanel }: Props) => (
21+
const CreateRedisearchIndexWrapper = ({ onClosePanel, onCreateIndex }: Props) => (
2122
<div className={styles.page} data-testid="create-index-panel">
2223
<EuiFlexGroup
2324
justifyContent="center"
@@ -60,7 +61,10 @@ const CreateRedisearchIndexWrapper = ({ onClosePanel }: Props) => (
6061
</EuiText>
6162
</EuiFlexItem>
6263
</div>
63-
<CreateRedisearchIndex onClosePanel={onClosePanel} />
64+
<CreateRedisearchIndex
65+
onCreateIndex={onCreateIndex}
66+
onClosePanel={onClosePanel}
67+
/>
6468
</EuiFlexGroup>
6569
</div>
6670
)

0 commit comments

Comments
 (0)