Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
14888a39
Commit
14888a39
authored
Aug 12, 2016
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable commit button if commit message textarea empty.
parent
a1d0b039
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
app/assets/javascripts/merge_conflict_data_provider.js.es6
app/assets/javascripts/merge_conflict_data_provider.js.es6
+8
-2
app/views/projects/merge_requests/conflicts/_submit_form.html.haml
.../projects/merge_requests/conflicts/_submit_form.html.haml
+2
-3
No files found.
app/assets/javascripts/merge_conflict_data_provider.js.es6
View file @
14888a39
...
...
@@ -237,8 +237,14 @@ class MergeConflictDataProvider {
}
isAllResolved() {
return !this.vueInstance.isSubmitting && this.getConflictsCount() === this.getResolvedCount();
isReadyToCommit() {
const { conflictsData, isSubmitting } = this.vueInstance
const allResolved = this.getConflictsCount() === this.getResolvedCount();
const hasCommitMessage = $.trim(conflictsData.commitMessage).length;
return !isSubmitting && hasCommitMessage && allResolved;
}
getCommitButtonText() {
const initial = 'Commit conflict resolution';
...
...
app/views/projects/merge_requests/conflicts/_submit_form.html.haml
View file @
14888a39
...
...
@@ -6,11 +6,10 @@
.commit-message-container.form-group
.max-width-marker
%textarea
.form-control.js-commit-message
{
"
:disabled"
=>
"!allResolved"
,
"
v-model"
=>
"conflictsData.commitMessage"
}
%textarea
.form-control.js-commit-message
{
"v-model"
=>
"conflictsData.commitMessage"
}
{{{conflictsData.commitMessage}}}
%button
{
type:
"button"
,
class:
"btn btn-success js-submit-button"
,
":disabled"
=>
"!allResolved"
,
"@click"
=>
"commit()"
}
%a
.fa.fa-spin.fa-spinner
{
":class"
=>
"{'hidden': !isSubmitting}"
}
%button
{
type:
"button"
,
class:
"btn btn-success js-submit-button"
,
":disabled"
=>
"!readyToCommit"
,
"@click"
=>
"commit()"
}
%span
{{commitButtonText}}
=
link_to
"Cancel"
,
namespace_project_merge_request_path
(
@merge_request
.
project
.
namespace
,
@merge_request
.
project
,
@merge_request
),
class:
"btn btn-cancel"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment