feat: show test runs in executions
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import Card from '@mui/material/Card';
|
import Card from '@mui/material/Card';
|
||||||
import Box from '@mui/material/Box';
|
|
||||||
import Stack from '@mui/material/Stack';
|
|
||||||
import CardActionArea from '@mui/material/CardActionArea';
|
import CardActionArea from '@mui/material/CardActionArea';
|
||||||
|
import Chip from '@mui/material/Chip';
|
||||||
import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
|
import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
|
||||||
import { DateTime } from 'luxon';
|
import { DateTime } from 'luxon';
|
||||||
import type { IExecution } from '@automatisch/types';
|
import type { IExecution } from '@automatisch/types';
|
||||||
@@ -49,6 +48,15 @@ export default function ExecutionRow(props: ExecutionRowProps): React.ReactEleme
|
|||||||
</Title>
|
</Title>
|
||||||
|
|
||||||
<ArrowContainer>
|
<ArrowContainer>
|
||||||
|
{execution.testRun && (
|
||||||
|
<Chip
|
||||||
|
size="small"
|
||||||
|
color="warning"
|
||||||
|
variant="outlined"
|
||||||
|
label={formatMessage('execution.test')}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<ArrowForwardIosIcon sx={{ color: (theme) => theme.palette.primary.main }} />
|
<ArrowForwardIosIcon sx={{ color: (theme) => theme.palette.primary.main }} />
|
||||||
</ArrowContainer>
|
</ArrowContainer>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
@@ -31,6 +31,10 @@ export const Title = styled(MuiStack)(() => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
export const ArrowContainer = styled(MuiBox)(() => ({
|
export const ArrowContainer = styled(MuiBox)(() => ({
|
||||||
|
flexDirection: 'row',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
gap: 10,
|
||||||
gridArea: 'arrow-container',
|
gridArea: 'arrow-container',
|
||||||
}));
|
}));
|
||||||
export const Typography = styled(MuiTypography)(() => ({
|
export const Typography = styled(MuiTypography)(() => ({
|
||||||
|
@@ -27,7 +27,7 @@ const validIcon = <CheckCircleIcon color="success" />;
|
|||||||
const errorIcon = <ErrorIcon color="error" />;
|
const errorIcon = <ErrorIcon color="error" />;
|
||||||
|
|
||||||
export default function ExecutionStep(props: ExecutionStepProps): React.ReactElement | null {
|
export default function ExecutionStep(props: ExecutionStepProps): React.ReactElement | null {
|
||||||
const { executionStep, index, } = props;
|
const { executionStep, } = props;
|
||||||
const [activeTabIndex, setActiveTabIndex] = React.useState(0);
|
const [activeTabIndex, setActiveTabIndex] = React.useState(0);
|
||||||
const step: IStep = executionStep.step;
|
const step: IStep = executionStep.step;
|
||||||
const isTrigger = step.type === 'trigger';
|
const isTrigger = step.type === 'trigger';
|
||||||
|
@@ -43,7 +43,6 @@ function FlowSubstep(props: FlowSubstepProps): React.ReactElement {
|
|||||||
expanded = false,
|
expanded = false,
|
||||||
onExpand,
|
onExpand,
|
||||||
onCollapse,
|
onCollapse,
|
||||||
onChange,
|
|
||||||
onSubmit,
|
onSubmit,
|
||||||
step,
|
step,
|
||||||
} = props;
|
} = props;
|
||||||
@@ -57,24 +56,6 @@ function FlowSubstep(props: FlowSubstepProps): React.ReactElement {
|
|||||||
const formContext = useFormContext();
|
const formContext = useFormContext();
|
||||||
const [validationStatus, setValidationStatus] = React.useState<boolean | null>(validateSubstep(substep, formContext.getValues() as IStep));
|
const [validationStatus, setValidationStatus] = React.useState<boolean | null>(validateSubstep(substep, formContext.getValues() as IStep));
|
||||||
|
|
||||||
const handleChangeOnBlur = React.useCallback((key: string) => {
|
|
||||||
return (value: string) => {
|
|
||||||
const currentValue = step.parameters?.[key];
|
|
||||||
|
|
||||||
if (currentValue !== value) {
|
|
||||||
onChange({
|
|
||||||
step: {
|
|
||||||
...step,
|
|
||||||
parameters: {
|
|
||||||
...step.parameters,
|
|
||||||
[key]: value,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, [step, onChange]);
|
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
function validate (step: unknown) {
|
function validate (step: unknown) {
|
||||||
const validationResult = validateSubstep(substep, step as IStep);
|
const validationResult = validateSubstep(substep, step as IStep);
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { useLazyQuery } from '@apollo/client';
|
|
||||||
import MuiTextField from '@mui/material/TextField';
|
import MuiTextField from '@mui/material/TextField';
|
||||||
import type { IField, IFieldDropdown, IFieldDropdownOption, IJSONObject } from '@automatisch/types';
|
import type { IField, IFieldDropdownOption } from '@automatisch/types';
|
||||||
|
|
||||||
import useDynamicData from 'hooks/useDynamicData';
|
import useDynamicData from 'hooks/useDynamicData';
|
||||||
import { GET_DATA } from 'graphql/queries/get-data';
|
|
||||||
import PowerInput from 'components/PowerInput';
|
import PowerInput from 'components/PowerInput';
|
||||||
import TextField from 'components/TextField';
|
import TextField from 'components/TextField';
|
||||||
import ControlledAutocomplete from 'components/ControlledAutocomplete';
|
import ControlledAutocomplete from 'components/ControlledAutocomplete';
|
||||||
@@ -23,7 +21,6 @@ type RawOption = {
|
|||||||
value: string;
|
value: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const computeArguments = (args: IFieldDropdown["source"]["arguments"]): IJSONObject => args.reduce((result, { name, value }) => ({ ...result, [name as string]: value }), {});
|
|
||||||
const optionGenerator = (options: RawOption[]): IFieldDropdownOption[] => options?.map(({ name, value }) => ({ label: name as string, value: value }));
|
const optionGenerator = (options: RawOption[]): IFieldDropdownOption[] => options?.map(({ name, value }) => ({ label: name as string, value: value }));
|
||||||
const getOption = (options: IFieldDropdownOption[], value: string) => options?.find(option => option.value === value);
|
const getOption = (options: IFieldDropdownOption[], value: string) => options?.find(option => option.value === value);
|
||||||
|
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { useMutation } from '@apollo/client';
|
import { useMutation } from '@apollo/client';
|
||||||
import { UseFormReturn } from 'react-hook-form';
|
|
||||||
import Paper from '@mui/material/Paper';
|
import Paper from '@mui/material/Paper';
|
||||||
import Typography from '@mui/material/Typography';
|
import Typography from '@mui/material/Typography';
|
||||||
import LoadingButton from '@mui/lab/LoadingButton';
|
import LoadingButton from '@mui/lab/LoadingButton';
|
||||||
@@ -12,15 +11,11 @@ import { LOGIN } from 'graphql/mutations/login';
|
|||||||
import Form from 'components/Form';
|
import Form from 'components/Form';
|
||||||
import TextField from 'components/TextField';
|
import TextField from 'components/TextField';
|
||||||
|
|
||||||
type FormValues = {
|
|
||||||
email: string;
|
|
||||||
password: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
function renderFields(props: { loading: boolean }) {
|
function renderFields(props: { loading: boolean }) {
|
||||||
const { loading = false } = props;
|
const { loading = false } = props;
|
||||||
|
|
||||||
return (methods: UseFormReturn) => {
|
return () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TextField
|
<TextField
|
||||||
|
@@ -119,7 +119,7 @@ const PowerInput = (props: PowerInputProps) => {
|
|||||||
control={control}
|
control={control}
|
||||||
defaultValue={defaultValue}
|
defaultValue={defaultValue}
|
||||||
shouldUnregister={false}
|
shouldUnregister={false}
|
||||||
render={({ field: { value, ref, onChange: controllerOnChange, onBlur: controllerOnBlur, ...field } }) => (
|
render={({ field: { value, onChange: controllerOnChange, onBlur: controllerOnBlur, } }) => (
|
||||||
<Slate
|
<Slate
|
||||||
editor={editor}
|
editor={editor}
|
||||||
value={deserialize(value)}
|
value={deserialize(value)}
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
import type { IAuthenticationStep, IJSONObject } from '@automatisch/types';
|
import type { IAuthenticationStep, IJSONObject } from '@automatisch/types';
|
||||||
import apolloClient from 'graphql/client';
|
import apolloClient from 'graphql/client';
|
||||||
import MUTATIONS from 'graphql/mutations';
|
import MUTATIONS from 'graphql/mutations';
|
||||||
import appConfig from 'config/app';
|
|
||||||
|
|
||||||
enum AuthenticationSteps {
|
enum AuthenticationSteps {
|
||||||
Mutation = 'mutation',
|
Mutation = 'mutation',
|
||||||
|
@@ -58,6 +58,7 @@
|
|||||||
"executions.title": "Executions",
|
"executions.title": "Executions",
|
||||||
"executions.noExecutions": "There is no execution data point to show.",
|
"executions.noExecutions": "There is no execution data point to show.",
|
||||||
"execution.executedAt": "executed {datetime}",
|
"execution.executedAt": "executed {datetime}",
|
||||||
|
"execution.test": "Test run",
|
||||||
"profileSettings.title": "My Profile",
|
"profileSettings.title": "My Profile",
|
||||||
"profileSettings.email": "Email",
|
"profileSettings.email": "Email",
|
||||||
"profileSettings.updateEmail": "Update email",
|
"profileSettings.updateEmail": "Update email",
|
||||||
|
@@ -15,7 +15,6 @@ import Container from 'components/Container';
|
|||||||
import PageTitle from 'components/PageTitle';
|
import PageTitle from 'components/PageTitle';
|
||||||
import useFormatMessage from 'hooks/useFormatMessage'
|
import useFormatMessage from 'hooks/useFormatMessage'
|
||||||
import { GET_EXECUTIONS } from 'graphql/queries/get-executions';
|
import { GET_EXECUTIONS } from 'graphql/queries/get-executions';
|
||||||
import * as URLS from 'config/urls';
|
|
||||||
|
|
||||||
const EXECUTION_PER_PAGE = 10;
|
const EXECUTION_PER_PAGE = 10;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user