-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [UIE-8098] - DBaaS GA Landing Page
- Loading branch information
1 parent
f51b555
commit 0ed20a3
Showing
14 changed files
with
366 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@linode/api-v4': Added | ||
--- | ||
|
||
DBaaS 2.0: Add allow_list to the DatabaseInstance ([#11039](https://github.com/linode/manager/pull/11039)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-11039-upcoming-features-1727885138241.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@linode/manager': Upcoming Features | ||
--- | ||
|
||
Added Action Menu Column to the Databases Table and update Database Logo ([#11039](https://github.com/linode/manager/pull/11039)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 43 additions & 52 deletions
95
packages/manager/src/features/Databases/DatabaseLanding/DatabaseActionMenu.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,68 @@ | ||
import { Theme, useTheme } from '@mui/material/styles'; | ||
import useMediaQuery from '@mui/material/useMediaQuery'; | ||
import * as React from 'react'; | ||
import { makeStyles } from 'tss-react/mui'; | ||
import { useHistory } from 'react-router-dom'; | ||
|
||
import { Action, ActionMenu } from 'src/components/ActionMenu/ActionMenu'; | ||
import { InlineMenuAction } from 'src/components/InlineMenuAction/InlineMenuAction'; | ||
import { ActionMenu } from 'src/components/ActionMenu/ActionMenu'; | ||
|
||
const useStyles = makeStyles()(() => ({ | ||
root: { | ||
alignItems: 'center', | ||
display: 'flex', | ||
justifyContent: 'flex-end', | ||
padding: '0px !important', | ||
}, | ||
})); | ||
import type { Engine } from '@linode/api-v4'; | ||
import type { Action } from 'src/components/ActionMenu/ActionMenu'; | ||
|
||
export interface ActionHandlers { | ||
[index: string]: any; | ||
triggerDeleteDatabase: (databaseID: number, databaseLabel: string) => void; | ||
interface Props { | ||
databaseEngine: Engine; | ||
databaseId: number; | ||
databaseLabel: string; | ||
handlers: ActionHandlers; | ||
} | ||
|
||
interface Props extends ActionHandlers { | ||
databaseID: number; | ||
databaseLabel: string; | ||
inlineLabel?: string; | ||
export interface ActionHandlers { | ||
handleDelete: () => void; | ||
handleManageAccessControls: () => void; | ||
handleResetPassword: () => void; | ||
} | ||
|
||
type CombinedProps = Props; | ||
export const DatabaseActionMenu = (props: Props) => { | ||
const { databaseEngine, databaseId, databaseLabel, handlers } = props; | ||
|
||
const DatabaseActionMenu = (props: CombinedProps) => { | ||
const { classes } = useStyles(); | ||
const theme = useTheme<Theme>(); | ||
const matchesSmDown = useMediaQuery(theme.breakpoints.down('md')); | ||
const databaseStatus = 'running'; | ||
const isDatabaseNotRunning = databaseStatus !== 'running'; | ||
|
||
const { databaseID, databaseLabel, triggerDeleteDatabase } = props; | ||
const history = useHistory(); | ||
|
||
const actions: Action[] = [ | ||
// TODO: add suspend action menu item once it's ready | ||
// { | ||
// onClick: () => {}, | ||
// title: databaseStatus === 'running' ? 'Suspend' : 'Power On', | ||
// }, | ||
{ | ||
disabled: isDatabaseNotRunning, | ||
onClick: handlers.handleManageAccessControls, | ||
title: 'Manage Access Controls', | ||
}, | ||
{ | ||
disabled: isDatabaseNotRunning, | ||
onClick: handlers.handleResetPassword, | ||
title: 'Reset Root Password', | ||
}, | ||
{ | ||
disabled: isDatabaseNotRunning, | ||
onClick: () => { | ||
alert('Resize not yet implemented'); | ||
history.push({ | ||
pathname: `/databases/${databaseEngine}/${databaseId}/resize`, | ||
}); | ||
}, | ||
title: 'Resize', | ||
}, | ||
{ | ||
onClick: () => { | ||
if (triggerDeleteDatabase !== undefined) { | ||
triggerDeleteDatabase(databaseID, databaseLabel); | ||
} | ||
}, | ||
disabled: isDatabaseNotRunning, | ||
onClick: handlers.handleDelete, | ||
title: 'Delete', | ||
}, | ||
]; | ||
|
||
return ( | ||
<div className={classes.root}> | ||
{!matchesSmDown && | ||
actions.map((thisAction) => { | ||
return ( | ||
<InlineMenuAction | ||
actionText={thisAction.title} | ||
key={thisAction.title} | ||
onClick={thisAction.onClick} | ||
/> | ||
); | ||
})} | ||
{matchesSmDown && ( | ||
<ActionMenu | ||
actionsList={actions} | ||
ariaLabel={`Action menu for Database ${props.databaseLabel}`} | ||
/> | ||
)} | ||
</div> | ||
<ActionMenu | ||
actionsList={actions} | ||
ariaLabel={`Action menu for Database ${databaseLabel}`} | ||
/> | ||
); | ||
}; | ||
|
||
export default React.memo(DatabaseActionMenu); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.