You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ab...@apache.org on 2024/07/25 09:37:43 UTC

(incubator-devlake) branch main updated: feat: remove graphql configuration from github connection (#7784)

This is an automated email from the ASF dual-hosted git repository.

abeizn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 8ee6abeae feat: remove graphql configuration from github connection (#7784)
8ee6abeae is described below

commit 8ee6abeaef471291a549dfc82ee5a02e3f276a49
Author: 青湛 <0x...@gmail.com>
AuthorDate: Thu Jul 25 21:37:38 2024 +1200

    feat: remove graphql configuration from github connection (#7784)
---
 config-ui/src/features/connections/utils.ts        |  1 -
 config-ui/src/plugins/register/github/config.tsx   | 11 +----
 .../register/github/connection-fields/graphql.tsx  | 47 ----------------------
 .../register/github/connection-fields/index.ts     |  1 -
 config-ui/src/types/connection.ts                  |  2 -
 5 files changed, 1 insertion(+), 61 deletions(-)

diff --git a/config-ui/src/features/connections/utils.ts b/config-ui/src/features/connections/utils.ts
index 3e6731ded..781fb4f11 100644
--- a/config-ui/src/features/connections/utils.ts
+++ b/config-ui/src/features/connections/utils.ts
@@ -38,7 +38,6 @@ export const transformConnection = (plugin: string, connection: IConnectionAPI):
     secretKey: connection.secretKey,
     dbUrl: connection.dbUrl,
     proxy: connection.proxy,
-    enableGraphql: connection.enableGraphql,
     rateLimitPerHour: connection.rateLimitPerHour,
     organization: connection.organization,
   };
diff --git a/config-ui/src/plugins/register/github/config.tsx b/config-ui/src/plugins/register/github/config.tsx
index 295d9d1ad..a7fb882f1 100644
--- a/config-ui/src/plugins/register/github/config.tsx
+++ b/config-ui/src/plugins/register/github/config.tsx
@@ -22,7 +22,7 @@ import { DOC_URL } from '@/release';
 import { IPluginConfig } from '@/types';
 
 import Icon from './assets/icon.svg?react';
-import { Token, Graphql, GithubApp, Authentication } from './connection-fields';
+import { Token, GithubApp, Authentication } from './connection-fields';
 
 export const GitHubConfig: IPluginConfig = {
   plugin: 'github',
@@ -34,7 +34,6 @@ export const GitHubConfig: IPluginConfig = {
     initialValues: {
       endpoint: 'https://api.github.com/',
       authMethod: 'AccessToken',
-      enableGraphql: true,
     },
     fields: [
       'name',
@@ -80,14 +79,6 @@ export const GitHubConfig: IPluginConfig = {
           />
         ),
       'proxy',
-      ({ initialValues, values, setValues }: any) => (
-        <Graphql
-          key="graphql"
-          initialValue={initialValues.enableGraphql ?? false}
-          value={values.enableGraphql ?? false}
-          setValue={(value) => setValues({ enableGraphql: value })}
-        />
-      ),
       {
         key: 'rateLimitPerHour',
         subLabel:
diff --git a/config-ui/src/plugins/register/github/connection-fields/graphql.tsx b/config-ui/src/plugins/register/github/connection-fields/graphql.tsx
deleted file mode 100644
index 401890bd3..000000000
--- a/config-ui/src/plugins/register/github/connection-fields/graphql.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-import { useEffect } from 'react';
-import { Switch } from 'antd';
-
-import { Block } from '@/components';
-
-interface Props {
-  initialValue: boolean;
-  value: boolean;
-  setValue: (value: boolean) => void;
-}
-
-export const Graphql = ({ initialValue, value, setValue }: Props) => {
-  useEffect(() => {
-    setValue(initialValue);
-  }, [initialValue]);
-
-  const handleChange = (checked: boolean) => {
-    setValue(checked);
-  };
-
-  return (
-    <Block
-      title="Use GraphQL APIs"
-      description="GraphQL APIs are 10+ times faster than REST APIs, but they may not be supported in GitHub Server."
-    >
-      <Switch checked={value} onChange={handleChange} />
-    </Block>
-  );
-};
diff --git a/config-ui/src/plugins/register/github/connection-fields/index.ts b/config-ui/src/plugins/register/github/connection-fields/index.ts
index 1775eec52..696c82108 100644
--- a/config-ui/src/plugins/register/github/connection-fields/index.ts
+++ b/config-ui/src/plugins/register/github/connection-fields/index.ts
@@ -17,6 +17,5 @@
  */
 
 export * from './token';
-export * from './graphql';
 export * from './githubapp';
 export * from './authentication';
diff --git a/config-ui/src/types/connection.ts b/config-ui/src/types/connection.ts
index 6f0226c41..04551002e 100644
--- a/config-ui/src/types/connection.ts
+++ b/config-ui/src/types/connection.ts
@@ -27,7 +27,6 @@ export interface IConnectionAPI {
   appId?: string;
   secretKey?: string;
   dbUrl?: string;
-  enableGraphql?: boolean;
   companyId?: number;
   proxy: string;
   rateLimitPerHour?: number;
@@ -82,7 +81,6 @@ export interface IConnection {
   appId?: string;
   secretKey?: string;
   dbUrl?: string;
-  enableGraphql?: boolean;
   companyId?: number;
   proxy: string;
   rateLimitPerHour?: number;