diff --git a/apps/ui/src/routes/applications/[id]/configuration/_GithubRepositories.svelte b/apps/ui/src/routes/applications/[id]/configuration/_GithubRepositories.svelte index 4abf5787e..7f1f40f62 100644 --- a/apps/ui/src/routes/applications/[id]/configuration/_GithubRepositories.svelte +++ b/apps/ui/src/routes/applications/[id]/configuration/_GithubRepositories.svelte @@ -92,27 +92,9 @@ label: branch.name })); } - async function isBranchAlreadyUsed(event: any) { + async function selectBranch(event: any) { selected.branch = event.detail.value; - try { - // const data = await get( - // `/applications/${id}/configuration/repository?repository=${selected.repository}&branch=${selected.branch}` - // ); - // if (data.used) { - // const sure = confirm($t('application.configuration.branch_already_in_use')); - // if (sure) { - // selected.autodeploy = false; - // showSave = true; - // return true; - // } - // showSave = false; - // return true; - // } - showSave = true; - } catch (error) { - showSave = false; - return errorNotification(error); - } + showSave = true; } onMount(async () => { @@ -178,7 +160,7 @@ isWaiting={loading.branches} showIndicator={selected.repository && !loading.branches} id="branches" - on:select={isBranchAlreadyUsed} + on:select={selectBranch} items={branchSelectOptions} isDisabled={loading.branches || !selected.repository} isClearable={false} @@ -186,10 +168,9 @@
diff --git a/apps/ui/src/routes/applications/[id]/configuration/_GitlabRepositories.svelte b/apps/ui/src/routes/applications/[id]/configuration/_GitlabRepositories.svelte index 94fc11885..8f2c09ea0 100644 --- a/apps/ui/src/routes/applications/[id]/configuration/_GitlabRepositories.svelte +++ b/apps/ui/src/routes/applications/[id]/configuration/_GitlabRepositories.svelte @@ -195,27 +195,11 @@ } } - async function isBranchAlreadyUsed(event) { + async function selectBranch(event: any) { selected.branch = event.detail; - try { - // const data = await get( - // `/applications/${id}/configuration/repository?repository=${selected.project.path_with_namespace}&branch=${selected.branch.name}` - // ); - // if (data.used) { - // const sure = confirm($t('application.configuration.branch_already_in_use')); - // if (sure) { - // autodeploy = false; - // showSave = true; - // return true; - // } - // showSave = false; - // return true; - // } - showSave = true; - } catch (error) { - return errorNotification(error); - } + showSave = true; } + async function checkSSHKey(sshkeyUrl: any) { try { return await post(sshkeyUrl, {}); @@ -394,7 +378,7 @@ showIndicator={!loading.branches} isWaiting={loading.branches} isDisabled={loading.branches || !selected.project} - on:select={isBranchAlreadyUsed} + on:select={selectBranch} on:clear={() => { showSave = false; selected.branch = null; @@ -414,7 +398,6 @@ class="btn btn-wide" type="submit" disabled={!showSave || loading.save} - class:bg-applications={showSave && !loading.save} >{loading.save ? $t('forms.saving') : $t('forms.save')} {#if tryAgain} @@ -423,7 +406,7 @@ configuration here. diff --git a/apps/ui/src/routes/applications/[id]/configuration/destination.svelte b/apps/ui/src/routes/applications/[id]/configuration/destination.svelte index 6209e851a..13e16e1ce 100644 --- a/apps/ui/src/routes/applications/[id]/configuration/destination.svelte +++ b/apps/ui/src/routes/applications/[id]/configuration/destination.svelte @@ -88,31 +88,111 @@ {:else} -
+
{#each ownDestinations as destination} -
-
handleSubmit(destination.id)}> - -
-
+ {/each}
{#if otherDestinations.length > 0 && $appSession.teamId === '0'}
Other Destinations
{/if} -
+
{#each otherDestinations as destination} -
-
handleSubmit(destination.id)}> - -
-
+ {/each}
{/if} diff --git a/apps/ui/src/routes/applications/[id]/configuration/source.svelte b/apps/ui/src/routes/applications/[id]/configuration/source.svelte index 4da394538..f29613198 100644 --- a/apps/ui/src/routes/applications/[id]/configuration/source.svelte +++ b/apps/ui/src/routes/applications/[id]/configuration/source.svelte @@ -78,10 +78,7 @@ {$t('application.configuration.no_configurable_git')}
- + {/if} - {#if $page.url.pathname === `/services/${id}/configuration/type`} + {#if $page.url.pathname === `/services/${id}/configuration/type` && dev}
{:else} -
+
{#each destinations as destination} -
-
handleSubmit(destination.id)}> - -
-
+ {/each}
{/if} diff --git a/apps/ui/src/tailwind.css b/apps/ui/src/tailwind.css index cf9d74d9a..1aeb96abf 100644 --- a/apps/ui/src/tailwind.css +++ b/apps/ui/src/tailwind.css @@ -156,7 +156,7 @@ a { } .box-selection { - @apply justify-center rounded border-transparent bg-coolgray-200 p-6 hover:border-transparent hover:bg-coolgray-400; + @apply min-w-[16rem] justify-center rounded border-transparent bg-coolgray-200 p-6 hover:border-transparent hover:bg-coolgray-400; } .lds-heart {