Skip to content

Commit

Permalink
EVEREST-1737: add code commands to add namespaces (#923)
Browse files Browse the repository at this point in the history
* feat: add code commands to add namespaces

* chore: add Roboto Mono
  • Loading branch information
fabio-silva authored Dec 12, 2024
1 parent 4891716 commit 7ea9089
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const CodeCopyBlock = ({
alignItems: 'center',
pt: 0,
},
fontFamily: '"Roboto Mono", "Helvetica", "Arial", "sans-serif"',
}}
action={
<CopyToClipboardButton
Expand Down
25 changes: 23 additions & 2 deletions ui/apps/everest/src/pages/common/empty-state/namespaces/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
import { Box, Button, Divider, Typography } from '@mui/material';
import { Box, Button, Divider, Stack, Typography } from '@mui/material';
import { EmptyStateIcon } from '@percona/ui-lib';
import { Messages } from './messages';
import { ArrowOutward } from '@mui/icons-material';
import { centeredContainerStyle } from '../utils';
import { ContactSupportLink } from '../ContactSupportLink';
import { CodeCopyBlock } from 'components/code-copy-block/code-copy-block';

const CommandInstructions = ({
message,
command,
}: {
message: string;
command: string;
}) => (
<Stack mt={3} maxWidth="350px">
<Typography variant="body2">{message}</Typography>
<CodeCopyBlock message={command} />
</Stack>
);

export const EmptyStateNamespaces = () => {
return (
Expand All @@ -19,7 +33,14 @@ export const EmptyStateNamespaces = () => {
<Box sx={centeredContainerStyle}>
<Typography>{Messages.noNamespaces}</Typography>
<Typography> {Messages.createToStart}</Typography>
<Typography> {Messages.command}</Typography>
<CommandInstructions
message="If you are using CLI, run the following command:"
command="everestctl namespaces add <NAMESPACE>"
/>
<CommandInstructions
message="If you are using Helm, run the following command:"
command="helm install everest percona/everest-db-namespace --create-namespace --namespace <NAMESPACE>"
/>
</Box>
<Button
data-testid="learn-more-button"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const Messages = {
noNamespaces: 'Uh-oh! Looks like no namespaces have been created',
createToStart: 'Create one to get started.',
command: 'Run `everestctl namespaces add [Namespace]` command.',
noNamespaces:
'Uh-oh! Looks like no namespaces have been created or no database engines are available.',
createToStart: 'To create a namespace, follow the commands:',
learnMore: 'Learn more',
contactSupport: 'Contact Percona Support',
};
1 change: 1 addition & 0 deletions ui/packages/design/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"dependencies": {
"@fontsource/poppins": "^5.0.8",
"@fontsource/roboto": "^5.0.8",
"@fontsource/roboto-mono": "^5.1.0",
"@mui/utils": "^5.14.15"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/design/src/themes/base/BaseTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import '@fontsource/roboto/700.css';
import '@fontsource/poppins/400.css';
import '@fontsource/poppins/500.css';
import '@fontsource/poppins/600.css';

import '@fontsource/roboto-mono/400.css';
import {
ComponentsOverrides,
createTheme,
Expand Down
8 changes: 8 additions & 0 deletions ui/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7ea9089

Please sign in to comment.