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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
67a6b171
Commit
67a6b171
authored
Aug 14, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Format and remove unused cruft
parent
0c8c9543
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
22 deletions
+50
-22
app/assets/javascripts/repo/components/repo_commit_section.vue
...ssets/javascripts/repo/components/repo_commit_section.vue
+50
-22
No files found.
app/assets/javascripts/repo/components/repo_commit_section.vue
View file @
67a6b171
...
...
@@ -17,7 +17,6 @@ const RepoCommitSection = {
},
branchPaths
()
{
const
branch
=
this
.
currentBranch
;
return
this
.
changedFiles
.
map
(
f
=>
f
.
path
);
},
...
...
@@ -33,15 +32,12 @@ const RepoCommitSection = {
methods
:
{
makeCommit
()
{
// see https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions
const
branch
=
Store
.
currentBranch
;
const
commitMessage
=
this
.
commitMessage
;
const
actions
=
this
.
changedFiles
.
map
(
f
=>
{
return
{
action
:
'
update
'
,
file_path
:
f
.
path
,
content
:
f
.
newContent
,
};
});
const
actions
=
this
.
changedFiles
.
map
(
f
=>
({
action
:
'
update
'
,
file_path
:
f
.
path
,
content
:
f
.
newContent
,
}));
const
payload
=
{
branch
:
Store
.
targetBranch
,
commit_message
:
commitMessage
,
...
...
@@ -54,10 +50,9 @@ const RepoCommitSection = {
resetCommitState
()
{
this
.
submitCommitsLoading
=
false
;
this
.
changedFiles
=
[];
// this.openedFiles = [];
this
.
commitMessage
=
''
;
this
.
editMode
=
false
;
window
.
scrollTo
(
0
,
0
);
window
.
scrollTo
(
0
,
0
);
},
},
};
...
...
@@ -66,35 +61,68 @@ export default RepoCommitSection;
</
script
>
<
template
>
<div
id=
"commit-area"
v-if=
"showCommitable"
>
<form
class=
"form-horizontal"
@
submit.prevent=
"makeCommit"
>
<div
v-if=
"showCommitable"
id=
"commit-area"
>
<form
class=
"form-horizontal"
@
submit.prevent=
"makeCommit"
>
<fieldset>
<div
class=
"form-group"
>
<label
class=
"col-md-4 control-label staged-files"
>
Staged files (
{{
changedFiles
.
length
}}
)
</label>
<label
class=
"col-md-4 control-label staged-files"
>
Staged files (
{{
changedFiles
.
length
}}
)
</label>
<div
class=
"col-md-6"
>
<ul
class=
"list-unstyled changed-files"
>
<li
v-for=
"file in branchPaths"
:key=
"file.id"
>
<span
class=
"help-block"
>
{{
file
}}
</span>
<span
class=
"help-block"
>
{{
file
}}
</span>
</li>
</ul>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-md-4 control-label"
for=
"commit-message"
>
Commit message
</label>
<label
class=
"col-md-4 control-label"
for=
"commit-message"
>
Commit message
</label>
<div
class=
"col-md-6"
>
<textarea
class=
"form-control"
id=
"commit-message"
name=
"commit-message"
v-model=
"commitMessage"
></textarea>
<textarea
id=
"commit-message"
class=
"form-control"
name=
"commit-message"
v-model=
"commitMessage"
>
</textarea>
</div>
</div>
<div
class=
"form-group target-branch"
>
<label
class=
"col-md-4 control-label"
for=
"target-branch"
>
Target branch
</label>
<label
class=
"col-md-4 control-label"
for=
"target-branch"
>
Target branch
</label>
<div
class=
"col-md-6"
>
<span
class=
"help-block"
>
{{
targetBranch
}}
</span>
<span
class=
"help-block"
>
{{
targetBranch
}}
</span>
</div>
</div>
<div
class=
"col-md-offset-4 col-md-6"
>
<button
type=
"submit"
:disabled=
"cantCommitYet"
class=
"btn btn-success submit-commit"
>
<i
class=
"fa fa-spinner fa-spin"
v-if=
"submitCommitsLoading"
aria-hidden=
"true"
aria-label=
"loading"
></i>
<span
class=
"commit-summary"
>
Commit
{{
changedFiles
.
length
}}
{{
filePluralize
}}
</span>
<button
type=
"submit"
:disabled=
"cantCommitYet"
class=
"btn btn-success submit-commit"
>
<i
v-if=
"submitCommitsLoading"
class=
"fa fa-spinner fa-spin"
aria-hidden=
"true"
aria-label=
"loading"
>
</i>
<span
class=
"commit-summary"
>
Commit
{{
changedFiles
.
length
}}
{{
filePluralize
}}
</span>
</button>
</div>
</fieldset>
...
...
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