Feat: Gitlab connector (#12248)

### What problem does this PR solve?

Feat: Gitlab connector
Fix: submit button in darkmode

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

---------

Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
Magicbook1108
2025-12-29 17:05:20 +08:00
committed by GitHub
parent f099bc1236
commit c3ae1aaecd
14 changed files with 498 additions and 4 deletions

View File

@ -25,6 +25,7 @@ export enum DataSourceKey {
OCI_STORAGE = 'oci_storage',
GOOGLE_CLOUD_STORAGE = 'google_cloud_storage',
AIRTABLE = 'airtable',
GITLAB = 'gitlab',
ASANA = 'asana',
// SHAREPOINT = 'sharepoint',
// SLACK = 'slack',
@ -110,6 +111,11 @@ export const generateDataSourceInfo = (t: TFunction) => {
description: t(`setting.${DataSourceKey.AIRTABLE}Description`),
icon: <SvgIcon name={'data-source/airtable'} width={38} />,
},
[DataSourceKey.GITLAB]: {
name: 'GitLab',
description: t(`setting.${DataSourceKey.GITLAB}Description`),
icon: <SvgIcon name={'data-source/gitlab'} width={38} />,
},
[DataSourceKey.ASANA]: {
name: 'Asana',
description: t(`setting.${DataSourceKey.ASANA}Description`),
@ -658,6 +664,54 @@ export const DataSourceFormFields = {
required: true,
},
],
[DataSourceKey.GITLAB]: [
{
label: 'Project Owner',
name: 'config.project_owner',
type: FormFieldType.Text,
required: true,
},
{
label: 'Project Name',
name: 'config.project_name',
type: FormFieldType.Text,
required: true,
},
{
label: 'GitLab Personal Access Token',
name: 'config.credentials.gitlab_access_token',
type: FormFieldType.Password,
required: true,
},
{
label: 'GitLab URL',
name: 'config.gitlab_url',
type: FormFieldType.Text,
required: true,
placeholder: 'https://gitlab.com',
},
{
label: 'include Merge Requests',
name: 'config.include_mrs',
type: FormFieldType.Checkbox,
required: false,
defaultValue: true,
},
{
label: 'include Issues',
name: 'config.include_issues',
type: FormFieldType.Checkbox,
required: false,
defaultValue: true,
},
{
label: 'include Code Files',
name: 'config.include_code_files',
type: FormFieldType.Checkbox,
required: false,
defaultValue: true,
},
],
[DataSourceKey.ASANA]: [
{
label: 'API Token',
@ -883,6 +937,21 @@ export const DataSourceFormDefaultValues = {
},
},
},
[DataSourceKey.GITLAB]: {
name: '',
source: DataSourceKey.GITLAB,
config: {
project_owner: '',
project_name: '',
gitlab_url: 'https://gitlab.com',
include_mrs: true,
include_issues: true,
include_code_files: true,
credentials: {
gitlab_access_token: '',
},
},
},
[DataSourceKey.ASANA]: {
name: '',
source: DataSourceKey.ASANA,