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

feat(frontend): add variable set help info #3707

Merged
merged 1 commit into from
Mar 5, 2024
Merged
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
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
Loading