Files
supabase/apps/studio/pages/integrations/github/authorize.tsx
T
74563fbeba chore(branching): GitHub integration 2.0 (#21008)
* start new github integration

* query/mutation updates

* progress

* branch management

* update codegen

* progress

* progress

* Refactor GitHub integration URLs

* Refactor GitHubIntegrationAuthorize component

* Updates

* Do not remove GitHub connection when creating new one

* Deleting a GH connection when branching is enabled for the project, will also disable branching for that project

* Add link to configure connection from org integration settings page

* Slight refactor

* Support updating CWD path

* Change cwd_path to workdir and disallow empty values

* Allow for triggering branches on supabase directory changes only

* Pass missing supabaseChangesOnly value

* Small style fix

* Add Authorization GitHub step

* Small change

* Fix supabase integrations form in project settings

* Revert URLa nd client ID

* Fix UI issues

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Kamil Ogórek <kamil.ogorek@gmail.com>
2024-03-04 18:17:26 +11:00

31 lines
753 B
TypeScript

import { useEffect } from 'react'
import { useParams } from 'common'
import { useGitHubAuthorizationCreateMutation } from 'data/integrations/github-authorization-create-mutation'
const GitHubIntegrationAuthorize = () => {
const { code } = useParams()
const { mutate, isSuccess } = useGitHubAuthorizationCreateMutation({
onSuccess() {
window.close()
},
})
useEffect(() => {
if (code) {
mutate({ code })
}
}, [code, mutate])
return (
<div className="h-screen flex flex-col justify-center items-center gap-4">
<h2 className="text-xl">Completing GitHub Authorization...</h2>
{isSuccess ? <p>You can now close this window.</p> : <p />}
</div>
)
}
export default GitHubIntegrationAuthorize