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.