diff --git a/src/lib/components/git/branchSelector.svelte b/src/lib/components/git/branchSelector.svelte new file mode 100644 index 000000000..9bc00990b --- /dev/null +++ b/src/lib/components/git/branchSelector.svelte @@ -0,0 +1,290 @@ + + +
{ + if (!e.currentTarget.contains(e.relatedTarget)) { + open = false; + searchQuery = ''; + searchResults = []; + } +}}> + + + {#if open} +
+ + + +
+ {/if} +
+ + diff --git a/src/lib/components/git/index.ts b/src/lib/components/git/index.ts index a5cab5eed..ddec8646b 100644 --- a/src/lib/components/git/index.ts +++ b/src/lib/components/git/index.ts @@ -7,5 +7,6 @@ export { default as DeploymentSource } from './deploymentSource.svelte'; export { default as DeploymentDomains } from './deploymentDomains.svelte'; export { default as ConnectBehaviour } from './connectBehaviour.svelte'; export { default as ProductionBranchFieldset } from './productionBranchFieldset.svelte'; +export { default as BranchSelector } from './branchSelector.svelte'; export { default as RepositoryCard } from './repositoryCard.svelte'; export { default as ConnectRepoModal } from './connectRepoModal.svelte'; diff --git a/src/lib/components/git/productionBranchFieldset.svelte b/src/lib/components/git/productionBranchFieldset.svelte index 6785d6499..fbd98f81e 100644 --- a/src/lib/components/git/productionBranchFieldset.svelte +++ b/src/lib/components/git/productionBranchFieldset.svelte @@ -1,10 +1,9 @@
- {#await loadBranches()} + {#await loadDefaultBranch()} - - - - - - - - - - - - - + - {:then branches} - {@const options = - branches - ?.map((branch) => { - return { - value: branch.name, - label: branch.name - }; - }) - ?.sort((a, b) => { - return a.label > b.label ? 1 : -1; - }) ?? []} + {:then} - { - branch = event.detail.value; - }} - {options} /> + {installationId} + {repositoryId} + on:select={(e) => (branch = e.detail)} />