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

lynwee 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 3195154a8 fix(config-ui): missed app installation list (#6571)
3195154a8 is described below

commit 3195154a8771153c3a05ecaaccf23272e1effa3f
Author: 青湛 <[email protected]>
AuthorDate: Wed Dec 6 17:34:43 2023 +0800

    fix(config-ui): missed app installation list (#6571)
---
 config-ui/src/plugins/register/github/config.tsx   |  1 +
 .../github/connection-fields/githubapp.tsx         | 49 +++++++---------------
 2 files changed, 16 insertions(+), 34 deletions(-)

diff --git a/config-ui/src/plugins/register/github/config.tsx 
b/config-ui/src/plugins/register/github/config.tsx
index b98efee42..38383f5fe 100644
--- a/config-ui/src/plugins/register/github/config.tsx
+++ b/config-ui/src/plugins/register/github/config.tsx
@@ -67,6 +67,7 @@ export const GitHubConfig: IPluginConfig = {
           />
         ) : (
           <GithubApp
+            key="github-app"
             endpoint={values.endpoint}
             proxy={values.proxy}
             initialValue={initialValues ? pick(initialValues, ['appId', 
'secretKey', 'installationId']) : {}}
diff --git 
a/config-ui/src/plugins/register/github/connection-fields/githubapp.tsx 
b/config-ui/src/plugins/register/github/connection-fields/githubapp.tsx
index fe99d1a4f..2cff1a8fd 100644
--- a/config-ui/src/plugins/register/github/connection-fields/githubapp.tsx
+++ b/config-ui/src/plugins/register/github/connection-fields/githubapp.tsx
@@ -17,8 +17,9 @@
  */
 
 import { useEffect, useState } from 'react';
+import { Select } from 'antd';
 import { Button, FormGroup, InputGroup, MenuItem, TextArea } from 
'@blueprintjs/core';
-import { Select2 } from '@blueprintjs/select';
+// import { Select2 } from '@blueprintjs/select';
 
 import API from '@/api';
 import { ExternalLink } from '@/components';
@@ -183,39 +184,19 @@ export const GithubApp = ({ endpoint, proxy, 
initialValue, value, error, setValu
         </div>
       </S.Input>
       <S.Input>
-        <Select2
-          items={settings.installations ?? []}
-          activeItem={settings.installations?.find((e) => e.id === 
settings.installationId)}
-          itemPredicate={(query, item) => 
item.account.login.toLowerCase().includes(query.toLowerCase())}
-          itemRenderer={(item, { handleClick, handleFocus, modifiers }) => {
-            return (
-              <MenuItem
-                active={modifiers.active}
-                disabled={modifiers.disabled}
-                key={item.id}
-                label={item.id.toString()}
-                onClick={handleClick}
-                onFocus={handleFocus}
-                roleStructure="listoption"
-                text={item.account.login}
-              />
-            );
-          }}
-          onItemSelect={(item) => {
-            setSettings({ ...settings, installationId: item.id });
-          }}
-          noResults={<option disabled={true}>No results</option>}
-          popoverProps={{ minimal: true }}
-        >
-          <Button
-            text={
-              settings.installations?.find((e) => e.id === 
settings.installationId)?.account.login ??
-              'Select App installation'
-            }
-            rightIcon="double-caret-vertical"
-            placeholder="Select App installation"
-          />
-        </Select2>
+        <Select
+          style={{ width: 200 }}
+          placeholder="Select App installation"
+          options={
+            settings.installations
+              ? settings.installations.map((it) => ({
+                  value: it.id,
+                  label: it.account.login,
+                }))
+              : []
+          }
+          onChange={(value) => setSettings({ ...settings, installationId: 
value })}
+        />
       </S.Input>
     </FormGroup>
   );

Reply via email to