From 11221ae8dd39e3997cc6086b299658866fe0d043 Mon Sep 17 00:00:00 2001 From: Ivan Li Date: Thu, 11 Mar 2021 20:10:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=B5=81=E6=B0=B4=E7=BA=BF=E7=95=8C=E9=9D=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/commit-actions/commit-actions.tsx | 6 +++--- src/routes/pipelines/pipeline-editor.tsx | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/commit-actions/commit-actions.tsx b/src/components/commit-actions/commit-actions.tsx index 990c7ed..4ce0b3b 100644 --- a/src/components/commit-actions/commit-actions.tsx +++ b/src/components/commit-actions/commit-actions.tsx @@ -4,7 +4,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { makeAutoObservable } from 'mobx'; import { ActionButton } from './action-button'; import { gql, useMutation } from '@apollo/client'; -import { Project } from '../../generated/graphql'; +import { Project, Pipeline } from '../../generated/graphql'; import { CommitActionsStoreProvider, CommitActionsStore @@ -20,7 +20,7 @@ import { useLocalObservable } from 'mobx-react'; const CHECKOUT = ''; interface Props { - project: Project; + pipeline: Pipeline; commitNumber: string; branch?: string; } @@ -32,7 +32,7 @@ class Store { isTasksWorking = [false, false, false, false]; } -export const CommitActions = ({ project, commitNumber }: Props) => { +export const CommitActions = ({ pipeline, commitNumber }: Props) => { const [checkout] = useMutation(CHECKOUT); const onCheckoutBtnClick = async () => { diff --git a/src/routes/pipelines/pipeline-editor.tsx b/src/routes/pipelines/pipeline-editor.tsx index 95e19a5..ec98ab1 100644 --- a/src/routes/pipelines/pipeline-editor.tsx +++ b/src/routes/pipelines/pipeline-editor.tsx @@ -119,7 +119,10 @@ export const PipelineEditor = ({ projectId, id }: Props) => { delete fd.__typename; return fd; } - return {}; + return { + projectId, + workUnitMetadata: JSON.stringify(defaultWorkUnitMetadata, null, 2) + }; }, [data, data?.pipeline]); const [createPipeline] = useMutation<{ pipeline: Pipeline }>(