Skip to content

Commit

Permalink
Merge pull request #130 from cybertec-postgresql/129-make-gridactions…
Browse files Browse the repository at this point in the history
…-gridtoolbar-components-common

[*] make GridActions & GridToolbar components common, closes #129
  • Loading branch information
pashagolub authored Mar 6, 2023
2 parents d3e7128 + df2e10c commit 2641a9d
Show file tree
Hide file tree
Showing 9 changed files with 517 additions and 486 deletions.
74 changes: 0 additions & 74 deletions src/webui/src/layout/Dashboard/DbsTable/ActionsComponent.tsx

This file was deleted.

10 changes: 5 additions & 5 deletions src/webui/src/layout/Dashboard/DbsTable/ModalComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { MultilineTextField, SimpleTextField } from "./TextFieldComponents";
type Props = {
open: boolean,
setOpen: Dispatch<SetStateAction<boolean>>,
handleAlertOpen: (isOpen: boolean, text: string, type: AlertColor) => void,
handleAlertOpen: (text: string, type: AlertColor) => void,
recordData: Db | undefined;
};

Expand Down Expand Up @@ -71,11 +71,11 @@ export const ModalComponent = ({ open, setOpen, handleAlertOpen, recordData }: P
onSuccess: (data: AxiosResponse<any, any>, variables: updateDbForm) => {
handleClose();
queryClient.invalidateQueries({ queryKey: QueryKeys.db });
handleAlertOpen(true, `Monitored DB "${variables.md_unique_name}" has been successfully updated!`, "success");
handleAlertOpen(`Monitored DB "${variables.md_unique_name}" has been successfully updated!`, "success");
reset();
},
onError: (error: any) => {
handleAlertOpen(true, error.response.data, "error");
handleAlertOpen(error.response.data, "error");
}
});

Expand All @@ -86,11 +86,11 @@ export const ModalComponent = ({ open, setOpen, handleAlertOpen, recordData }: P
onSuccess: (data: AxiosResponse<any, any>, variables: createDbForm) => {
handleClose();
queryClient.invalidateQueries({ queryKey: QueryKeys.db });
handleAlertOpen(true, `New DB "${variables.md_unique_name}" has been successfully added to monitoring!`, "success");
handleAlertOpen(`New DB "${variables.md_unique_name}" has been successfully added to monitoring!`, "success");
reset();
},
onError: (error: any) => {
handleAlertOpen(true, error.response.data, "error");
handleAlertOpen(error.response.data, "error");
}
});

Expand Down
Loading

0 comments on commit 2641a9d

Please sign in to comment.