From 20737b532423c964bd70e0aa2aac2c9533b5c3d4 Mon Sep 17 00:00:00 2001 From: Csaba Tuncsik Date: Fri, 7 Jul 2023 11:48:44 +0200 Subject: [PATCH] fix(editor): Make Source control branch select required (#6619) --- .../src/views/SettingsSourceControl.vue | 49 +++++++++++++------ 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/packages/editor-ui/src/views/SettingsSourceControl.vue b/packages/editor-ui/src/views/SettingsSourceControl.vue index 3967dff8df..dd111bab13 100644 --- a/packages/editor-ui/src/views/SettingsSourceControl.vue +++ b/packages/editor-ui/src/views/SettingsSourceControl.vue @@ -17,6 +17,12 @@ const sourceControlDocsSetupUrl = computed(() => locale.baseText('settings.sourceControl.docs.setup.url'), ); const isConnected = ref(false); +const branchNameOptions = computed(() => + sourceControlStore.preferences.branches.map((branch) => ({ + value: branch, + label: branch, + })), +); const onConnect = async () => { loadingService.startLoading(); @@ -106,6 +112,7 @@ const formValidationStatus = reactive>({ repoUrl: false, authorName: false, authorEmail: false, + branchName: false, }); function onValidate(key: string, value: boolean) { @@ -136,6 +143,8 @@ const authorEmailValidationRules: Array = [ }, ]; +const branchNameValidationRules: Array = [{ name: 'REQUIRED' }]; + const validForConnection = computed( () => formValidationStatus.repoUrl && @@ -216,7 +225,7 @@ const refreshBranches = async () => { @validate="(value) => onValidate('repoUrl', value)" /> { }}
- - - + validateOnBlur + :validationRules="branchNameValidationRules" + :options="branchNameOptions" + :value="sourceControlStore.preferences.branchName" + @validate="(value) => onValidate('branchName', value)" + @input="onSelect" + />