diff --git a/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/components/constant.ts b/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/components/constant.ts index 1cabeaee9891..b137ff354c58 100644 --- a/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/components/constant.ts +++ b/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/components/constant.ts @@ -23,5 +23,13 @@ export const PROVIDER_METAS: Array<{ domain: 'google.com', displayName: 'Google' } + }, + { + name: 'gitlab', + enum: OAuthProvider.Gitlab, + meta: { + domain: 'gitlab.com', + displayName: 'GitLab' + } } ] diff --git a/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/components/oauth-credential-form.tsx b/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/components/oauth-credential-form.tsx index f148c3f87d5f..ebe8b94f4124 100644 --- a/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/components/oauth-credential-form.tsx +++ b/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/components/oauth-credential-form.tsx @@ -206,6 +206,16 @@ export default function OAuthCredentialForm({ Google +
+ + +
diff --git a/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/components/oauth-credential-list.tsx b/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/components/oauth-credential-list.tsx index 95ccb787537f..1b081de240ba 100644 --- a/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/components/oauth-credential-list.tsx +++ b/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/components/oauth-credential-list.tsx @@ -41,11 +41,19 @@ const OAuthCredentialList = () => { query: oauthCredential, variables: { provider: OAuthProvider.Google } }) + const [{ data: gitlabData, fetching: fetchingGitlab }] = useQuery({ + query: oauthCredential, + variables: { provider: OAuthProvider.Gitlab } + }) - const isLoading = fetchingGithub || fetchingGoogle + const isLoading = fetchingGithub || fetchingGoogle || fetchingGitlab const credentialList = React.useMemo(() => { - return compact([githubData?.oauthCredential, googleData?.oauthCredential]) - }, [githubData, googleData]) + return compact([ + githubData?.oauthCredential, + googleData?.oauthCredential, + gitlabData?.oauthCredential + ]) + }, [githubData, googleData, gitlabData]) const router = useRouter() const createButton = ( @@ -100,7 +108,7 @@ const OAuthCredentialList = () => { ) })} - {credentialList.length < 2 && ( + {credentialList.length < 3 && (
{createButton}
)} @@ -144,4 +152,4 @@ const OauthCredentialCard = ({ ) } -export { OAuthCredentialList as OauthCredentialList } +export { OAuthCredentialList } diff --git a/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/page.tsx b/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/page.tsx index bdd789a508ea..c5f30465d8d0 100644 --- a/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/page.tsx +++ b/ee/tabby-ui/app/(dashboard)/settings/(integrations)/sso/page.tsx @@ -1,11 +1,11 @@ import { Metadata } from 'next' -import { OauthCredentialList } from './components/oauth-credential-list' +import { OAuthCredentialList } from './components/oauth-credential-list' export const metadata: Metadata = { title: 'SSO' } export default function IndexPage() { - return + return } diff --git a/ee/tabby-ui/app/auth/signin/components/signin-section.tsx b/ee/tabby-ui/app/auth/signin/components/signin-section.tsx index 061f5d5d119b..9fcca384c95a 100644 --- a/ee/tabby-ui/app/auth/signin/components/signin-section.tsx +++ b/ee/tabby-ui/app/auth/signin/components/signin-section.tsx @@ -8,7 +8,7 @@ import useRouterStuff from '@/lib/hooks/use-router-stuff' import { useAllowSelfSignup } from '@/lib/hooks/use-server-info' import { useSession, useSignIn } from '@/lib/tabby/auth' import fetcher from '@/lib/tabby/fetcher' -import { IconGithub, IconGoogle, IconSpinner } from '@/components/ui/icons' +import { IconGitLab, IconGithub, IconGoogle, IconSpinner } from '@/components/ui/icons' import UserSignInForm from './user-signin-form' @@ -78,7 +78,7 @@ export default function SigninSection() {
)} -
+
{data?.includes('github') && ( @@ -89,6 +89,11 @@ export default function SigninSection() { )} + {data?.includes('gitlab') && ( + + + + )}
{!!errorMessage && (
{errorMessage}
diff --git a/ee/tabby-webserver/src/routes/oauth.rs b/ee/tabby-webserver/src/routes/oauth.rs index cd18b7950ede..9c6793b09b97 100644 --- a/ee/tabby-webserver/src/routes/oauth.rs +++ b/ee/tabby-webserver/src/routes/oauth.rs @@ -54,7 +54,7 @@ async fn has_provider(auth: &Arc, x: &OAuthProvider) } async fn providers_handler(state: State) -> Json> { - let candidates = vec![OAuthProvider::Google, OAuthProvider::Github]; + let candidates = vec![OAuthProvider::Google, OAuthProvider::Github, OAuthProvider::Gitlab]; let mut providers = vec![]; for x in candidates {