Compare commits
No commits in common. "develop" and "master" have entirely different histories.
21
.cracorc.js
21
.cracorc.js
@ -1,21 +0,0 @@
|
|||||||
const { ServiceRegister } = require("configuration");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
devServer: (devServerConfig) => {
|
|
||||||
devServerConfig.port = "auto";
|
|
||||||
devServerConfig.onListening = function (devServer) {
|
|
||||||
if (!devServer) {
|
|
||||||
throw new Error("webpack-dev-server is not defined");
|
|
||||||
}
|
|
||||||
|
|
||||||
const port = devServer.listeningApp.address().port;
|
|
||||||
const register = new ServiceRegister({
|
|
||||||
etcd: { hosts: ["http://rpi:2379"] },
|
|
||||||
});
|
|
||||||
register.register("fennec", `http://localhost:${port}/`);
|
|
||||||
console.log("Listening on port:", port);
|
|
||||||
};
|
|
||||||
|
|
||||||
return devServerConfig;
|
|
||||||
},
|
|
||||||
};
|
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -21,5 +21,3 @@
|
|||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
|
||||||
.vscode/chrome
|
|
5
.vscode/launch.json
vendored
5
.vscode/launch.json
vendored
@ -8,9 +8,10 @@
|
|||||||
"name": "chrome",
|
"name": "chrome",
|
||||||
"type": "chrome",
|
"type": "chrome",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"url": "http://fennec.localhost:7070/",
|
"reAttach": true,
|
||||||
|
"url": "http://fennec.localhost/",
|
||||||
"webRoot": "${workspaceFolder}",
|
"webRoot": "${workspaceFolder}",
|
||||||
"userDataDir": ".vscode/chrome"
|
"userDataDir": "/Users/ivan/Projects/.chrome"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -1,9 +1,8 @@
|
|||||||
{
|
{
|
||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
|
"Formik",
|
||||||
"clsx",
|
"clsx",
|
||||||
"fontsource",
|
"fontsource",
|
||||||
"Formik",
|
|
||||||
"noconflict",
|
|
||||||
"notistack",
|
"notistack",
|
||||||
"unmount",
|
"unmount",
|
||||||
"vditor"
|
"vditor"
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
client: {
|
client: {
|
||||||
service: {
|
service: {
|
||||||
name: "fennec-be",
|
name: 'fennec-be',
|
||||||
url: "http://localhost:7122/graphql",
|
url: 'http://api.fennec.localhost/graphql'
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
overwrite: true
|
overwrite: true
|
||||||
schema: "http://localhost:7122/graphql"
|
schema: "http://api.fennec.localhost/graphql"
|
||||||
# documents: "src/**/*.graphql"
|
# documents: "src/**/*.graphql"
|
||||||
generates:
|
generates:
|
||||||
src/generated/graphql.tsx:
|
src/generated/graphql.tsx:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
apps: [
|
apps: [
|
||||||
{
|
{
|
||||||
name: "fennec-fe",
|
name: "fennec-bs",
|
||||||
script: "serve",
|
script: "serve",
|
||||||
args: "",
|
args: "",
|
||||||
watch: false,
|
watch: false,
|
||||||
@ -9,7 +9,7 @@ module.exports = {
|
|||||||
log_date_format: "MM-DD HH:mm:ss.SSS Z",
|
log_date_format: "MM-DD HH:mm:ss.SSS Z",
|
||||||
env: {
|
env: {
|
||||||
PM2_SERVE_PATH: "./build",
|
PM2_SERVE_PATH: "./build",
|
||||||
PM2_SERVE_PORT: 7123,
|
PM2_SERVE_PORT: 7135,
|
||||||
PM2_SERVE_SPA: "true",
|
PM2_SERVE_SPA: "true",
|
||||||
PM2_SERVE_HOMEPAGE: "/index.html",
|
PM2_SERVE_HOMEPAGE: "/index.html",
|
||||||
},
|
},
|
||||||
|
31048
package-lock.json
generated
31048
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
@ -1,22 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "fennec-bs",
|
"name": "fennec-bs",
|
||||||
"version": "0.2.0",
|
"version": "0.1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.3.15",
|
"@apollo/client": "^3.3.15",
|
||||||
"@craco/craco": "^6.3.0",
|
|
||||||
"@curi/react-dom": "^2.0.4",
|
"@curi/react-dom": "^2.0.4",
|
||||||
"@curi/router": "^2.1.2",
|
"@curi/router": "^2.1.2",
|
||||||
"@emotion/react": "^11.4.1",
|
"@date-io/date-fns": "^1.3.13",
|
||||||
"@emotion/styled": "^11.3.0",
|
"@fortawesome/fontawesome-svg-core": "^1.2.35",
|
||||||
"@fortawesome/fontawesome-svg-core": "^1.2.36",
|
"@fortawesome/free-solid-svg-icons": "^5.15.3",
|
||||||
"@fortawesome/free-solid-svg-icons": "^5.15.4",
|
"@fortawesome/react-fontawesome": "^0.1.14",
|
||||||
"@fortawesome/react-fontawesome": "^0.1.16",
|
|
||||||
"@hickory/browser": "^2.1.0",
|
"@hickory/browser": "^2.1.0",
|
||||||
"@mui/icons-material": "^5.0.1",
|
"@material-ui/core": "^4.11.3",
|
||||||
"@mui/lab": "^5.0.0-alpha.49",
|
"@material-ui/icons": "^4.11.2",
|
||||||
"@mui/material": "^5.0.2",
|
"@material-ui/lab": "*",
|
||||||
"@mui/styles": "^5.0.1",
|
"@material-ui/pickers": "^3.3.10",
|
||||||
"@testing-library/jest-dom": "^5.11.10",
|
"@testing-library/jest-dom": "^5.11.10",
|
||||||
"@testing-library/react": "^11.2.6",
|
"@testing-library/react": "^11.2.6",
|
||||||
"@testing-library/user-event": "^12.8.3",
|
"@testing-library/user-event": "^12.8.3",
|
||||||
@ -24,21 +22,18 @@
|
|||||||
"@types/node": "^12.20.10",
|
"@types/node": "^12.20.10",
|
||||||
"@types/react": "^17.0.3",
|
"@types/react": "^17.0.3",
|
||||||
"@types/react-dom": "^17.0.3",
|
"@types/react-dom": "^17.0.3",
|
||||||
"ace-builds": "^1.4.13",
|
|
||||||
"apollo-link-scalars": "^2.1.3",
|
"apollo-link-scalars": "^2.1.3",
|
||||||
"configuration": "file:../configuration",
|
|
||||||
"date-fns": "^2.21.1",
|
"date-fns": "^2.21.1",
|
||||||
"fontsource-roboto": "^4.0.0",
|
"fontsource-roboto": "^4.0.0",
|
||||||
"formik": "^2.2.6",
|
"formik": "^2.2.6",
|
||||||
"formik-material-ui": "^3.0.1",
|
"formik-material-ui": "^3.0.1",
|
||||||
"formik-material-ui-pickers": "^0.0.12",
|
"formik-material-ui-pickers": "^0.0.12",
|
||||||
"graphql": "^15.5.0",
|
"graphql": "^15.5.0",
|
||||||
"graphql-scalars": "^1.10.0",
|
"graphql-scalars": "^1.9.3",
|
||||||
"material-ui-confirm": "^2.1.2",
|
"material-ui-confirm": "^2.1.2",
|
||||||
"notistack": "^2.0.2",
|
"notistack": "^1.0.6",
|
||||||
"ramda": "^0.27.1",
|
"ramda": "^0.27.1",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-ace": "^9.4.4",
|
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
"react-scripts": "4.0.3",
|
"react-scripts": "4.0.3",
|
||||||
"typescript": "^4.2.4",
|
"typescript": "^4.2.4",
|
||||||
@ -47,9 +42,10 @@
|
|||||||
"yup": "^0.32.9"
|
"yup": "^0.32.9"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "BROWSER=none PORT=auto craco start",
|
"start": "PORT=7123 BROWSER=none react-scripts start",
|
||||||
"build": "craco build",
|
"build": "react-scripts build",
|
||||||
"test": "craco test",
|
"test": "react-scripts test",
|
||||||
|
"eject": "react-scripts eject",
|
||||||
"prestart": "npm run graphql",
|
"prestart": "npm run graphql",
|
||||||
"graphql": "graphql-codegen --config codegen.yml"
|
"graphql": "graphql-codegen --config codegen.yml"
|
||||||
},
|
},
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
work correctly both with client-side routing and a non-root public URL.
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
Learn how to configure a non-root public URL by running `npm run build`.
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
-->
|
-->
|
||||||
<title>Fennec</title>
|
<title>React App</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
|
@ -3,12 +3,9 @@ import './App.css';
|
|||||||
import { DefaultLayout } from './layouts';
|
import { DefaultLayout } from './layouts';
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const { response } = useResponse();
|
const { response } = useResponse();
|
||||||
|
|
||||||
const { body: Body } = response;
|
const { body: Body } = response;
|
||||||
if (!Body) {
|
|
||||||
return <DefaultLayout> Client has some wrong!</DefaultLayout>;
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<DefaultLayout>
|
<DefaultLayout>
|
||||||
<Body response={response} />
|
<Body response={response} />
|
||||||
|
@ -13,10 +13,10 @@ import {
|
|||||||
ListItemIcon,
|
ListItemIcon,
|
||||||
ListItemSecondaryAction,
|
ListItemSecondaryAction,
|
||||||
ListItemText,
|
ListItemText,
|
||||||
|
makeStyles,
|
||||||
useTheme,
|
useTheme,
|
||||||
} from "@mui/material";
|
withStyles,
|
||||||
import { makeStyles } from "@mui/styles";
|
} from "@material-ui/core";
|
||||||
import withStyles from "@mui/styles/withStyles";
|
|
||||||
import {
|
import {
|
||||||
Cancel,
|
Cancel,
|
||||||
CheckCircle,
|
CheckCircle,
|
||||||
@ -24,7 +24,7 @@ import {
|
|||||||
ShoppingCart,
|
ShoppingCart,
|
||||||
Stop,
|
Stop,
|
||||||
Timer,
|
Timer,
|
||||||
} from "@mui/icons-material";
|
} from "@material-ui/icons";
|
||||||
import { format } from "date-fns";
|
import { format } from "date-fns";
|
||||||
import { useSnackbar } from "notistack";
|
import { useSnackbar } from "notistack";
|
||||||
import { complement, equals, find, propEq, takeWhile } from "ramda";
|
import { complement, equals, find, propEq, takeWhile } from "ramda";
|
||||||
@ -133,10 +133,11 @@ const Item: FC<{ commit: Commit; pipeline: Pipeline }> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const [isOpen, setOpen] = useState(() => false);
|
const [isOpen, setOpen] = useState(() => false);
|
||||||
|
|
||||||
const [createTask, { loading }] = useMutation<
|
const [createTask, { loading }] =
|
||||||
{ createPipelineTask: PipelineTask },
|
useMutation<
|
||||||
{ task: CreatePipelineTaskInput }
|
{ createPipelineTask: PipelineTask },
|
||||||
>(CREATE_PIPELINE_TASK);
|
{ task: CreatePipelineTaskInput }
|
||||||
|
>(CREATE_PIPELINE_TASK);
|
||||||
|
|
||||||
const units = useMemo(
|
const units = useMemo(
|
||||||
() => pipeline.workUnitMetadata.units.map((unit) => unit.type),
|
() => pipeline.workUnitMetadata.units.map((unit) => unit.type),
|
||||||
@ -180,7 +181,6 @@ const Item: FC<{ commit: Commit; pipeline: Pipeline }> = ({
|
|||||||
aria-label={pair[2]}
|
aria-label={pair[2]}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
onClick={() => handleCreateTask(unit)}
|
onClick={() => handleCreateTask(unit)}
|
||||||
size="large"
|
|
||||||
>
|
>
|
||||||
{pair[1]}
|
{pair[1]}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
@ -257,7 +257,7 @@ const TaskItem: FC<{ task: PipelineTask }> = ({ task }) => {
|
|||||||
/>
|
/>
|
||||||
<ListItemSecondaryAction>
|
<ListItemSecondaryAction>
|
||||||
{task.status === TaskStatuses.Working && (
|
{task.status === TaskStatuses.Working && (
|
||||||
<IconButton edge="end" aria-label="stop" onClick={stop} size="large">
|
<IconButton edge="end" aria-label="stop" onClick={stop}>
|
||||||
<Stop />
|
<Stop />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
|
@ -1,55 +0,0 @@
|
|||||||
import { createContext, useContext, useState } from "react";
|
|
||||||
import { FC } from "react";
|
|
||||||
import { Login } from "./login";
|
|
||||||
|
|
||||||
export interface AuthContext {
|
|
||||||
accessToken: string | null;
|
|
||||||
setAccessToken: (token: string) => void;
|
|
||||||
setRefreshToken: (token: string) => void;
|
|
||||||
refreshToken: string | undefined;
|
|
||||||
login: (dto: any) => void;
|
|
||||||
account?: any;
|
|
||||||
setAccount: (dto: any) => void;
|
|
||||||
logout: () => void;
|
|
||||||
}
|
|
||||||
const Context = createContext({} as AuthContext);
|
|
||||||
|
|
||||||
export const useAuth = () => useContext(Context);
|
|
||||||
|
|
||||||
export const AuthProvider: FC = ({ children }) => {
|
|
||||||
const [accessToken, setAccessToken] = useState<string | null>(
|
|
||||||
localStorage.getItem("accessToken")
|
|
||||||
);
|
|
||||||
const [refreshToken, setRefreshToken] = useState<string>();
|
|
||||||
const [account, setAccount] = useState<any>();
|
|
||||||
|
|
||||||
const login = (dto: any) => {
|
|
||||||
setAccessToken(dto.accessToken);
|
|
||||||
setRefreshToken(dto.refreshToken);
|
|
||||||
setAccount(dto.account);
|
|
||||||
localStorage.setItem("accessToken", dto.accessToken);
|
|
||||||
};
|
|
||||||
const logout = () => {
|
|
||||||
setAccessToken(null);
|
|
||||||
setRefreshToken(undefined);
|
|
||||||
setAccount(undefined);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Context.Provider
|
|
||||||
value={{
|
|
||||||
accessToken,
|
|
||||||
setAccessToken,
|
|
||||||
refreshToken,
|
|
||||||
setRefreshToken,
|
|
||||||
login,
|
|
||||||
account,
|
|
||||||
setAccount,
|
|
||||||
logout,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
{accessToken ? null : <Login />}
|
|
||||||
</Context.Provider>
|
|
||||||
);
|
|
||||||
};
|
|
@ -1,68 +0,0 @@
|
|||||||
import makeStyles from "@mui/styles/makeStyles";
|
|
||||||
import { FC, Fragment, useEffect, useRef } from "react";
|
|
||||||
import { useAuth } from "./auth.provider";
|
|
||||||
const useStyles = makeStyles((theme) => {
|
|
||||||
return {
|
|
||||||
iframe: {
|
|
||||||
height: "300px",
|
|
||||||
width: "500px",
|
|
||||||
position: "absolute",
|
|
||||||
top: "100px",
|
|
||||||
left: "50%",
|
|
||||||
transform: "translateX(-50%)",
|
|
||||||
zIndex: theme.zIndex.modal,
|
|
||||||
border: "none",
|
|
||||||
boxShadow: theme.shadows[4],
|
|
||||||
},
|
|
||||||
mask: {
|
|
||||||
top: "0",
|
|
||||||
left: "0",
|
|
||||||
bottom: "0",
|
|
||||||
right: "0",
|
|
||||||
position: "absolute",
|
|
||||||
backgroundColor: "rgba(0, 0, 0, 0.3)",
|
|
||||||
zIndex: theme.zIndex.modal,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
export const Login: FC = () => {
|
|
||||||
const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
||||||
const { login } = useAuth();
|
|
||||||
useEffect(() => {
|
|
||||||
const iframe = iframeRef.current;
|
|
||||||
if (!iframe) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let messagePort: MessagePort;
|
|
||||||
const onLoad = (ev: MessageEvent) => {
|
|
||||||
if (ev.data !== "init-channel") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
messagePort = ev.ports?.[0] as MessagePort;
|
|
||||||
messagePort.onmessage = (ev: MessageEvent) => {
|
|
||||||
if (ev.data?.type === "logged") {
|
|
||||||
login(ev.data.payload);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
window.addEventListener("message", onLoad);
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
window.removeEventListener("message", onLoad);
|
|
||||||
};
|
|
||||||
}, [login]);
|
|
||||||
|
|
||||||
const classes = useStyles();
|
|
||||||
return (
|
|
||||||
<Fragment>
|
|
||||||
<div className={classes.mask} />
|
|
||||||
<iframe
|
|
||||||
ref={iframeRef}
|
|
||||||
className={classes.iframe}
|
|
||||||
title="Auth"
|
|
||||||
src="https://user.rpi.ivanli.cc/auth/login"
|
|
||||||
></iframe>
|
|
||||||
</Fragment>
|
|
||||||
);
|
|
||||||
};
|
|
@ -1,4 +1,4 @@
|
|||||||
import { Typography } from '@mui/material';
|
import { Typography } from '@material-ui/core';
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
export const ErrorPage: FC = ({children}) => {
|
export const ErrorPage: FC = ({children}) => {
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
import { FC } from "@curi/react-universal/node_modules/@types/react";
|
|
||||||
import { FieldConfig, useField } from "formik";
|
|
||||||
import AceEditor from "react-ace";
|
|
||||||
import "ace-builds/src-noconflict/mode-yaml";
|
|
||||||
import "ace-builds/src-noconflict/theme-github";
|
|
||||||
import { styled } from "@mui/system";
|
|
||||||
|
|
||||||
const Editor: FC<FieldConfig<string> & { label?: string; className?: string }> =
|
|
||||||
({ label, className, ...props }) => {
|
|
||||||
const [field, , helper] = useField(props);
|
|
||||||
return (
|
|
||||||
<AceEditor
|
|
||||||
className={className}
|
|
||||||
style={{ width: "100%" }}
|
|
||||||
{...field}
|
|
||||||
onChange={(value) => helper.setValue(value)}
|
|
||||||
{...props}
|
|
||||||
mode="yaml"
|
|
||||||
theme="github"
|
|
||||||
editorProps={{ $blockScrolling: true }}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const YamlEditor = Editor;
|
|
||||||
styled(Editor)(({ theme }) => ({
|
|
||||||
marginBottom: theme.spacing(2),
|
|
||||||
}));
|
|
@ -5,8 +5,6 @@ import {
|
|||||||
InMemoryCache,
|
InMemoryCache,
|
||||||
split,
|
split,
|
||||||
ApolloProvider,
|
ApolloProvider,
|
||||||
fromPromise,
|
|
||||||
FetchResult,
|
|
||||||
} from "@apollo/client";
|
} from "@apollo/client";
|
||||||
import { withScalars } from "apollo-link-scalars";
|
import { withScalars } from "apollo-link-scalars";
|
||||||
import { buildClientSchema, IntrospectionQuery } from "graphql";
|
import { buildClientSchema, IntrospectionQuery } from "graphql";
|
||||||
@ -15,16 +13,9 @@ import { FC } from "react";
|
|||||||
import introspectionResult from "../../generated/graphql.schema.json";
|
import introspectionResult from "../../generated/graphql.schema.json";
|
||||||
import { onError } from "@apollo/client/link/error";
|
import { onError } from "@apollo/client/link/error";
|
||||||
import { WebSocketLink } from "@apollo/client/link/ws";
|
import { WebSocketLink } from "@apollo/client/link/ws";
|
||||||
import { getMainDefinition, Observable } from "@apollo/client/utilities";
|
import { getMainDefinition } from "@apollo/client/utilities";
|
||||||
import { useSnackbar } from "notistack";
|
import { useSnackbar } from "notistack";
|
||||||
import { deepOmit } from "../../utils/deep-omit";
|
import { deepOmit } from "../../utils/deep-omit";
|
||||||
import { useMemo } from "react";
|
|
||||||
import { EventEmitter } from "events";
|
|
||||||
import { useState } from "react";
|
|
||||||
import { useAuth } from "../auth/auth.provider";
|
|
||||||
import { useEffect } from "react";
|
|
||||||
import { useRef } from "react";
|
|
||||||
import { setContext } from "@apollo/client/link/context";
|
|
||||||
|
|
||||||
const schema = buildClientSchema(
|
const schema = buildClientSchema(
|
||||||
introspectionResult as unknown as IntrospectionQuery
|
introspectionResult as unknown as IntrospectionQuery
|
||||||
@ -46,139 +37,77 @@ const cleanTypeName = new ApolloLink((operation, forward) => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
export const AppApolloClientProvider: FC = ({ children }) => {
|
export const FennecApolloClientProvider: FC = ({ children }) => {
|
||||||
const { enqueueSnackbar } = useSnackbar();
|
const { enqueueSnackbar } = useSnackbar();
|
||||||
const { accessToken, logout } = useAuth();
|
const errorLink = onError(({ graphQLErrors, networkError }) => {
|
||||||
|
if (graphQLErrors) {
|
||||||
const [loggedEventTarget] = useState(() => new EventEmitter());
|
graphQLErrors.forEach((error) => {
|
||||||
const accessTokenRef = useRef(accessToken);
|
enqueueSnackbar(error.message, {
|
||||||
const logoutRef = useRef(logout);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
accessTokenRef.current = accessToken;
|
|
||||||
if (accessToken) {
|
|
||||||
loggedEventTarget.emit("logged", accessToken);
|
|
||||||
}
|
|
||||||
}, [loggedEventTarget, accessToken]);
|
|
||||||
useEffect(() => {
|
|
||||||
logoutRef.current = logout;
|
|
||||||
}, [logout]);
|
|
||||||
const client = useMemo(() => {
|
|
||||||
const authLink = onError(
|
|
||||||
({ graphQLErrors, networkError, operation, forward }) => {
|
|
||||||
if (graphQLErrors) {
|
|
||||||
for (const error of graphQLErrors) {
|
|
||||||
if (error.extensions?.code === "401") {
|
|
||||||
return fromPromise(
|
|
||||||
new Promise<Observable<FetchResult>>((resolve) => {
|
|
||||||
loggedEventTarget.once("logged", (accessToken: string) => {
|
|
||||||
const oldHeaders = operation.getContext().headers;
|
|
||||||
operation.setContext({
|
|
||||||
headers: {
|
|
||||||
...oldHeaders,
|
|
||||||
authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const subscriptionClient = (wsLink as any)
|
|
||||||
.subscriptionClient;
|
|
||||||
subscriptionClient?.close(false, false);
|
|
||||||
resolve(forward(operation));
|
|
||||||
});
|
|
||||||
logoutRef.current();
|
|
||||||
})
|
|
||||||
).flatMap((v) => v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const httpResult = (networkError as any)?.result;
|
|
||||||
if (httpResult?.statusCode === 401) {
|
|
||||||
return fromPromise(
|
|
||||||
new Promise<Observable<FetchResult>>((resolve) => {
|
|
||||||
loggedEventTarget.once("logged", (accessToken: string) => {
|
|
||||||
const oldHeaders = operation.getContext().headers;
|
|
||||||
operation.setContext({
|
|
||||||
headers: {
|
|
||||||
...oldHeaders,
|
|
||||||
authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
resolve(forward(operation));
|
|
||||||
});
|
|
||||||
logoutRef.current();
|
|
||||||
})
|
|
||||||
).flatMap((v) => v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
).concat(
|
|
||||||
setContext(() => ({
|
|
||||||
headers: {
|
|
||||||
authorization: `Bearer ${accessTokenRef.current}`,
|
|
||||||
},
|
|
||||||
}))
|
|
||||||
);
|
|
||||||
const errorLink = onError(({ graphQLErrors, networkError }) => {
|
|
||||||
if (graphQLErrors) {
|
|
||||||
graphQLErrors.forEach((error) => {
|
|
||||||
enqueueSnackbar(error.message, {
|
|
||||||
variant: "error",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
graphQLErrors.forEach(({ message, locations, path }) => {
|
|
||||||
console.error(
|
|
||||||
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (networkError) {
|
|
||||||
console.log(`[Network error]: ${networkError}`);
|
|
||||||
enqueueSnackbar(networkError.message, {
|
|
||||||
variant: "error",
|
variant: "error",
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
});
|
graphQLErrors.forEach(({ message, locations, path }) => {
|
||||||
const wsLink = new WebSocketLink({
|
console.error(
|
||||||
uri: `${window.location.protocol.replace("http", "ws")}//${
|
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`
|
||||||
window.location.hostname
|
|
||||||
}:${window.location.port}/api/graphql`,
|
|
||||||
options: {
|
|
||||||
reconnect: true,
|
|
||||||
connectionParams: () => ({
|
|
||||||
authorization: `Bearer ${accessTokenRef.current} `,
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const httpLink = new HttpLink({
|
|
||||||
uri: "/api/graphql",
|
|
||||||
});
|
|
||||||
const splitLink = split(
|
|
||||||
({ query }) => {
|
|
||||||
const definition = getMainDefinition(query);
|
|
||||||
return (
|
|
||||||
definition.kind === "OperationDefinition" &&
|
|
||||||
definition.operation === "subscription"
|
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (networkError) {
|
||||||
|
console.log(`[Network error]: ${networkError}`);
|
||||||
|
enqueueSnackbar(networkError.message, {
|
||||||
|
variant: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const wsLink = new WebSocketLink({
|
||||||
|
uri: `${window.location.protocol.replace("http", "ws")}//${
|
||||||
|
window.location.hostname
|
||||||
|
}:${window.location.port}/api/graphql`,
|
||||||
|
options: {
|
||||||
|
reconnect: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const httpLink = new HttpLink({
|
||||||
|
uri: "/api/graphql",
|
||||||
|
});
|
||||||
|
const splitLink = split(
|
||||||
|
({ query }) => {
|
||||||
|
const definition = getMainDefinition(query);
|
||||||
|
return (
|
||||||
|
definition.kind === "OperationDefinition" &&
|
||||||
|
definition.operation === "subscription"
|
||||||
|
);
|
||||||
|
},
|
||||||
|
wsLink,
|
||||||
|
httpLink
|
||||||
|
);
|
||||||
|
const link = ApolloLink.from([
|
||||||
|
errorLink,
|
||||||
|
withScalars({ schema, typesMap }) as unknown as ApolloLink,
|
||||||
|
cleanTypeName,
|
||||||
|
splitLink,
|
||||||
|
]);
|
||||||
|
const client = new ApolloClient({
|
||||||
|
connectToDevTools: true,
|
||||||
|
ssrMode: typeof window === "undefined",
|
||||||
|
link,
|
||||||
|
cache: new InMemoryCache({
|
||||||
|
typePolicies: {
|
||||||
|
// PipelineTaskLogs: {
|
||||||
|
// keyFields: ["unit"],
|
||||||
|
// },
|
||||||
|
// PipelineTask: {
|
||||||
|
// fields: {
|
||||||
|
// logs: {
|
||||||
|
// merge(existing = [], incoming: any[]) {
|
||||||
|
// return [...existing, ...incoming];
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
},
|
},
|
||||||
wsLink,
|
}),
|
||||||
httpLink
|
});
|
||||||
);
|
|
||||||
const link = ApolloLink.from([
|
|
||||||
errorLink,
|
|
||||||
authLink,
|
|
||||||
withScalars({ schema, typesMap }) as unknown as ApolloLink,
|
|
||||||
cleanTypeName,
|
|
||||||
splitLink,
|
|
||||||
]);
|
|
||||||
const client = new ApolloClient({
|
|
||||||
connectToDevTools: true,
|
|
||||||
ssrMode: typeof window === "undefined",
|
|
||||||
link,
|
|
||||||
cache: new InMemoryCache({
|
|
||||||
typePolicies: {},
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
return client;
|
|
||||||
}, [enqueueSnackbar, loggedEventTarget]);
|
|
||||||
|
|
||||||
return <ApolloProvider client={client}>{children}</ApolloProvider>;
|
return <ApolloProvider client={client}>{children}</ApolloProvider>;
|
||||||
};
|
};
|
||||||
|
@ -2,9 +2,9 @@ import { useApolloClient } from "@apollo/client";
|
|||||||
import { createRouterComponent } from "@curi/react-dom";
|
import { createRouterComponent } from "@curi/react-dom";
|
||||||
import { createRouter, announce } from "@curi/router";
|
import { createRouter, announce } from "@curi/router";
|
||||||
import { browser } from "@hickory/browser";
|
import { browser } from "@hickory/browser";
|
||||||
import { FC, useEffect, useState } from "react";
|
import { FC, ReactNode, useEffect, useMemo, useState } from "react";
|
||||||
import routes from "../../routes";
|
import routes from "../../routes";
|
||||||
import { LinearProgress } from "@mui/material";
|
import { LinearProgress } from "@material-ui/core";
|
||||||
|
|
||||||
const Component: FC = ({ children }) => {
|
const Component: FC = ({ children }) => {
|
||||||
const client = useApolloClient();
|
const client = useApolloClient();
|
||||||
|
@ -167,178 +167,6 @@
|
|||||||
"enumValues": null,
|
"enumValues": null,
|
||||||
"possibleTypes": null
|
"possibleTypes": null
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"kind": "OBJECT",
|
|
||||||
"name": "Configuration",
|
|
||||||
"description": null,
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"description": null,
|
|
||||||
"args": [],
|
|
||||||
"type": {
|
|
||||||
"kind": "NON_NULL",
|
|
||||||
"name": null,
|
|
||||||
"ofType": {
|
|
||||||
"kind": "SCALAR",
|
|
||||||
"name": "ID",
|
|
||||||
"ofType": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pipeline",
|
|
||||||
"description": null,
|
|
||||||
"args": [],
|
|
||||||
"type": {
|
|
||||||
"kind": "NON_NULL",
|
|
||||||
"name": null,
|
|
||||||
"ofType": {
|
|
||||||
"kind": "OBJECT",
|
|
||||||
"name": "Pipeline",
|
|
||||||
"ofType": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pipelineId",
|
|
||||||
"description": null,
|
|
||||||
"args": [],
|
|
||||||
"type": {
|
|
||||||
"kind": "NON_NULL",
|
|
||||||
"name": null,
|
|
||||||
"ofType": {
|
|
||||||
"kind": "SCALAR",
|
|
||||||
"name": "String",
|
|
||||||
"ofType": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "project",
|
|
||||||
"description": null,
|
|
||||||
"args": [],
|
|
||||||
"type": {
|
|
||||||
"kind": "NON_NULL",
|
|
||||||
"name": null,
|
|
||||||
"ofType": {
|
|
||||||
"kind": "OBJECT",
|
|
||||||
"name": "Project",
|
|
||||||
"ofType": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "projectId",
|
|
||||||
"description": null,
|
|
||||||
"args": [],
|
|
||||||
"type": {
|
|
||||||
"kind": "NON_NULL",
|
|
||||||
"name": null,
|
|
||||||
"ofType": {
|
|
||||||
"kind": "SCALAR",
|
|
||||||
"name": "String",
|
|
||||||
"ofType": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "content",
|
|
||||||
"description": null,
|
|
||||||
"args": [],
|
|
||||||
"type": {
|
|
||||||
"kind": "NON_NULL",
|
|
||||||
"name": null,
|
|
||||||
"ofType": {
|
|
||||||
"kind": "SCALAR",
|
|
||||||
"name": "String",
|
|
||||||
"ofType": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"description": null,
|
|
||||||
"args": [],
|
|
||||||
"type": {
|
|
||||||
"kind": "NON_NULL",
|
|
||||||
"name": null,
|
|
||||||
"ofType": {
|
|
||||||
"kind": "SCALAR",
|
|
||||||
"name": "String",
|
|
||||||
"ofType": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "language",
|
|
||||||
"description": null,
|
|
||||||
"args": [],
|
|
||||||
"type": {
|
|
||||||
"kind": "NON_NULL",
|
|
||||||
"name": null,
|
|
||||||
"ofType": {
|
|
||||||
"kind": "ENUM",
|
|
||||||
"name": "ConfigurationLanguage",
|
|
||||||
"ofType": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"inputFields": null,
|
|
||||||
"interfaces": [],
|
|
||||||
"enumValues": null,
|
|
||||||
"possibleTypes": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"kind": "SCALAR",
|
|
||||||
"name": "ID",
|
|
||||||
"description": "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.",
|
|
||||||
"fields": null,
|
|
||||||
"inputFields": null,
|
|
||||||
"interfaces": null,
|
|
||||||
"enumValues": null,
|
|
||||||
"possibleTypes": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"kind": "ENUM",
|
|
||||||
"name": "ConfigurationLanguage",
|
|
||||||
"description": null,
|
|
||||||
"fields": null,
|
|
||||||
"inputFields": null,
|
|
||||||
"interfaces": null,
|
|
||||||
"enumValues": [
|
|
||||||
{
|
|
||||||
"name": "JavaScript",
|
|
||||||
"description": null,
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "YAML",
|
|
||||||
"description": null,
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"possibleTypes": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "INPUT_OBJECT",
|
"kind": "INPUT_OBJECT",
|
||||||
"name": "CreatePipelineInput",
|
"name": "CreatePipelineInput",
|
||||||
@ -1016,39 +844,6 @@
|
|||||||
},
|
},
|
||||||
"isDeprecated": false,
|
"isDeprecated": false,
|
||||||
"deprecationReason": null
|
"deprecationReason": null
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "setConfiguration",
|
|
||||||
"description": null,
|
|
||||||
"args": [
|
|
||||||
{
|
|
||||||
"name": "setConfigurationInput",
|
|
||||||
"description": null,
|
|
||||||
"type": {
|
|
||||||
"kind": "NON_NULL",
|
|
||||||
"name": null,
|
|
||||||
"ofType": {
|
|
||||||
"kind": "INPUT_OBJECT",
|
|
||||||
"name": "SetConfigurationInput",
|
|
||||||
"ofType": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaultValue": null,
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": {
|
|
||||||
"kind": "NON_NULL",
|
|
||||||
"name": null,
|
|
||||||
"ofType": {
|
|
||||||
"kind": "OBJECT",
|
|
||||||
"name": "Configuration",
|
|
||||||
"ofType": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inputFields": null,
|
"inputFields": null,
|
||||||
@ -1176,22 +971,6 @@
|
|||||||
},
|
},
|
||||||
"isDeprecated": false,
|
"isDeprecated": false,
|
||||||
"deprecationReason": null
|
"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,
|
"inputFields": null,
|
||||||
@ -1199,6 +978,16 @@
|
|||||||
"enumValues": null,
|
"enumValues": null,
|
||||||
"possibleTypes": null
|
"possibleTypes": null
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"kind": "SCALAR",
|
||||||
|
"name": "ID",
|
||||||
|
"description": "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.",
|
||||||
|
"fields": null,
|
||||||
|
"inputFields": null,
|
||||||
|
"interfaces": null,
|
||||||
|
"enumValues": null,
|
||||||
|
"possibleTypes": null
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"kind": "OBJECT",
|
"kind": "OBJECT",
|
||||||
"name": "PipelineTask",
|
"name": "PipelineTask",
|
||||||
@ -1994,55 +1783,6 @@
|
|||||||
},
|
},
|
||||||
"isDeprecated": false,
|
"isDeprecated": false,
|
||||||
"deprecationReason": null
|
"deprecationReason": null
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "getConfiguration",
|
|
||||||
"description": null,
|
|
||||||
"args": [
|
|
||||||
{
|
|
||||||
"name": "pipelineId",
|
|
||||||
"description": null,
|
|
||||||
"type": {
|
|
||||||
"kind": "SCALAR",
|
|
||||||
"name": "String",
|
|
||||||
"ofType": null
|
|
||||||
},
|
|
||||||
"defaultValue": null,
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "projectId",
|
|
||||||
"description": null,
|
|
||||||
"type": {
|
|
||||||
"kind": "SCALAR",
|
|
||||||
"name": "String",
|
|
||||||
"ofType": null
|
|
||||||
},
|
|
||||||
"defaultValue": null,
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"description": null,
|
|
||||||
"type": {
|
|
||||||
"kind": "SCALAR",
|
|
||||||
"name": "String",
|
|
||||||
"ofType": null
|
|
||||||
},
|
|
||||||
"defaultValue": null,
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": {
|
|
||||||
"kind": "OBJECT",
|
|
||||||
"name": "Configuration",
|
|
||||||
"ofType": null
|
|
||||||
},
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"inputFields": null,
|
"inputFields": null,
|
||||||
@ -2050,105 +1790,6 @@
|
|||||||
"enumValues": null,
|
"enumValues": null,
|
||||||
"possibleTypes": null
|
"possibleTypes": null
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"kind": "INPUT_OBJECT",
|
|
||||||
"name": "SetConfigurationInput",
|
|
||||||
"description": null,
|
|
||||||
"fields": null,
|
|
||||||
"inputFields": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"description": null,
|
|
||||||
"type": {
|
|
||||||
"kind": "SCALAR",
|
|
||||||
"name": "String",
|
|
||||||
"ofType": null
|
|
||||||
},
|
|
||||||
"defaultValue": null,
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pipelineId",
|
|
||||||
"description": null,
|
|
||||||
"type": {
|
|
||||||
"kind": "NON_NULL",
|
|
||||||
"name": null,
|
|
||||||
"ofType": {
|
|
||||||
"kind": "SCALAR",
|
|
||||||
"name": "String",
|
|
||||||
"ofType": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaultValue": null,
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "projectId",
|
|
||||||
"description": null,
|
|
||||||
"type": {
|
|
||||||
"kind": "NON_NULL",
|
|
||||||
"name": null,
|
|
||||||
"ofType": {
|
|
||||||
"kind": "SCALAR",
|
|
||||||
"name": "String",
|
|
||||||
"ofType": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaultValue": null,
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "content",
|
|
||||||
"description": null,
|
|
||||||
"type": {
|
|
||||||
"kind": "NON_NULL",
|
|
||||||
"name": null,
|
|
||||||
"ofType": {
|
|
||||||
"kind": "SCALAR",
|
|
||||||
"name": "String",
|
|
||||||
"ofType": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaultValue": null,
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "language",
|
|
||||||
"description": null,
|
|
||||||
"type": {
|
|
||||||
"kind": "NON_NULL",
|
|
||||||
"name": null,
|
|
||||||
"ofType": {
|
|
||||||
"kind": "ENUM",
|
|
||||||
"name": "ConfigurationLanguage",
|
|
||||||
"ofType": null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaultValue": null,
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"description": null,
|
|
||||||
"type": {
|
|
||||||
"kind": "SCALAR",
|
|
||||||
"name": "String",
|
|
||||||
"ofType": null
|
|
||||||
},
|
|
||||||
"defaultValue": "\"Default Configuration\"",
|
|
||||||
"isDeprecated": false,
|
|
||||||
"deprecationReason": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"interfaces": null,
|
|
||||||
"enumValues": null,
|
|
||||||
"possibleTypes": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "OBJECT",
|
"kind": "OBJECT",
|
||||||
"name": "Subscription",
|
"name": "Subscription",
|
||||||
@ -2308,6 +1949,22 @@
|
|||||||
"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,
|
||||||
|
@ -26,23 +26,6 @@ export type Commit = {
|
|||||||
tasks: Array<PipelineTask>;
|
tasks: Array<PipelineTask>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Configuration = {
|
|
||||||
__typename?: 'Configuration';
|
|
||||||
id: Scalars['ID'];
|
|
||||||
pipeline: Pipeline;
|
|
||||||
pipelineId: Scalars['String'];
|
|
||||||
project: Project;
|
|
||||||
projectId: Scalars['String'];
|
|
||||||
content: Scalars['String'];
|
|
||||||
name: Scalars['String'];
|
|
||||||
language: ConfigurationLanguage;
|
|
||||||
};
|
|
||||||
|
|
||||||
export enum ConfigurationLanguage {
|
|
||||||
JavaScript = 'JavaScript',
|
|
||||||
Yaml = 'YAML'
|
|
||||||
}
|
|
||||||
|
|
||||||
export type CreatePipelineInput = {
|
export type CreatePipelineInput = {
|
||||||
projectId: Scalars['String'];
|
projectId: Scalars['String'];
|
||||||
branch: Scalars['String'];
|
branch: Scalars['String'];
|
||||||
@ -92,7 +75,6 @@ export type Mutation = {
|
|||||||
deletePipeline: Scalars['Float'];
|
deletePipeline: Scalars['Float'];
|
||||||
createPipelineTask: PipelineTask;
|
createPipelineTask: PipelineTask;
|
||||||
stopPipelineTask: Scalars['Boolean'];
|
stopPipelineTask: Scalars['Boolean'];
|
||||||
setConfiguration: Configuration;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -135,11 +117,6 @@ export type MutationStopPipelineTaskArgs = {
|
|||||||
id: Scalars['String'];
|
id: Scalars['String'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type MutationSetConfigurationArgs = {
|
|
||||||
setConfigurationInput: SetConfigurationInput;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Pipeline = {
|
export type Pipeline = {
|
||||||
__typename?: 'Pipeline';
|
__typename?: 'Pipeline';
|
||||||
id: Scalars['ID'];
|
id: Scalars['ID'];
|
||||||
@ -148,7 +125,6 @@ export type Pipeline = {
|
|||||||
branch: Scalars['String'];
|
branch: Scalars['String'];
|
||||||
name: Scalars['String'];
|
name: Scalars['String'];
|
||||||
workUnitMetadata: WorkUnitMetadata;
|
workUnitMetadata: WorkUnitMetadata;
|
||||||
environment: Scalars['String'];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type PipelineTask = {
|
export type PipelineTask = {
|
||||||
@ -215,7 +191,6 @@ export type Query = {
|
|||||||
commits?: Maybe<Array<Commit>>;
|
commits?: Maybe<Array<Commit>>;
|
||||||
listPipelineTaskByPipelineId: Array<PipelineTask>;
|
listPipelineTaskByPipelineId: Array<PipelineTask>;
|
||||||
pipelineTask: PipelineTask;
|
pipelineTask: PipelineTask;
|
||||||
getConfiguration?: Maybe<Configuration>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -248,22 +223,6 @@ export type QueryPipelineTaskArgs = {
|
|||||||
id: Scalars['String'];
|
id: Scalars['String'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type QueryGetConfigurationArgs = {
|
|
||||||
pipelineId?: Maybe<Scalars['String']>;
|
|
||||||
projectId?: Maybe<Scalars['String']>;
|
|
||||||
id?: Maybe<Scalars['String']>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type SetConfigurationInput = {
|
|
||||||
id?: Maybe<Scalars['String']>;
|
|
||||||
pipelineId: Scalars['String'];
|
|
||||||
projectId: Scalars['String'];
|
|
||||||
content: Scalars['String'];
|
|
||||||
language: ConfigurationLanguage;
|
|
||||||
name?: Maybe<Scalars['String']>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Subscription = {
|
export type Subscription = {
|
||||||
__typename?: 'Subscription';
|
__typename?: 'Subscription';
|
||||||
syncCommits?: Maybe<Scalars['String']>;
|
syncCommits?: Maybe<Scalars['String']>;
|
||||||
@ -296,6 +255,7 @@ 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;
|
||||||
|
@ -4,46 +4,30 @@ import "./index.css";
|
|||||||
import "fontsource-roboto";
|
import "fontsource-roboto";
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
import reportWebVitals from "./reportWebVitals";
|
import reportWebVitals from "./reportWebVitals";
|
||||||
import { AppApolloClientProvider } from "./commons/graphql/client";
|
import { FennecApolloClientProvider } from "./commons/graphql/client";
|
||||||
|
import { MuiPickersUtilsProvider } from "@material-ui/pickers";
|
||||||
|
import DateFnsUtils from "@date-io/date-fns";
|
||||||
|
import zhLocale from "date-fns/locale/zh-CN";
|
||||||
import { ConfirmProvider } from "material-ui-confirm";
|
import { ConfirmProvider } from "material-ui-confirm";
|
||||||
import { SnackbarProvider } from "notistack";
|
import { SnackbarProvider } from "notistack";
|
||||||
import Router from "./commons/route/router";
|
import Router from './commons/route/router';
|
||||||
import { AuthProvider } from "./commons/auth/auth.provider";
|
|
||||||
import { zhCN } from "@mui/material/locale";
|
|
||||||
import {
|
|
||||||
ThemeProvider,
|
|
||||||
Theme,
|
|
||||||
StyledEngineProvider,
|
|
||||||
createTheme,
|
|
||||||
} from "@mui/material/styles";
|
|
||||||
|
|
||||||
declare module "@mui/styles/defaultTheme" {
|
ReactDOM.render(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
<React.StrictMode>
|
||||||
interface DefaultTheme extends Theme {}
|
<ConfirmProvider>
|
||||||
}
|
<SnackbarProvider maxSnack={5}>
|
||||||
|
<FennecApolloClientProvider>
|
||||||
const theme = createTheme({}, zhCN);
|
<MuiPickersUtilsProvider utils={DateFnsUtils} locale={zhLocale}>
|
||||||
|
<Router>
|
||||||
ReactDOM.render(
|
<App />
|
||||||
<React.StrictMode>
|
</Router>
|
||||||
<ConfirmProvider>
|
</MuiPickersUtilsProvider>
|
||||||
<StyledEngineProvider injectFirst>
|
</FennecApolloClientProvider>
|
||||||
<ThemeProvider theme={theme}>
|
</SnackbarProvider>
|
||||||
<SnackbarProvider maxSnack={5}>
|
</ConfirmProvider>
|
||||||
<AuthProvider>
|
</React.StrictMode>,
|
||||||
<AppApolloClientProvider>
|
document.getElementById("root")
|
||||||
<Router>
|
);
|
||||||
<App />
|
|
||||||
</Router>
|
|
||||||
</AppApolloClientProvider>
|
|
||||||
</AuthProvider>
|
|
||||||
</SnackbarProvider>
|
|
||||||
</ThemeProvider>
|
|
||||||
</StyledEngineProvider>
|
|
||||||
</ConfirmProvider>
|
|
||||||
</React.StrictMode>,
|
|
||||||
document.getElementById("root")
|
|
||||||
);
|
|
||||||
|
|
||||||
// If you want to start measuring performance in your app, pass a function
|
// If you want to start measuring performance in your app, pass a function
|
||||||
// to log results (for example: reportWebVitals(console.log))
|
// to log results (for example: reportWebVitals(console.log))
|
||||||
|
@ -1,17 +1,21 @@
|
|||||||
import React, { FC, useCallback, useState } from "react";
|
import React, { FC, useCallback, useRef, useState } from "react";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { useTheme, Theme } from "@mui/material/styles";
|
import {
|
||||||
import createStyles from '@mui/styles/createStyles';
|
createStyles,
|
||||||
import makeStyles from '@mui/styles/makeStyles';
|
makeStyles,
|
||||||
import Drawer from "@mui/material/Drawer";
|
useTheme,
|
||||||
import AppBar from "@mui/material/AppBar";
|
Theme,
|
||||||
import Toolbar from "@mui/material/Toolbar";
|
} from "@material-ui/core/styles";
|
||||||
import CssBaseline from "@mui/material/CssBaseline";
|
import Drawer from "@material-ui/core/Drawer";
|
||||||
import Divider from "@mui/material/Divider";
|
import AppBar from "@material-ui/core/AppBar";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import Toolbar from "@material-ui/core/Toolbar";
|
||||||
import MenuIcon from "@mui/icons-material/Menu";
|
import CssBaseline from "@material-ui/core/CssBaseline";
|
||||||
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
import Typography from "@material-ui/core/Typography";
|
||||||
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
|
import Divider from "@material-ui/core/Divider";
|
||||||
|
import IconButton from "@material-ui/core/IconButton";
|
||||||
|
import MenuIcon from "@material-ui/icons/Menu";
|
||||||
|
import ChevronLeftIcon from "@material-ui/icons/ChevronLeft";
|
||||||
|
import ChevronRightIcon from "@material-ui/icons/ChevronRight";
|
||||||
import { ProjectPanel } from "../projects/project-panel";
|
import { ProjectPanel } from "../projects/project-panel";
|
||||||
import { HeaderContainerProvider } from "./header-container";
|
import { HeaderContainerProvider } from "./header-container";
|
||||||
const drawerWidth = 240;
|
const drawerWidth = 240;
|
||||||
@ -124,7 +128,7 @@ export const DefaultLayout: FC = ({ children }) => {
|
|||||||
className={clsx(classes.menuButton, {
|
className={clsx(classes.menuButton, {
|
||||||
[classes.hide]: open,
|
[classes.hide]: open,
|
||||||
})}
|
})}
|
||||||
size="large">
|
>
|
||||||
<MenuIcon />
|
<MenuIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<div className={classes.headerContaner} ref={onRefChange}></div>
|
<div className={classes.headerContaner} ref={onRefChange}></div>
|
||||||
@ -144,7 +148,7 @@ export const DefaultLayout: FC = ({ children }) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className={classes.toolbar}>
|
<div className={classes.toolbar}>
|
||||||
<IconButton onClick={handleDrawerClose} size="large">
|
<IconButton onClick={handleDrawerClose}>
|
||||||
{theme.direction === "rtl" ? (
|
{theme.direction === "rtl" ? (
|
||||||
<ChevronRightIcon />
|
<ChevronRightIcon />
|
||||||
) : (
|
) : (
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { gql, useQuery, useSubscription } from "@apollo/client";
|
import { gql, useQuery, useSubscription } from "@apollo/client";
|
||||||
import { LinearProgress, Typography } from "@mui/material";
|
import { LinearProgress, makeStyles, Typography } from "@material-ui/core";
|
||||||
import makeStyles from '@mui/styles/makeStyles';
|
|
||||||
import { format } from "date-fns";
|
import { format } from "date-fns";
|
||||||
import { FC, useState } from "react";
|
import { FC, useState } from "react";
|
||||||
import { ErrorPage } from "../commons/fallbacks/error-page";
|
import { ErrorPage } from "../commons/fallbacks/error-page";
|
||||||
@ -57,7 +56,9 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
export const PipelineTaskDetail: FC<Props> = ({ taskId }) => {
|
export const PipelineTaskDetail: FC<Props> = ({ taskId }) => {
|
||||||
const [, setTaskEvents] = useState(() => new Array<PipelineTaskEvent>());
|
const [taskEvents, setTaskEvents] = useState(
|
||||||
|
() => new Array<PipelineTaskEvent>()
|
||||||
|
);
|
||||||
const { data, loading, error, client } = useQuery<{
|
const { data, loading, error, client } = useQuery<{
|
||||||
pipelineTask: PipelineTask;
|
pipelineTask: PipelineTask;
|
||||||
}>(PIPELINE_TASK, {
|
}>(PIPELINE_TASK, {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
export * from './pipeline-detail';
|
export * from './pipeline-detail';
|
||||||
export * from './pipeline-list';
|
export * from './pipeline-list';
|
||||||
export * from './queries';
|
export * from './queries';
|
||||||
export * from "./runtime-config-editor";
|
|
||||||
|
@ -7,7 +7,6 @@ export const CREATE_PIPELINE = gql`
|
|||||||
projectId
|
projectId
|
||||||
branch
|
branch
|
||||||
name
|
name
|
||||||
environment
|
|
||||||
workUnitMetadata {
|
workUnitMetadata {
|
||||||
version
|
version
|
||||||
units {
|
units {
|
||||||
@ -26,7 +25,6 @@ export const UPDATE_PIPELINE = gql`
|
|||||||
projectId
|
projectId
|
||||||
branch
|
branch
|
||||||
name
|
name
|
||||||
environment
|
|
||||||
workUnitMetadata {
|
workUnitMetadata {
|
||||||
version
|
version
|
||||||
units {
|
units {
|
||||||
@ -43,12 +41,3 @@ export const DELETE_PIPELINE = gql`
|
|||||||
deletePipeline(id: $id)
|
deletePipeline(id: $id)
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
||||||
export const SET_CONFIGURATION = gql`
|
|
||||||
mutation SetConfiguration($configuration: SetConfigurationInput!) {
|
|
||||||
setConfiguration(setConfigurationInput: $configuration) {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
@ -1,18 +1,33 @@
|
|||||||
import { gql, Reference, useMutation } from "@apollo/client";
|
import { gql, Reference, useMutation, useQuery } from "@apollo/client";
|
||||||
import { useRouter } from "@curi/react-dom";
|
import { useRouter } from "@curi/react-dom";
|
||||||
import { Button, Grid, IconButton, LinearProgress, Paper, Portal, Typography } from "@mui/material";
|
import {
|
||||||
import makeStyles from '@mui/styles/makeStyles';
|
Button,
|
||||||
import { Delete } from "@mui/icons-material";
|
Grid,
|
||||||
|
IconButton,
|
||||||
|
LinearProgress,
|
||||||
|
makeStyles,
|
||||||
|
Paper,
|
||||||
|
Portal,
|
||||||
|
Typography,
|
||||||
|
} from "@material-ui/core";
|
||||||
|
import { Delete } from "@material-ui/icons";
|
||||||
import { FormikHelpers, Formik, Form, Field } from "formik";
|
import { FormikHelpers, Formik, Form, Field } from "formik";
|
||||||
import { TextField, TextFieldProps } from "formik-material-ui";
|
import { TextField, TextFieldProps } from "formik-material-ui";
|
||||||
|
import { TextField as MuiTextField } from "@material-ui/core";
|
||||||
import { useConfirm } from "material-ui-confirm";
|
import { useConfirm } from "material-ui-confirm";
|
||||||
import { useSnackbar } from "notistack";
|
import { useSnackbar } from "notistack";
|
||||||
import { not, omit } from "ramda";
|
import { not, omit } from "ramda";
|
||||||
import { ChangeEvent, FC } from "react";
|
import { ChangeEvent, FC } from "react";
|
||||||
import { Pipeline, PipelineUnits } from "../generated/graphql";
|
import {
|
||||||
|
Pipeline,
|
||||||
|
WorkUnitMetadata,
|
||||||
|
PipelineUnits,
|
||||||
|
} from "../generated/graphql";
|
||||||
import { useHeaderContainer } from "../layouts";
|
import { useHeaderContainer } from "../layouts";
|
||||||
import { CREATE_PIPELINE, DELETE_PIPELINE, UPDATE_PIPELINE } from "./mutations";
|
import { CREATE_PIPELINE, DELETE_PIPELINE, UPDATE_PIPELINE } from "./mutations";
|
||||||
|
import { PIPELINE } from "./queries";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
|
import { useField } from "formik";
|
||||||
|
|
||||||
type Values = Partial<Pipeline>;
|
type Values = Partial<Pipeline>;
|
||||||
|
|
||||||
@ -61,7 +76,6 @@ export const PipelineEditor: FC<Props> = ({ pipeline }) => {
|
|||||||
id
|
id
|
||||||
projectId
|
projectId
|
||||||
branch
|
branch
|
||||||
environment
|
|
||||||
name
|
name
|
||||||
workUnitMetadata {
|
workUnitMetadata {
|
||||||
version
|
version
|
||||||
@ -94,7 +108,7 @@ export const PipelineEditor: FC<Props> = ({ pipeline }) => {
|
|||||||
if (isCreate) {
|
if (isCreate) {
|
||||||
await createPipeline({
|
await createPipeline({
|
||||||
variables: {
|
variables: {
|
||||||
pipeline: values,
|
input: values,
|
||||||
},
|
},
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
pipelineId = data!.createPipeline.id;
|
pipelineId = data!.createPipeline.id;
|
||||||
@ -169,7 +183,7 @@ export const PipelineEditor: FC<Props> = ({ pipeline }) => {
|
|||||||
return (
|
return (
|
||||||
<Paper className={classes.root}>
|
<Paper className={classes.root}>
|
||||||
<Portal container={headerContainer}>
|
<Portal container={headerContainer}>
|
||||||
<Grid container justifyContent="space-between" alignItems="center">
|
<Grid container justify="space-between" alignItems="center">
|
||||||
<Typography variant="h6" component="h1">
|
<Typography variant="h6" component="h1">
|
||||||
{isCreate ? "Create" : "Edit"} Pipeline
|
{isCreate ? "Create" : "Edit"} Pipeline
|
||||||
</Typography>
|
</Typography>
|
||||||
@ -178,7 +192,6 @@ export const PipelineEditor: FC<Props> = ({ pipeline }) => {
|
|||||||
color="inherit"
|
color="inherit"
|
||||||
onClick={handleDelete}
|
onClick={handleDelete}
|
||||||
disabled={deleting}
|
disabled={deleting}
|
||||||
size="large"
|
|
||||||
>
|
>
|
||||||
<Delete />
|
<Delete />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
@ -192,10 +205,7 @@ export const PipelineEditor: FC<Props> = ({ pipeline }) => {
|
|||||||
.max(32, "Must be 32 characters or less")
|
.max(32, "Must be 32 characters or less")
|
||||||
.required("Required"),
|
.required("Required"),
|
||||||
branch: Yup.string()
|
branch: Yup.string()
|
||||||
.max(64, "Must be 64 characters or less")
|
.max(32, "Must be 32 characters or less")
|
||||||
.required("Required"),
|
|
||||||
environment: Yup.string()
|
|
||||||
.max(64, "Must be 64 characters or less")
|
|
||||||
.required("Required"),
|
.required("Required"),
|
||||||
})}
|
})}
|
||||||
onSubmit={submitForm}
|
onSubmit={submitForm}
|
||||||
@ -211,13 +221,6 @@ export const PipelineEditor: FC<Props> = ({ pipeline }) => {
|
|||||||
fullWidth
|
fullWidth
|
||||||
margin="normal"
|
margin="normal"
|
||||||
/>
|
/>
|
||||||
<Field
|
|
||||||
component={TextField}
|
|
||||||
name="environment"
|
|
||||||
label="Environment"
|
|
||||||
fullWidth
|
|
||||||
margin="normal"
|
|
||||||
/>
|
|
||||||
<Paper className={classes.metadataContainer}>
|
<Paper className={classes.metadataContainer}>
|
||||||
<Field
|
<Field
|
||||||
component={TextField}
|
component={TextField}
|
||||||
@ -270,18 +273,11 @@ const ScriptsField: FC<TextFieldProps> = ({ field, form, meta, ...props }) => {
|
|||||||
meta={meta}
|
meta={meta}
|
||||||
field={{
|
field={{
|
||||||
...field,
|
...field,
|
||||||
onBlur: (ev: React.FocusEvent) => {
|
|
||||||
form.setFieldValue(
|
|
||||||
field.name,
|
|
||||||
field.value.filter((it: string) => !!it)
|
|
||||||
);
|
|
||||||
return field.onBlur(ev);
|
|
||||||
},
|
|
||||||
value: field.value?.join("\n") ?? "",
|
value: field.value?.join("\n") ?? "",
|
||||||
onChange: (ev: ChangeEvent<HTMLInputElement>) =>
|
onChange: (ev: ChangeEvent<HTMLInputElement>) =>
|
||||||
form.setFieldValue(
|
form.setFieldValue(
|
||||||
field.name,
|
field.name,
|
||||||
ev.target.value?.split("\n").map((it) => it) ?? []
|
ev.target.value?.split("\n").map((it) => it.trim()) ?? []
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -5,20 +5,14 @@ import {
|
|||||||
ListItem,
|
ListItem,
|
||||||
Typography,
|
Typography,
|
||||||
ListItemText,
|
ListItemText,
|
||||||
Menu,
|
ListItemSecondaryAction,
|
||||||
MenuItem,
|
IconButton,
|
||||||
PopoverPosition,
|
} from "@material-ui/core";
|
||||||
} from "@mui/material";
|
import { FC, MouseEventHandler, useMemo } from "react";
|
||||||
import { FC, useMemo, useState, MouseEvent } from "react";
|
|
||||||
import { Pipeline, Project } from "../generated/graphql";
|
import { Pipeline, Project } from "../generated/graphql";
|
||||||
import { CallMerge } from "@mui/icons-material";
|
import { CallMerge, Edit } from "@material-ui/icons";
|
||||||
import { Divider } from "@material-ui/core";
|
import { clone } from "ramda";
|
||||||
import { Box } from "@mui/system";
|
import { useEffect } from "react";
|
||||||
import {
|
|
||||||
faCodeBranch,
|
|
||||||
faMapMarkerAlt,
|
|
||||||
} from "@fortawesome/free-solid-svg-icons";
|
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
projectId: string;
|
projectId: string;
|
||||||
@ -30,7 +24,6 @@ const PIPELINES = gql`
|
|||||||
id
|
id
|
||||||
name
|
name
|
||||||
branch
|
branch
|
||||||
environment
|
|
||||||
}
|
}
|
||||||
project(id: $projectId) {
|
project(id: $projectId) {
|
||||||
id
|
id
|
||||||
@ -39,7 +32,7 @@ const PIPELINES = gql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export const PipelineList: FC<Props> = ({ projectId }) => {
|
export const PipelineList: FC<Props> = ({ projectId }) => {
|
||||||
const { data } = useQuery<
|
const { data, loading } = useQuery<
|
||||||
{ pipelines: Pipeline[]; project: Project },
|
{ pipelines: Pipeline[]; project: Project },
|
||||||
{ projectId: string }
|
{ projectId: string }
|
||||||
>(PIPELINES, {
|
>(PIPELINES, {
|
||||||
@ -51,142 +44,48 @@ export const PipelineList: FC<Props> = ({ projectId }) => {
|
|||||||
project: data?.project,
|
project: data?.project,
|
||||||
}));
|
}));
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
const [contextMenu, setContextMenu] = useState<[PopoverPosition, Pipeline]>();
|
|
||||||
const { navigate, url } = useRouter();
|
|
||||||
|
|
||||||
const handleContextMenu = (event: MouseEvent, pipeline: Pipeline | false) => {
|
|
||||||
event.preventDefault();
|
|
||||||
if (pipeline) {
|
|
||||||
setContextMenu([
|
|
||||||
{ top: event.clientY - 4, left: event.clientX - 2 },
|
|
||||||
pipeline,
|
|
||||||
]);
|
|
||||||
} else {
|
|
||||||
setContextMenu(undefined);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleClose = () => {
|
|
||||||
setContextMenu(undefined);
|
|
||||||
};
|
|
||||||
|
|
||||||
const modify = () => {
|
|
||||||
navigate({
|
|
||||||
url: url({
|
|
||||||
name: "edit-pipeline",
|
|
||||||
params: {
|
|
||||||
pipelineId: contextMenu![1].id,
|
|
||||||
projectId: contextMenu![1].project.id,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const modifyRuntimeConfiguration = () => {
|
|
||||||
navigate({
|
|
||||||
url: url({
|
|
||||||
name: "edit-runtime-configuration",
|
|
||||||
params: {
|
|
||||||
pipelineId: contextMenu![1].id,
|
|
||||||
projectId: contextMenu![1].project.id,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<List>
|
||||||
<List>
|
{pipelines?.map((pipeline) => (
|
||||||
{pipelines?.map((pipeline) => (
|
<Link
|
||||||
<Link
|
name="pipeline-commits"
|
||||||
name="pipeline-commits"
|
params={{ pipelineId: pipeline.id, projectId: projectId }}
|
||||||
params={{ pipelineId: pipeline.id, projectId: projectId }}
|
key={pipeline.id}
|
||||||
key={pipeline.id}
|
|
||||||
onContextMenu={(ev) => handleContextMenu(ev, pipeline)}
|
|
||||||
>
|
|
||||||
<Item pipeline={pipeline} />
|
|
||||||
</Link>
|
|
||||||
))}
|
|
||||||
</List>
|
|
||||||
<Menu
|
|
||||||
keepMounted
|
|
||||||
open={!!contextMenu}
|
|
||||||
onClose={handleClose}
|
|
||||||
onContextMenu={(ev) => handleContextMenu(ev, false)}
|
|
||||||
anchorReference="anchorPosition"
|
|
||||||
anchorPosition={contextMenu?.[0]}
|
|
||||||
>
|
|
||||||
<MenuItem
|
|
||||||
onClick={() => {
|
|
||||||
modifyRuntimeConfiguration();
|
|
||||||
handleClose();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
Runtime Config
|
<Item pipeline={pipeline} />
|
||||||
</MenuItem>
|
</Link>
|
||||||
<MenuItem
|
))}
|
||||||
onClick={() => {
|
</List>
|
||||||
modify();
|
|
||||||
handleClose();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Pipeline Config
|
|
||||||
</MenuItem>
|
|
||||||
<Divider />
|
|
||||||
<MenuItem sx={{ color: "error.main" }} onClick={handleClose}>
|
|
||||||
Delete
|
|
||||||
</MenuItem>
|
|
||||||
</Menu>
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const Item = ({ pipeline }: { pipeline: Pipeline }) => {
|
const Item = ({ pipeline }: { pipeline: Pipeline }) => {
|
||||||
|
const { navigate, url } = useRouter();
|
||||||
|
const modify: MouseEventHandler = (ev) => {
|
||||||
|
ev.preventDefault();
|
||||||
|
navigate({
|
||||||
|
url: url({
|
||||||
|
name: "edit-pipeline",
|
||||||
|
params: { pipelineId: pipeline.id, projectId: pipeline.project.id },
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<ListItem button>
|
<ListItem button>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary={pipeline.name}
|
primary={pipeline.name}
|
||||||
secondary={
|
secondary={
|
||||||
<Box sx={{ display: "flex", flexFlow: "column" }}>
|
<Typography component="span" variant="body2" color="textSecondary">
|
||||||
<Box
|
<CallMerge fontSize="small" />
|
||||||
sx={{
|
{pipeline.branch}
|
||||||
display: "flex",
|
</Typography>
|
||||||
alignItems: "center",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<FontAwesomeIcon
|
|
||||||
style={{ width: "1em", marginRight: "0.5em" }}
|
|
||||||
icon={faCodeBranch}
|
|
||||||
/>
|
|
||||||
<Typography
|
|
||||||
component="span"
|
|
||||||
variant="body2"
|
|
||||||
color="textSecondary"
|
|
||||||
>
|
|
||||||
{pipeline.branch}
|
|
||||||
</Typography>
|
|
||||||
</Box>
|
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
display: "flex",
|
|
||||||
alignItems: "center",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<FontAwesomeIcon
|
|
||||||
style={{ width: "1em", marginRight: "0.5em" }}
|
|
||||||
icon={faMapMarkerAlt}
|
|
||||||
/>
|
|
||||||
<Typography
|
|
||||||
component="span"
|
|
||||||
variant="body2"
|
|
||||||
color="textSecondary"
|
|
||||||
>
|
|
||||||
{pipeline.environment}
|
|
||||||
</Typography>
|
|
||||||
</Box>
|
|
||||||
</Box>
|
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
<ListItemSecondaryAction>
|
||||||
|
<IconButton edge="end" aria-label="edit" onClick={modify}>
|
||||||
|
<Edit />
|
||||||
|
</IconButton>
|
||||||
|
</ListItemSecondaryAction>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { gql } from "@apollo/client";
|
import { gql } from '@apollo/client';
|
||||||
|
|
||||||
export const PIPELINE = gql`
|
export const PIPELINE = gql`
|
||||||
query Pipeline($id: String!) {
|
query Pipeline($id: String!) {
|
||||||
@ -7,7 +7,6 @@ export const PIPELINE = gql`
|
|||||||
name
|
name
|
||||||
projectId
|
projectId
|
||||||
branch
|
branch
|
||||||
environment
|
|
||||||
workUnitMetadata {
|
workUnitMetadata {
|
||||||
version
|
version
|
||||||
units {
|
units {
|
||||||
@ -18,19 +17,3 @@ export const PIPELINE = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const CONFIGURATION = gql`
|
|
||||||
query QueryGetConfigurationArgs($pipelineId: String!, $projectId: String!) {
|
|
||||||
configuration: getConfiguration(
|
|
||||||
pipelineId: $pipelineId
|
|
||||||
projectId: $projectId
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
content
|
|
||||||
language
|
|
||||||
pipelineId
|
|
||||||
projectId
|
|
||||||
name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
|
||||||
import { useRouter } from "@curi/react-universal";
|
|
||||||
import { Button, Paper } from "@mui/material";
|
|
||||||
import { Form, Formik } from "formik";
|
|
||||||
import { FC, useCallback } from "react";
|
|
||||||
import { YamlEditor } from "../commons/form/yaml-editor/yaml-editor";
|
|
||||||
import { Configuration } from "../generated/graphql";
|
|
||||||
import { SET_CONFIGURATION } from "./mutations";
|
|
||||||
|
|
||||||
type Values = Configuration;
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
configuration: Configuration;
|
|
||||||
}
|
|
||||||
export const RuntimeConfigEditor: FC<Props> = ({ configuration }) => {
|
|
||||||
const { history } = useRouter();
|
|
||||||
const [setConfiguration] =
|
|
||||||
useMutation<{ configuration: Configuration }>(SET_CONFIGURATION);
|
|
||||||
const submitForm = useCallback(
|
|
||||||
async (values: Values) => {
|
|
||||||
await setConfiguration({ variables: { configuration: values } });
|
|
||||||
history.go(-1);
|
|
||||||
},
|
|
||||||
[setConfiguration, history]
|
|
||||||
);
|
|
||||||
return (
|
|
||||||
<Paper sx={{ p: 2 }}>
|
|
||||||
<Formik<Values> initialValues={configuration ?? {}} onSubmit={submitForm}>
|
|
||||||
{({ submitForm, isSubmitting, values }) => {
|
|
||||||
return (
|
|
||||||
<Form>
|
|
||||||
<YamlEditor label="YAML" name="content" />
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="primary"
|
|
||||||
type="submit"
|
|
||||||
disabled={isSubmitting}
|
|
||||||
onClick={submitForm}
|
|
||||||
fullWidth
|
|
||||||
>
|
|
||||||
Submit
|
|
||||||
</Button>
|
|
||||||
</Form>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</Formik>
|
|
||||||
</Paper>
|
|
||||||
);
|
|
||||||
};
|
|
@ -1,13 +1,10 @@
|
|||||||
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, Paper, Portal, Typography, Box } from "@mui/material";
|
import { IconButton, Grid, makeStyles, Paper, Portal, Typography } from "@material-ui/core";
|
||||||
import makeStyles from '@mui/styles/makeStyles';
|
|
||||||
import { useHeaderContainer } from "../layouts";
|
import { useHeaderContainer } from "../layouts";
|
||||||
import { PipelineList } from "../pipelines/pipeline-list";
|
import { PipelineList } from "../pipelines/pipeline-list";
|
||||||
import { Edit } from '@mui/icons-material';
|
import { Edit } from '@material-ui/icons';
|
||||||
import { Link } from '@curi/react-dom';
|
import { Link } from '@curi/react-dom';
|
||||||
import { Button } from "@mui/material";
|
|
||||||
import { AddBox } from "@mui/icons-material";
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
project: Project;
|
project: Project;
|
||||||
@ -38,7 +35,7 @@ export const ProjectDetail: FC<Props> = ({ project, children }) => {
|
|||||||
container
|
container
|
||||||
spacing={3}
|
spacing={3}
|
||||||
direction="row"
|
direction="row"
|
||||||
justifyContent="space-between"
|
justify="space-between"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
>
|
>
|
||||||
<Grid item>
|
<Grid item>
|
||||||
@ -51,7 +48,7 @@ export const ProjectDetail: FC<Props> = ({ project, children }) => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<Link name="edit-project" params={{ projectId: project.id }}>
|
<Link name="edit-project" params={{ projectId: project.id }}>
|
||||||
<IconButton color="inherit" size="large">{<Edit />}</IconButton>
|
<IconButton color="inherit">{<Edit />}</IconButton>
|
||||||
</Link>
|
</Link>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
@ -65,18 +62,6 @@ 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>
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
import { gql, Reference, useMutation } from "@apollo/client";
|
import { gql, Reference, useMutation } from "@apollo/client";
|
||||||
import { Button, LinearProgress, Paper, Portal, Typography, Grid, IconButton } from "@mui/material";
|
import {
|
||||||
import makeStyles from '@mui/styles/makeStyles';
|
Button,
|
||||||
|
LinearProgress,
|
||||||
|
makeStyles,
|
||||||
|
Paper,
|
||||||
|
Portal,
|
||||||
|
Typography,
|
||||||
|
Grid,
|
||||||
|
IconButton,
|
||||||
|
} from "@material-ui/core";
|
||||||
import { Form, Formik, Field, FormikHelpers } from "formik";
|
import { Form, Formik, Field, FormikHelpers } from "formik";
|
||||||
import { TextField } from "formik-material-ui";
|
import { TextField } from "formik-material-ui";
|
||||||
import { not } from "ramda";
|
import { not } from "ramda";
|
||||||
@ -9,7 +17,7 @@ import { Project } from "../generated/graphql";
|
|||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
import { useRouter } from "@curi/react-dom";
|
import { useRouter } from "@curi/react-dom";
|
||||||
import { useHeaderContainer } from "../layouts";
|
import { useHeaderContainer } from "../layouts";
|
||||||
import DeleteIcon from "@mui/icons-material/Delete";
|
import DeleteIcon from "@material-ui/icons/Delete";
|
||||||
import { useConfirm } from "material-ui-confirm";
|
import { useConfirm } from "material-ui-confirm";
|
||||||
import { useSnackbar } from "notistack";
|
import { useSnackbar } from "notistack";
|
||||||
|
|
||||||
@ -170,12 +178,16 @@ export const ProjectEditor: FC<Props> = ({ project }) => {
|
|||||||
return (
|
return (
|
||||||
<Paper className={classes.root}>
|
<Paper className={classes.root}>
|
||||||
<Portal container={headerContainer}>
|
<Portal container={headerContainer}>
|
||||||
<Grid container justifyContent="space-between" alignItems="center">
|
<Grid container justify="space-between" alignItems="center">
|
||||||
<Typography variant="h6" component="h1">
|
<Typography variant="h6" component="h1">
|
||||||
{isCreate ? "Create" : "Edit"} Project
|
{isCreate ? "Create" : "Edit"} Project
|
||||||
</Typography>
|
</Typography>
|
||||||
{isCreate ? null : (
|
{isCreate ? null : (
|
||||||
<IconButton color="inherit" onClick={handleDelete} disabled={deleting} size="large">
|
<IconButton
|
||||||
|
color="inherit"
|
||||||
|
onClick={handleDelete}
|
||||||
|
disabled={deleting}
|
||||||
|
>
|
||||||
<DeleteIcon />
|
<DeleteIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
import { gql, useQuery } from "@apollo/client";
|
import { gql, useQuery } from "@apollo/client";
|
||||||
import { Link } from "@curi/react-dom";
|
import { Link } from "@curi/react-dom";
|
||||||
import { Box, List, ListItem, Theme } from "@mui/material";
|
import { Box, List, ListItem, makeStyles, Theme } from "@material-ui/core";
|
||||||
import makeStyles from '@mui/styles/makeStyles';
|
|
||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
import { Project } from "../generated/graphql";
|
import { Project } from "../generated/graphql";
|
||||||
import { ListItemText } from "@mui/material";
|
import { ListItemText } from "@material-ui/core";
|
||||||
import { Button } from "@mui/material";
|
import { Button } from "@material-ui/core";
|
||||||
import { AddBox } from "@mui/icons-material";
|
import { AddBox } from "@material-ui/icons";
|
||||||
import { ActiveLink } from "../commons/route/active-link";
|
import { ActiveLink } from "../commons/route/active-link";
|
||||||
|
|
||||||
const PROJECTS = gql`
|
const PROJECTS = gql`
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
import { ApolloClient, InMemoryCache } from "@apollo/client";
|
import { ApolloClient, InMemoryCache } from "@apollo/client";
|
||||||
import { prepareRoutes } from "@curi/router";
|
import { prepareRoutes } from "@curi/router";
|
||||||
import { omit } from "ramda";
|
import { omit } from 'ramda';
|
||||||
|
import React from "react";
|
||||||
import { ProjectDetail, ProjectEditor, PROJECT } from "./projects";
|
import { ProjectDetail, ProjectEditor, PROJECT } from "./projects";
|
||||||
import { COMMIT_LIST_QUERY } from "./commons/graphql/queries";
|
import { COMMIT_LIST_QUERY } from './commons/graphql/queries';
|
||||||
import { CommitList } from "./commits/commit-list";
|
import { CommitList } from './commits/commit-list';
|
||||||
import { PipelineTaskDetail } from "./pipeline-tasks/pipeline-task-detail";
|
import { PipelineTaskDetail } from './pipeline-tasks/pipeline-task-detail';
|
||||||
import { PipelineEditor } from "./pipelines/pipeline-editor";
|
import { PipelineEditor } from "./pipelines/pipeline-editor";
|
||||||
import {
|
import {
|
||||||
Configuration,
|
|
||||||
ConfigurationLanguage,
|
|
||||||
CreatePipelineInput,
|
CreatePipelineInput,
|
||||||
CreateProjectInput,
|
CreateProjectInput,
|
||||||
Pipeline,
|
Pipeline,
|
||||||
PipelineUnits,
|
|
||||||
Project,
|
Project,
|
||||||
} from "./generated/graphql";
|
} from "./generated/graphql";
|
||||||
import { CONFIGURATION, PIPELINE, RuntimeConfigEditor } from "./pipelines";
|
import { PIPELINE } from "./pipelines";
|
||||||
|
|
||||||
export default prepareRoutes([
|
export default prepareRoutes([
|
||||||
{
|
{
|
||||||
@ -67,20 +65,13 @@ export default prepareRoutes([
|
|||||||
matched,
|
matched,
|
||||||
{ client }: { client: ApolloClient<InMemoryCache> }
|
{ client }: { client: ApolloClient<InMemoryCache> }
|
||||||
) {
|
) {
|
||||||
const units = [
|
|
||||||
PipelineUnits.Checkout,
|
|
||||||
PipelineUnits.InstallDependencies,
|
|
||||||
PipelineUnits.Test,
|
|
||||||
PipelineUnits.Deploy,
|
|
||||||
PipelineUnits.CleanUp,
|
|
||||||
];
|
|
||||||
const input: CreatePipelineInput = {
|
const input: CreatePipelineInput = {
|
||||||
name: "",
|
name: "",
|
||||||
branch: "",
|
branch: "",
|
||||||
projectId: matched!.params.projectId,
|
projectId: matched!.params.projectId,
|
||||||
workUnitMetadata: {
|
workUnitMetadata: {
|
||||||
version: 1,
|
version: 1,
|
||||||
units: units.map((util) => ({ type: util, scripts: [] })),
|
units: [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
@ -110,40 +101,6 @@ export default prepareRoutes([
|
|||||||
return resolved;
|
return resolved;
|
||||||
},
|
},
|
||||||
}, // edit-pipeline
|
}, // edit-pipeline
|
||||||
{
|
|
||||||
name: "edit-runtime-configuration",
|
|
||||||
path: "projects/:projectId/pipelines/:pipelineId/runtime-configuration",
|
|
||||||
async resolve(
|
|
||||||
matched,
|
|
||||||
{ client }: { client: ApolloClient<InMemoryCache> }
|
|
||||||
) {
|
|
||||||
const { data } = await client.query<{ configuration: Configuration }>({
|
|
||||||
query: CONFIGURATION,
|
|
||||||
variables: {
|
|
||||||
pipelineId: matched?.params.pipelineId,
|
|
||||||
projectId: matched?.params.projectId,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return {
|
|
||||||
body: () => (
|
|
||||||
<RuntimeConfigEditor
|
|
||||||
configuration={
|
|
||||||
data.configuration ?? {
|
|
||||||
name: "Default Configuration",
|
|
||||||
pipelineId: matched?.params.pipelineId,
|
|
||||||
projectId: matched?.params.projectId,
|
|
||||||
language: ConfigurationLanguage.Yaml,
|
|
||||||
content: null,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
};
|
|
||||||
},
|
|
||||||
respond({ resolved }) {
|
|
||||||
return resolved;
|
|
||||||
},
|
|
||||||
}, // edit-pipeline
|
|
||||||
{
|
{
|
||||||
name: "project-detail",
|
name: "project-detail",
|
||||||
path: "projects/:projectId",
|
path: "projects/:projectId",
|
||||||
|
Loading…
Reference in New Issue
Block a user