Skip to content
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
4 changes: 3 additions & 1 deletion src/components/DrawArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const useStyles = makeStyles((theme) => ({
interface IDrawArea {
type: "Baseline" | "Image" | "Diff";
imageName: string;
branchName: string;
ignoreAreas: IgnoreArea[];
setIgnoreAreas: (ignoreAreas: IgnoreArea[]) => void;
selectedRectId: string | undefined;
Expand All @@ -55,6 +56,7 @@ interface IDrawArea {
export const DrawArea: FunctionComponent<IDrawArea> = ({
type,
imageName,
branchName,
ignoreAreas,
setIgnoreAreas,
selectedRectId,
Expand Down Expand Up @@ -124,7 +126,7 @@ export const DrawArea: FunctionComponent<IDrawArea> = ({
<React.Fragment>
<Grid container direction="column">
<Grid item>
<ImageDetails type={type} imageName={imageName} />
<ImageDetails type={type} branchName={branchName} imageName={imageName} />
</Grid>
{imageStatus === "loading" && (
<Grid
Expand Down
22 changes: 18 additions & 4 deletions src/components/ImageDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
import React from "react";
import { Typography } from "@material-ui/core";
import { Typography, Chip, Grid } from "@material-ui/core";
import { staticService } from "../services";
import useImage from "use-image";

interface IProps {
type: "Baseline" | "Image" | "Diff";
imageName: string;
branchName: string;
}

const ImageDetails: React.FunctionComponent<IProps> = ({ type, imageName }) => {
const ImageDetails: React.FunctionComponent<IProps> = ({
type,
imageName,
branchName,
}) => {
const [image] = useImage(staticService.getImage(imageName));
return (
<React.Fragment>
<Typography>{type}</Typography>
{imageName ? (
<React.Fragment>
<Typography variant='caption'>Real size: {`${image?.width} x ${image?.height}`}</Typography>
<Grid container spacing={2}>
<Grid item>
<Typography variant="caption">
Real size: {`${image?.width} x ${image?.height}`}
</Typography>
</Grid>
<Grid item>
<Chip size="small" label={branchName} />
</Grid>
</Grid>
</React.Fragment>
) : (
<Typography variant='caption'>No image</Typography>
<Typography variant="caption">No image</Typography>
)}
</React.Fragment>
);
Expand Down
3 changes: 3 additions & 0 deletions src/components/TestDetailsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ const TestDetailsModal: React.FunctionComponent<{
<DrawArea
type="Baseline"
imageName={testRun.baselineName}
branchName={testRun.baselineBranchName}
ignoreAreas={[]}
setIgnoreAreas={setIgnoreAreas}
selectedRectId={selectedRectId}
Expand All @@ -336,6 +337,7 @@ const TestDetailsModal: React.FunctionComponent<{
<DrawArea
type="Diff"
imageName={testRun.diffName}
branchName={testRun.branchName}
ignoreAreas={ignoreAreas}
setIgnoreAreas={setIgnoreAreas}
selectedRectId={selectedRectId}
Expand All @@ -351,6 +353,7 @@ const TestDetailsModal: React.FunctionComponent<{
<DrawArea
type="Image"
imageName={testRun.imageName}
branchName={testRun.branchName}
ignoreAreas={ignoreAreas}
setIgnoreAreas={setIgnoreAreas}
selectedRectId={selectedRectId}
Expand Down
5 changes: 4 additions & 1 deletion src/components/TestVariationDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Grid, Typography } from "@material-ui/core";
import { Grid, Typography, Chip } from "@material-ui/core";
import { TestVariation } from "../types";

interface IProps {
Expand Down Expand Up @@ -33,6 +33,9 @@ export const TestVariationDetails: React.FunctionComponent<IProps> = ({
<Typography>Viewport: {testVariation.viewport}</Typography>
</Grid>
)}
<Grid item>
<Chip size="small" label={testVariation.branchName} />
</Grid>
</Grid>
</Grid>
);
Expand Down
1 change: 1 addition & 0 deletions src/pages/ProjectListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const ProjectsListPage = () => {
<CardContent>
<Typography>Key: {project.id}</Typography>
<Typography>Name: {project.name}</Typography>
<Typography>Main branch: {project.mainBranchName}</Typography>
<Typography>Created: {formatDateTime(project.createdAt)}</Typography>
</CardContent>
<CardActions>
Expand Down
1 change: 1 addition & 0 deletions src/types/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Build } from "./build";
export interface Project {
id: string;
name: string;
mainBranchName: string;
builds: Build[];
updatedAt: string;
createdAt: string;
Expand Down
2 changes: 2 additions & 0 deletions src/types/testRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ export interface TestRun {
device: string;
ignoreAreas: string;
comment?: string;
branchName: string;
baselineBranchName: string;
}
1 change: 1 addition & 0 deletions src/types/testVariation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export interface TestVariation {
id: string;
name: string;
baselineName: string;
branchName: string;
os: string;
browser: string;
viewport: string;
Expand Down