You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by mi...@apache.org on 2024/03/15 06:10:06 UTC

(incubator-devlake) 01/01: feat: add beta badge for plugin

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

mintsweet pushed a commit to branch feat-badge-beta
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 44c41ff7d276331fa206d4482c4bf7f05e9210d3
Author: mintsweet <0x...@gmail.com>
AuthorDate: Fri Mar 15 19:09:55 2024 +1300

    feat: add beta badge for plugin
---
 config-ui/src/plugins/register/azure/config.tsx            |  3 ++-
 config-ui/src/plugins/register/bitbucket-server/config.tsx |  3 ++-
 config-ui/src/routes/connection/connections.tsx            |  2 ++
 config-ui/src/routes/connection/styled.ts                  | 11 +++++++++++
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/config-ui/src/plugins/register/azure/config.tsx b/config-ui/src/plugins/register/azure/config.tsx
index 873fa54f3..c2157a90b 100644
--- a/config-ui/src/plugins/register/azure/config.tsx
+++ b/config-ui/src/plugins/register/azure/config.tsx
@@ -76,9 +76,10 @@ export const AzureConfig: IPluginConfig = {
 
 export const AzureGoConfig: IPluginConfig = {
   plugin: 'azuredevops_go',
-  name: 'Azure DevOps Go(beta)',
+  name: 'Azure DevOps Go',
   icon: ({ color }) => <Icon fill={color} />,
   sort: 1,
+  isBeta: true,
   connection: {
     docLink: DOC_URL.PLUGIN.AZUREDEVOPS.BASIS,
     fields: [
diff --git a/config-ui/src/plugins/register/bitbucket-server/config.tsx b/config-ui/src/plugins/register/bitbucket-server/config.tsx
index 6691921f6..21fa96353 100644
--- a/config-ui/src/plugins/register/bitbucket-server/config.tsx
+++ b/config-ui/src/plugins/register/bitbucket-server/config.tsx
@@ -23,9 +23,10 @@ import Icon from './assets/icon.svg?react';
 
 export const BitbucketServerConfig: IPluginConfig = {
   plugin: 'bitbucket_server',
-  name: 'Bitbucket Server(beta)',
+  name: 'Bitbucket Server',
   icon: ({ color }) => <Icon fill={color} />,
   sort: 3,
+  isBeta: true,
   connection: {
     docLink: DOC_URL.PLUGIN.BITBUCKET_SERVER.BASIS,
     fields: [
diff --git a/config-ui/src/routes/connection/connections.tsx b/config-ui/src/routes/connection/connections.tsx
index f88beff58..776089b0a 100644
--- a/config-ui/src/routes/connection/connections.tsx
+++ b/config-ui/src/routes/connection/connections.tsx
@@ -90,6 +90,7 @@ export const Connections = () => {
           const connectionCount = connections.filter((cs) => cs.plugin === plugin).length;
           return (
             <li key={plugin} onClick={() => handleShowListDialog(plugin)}>
+              {pluginConfig.isBeta && <span className="beta">Beta</span>}
               <span className="logo">{pluginConfig.icon({ color: colorPrimary })}</span>
               <span className="name">{pluginConfig.name}</span>
               <span className="count">
@@ -110,6 +111,7 @@ export const Connections = () => {
           const connectionCount = connections.filter((cs) => cs.plugin === plugin).length;
           return (
             <li key={plugin} onClick={() => handleShowListDialog(plugin)}>
+              {pluginConfig.isBeta && <span className="beta">Beta</span>}
               <span className="logo">{pluginConfig.icon({ color: colorPrimary })}</span>
               <span className="name">{pluginConfig.name}</span>
               <span className="count">
diff --git a/config-ui/src/routes/connection/styled.ts b/config-ui/src/routes/connection/styled.ts
index a3bb3ccd8..6aa45c948 100644
--- a/config-ui/src/routes/connection/styled.ts
+++ b/config-ui/src/routes/connection/styled.ts
@@ -67,6 +67,17 @@ export const Wrapper = styled.div<{ theme: string }>`
       background-color: #eeeeee;
     }
 
+    & > .beta {
+      position: absolute;
+      top: 0;
+      right: 0;
+      padding: 4px 8px;
+      font-size: 12px;
+      color: #fff;
+      background-color: #f5a623;
+      border-radius: 8px;
+    }
+
     & > .logo {
       width: 60px;
       height: 60px;