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

Feature/refactoring project settings #476

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
805 changes: 632 additions & 173 deletions packages/api/src/generated/graphql.ts

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion packages/common/src/hook/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,9 @@ export type TeamsHook = BaseHook & {
};

export type HookWithCustomEvents = SlackHook | TeamsHook | GenericHook;
export type Hook = SlackHook | TeamsHook | GenericHook | GithubHook | BitBucketHook;
export type Hook =
| SlackHook
| TeamsHook
| GenericHook
| GithubHook
| BitBucketHook;
59 changes: 34 additions & 25 deletions packages/dashboard/src/components/common/textFieldLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,47 @@
import styled from '@emotion/styled';
import { theme } from '@sorry-cypress/dashboard/theme';
import { FormControl, FormControlProps, Icon, Tooltip } from 'bold-ui';
import React, { PropsWithChildren } from 'react';
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
import {
FormControl,
FormControlProps,
FormHelperText,
FormLabel,
Tooltip,
} from '@mui/material';
import React, { PropsWithChildren, ReactNode } from 'react';

interface InputFieldLabelProps extends FormControlProps {
helpText?: string;
htmlFor: string;
label?: string | ReactNode;
errorMessage?: string;
}
const InfoIcon = styled(Icon)`
margin-right: 0.5rem;
fill: ${theme.pallete.gray.c50};

&:hover {
fill: ${theme.pallete.text.main};
}
`;

export const InputFieldLabel = (
props: PropsWithChildren<InputFieldLabelProps>
) => {
const { label, helpText, ...rest } = props;
const Help = helpText ? (
<Tooltip text={helpText}>
<InfoIcon size={1} icon="infoCircleOutline" />
const { label, helpText, errorMessage, htmlFor, children, required } = props;
const hasError = errorMessage ? true : false;
const Help = helpText && (
<Tooltip title={helpText}>
<InfoOutlinedIcon fontSize="small" sx={{ mr: 0.5 }} />
</Tooltip>
) : null;
);
return (
<FormControl
label={
<>
{Help}
<span>{label}</span>
</>
}
{...rest}
/>
fullWidth
required={required}
style={{ marginBottom: '1.5rem' }}
>
<FormLabel
htmlFor={htmlFor}
sx={{ display: 'flex', marginBottom: '0.5rem' }}
>
{Help}
<span>{label}</span>
</FormLabel>
{children}
<FormHelperText error={hasError} id={htmlFor}>
{errorMessage}
</FormHelperText>
</FormControl>
);
};