Files
supabase/apps/studio/state/side-panels.ts
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

32 lines
988 B
TypeScript

import { proxy, snapshot, useSnapshot } from 'valtio'
export type SidePanelTypeProps = 'VERCEL_CONNECTIONS' | 'GITHUB_CONNECTIONS'
export const sidePanelsState = proxy({
/**
* Vercel connections
*/
vercelConnectionsOpen: false as boolean,
setVercelConnectionsOpen: (bool: boolean) => {
sidePanelsState.vercelConnectionsOpen = bool
},
// ID to determine which vercel integration installation to use
vercelConnectionsIntegrationId: undefined as undefined | string,
setVercelConnectionsIntegrationId: (id: string) => {
sidePanelsState.vercelConnectionsIntegrationId = id
},
/**
* GitHub connections
*/
githubConnectionsOpen: false as boolean,
setGithubConnectionsOpen: (bool: boolean) => {
sidePanelsState.githubConnectionsOpen = bool
},
})
export const getSidePanelsState = () => snapshot(sidePanelsState)
export const useSidePanelsStateSnapshot = (options?: Parameters<typeof useSnapshot>[1]) =>
useSnapshot(sidePanelsState, options)