Skip to content

Commit

Permalink
API updates, type + lint fixes and in-progress run tests button
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Jun 26, 2023
1 parent f76d028 commit c2ebeb4
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 76 deletions.
73 changes: 34 additions & 39 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ export const Panel = ({ active }: PanelProps) => {

return (
<Provider key={PANEL_ID} value={client}>
<VisualTests setAccessToken={setAccessToken} />
<VisualTests
isOutdated={false}
isRunning={false}
runTests={() => {}}
setAccessToken={setAccessToken}
/>
</Provider>
);
};
43 changes: 27 additions & 16 deletions src/components/icons/ProgressIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
import { animation } from "@storybook/design-system";
import { styled } from "@storybook/theming";
import { css, styled } from "@storybook/theming";

const { rotate360 } = animation;

export const ProgressIcon = styled.div(({ theme }) => ({
width: 12,
height: 12,
margin: "3px 6px",
verticalAlign: "top",
display: "inline-block",
export const ProgressIcon = styled.div<{ onButton?: boolean }>(
({ theme }) => ({
width: 12,
height: 12,
margin: "3px 6px",
verticalAlign: "top",
display: "inline-block",

animation: `${rotate360} 0.7s linear infinite`,
border: "2px solid transparent",
borderLeftColor: theme.base === "dark" ? "#58faf9" : "#00aaff",
borderBottomColor: "#25ccfd",
borderRightColor: theme.base === "dark" ? "#00aaff" : "#58faf9",
borderRadius: "100%",
cursor: "progress",
transform: "translate3d(0, 0, 0)",
}));
animation: `${rotate360} 0.7s linear infinite`,
border: "2px solid transparent",
borderLeftColor: theme.base === "dark" ? "#58faf9" : "#00aaff",
borderBottomColor: "#25ccfd",
borderRightColor: theme.base === "dark" ? "#00aaff" : "#58faf9",
borderRadius: "100%",
cursor: "progress",
transform: "translate3d(0, 0, 0)",
}),
({ theme, onButton }) =>
onButton &&
css({
margin: "0 6px 0 0",
borderWidth: 1,
borderLeftColor: theme.color.lightest,
borderBottomColor: theme.color.lightest,
borderRightColor: theme.color.lightest,
})
);
4 changes: 2 additions & 2 deletions src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
*/
const documents = {
"\n query ProjectQuery($projectId: ID!) {\n project(id: $projectId) {\n id\n name\n webUrl\n lastBuild {\n branch\n number\n }\n }\n }\n": types.ProjectQueryDocument,
"\n query LastBuild($projectId: ID!, $branch: String!, $storyId: String!) {\n project(id: $projectId) {\n id\n name\n webUrl\n lastBuild(branches: [$branch]) {\n id\n number\n branch\n commit\n status\n browsers {\n id\n key\n name\n }\n ... on StartedBuild {\n changeCount: testCount(results: [ADDED, CHANGED, FIXED])\n startedAt\n tests(storyId: $storyId) {\n nodes {\n id\n result\n status\n comparisons {\n result\n browser {\n id\n }\n viewport {\n id\n }\n }\n parameters {\n viewport {\n id\n name\n }\n }\n }\n }\n }\n }\n }\n }\n": types.LastBuildDocument,
"\n query LastBuild($projectId: ID!, $branch: String!, $storyId: String!) {\n project(id: $projectId) {\n id\n name\n webUrl\n lastBuild(branches: [$branch]) {\n id\n number\n branch\n commit\n status\n browsers {\n id\n key\n name\n }\n ... on StartedBuild {\n changeCount: testCount(results: [ADDED, CHANGED, FIXED])\n startedAt\n tests(storyId: $storyId) {\n nodes {\n id\n status\n result\n comparisons {\n id\n browser {\n id\n key\n name\n version\n }\n viewport {\n id\n name\n width\n isDefault\n }\n result\n }\n parameters {\n viewport {\n id\n name\n width\n isDefault\n }\n }\n }\n }\n }\n }\n }\n }\n": types.LastBuildDocument,
};

/**
Expand All @@ -38,7 +38,7 @@ export function graphql(source: "\n query ProjectQuery($projectId: ID!) {\n
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(source: "\n query LastBuild($projectId: ID!, $branch: String!, $storyId: String!) {\n project(id: $projectId) {\n id\n name\n webUrl\n lastBuild(branches: [$branch]) {\n id\n number\n branch\n commit\n status\n browsers {\n id\n key\n name\n }\n ... on StartedBuild {\n changeCount: testCount(results: [ADDED, CHANGED, FIXED])\n startedAt\n tests(storyId: $storyId) {\n nodes {\n id\n result\n status\n comparisons {\n result\n browser {\n id\n }\n viewport {\n id\n }\n }\n parameters {\n viewport {\n id\n name\n }\n }\n }\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query LastBuild($projectId: ID!, $branch: String!, $storyId: String!) {\n project(id: $projectId) {\n id\n name\n webUrl\n lastBuild(branches: [$branch]) {\n id\n number\n branch\n commit\n status\n browsers {\n id\n key\n name\n }\n ... on StartedBuild {\n changeCount: testCount(results: [ADDED, CHANGED, FIXED])\n startedAt\n tests(storyId: $storyId) {\n nodes {\n id\n result\n status\n comparisons {\n result\n browser {\n id\n }\n viewport {\n id\n }\n }\n parameters {\n viewport {\n id\n name\n }\n }\n }\n }\n }\n }\n }\n }\n"];
export function graphql(source: "\n query LastBuild($projectId: ID!, $branch: String!, $storyId: String!) {\n project(id: $projectId) {\n id\n name\n webUrl\n lastBuild(branches: [$branch]) {\n id\n number\n branch\n commit\n status\n browsers {\n id\n key\n name\n }\n ... on StartedBuild {\n changeCount: testCount(results: [ADDED, CHANGED, FIXED])\n startedAt\n tests(storyId: $storyId) {\n nodes {\n id\n status\n result\n comparisons {\n id\n browser {\n id\n key\n name\n version\n }\n viewport {\n id\n name\n width\n isDefault\n }\n result\n }\n parameters {\n viewport {\n id\n name\n width\n isDefault\n }\n }\n }\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query LastBuild($projectId: ID!, $branch: String!, $storyId: String!) {\n project(id: $projectId) {\n id\n name\n webUrl\n lastBuild(branches: [$branch]) {\n id\n number\n branch\n commit\n status\n browsers {\n id\n key\n name\n }\n ... on StartedBuild {\n changeCount: testCount(results: [ADDED, CHANGED, FIXED])\n startedAt\n tests(storyId: $storyId) {\n nodes {\n id\n status\n result\n comparisons {\n id\n browser {\n id\n key\n name\n version\n }\n viewport {\n id\n name\n width\n isDefault\n }\n result\n }\n parameters {\n viewport {\n id\n name\n width\n isDefault\n }\n }\n }\n }\n }\n }\n }\n }\n"];

export function graphql(source: string) {
return (documents as any)[source] ?? {};
Expand Down
Loading

0 comments on commit c2ebeb4

Please sign in to comment.