Skip to content

Commit

Permalink
feat(frontend): add variable set help info (#3707)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeepc authored and danielbdias committed Mar 5, 2024
1 parent eb98377 commit 9577d6a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
1 change: 0 additions & 1 deletion web/src/components/ImportModal/ImportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const ImportModal = ({isOpen, onClose}: IProps) => {
onCancel={onClose}
title={<S.Title level={2}>Import a test</S.Title>}
visible={isOpen}
centered
>
<Form<TDraftTest>
form={form}
Expand Down
9 changes: 4 additions & 5 deletions web/src/components/ImportModal/Tip.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import {BulbOutlined} from '@ant-design/icons';
import {Typography} from 'antd';

const Tip = () => (
<>
<Typography.Title level={3} type="secondary">
<BulbOutlined /> What are the supported formats?
</Typography.Title>
<Typography.Text type="secondary">We support Tracetest Definition, cURL & Postman. OpenAPI is coming soon!</Typography.Text>
<Typography.Title level={3}>馃挕 What are the supported formats?</Typography.Title>
<Typography.Text type="secondary">
We support Tracetest Definition, cURL & Postman. OpenAPI is coming soon!
</Typography.Text>
</>
);

Expand Down
19 changes: 19 additions & 0 deletions web/src/components/VariableSetModal/Tip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {Typography} from 'antd';
import {VARIABLE_SET_DOCUMENTATION_URL} from 'constants/Common.constants';
import * as S from './VariableSetModal.styled';

const Tip = () => (
<S.TipContainer>
<Typography.Title level={3}>馃挕 What are Variable Sets?</Typography.Title>
<Typography.Paragraph>
<Typography.Text type="secondary">
{`Variable sets are groups of variables that can be referenced by tests using this syntax: http://\${var:HOSTNAME}/api/users. `}
</Typography.Text>
<Typography.Link href={VARIABLE_SET_DOCUMENTATION_URL} target="_blank">
Read more
</Typography.Link>
</Typography.Paragraph>
</S.TipContainer>
);

export default Tip;
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export const Modal = styled(AntModal)`

export const Title = styled(Typography.Title)`
&& {
font-size: ${({theme}) => theme.size.lg};
margin: 0;
}
`;

export const TipContainer = styled.div`
margin-top: 24px;
`;
5 changes: 4 additions & 1 deletion web/src/components/VariableSetModal/VariableSetModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import VariableSet from 'models/VariableSet.model';
import VariableSetService from 'services/VariableSet.service';
import * as S from './VariableSetModal.styled';
import VariableSetModalFooter from './VariableSetModalFooter';
import Tip from './Tip';

interface IProps {
variableSet?: VariableSet;
Expand Down Expand Up @@ -52,7 +53,7 @@ const VariableSetModal = ({variableSet, isOpen, onClose, onSubmit, isLoading}: I
/>
}
onCancel={onClose}
title={<S.Title>{isEditing ? 'Edit variable set' : 'Create a new variable set'}</S.Title>}
title={<S.Title level={2}>{isEditing ? 'Edit variable set' : 'Create a new variable set'}</S.Title>}
visible={isOpen}
>
<VariableSetForm
Expand All @@ -61,6 +62,8 @@ const VariableSetModal = ({variableSet, isOpen, onClose, onSubmit, isLoading}: I
onSubmit={handleOnSubmit}
onValidate={handleOnValidate}
/>

<Tip />
</S.Modal>
);
};
Expand Down

0 comments on commit 9577d6a

Please sign in to comment.