Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZKUI-393 // Link the no account page to the Veeam Assistant #682

Closed
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
20 changes: 19 additions & 1 deletion src/react/account/Accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { useAccessibleAccountsAdapter } from '../next-architecture/ui/Accessible
import { EmptyStateContainer } from '../ui-elements/Container';
import { Warning } from '../ui-elements/Warning';
import { useAuthGroups } from '../utils/hooks';
import { Button } from '@scality/core-ui/dist/next';

const Accounts = () => {
const { pathname } = useLocation();
Expand Down Expand Up @@ -59,7 +60,24 @@ const Accounts = () => {
<Warning
centered={true}
icon={<Icon name="Account" size="5x" />}
title={`You don't have any account, please create your first one.`}
title={
<>
You don't have any account yet.
<br />
Launch configuration assitant to create resources needed
by Veeam.
</>
}
content={
<>
<Button
label="Start Configuration for Veeam"
variant="primary"
onClick={() => history.push('/veeam/configuration')}
/>
<p>or</p>
</>
}
btnTitle="Create Account"
btnAction={() => history.push('/create-account')}
/>
Expand Down
12 changes: 8 additions & 4 deletions src/react/ui-elements/Warning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled, { css } from 'styled-components';
import { Button } from '@scality/core-ui/dist/next';
import { spacing } from '@scality/core-ui/dist/style/theme';
import { ReactNode } from 'react';
import { Icon } from '@scality/core-ui';
import { Icon, Text } from '@scality/core-ui';
const Container = styled.div<{ centered?: boolean }>`
display: flex;
flex: 1;
Expand Down Expand Up @@ -39,24 +39,28 @@ const ButtonSection = styled.div`
type WarningProps = {
icon?: ReactNode;
title: ReactNode;
content?: ReactNode;
btnTitle?: string;
btnAction?: () => void;
centered?: boolean;
};
export const Warning = ({
icon,
title,
content,
btnTitle,
btnAction,
centered,
}: WarningProps) => (
<Container centered={centered}>
<div>{icon}</div>
<Title> {title} </Title>
<Title>
<Text isEmphazed>{title}</Text>
</Title>
{!!btnTitle && !!btnAction && (
<ButtonSection>
{' '}
<Button label={btnTitle} variant="secondary" onClick={btnAction} />{' '}
{content}
<Button label={btnTitle} variant="outline" onClick={btnAction} />{' '}
</ButtonSection>
)}
</Container>
Expand Down
Loading