diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-04 00:15:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-04 00:15:10 +0300 |
commit | 7a5409764a6a6e450981eed73e5e2a09a6b60533 (patch) | |
tree | 691571846a926dd68b81bcc400bfc3ac03c705fc /app/assets/javascripts/pipeline_editor | |
parent | 1e28c9498f80fa09b3061ef0903cf99e5142c2f2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/pipeline_editor')
3 files changed, 21 insertions, 3 deletions
diff --git a/app/assets/javascripts/pipeline_editor/components/commit/commit_form.vue b/app/assets/javascripts/pipeline_editor/components/commit/commit_form.vue index ca78f194a82..107af6b4705 100644 --- a/app/assets/javascripts/pipeline_editor/components/commit/commit_form.vue +++ b/app/assets/javascripts/pipeline_editor/components/commit/commit_form.vue @@ -31,6 +31,14 @@ export default { required: false, default: '', }, + hasUnsavedChanges: { + type: Boolean, + required: true, + }, + isNewCiConfigFile: { + type: Boolean, + required: true, + }, isSaving: { type: Boolean, required: false, @@ -50,11 +58,14 @@ export default { }; }, computed: { + isCommitFormFilledOut() { + return this.message && this.targetBranch; + }, isCurrentBranchTarget() { return this.targetBranch === this.currentBranch; }, - submitDisabled() { - return !(this.message && this.targetBranch); + isSubmitDisabled() { + return !this.isCommitFormFilledOut || (!this.hasUnsavedChanges && !this.isNewCiConfigFile); }, }, watch: { @@ -143,7 +154,7 @@ export default { category="primary" variant="confirm" data-qa-selector="commit_changes_button" - :disabled="submitDisabled" + :disabled="isSubmitDisabled" :loading="isSaving" > {{ $options.i18n.commitChanges }} diff --git a/app/assets/javascripts/pipeline_editor/components/commit/commit_section.vue b/app/assets/javascripts/pipeline_editor/components/commit/commit_section.vue index 8ff1aea020f..4ef598d6ff3 100644 --- a/app/assets/javascripts/pipeline_editor/components/commit/commit_section.vue +++ b/app/assets/javascripts/pipeline_editor/components/commit/commit_section.vue @@ -37,6 +37,10 @@ export default { required: false, default: '', }, + hasUnsavedChanges: { + type: Boolean, + required: true, + }, isNewCiConfigFile: { type: Boolean, required: false, @@ -151,6 +155,8 @@ export default { <commit-form :current-branch="currentBranch" :default-message="defaultCommitMessage" + :has-unsaved-changes="hasUnsavedChanges" + :is-new-ci-config-file="isNewCiConfigFile" :is-saving="isSaving" :scroll-to-commit-form="scrollToCommitForm" v-on="$listeners" diff --git a/app/assets/javascripts/pipeline_editor/pipeline_editor_home.vue b/app/assets/javascripts/pipeline_editor/pipeline_editor_home.vue index bb759477e1e..631dd8a2c00 100644 --- a/app/assets/javascripts/pipeline_editor/pipeline_editor_home.vue +++ b/app/assets/javascripts/pipeline_editor/pipeline_editor_home.vue @@ -131,6 +131,7 @@ export default { :ref="$options.commitSectionRef" :ci-file-content="ciFileContent" :commit-sha="commitSha" + :has-unsaved-changes="hasUnsavedChanges" :is-new-ci-config-file="isNewCiConfigFile" :scroll-to-commit-form="scrollToCommitForm" @scrolled-to-commit-form="setScrollToCommitForm(false)" |