From 832d77d57a96e2907aef417b1e104a85d18c706b Mon Sep 17 00:00:00 2001 From: Ivan Li Date: Tue, 19 Oct 2021 23:05:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=20=E6=B7=BB=E5=8A=A0=20pipeline=20?= =?UTF-8?q?=E7=9A=84=E9=83=A8=E7=BD=B2=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=8E=E5=B1=95=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 24 +++++++-------- package.json | 6 ++-- src/generated/graphql.schema.json | 16 ++++++++++ src/generated/graphql.tsx | 1 + src/pipelines/mutations.ts | 2 ++ src/pipelines/pipeline-editor.tsx | 20 +++++++++++-- src/pipelines/pipeline-list.tsx | 49 ++++++++++++++++++++++++++++--- src/pipelines/queries.ts | 1 + 8 files changed, 98 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5f90f18..f0d7989 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,9 +14,9 @@ "@curi/router": "^2.1.2", "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", - "@fortawesome/fontawesome-svg-core": "^1.2.35", - "@fortawesome/free-solid-svg-icons": "^5.15.3", - "@fortawesome/react-fontawesome": "^0.1.14", + "@fortawesome/fontawesome-svg-core": "^1.2.36", + "@fortawesome/free-solid-svg-icons": "^5.15.4", + "@fortawesome/react-fontawesome": "^0.1.16", "@hickory/browser": "^2.1.0", "@mui/icons-material": "^5.0.1", "@mui/lab": "^5.0.0-alpha.49", @@ -79,7 +79,7 @@ "@types/node": "^14.17.17", "rimraf": "^3.0.2", "ts-node": "^10.2.1", - "typescript": "^4.4.3" + "typescript": "^4.4.4" } }, "node_modules/@apollo/client": { @@ -2493,15 +2493,15 @@ } }, "node_modules/@fortawesome/react-fontawesome": { - "version": "0.1.15", - "resolved": "https://npm.ivanli.cc/@fortawesome%2freact-fontawesome/-/react-fontawesome-0.1.15.tgz", - "integrity": "sha512-/HFHdcoLESxxMkqZAcZ6RXDJ69pVApwdwRos/B2kiMWxDSAX2dFK8Er2/+rG+RsrzWB/dsAyjefLmemgmfE18g==", + "version": "0.1.16", + "resolved": "https://npm.ivanli.cc/@fortawesome%2freact-fontawesome/-/react-fontawesome-0.1.16.tgz", + "integrity": "sha512-aLmzDwC9rEOAJv2UJdMns89VZR5Ry4IHu5dQQh24Z/lWKEm44lfQr1UNalZlkUaQN8d155tNh+CS7ntntj1VMA==", "license": "MIT", "dependencies": { "prop-types": "^15.7.2" }, "peerDependencies": { - "@fortawesome/fontawesome-svg-core": "^1.2.32", + "@fortawesome/fontawesome-svg-core": "~1 || >=1.3.0-beta1", "react": ">=16.x" } }, @@ -33044,9 +33044,9 @@ } }, "@fortawesome/react-fontawesome": { - "version": "0.1.15", - "resolved": "https://npm.ivanli.cc/@fortawesome%2freact-fontawesome/-/react-fontawesome-0.1.15.tgz", - "integrity": "sha512-/HFHdcoLESxxMkqZAcZ6RXDJ69pVApwdwRos/B2kiMWxDSAX2dFK8Er2/+rG+RsrzWB/dsAyjefLmemgmfE18g==", + "version": "0.1.16", + "resolved": "https://npm.ivanli.cc/@fortawesome%2freact-fontawesome/-/react-fontawesome-0.1.16.tgz", + "integrity": "sha512-aLmzDwC9rEOAJv2UJdMns89VZR5Ry4IHu5dQQh24Z/lWKEm44lfQr1UNalZlkUaQN8d155tNh+CS7ntntj1VMA==", "requires": { "prop-types": "^15.7.2" } @@ -38295,7 +38295,7 @@ "js-yaml": "^4.1.0", "rimraf": "^3.0.2", "ts-node": "^10.2.1", - "typescript": "^4.4.3" + "typescript": "^4.4.4" } }, "confusing-browser-globals": { diff --git a/package.json b/package.json index e96232b..29a3f7f 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,9 @@ "@curi/router": "^2.1.2", "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", - "@fortawesome/fontawesome-svg-core": "^1.2.35", - "@fortawesome/free-solid-svg-icons": "^5.15.3", - "@fortawesome/react-fontawesome": "^0.1.14", + "@fortawesome/fontawesome-svg-core": "^1.2.36", + "@fortawesome/free-solid-svg-icons": "^5.15.4", + "@fortawesome/react-fontawesome": "^0.1.16", "@hickory/browser": "^2.1.0", "@mui/icons-material": "^5.0.1", "@mui/lab": "^5.0.0-alpha.49", diff --git a/src/generated/graphql.schema.json b/src/generated/graphql.schema.json index 02f773b..ea7dca1 100644 --- a/src/generated/graphql.schema.json +++ b/src/generated/graphql.schema.json @@ -1176,6 +1176,22 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "environment", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, diff --git a/src/generated/graphql.tsx b/src/generated/graphql.tsx index 4d9ece0..f6b3aad 100644 --- a/src/generated/graphql.tsx +++ b/src/generated/graphql.tsx @@ -148,6 +148,7 @@ export type Pipeline = { branch: Scalars['String']; name: Scalars['String']; workUnitMetadata: WorkUnitMetadata; + environment: Scalars['String']; }; export type PipelineTask = { diff --git a/src/pipelines/mutations.ts b/src/pipelines/mutations.ts index d012b8c..99a171f 100644 --- a/src/pipelines/mutations.ts +++ b/src/pipelines/mutations.ts @@ -7,6 +7,7 @@ export const CREATE_PIPELINE = gql` projectId branch name + environment workUnitMetadata { version units { @@ -25,6 +26,7 @@ export const UPDATE_PIPELINE = gql` projectId branch name + environment workUnitMetadata { version units { diff --git a/src/pipelines/pipeline-editor.tsx b/src/pipelines/pipeline-editor.tsx index c384cf9..1eac0bd 100644 --- a/src/pipelines/pipeline-editor.tsx +++ b/src/pipelines/pipeline-editor.tsx @@ -61,6 +61,7 @@ export const PipelineEditor: FC = ({ pipeline }) => { id projectId branch + environment name workUnitMetadata { version @@ -173,7 +174,12 @@ export const PipelineEditor: FC = ({ pipeline }) => { {isCreate ? "Create" : "Edit"} Pipeline {isCreate ? null : ( - + )} @@ -186,7 +192,10 @@ export const PipelineEditor: FC = ({ pipeline }) => { .max(32, "Must be 32 characters or less") .required("Required"), branch: Yup.string() - .max(32, "Must be 32 characters or less") + .max(64, "Must be 64 characters or less") + .required("Required"), + environment: Yup.string() + .max(64, "Must be 64 characters or less") .required("Required"), })} onSubmit={submitForm} @@ -202,6 +211,13 @@ export const PipelineEditor: FC = ({ pipeline }) => { fullWidth margin="normal" /> + { - - {pipeline.branch} - + + + + + {pipeline.branch} + + + + + + {pipeline.environment} + + + } /> diff --git a/src/pipelines/queries.ts b/src/pipelines/queries.ts index d1d1ca7..a9c3df5 100644 --- a/src/pipelines/queries.ts +++ b/src/pipelines/queries.ts @@ -7,6 +7,7 @@ export const PIPELINE = gql` name projectId branch + environment workUnitMetadata { version units {