Skip to content

Commit cadd93d

Browse files
authored
Merge pull request #79 from RedisInsight/bugfix/RI-2078/RI-2103/RI-2110
#RI-2078, #RI-2103, #RI-2110
2 parents 13854db + cbe2bfb commit cadd93d

File tree

8 files changed

+19
-5
lines changed

8 files changed

+19
-5
lines changed

redisinsight/ui/src/pages/home/HomePage.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ const HomePage = () => {
159159
setAddDialogIsOpen(false)
160160
}
161161

162+
const handleDeleteInstances = (instances: Instance[]) => {
163+
if (instances.find((instance) => instance.id === editedInstance?.id)) {
164+
setEditedInstance(null)
165+
setEditDialogIsOpen(false)
166+
}
167+
}
168+
162169
const onResize = ({ width: innerWidth }: { width: number }) => {
163170
setWidth(innerWidth)
164171
}
@@ -200,6 +207,7 @@ const HomePage = () => {
200207
dialogIsOpen={dialogIsOpen}
201208
editedInstance={editedInstance}
202209
onEditInstance={handleEditInstance}
210+
onDeleteInstances={handleDeleteInstances}
203211
/>
204212
</div>
205213
</EuiResizablePanel>

redisinsight/ui/src/pages/home/components/DatabasesListComponent/DatabasesListWrapper.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ export interface Props {
3939
dialogIsOpen: boolean;
4040
editedInstance: Nullable<Instance>;
4141
onEditInstance: (instance: Instance) => void;
42+
onDeleteInstances: (instances: Instance[]) => void;
4243
}
4344
const DatabasesListWrapper = ({
4445
width,
4546
dialogIsOpen,
4647
onEditInstance,
4748
editedInstance,
49+
onDeleteInstances
4850
}: Props) => {
4951
const dispatch = useDispatch()
5052
const history = useHistory()
@@ -145,11 +147,11 @@ const DatabasesListWrapper = ({
145147
}
146148

147149
const handleDeleteInstance = (instance: Instance) => {
148-
dispatch(deleteInstancesAction([instance]))
150+
dispatch(deleteInstancesAction([instance], () => onDeleteInstances([instance])))
149151
}
150152

151153
const handleDeleteInstances = (instances: Instance[]) => {
152-
dispatch(deleteInstancesAction(instances))
154+
dispatch(deleteInstancesAction(instances, () => onDeleteInstances(instances)))
153155
}
154156

155157
const PopoverDelete = ({ id, ...instance }: Instance) => (

redisinsight/ui/src/pages/home/constants/help-links.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export enum HelpLink {
99

1010
export const HELP_LINKS = {
1111
[HelpLink.CreateRedisCloud]: {
12-
label: 'Create a FREE on Redis Cloud',
12+
label: 'Create a free Redis Database on Redis Cloud',
1313
link: 'https://redis.com/try-free/?utm_source=redis&utm_medium=app&utm_campaign=redisinsight',
1414
event: TelemetryEvent.CONFIG_DATABASES_GET_REDIS_CLOUD_ACCOUNT_CLICKED
1515
},

redisinsight/ui/src/slices/instances.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export function updateInstanceAction({ id, ...payload }: Instance) {
270270
}
271271

272272
// Asynchronous thunk action
273-
export function deleteInstancesAction(instances: Instance[]) {
273+
export function deleteInstancesAction(instances: Instance[], onSuccess?: () => void) {
274274
return async (dispatch: AppDispatch, stateInit: () => RootState) => {
275275
dispatch(setDefaultInstance())
276276

@@ -289,6 +289,7 @@ export function deleteInstancesAction(instances: Instance[]) {
289289
dispatch(resetConnectedInstance())
290290
dispatch(setAppContextInitialState())
291291
}
292+
onSuccess?.()
292293

293294
if (instances.length === 1) {
294295
dispatch(

redisinsight/ui/src/styles/components/_callout.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.euiCallOut {
22
padding: 12px 24px !important;
33
&--primary {
4-
background-color: var(--euiTooltipBackgroundColor) !important;
4+
background-color: var(--callOutBackgroundColor) !important;
55
border-color: var(--euiColorPrimary) !important;
66
.euiText {
77
color: var(--euiTooltipTextColor) !important;

redisinsight/ui/src/styles/themes/dark_theme/_dark_theme.lazy.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
--commandGroupBadgeColor: #{$commandGroupBadgeColor};
106106

107107
--moduleBackgroundColor: #{$commandGroupBadgeColor};
108+
--callOutBackgroundColor: #{$euiTooltipBackgroundColor};
108109

109110
// KeyTypes
110111
--typeHashColor: #{$typeHashColor};

redisinsight/ui/src/styles/themes/light_theme/_light_theme.lazy.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
--commandGroupBadgeColor: #{$commandGroupBadgeColor};
108108

109109
--moduleBackgroundColor: #{$typeHashColor};
110+
--callOutBackgroundColor: #{$callOutBackgroundColor};
110111

111112
// KeyTypes
112113
--typeHashColor: #{$typeHashColor};

redisinsight/ui/src/styles/themes/light_theme/_theme_color.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ $cliOutputResponseFailColor: #AA131F;
6565

6666
$badgeBackgroundColor: #E8EFFF;
6767
$commandGroupBadgeColor: #B8C5DB;
68+
$callOutBackgroundColor: #E9EDFA;
6869

6970
// Types colors
7071
$typeHashColor: #CDDDF8;

0 commit comments

Comments
 (0)