Skip to content

Commit

Permalink
EVEREST-1574-db-details-status-modal (#779)
Browse files Browse the repository at this point in the history
* EVEREST-1574-db-details-status-modal

* EVEREST-1574-db-details-status-modal

* EVEREST-1574-db-details-status-modal
  • Loading branch information
solovevayaroslavna authored Oct 23, 2024
1 parent c40c26a commit 5f77b08
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions ui/apps/everest/src/components/db-actions/db-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export const DbActions = ({
isDetailView = false,
dbCluster,
setIsNewClusterMode,
setOpenDetailsDialog,
handleRestoreDbCluster,
handleOpenDbDetailsDialog,
handleDeleteDbCluster,
handleDbRestart,
handleDbSuspendOrResumed,
Expand Down Expand Up @@ -182,12 +182,12 @@ export const DbActions = ({
<KeyboardReturnIcon /> {Messages.menuItems.restoreFromBackup}
</MenuItem>
)}
{isDetailView && setOpenDetailsDialog && dbCluster?.status?.details && (
{isDetailView && dbCluster?.status?.details && (
<MenuItem
key={6}
sx={sx}
onClick={() => {
setOpenDetailsDialog(true);
handleOpenDbDetailsDialog(dbCluster);
}}
>
<VisibilityOutlinedIcon /> {Messages.menuItems.dbStatusDetails}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface DbActionsProps {
isDetailView?: boolean;
dbCluster: DbCluster;
setIsNewClusterMode: React.Dispatch<React.SetStateAction<boolean>>;
setOpenDetailsDialog?: React.Dispatch<React.SetStateAction<boolean>>;
handleOpenDbDetailsDialog: (dbCluster: DbCluster) => void;
handleRestoreDbCluster: (dbCluster: DbCluster) => void;
handleDeleteDbCluster: (dbCluster: DbCluster) => void;
handleDbRestart: (dbCluster: DbCluster) => void;
Expand Down
6 changes: 6 additions & 0 deletions ui/apps/everest/src/hooks/api/db-cluster/useDbActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ export const useDbActions = () => {
setOpenRestoreDialog(true);
};

const handleOpenDbDetailsDialog = (dbCluster: DbCluster) => {
setSelectedDbCluster(dbCluster);
setOpenDetailsDialog(true);
};

const handleCloseRestoreDialog = () => {
setOpenRestoreDialog(false);
};
Expand All @@ -173,6 +178,7 @@ export const useDbActions = () => {
handleDbRestart,
handleDeleteDbCluster,
handleConfirmDelete,
handleOpenDbDetailsDialog,
handleCloseDeleteDialog,
handleCloseDetailsDialog,
isPaused,
Expand Down
4 changes: 2 additions & 2 deletions ui/apps/everest/src/pages/databases/DbClusterView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const DbClusterView = () => {
handleConfirmDelete,
handleCloseDeleteDialog,
openDetailsDialog,
setOpenDetailsDialog,
handleOpenDbDetailsDialog,
handleCloseDetailsDialog,
selectedDbCluster,
} = useDbActions();
Expand Down Expand Up @@ -181,7 +181,7 @@ export const DbClusterView = () => {
handleDeleteDbCluster={handleDeleteDbCluster}
isPaused={isPaused}
handleRestoreDbCluster={handleRestoreDbCluster}
setOpenDetailsDialog={setOpenDetailsDialog}
handleOpenDbDetailsDialog={handleOpenDbDetailsDialog}
/>
);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ export const DbClusterDetails = () => {
openRestoreDialog,
handleCloseRestoreDialog,
handleRestoreDbCluster,
handleOpenDbDetailsDialog,
handleDbRestart,
handleDbSuspendOrResumed,
handleDeleteDbCluster,
openDetailsDialog,
setOpenDetailsDialog,
handleCloseDetailsDialog,
isPaused,
openDeleteDialog,
Expand Down Expand Up @@ -102,7 +102,7 @@ export const DbClusterDetails = () => {
isDetailView={true}
dbCluster={dbCluster}
setIsNewClusterMode={setIsNewClusterMode}
setOpenDetailsDialog={setOpenDetailsDialog}
handleOpenDbDetailsDialog={handleOpenDbDetailsDialog}
handleDbRestart={handleDbRestart}
handleDbSuspendOrResumed={handleDbSuspendOrResumed}
handleDeleteDbCluster={handleDeleteDbCluster}
Expand Down

0 comments on commit 5f77b08

Please sign in to comment.