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
2bdf1d9f
Commit
2bdf1d9f
authored
Jul 25, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds after change UX.
parent
3497ba3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
app/assets/javascripts/repo/repo_commit_section.vue
app/assets/javascripts/repo/repo_commit_section.vue
+14
-7
app/assets/javascripts/repo/repo_store.js
app/assets/javascripts/repo/repo_store.js
+1
-0
No files found.
app/assets/javascripts/repo/repo_commit_section.vue
View file @
2bdf1d9f
...
@@ -9,11 +9,6 @@ const RepoCommitSection = {
...
@@ -9,11 +9,6 @@ const RepoCommitSection = {
methods
:
{
methods
:
{
makeCommit
()
{
makeCommit
()
{
// see https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions
// see https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions
// branch string
// commit_message string
// actions[]
// author_email
// author_name
const
branch
=
$
(
"
button.dropdown-menu-toggle
"
).
attr
(
'
data-ref
'
);
const
branch
=
$
(
"
button.dropdown-menu-toggle
"
).
attr
(
'
data-ref
'
);
const
commitMessage
=
this
.
commitMessage
;
const
commitMessage
=
this
.
commitMessage
;
const
actions
=
this
.
changedFiles
.
map
(
f
=>
{
const
actions
=
this
.
changedFiles
.
map
(
f
=>
{
...
@@ -29,8 +24,17 @@ const RepoCommitSection = {
...
@@ -29,8 +24,17 @@ const RepoCommitSection = {
commit_message
:
commitMessage
,
commit_message
:
commitMessage
,
actions
:
actions
,
actions
:
actions
,
}
}
Store
.
submitCommitsLoading
=
true
;
Api
.
commitMultiple
(
Store
.
projectId
,
payload
,
(
data
)
=>
{
Api
.
commitMultiple
(
Store
.
projectId
,
payload
,
(
data
)
=>
{
console
.
log
(
'
got back
'
,
data
);
Store
.
submitCommitsLoading
=
false
;
Flash
(
`Your changes have been committed. Commit
${
data
.
short_id
}
with
${
data
.
stats
.
additions
}
additions,
${
data
.
stats
.
deletions
}
deletions.`
,
'
notice
'
);
console
.
log
(
'
this.changedFiles
'
,
this
.
changedFiles
);
console
.
log
(
'
this.files
'
,
this
.
files
);
this
.
changedFiles
=
[];
this
.
openedFiles
=
[];
this
.
commitMessage
=
''
;
this
.
editMode
=
false
;
$
(
'
html, body
'
).
animate
({
scrollTop
:
0
},
'
fast
'
);
},
Store
.
tempPrivateToken
);
},
Store
.
tempPrivateToken
);
}
}
},
},
...
@@ -107,7 +111,10 @@ export default RepoCommitSection;
...
@@ -107,7 +111,10 @@ export default RepoCommitSection;
</div>
</div>
</div>
</div>
<div
class=
"col-md-offset-4 col-md-4"
>
<div
class=
"col-md-offset-4 col-md-4"
>
<button
type=
"submit"
:disabled=
"!commitMessage"
class=
"btn btn-success"
@
click.prevent=
"makeCommit"
>
Commit
{{
changedFiles
.
length
}}
Files
</button>
<button
type=
"submit"
:disabled=
"!commitMessage || submitCommitsLoading"
class=
"btn btn-success"
@
click.prevent=
"makeCommit"
>
<i
class=
"fa fa-spinner fa-spin"
v-if=
"submitCommitsLoading"
></i>
<span>
Commit
{{
changedFiles
.
length
}}
Files
</span>
</button>
</div>
</div>
</fieldset>
</fieldset>
</form>
</form>
...
...
app/assets/javascripts/repo/repo_store.js
View file @
2bdf1d9f
...
@@ -23,6 +23,7 @@ const RepoStore = {
...
@@ -23,6 +23,7 @@ const RepoStore = {
minTabSize
:
30
,
minTabSize
:
30
,
tabsOverflow
:
41
,
tabsOverflow
:
41
,
tempPrivateToken
:
''
,
tempPrivateToken
:
''
,
submitCommitsLoading
:
false
,
activeFile
:
{
activeFile
:
{
active
:
true
,
active
:
true
,
binary
:
false
,
binary
:
false
,
...
...
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