feat: add create pipeline button.

This commit is contained in:
Ivan 2021-07-06 16:04:33 +08:00
parent c6b09aa075
commit edab87d3f1
4 changed files with 24 additions and 19 deletions

View File

@ -1,5 +1,5 @@
overwrite: true overwrite: true
schema: "http://api.fennec.localhost/graphql" schema: "http://localhost:7122/graphql"
# documents: "src/**/*.graphql" # documents: "src/**/*.graphql"
generates: generates:
src/generated/graphql.tsx: src/generated/graphql.tsx:

View File

@ -1949,22 +1949,6 @@
"description": null, "description": null,
"fields": null, "fields": null,
"inputFields": [ "inputFields": [
{
"name": "projectId",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "branch", "name": "branch",
"description": null, "description": null,

View File

@ -255,7 +255,6 @@ export enum TaskStatuses {
} }
export type UpdatePipelineInput = { export type UpdatePipelineInput = {
projectId: Scalars['String'];
branch: Scalars['String']; branch: Scalars['String'];
name: Scalars['String']; name: Scalars['String'];
workUnitMetadata: WorkUnitMetadataInput; workUnitMetadata: WorkUnitMetadataInput;

View File

@ -1,10 +1,20 @@
import { Project } from "../generated/graphql"; import { Project } from "../generated/graphql";
import React, { FC, Fragment } from "react"; import React, { FC, Fragment } from "react";
import { IconButton, Grid, makeStyles, Paper, Portal, Typography } from "@material-ui/core"; import {
IconButton,
Grid,
makeStyles,
Paper,
Portal,
Typography,
Box,
} from "@material-ui/core";
import { useHeaderContainer } from "../layouts"; import { useHeaderContainer } from "../layouts";
import { PipelineList } from "../pipelines/pipeline-list"; import { PipelineList } from "../pipelines/pipeline-list";
import { Edit } from '@material-ui/icons'; import { Edit } from '@material-ui/icons';
import { Link } from '@curi/react-dom'; import { Link } from '@curi/react-dom';
import { Button } from "@material-ui/core";
import { AddBox } from "@material-ui/icons";
interface Props { interface Props {
project: Project; project: Project;
@ -62,6 +72,18 @@ export const ProjectDetail: FC<Props> = ({ project, children }) => {
> >
<Grid item xs={3} lg={2} style={{ height: "100%", display: "flex" }}> <Grid item xs={3} lg={2} style={{ height: "100%", display: "flex" }}>
<Paper className={classes.pipelineListContainer}> <Paper className={classes.pipelineListContainer}>
<Box m={2}>
<Link name="create-pipeline" params={{ projectId: project.id }}>
<Button
variant="contained"
color="primary"
title="New Pipeline"
startIcon={<AddBox />}
>
New Pipeline
</Button>
</Link>
</Box>
<PipelineList projectId={project.id} /> <PipelineList projectId={project.id} />
</Paper> </Paper>
</Grid> </Grid>