Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions redisinsight/ui/src/pages/home/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ const HomePage = () => {
setAddDialogIsOpen(false)
}

const handleDeleteInstances = (instances: Instance[]) => {
if (instances.find((instance) => instance.id === editedInstance?.id)) {
setEditedInstance(null)
setEditDialogIsOpen(false)
}
}

const onResize = ({ width: innerWidth }: { width: number }) => {
setWidth(innerWidth)
}
Expand Down Expand Up @@ -200,6 +207,7 @@ const HomePage = () => {
dialogIsOpen={dialogIsOpen}
editedInstance={editedInstance}
onEditInstance={handleEditInstance}
onDeleteInstances={handleDeleteInstances}
/>
</div>
</EuiResizablePanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ export interface Props {
dialogIsOpen: boolean;
editedInstance: Nullable<Instance>;
onEditInstance: (instance: Instance) => void;
onDeleteInstances: (instances: Instance[]) => void;
}
const DatabasesListWrapper = ({
width,
dialogIsOpen,
onEditInstance,
editedInstance,
onDeleteInstances
}: Props) => {
const dispatch = useDispatch()
const history = useHistory()
Expand Down Expand Up @@ -145,11 +147,11 @@ const DatabasesListWrapper = ({
}

const handleDeleteInstance = (instance: Instance) => {
dispatch(deleteInstancesAction([instance]))
dispatch(deleteInstancesAction([instance], () => onDeleteInstances([instance])))
}

const handleDeleteInstances = (instances: Instance[]) => {
dispatch(deleteInstancesAction(instances))
dispatch(deleteInstancesAction(instances, () => onDeleteInstances(instances)))
}

const PopoverDelete = ({ id, ...instance }: Instance) => (
Expand Down
2 changes: 1 addition & 1 deletion redisinsight/ui/src/pages/home/constants/help-links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export enum HelpLink {

export const HELP_LINKS = {
[HelpLink.CreateRedisCloud]: {
label: 'Create a FREE on Redis Cloud',
label: 'Create a free Redis Database on Redis Cloud',
link: 'https://redis.com/try-free/?utm_source=redis&utm_medium=app&utm_campaign=redisinsight',
event: TelemetryEvent.CONFIG_DATABASES_GET_REDIS_CLOUD_ACCOUNT_CLICKED
},
Expand Down
3 changes: 2 additions & 1 deletion redisinsight/ui/src/slices/instances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export function updateInstanceAction({ id, ...payload }: Instance) {
}

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

Expand All @@ -289,6 +289,7 @@ export function deleteInstancesAction(instances: Instance[]) {
dispatch(resetConnectedInstance())
dispatch(setAppContextInitialState())
}
onSuccess?.()

if (instances.length === 1) {
dispatch(
Expand Down
2 changes: 1 addition & 1 deletion redisinsight/ui/src/styles/components/_callout.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.euiCallOut {
padding: 12px 24px !important;
&--primary {
background-color: var(--euiTooltipBackgroundColor) !important;
background-color: var(--callOutBackgroundColor) !important;
border-color: var(--euiColorPrimary) !important;
.euiText {
color: var(--euiTooltipTextColor) !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
--commandGroupBadgeColor: #{$commandGroupBadgeColor};

--moduleBackgroundColor: #{$commandGroupBadgeColor};
--callOutBackgroundColor: #{$euiTooltipBackgroundColor};

// KeyTypes
--typeHashColor: #{$typeHashColor};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
--commandGroupBadgeColor: #{$commandGroupBadgeColor};

--moduleBackgroundColor: #{$typeHashColor};
--callOutBackgroundColor: #{$callOutBackgroundColor};

// KeyTypes
--typeHashColor: #{$typeHashColor};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ $cliOutputResponseFailColor: #AA131F;

$badgeBackgroundColor: #E8EFFF;
$commandGroupBadgeColor: #B8C5DB;
$callOutBackgroundColor: #E9EDFA;

// Types colors
$typeHashColor: #CDDDF8;
Expand Down