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
28d6fd18
Commit
28d6fd18
authored
Jul 25, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempts (unsuccessfully) a POST call to make commits.
parent
fcd23d55
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
3 deletions
+11
-3
app/assets/javascripts/api.js
app/assets/javascripts/api.js
+4
-1
app/assets/javascripts/repo/index.js
app/assets/javascripts/repo/index.js
+1
-0
app/assets/javascripts/repo/repo_commit_section.vue
app/assets/javascripts/repo/repo_commit_section.vue
+4
-1
app/assets/javascripts/repo/repo_store.js
app/assets/javascripts/repo/repo_store.js
+1
-0
app/views/projects/tree/_tree_content.html.haml
app/views/projects/tree/_tree_content.html.haml
+1
-1
No files found.
app/assets/javascripts/api.js
View file @
28d6fd18
...
...
@@ -96,12 +96,15 @@ const Api = {
.
done
(
projects
=>
callback
(
projects
));
},
commitMultiple
(
id
,
data
,
callback
)
{
commitMultiple
(
id
,
data
,
callback
,
token
)
{
// see https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions
const
url
=
Api
.
buildUrl
(
Api
.
commitPath
)
.
replace
(
'
:id
'
,
id
);
return
$
.
ajax
({
url
,
headers
:
{
'
PRIVATE_TOKEN
'
:
token
,
},
type
:
'
POST
'
,
data
:
data
,
dataType
:
'
json
'
,
...
...
app/assets/javascripts/repo/index.js
View file @
28d6fd18
...
...
@@ -21,6 +21,7 @@ function initRepo() {
Store
.
service
.
refsUrl
=
repo
.
dataset
.
refsUrl
;
Store
.
currentBranch
=
$
(
"
button.dropdown-menu-toggle
"
).
attr
(
'
data-ref
'
);
Store
.
checkIsCommitable
();
Store
.
projectId
=
repo
.
dataset
.
projectId
;
new
Vue
({
el
:
repo
,
...
...
app/assets/javascripts/repo/repo_commit_section.vue
View file @
28d6fd18
<
script
>
import
Vue
from
'
vue
'
;
import
Store
from
'
./repo_store
'
;
import
Api
from
'
../api
'
const
RepoCommitSection
=
{
data
:
()
=>
Store
,
...
...
@@ -28,7 +29,9 @@ const RepoCommitSection = {
commit_message
:
commitMessage
,
actions
:
actions
,
}
console
.
log
(
branch
,
commitMessage
,
actions
);
Api
.
commitMultiple
(
Store
.
projectId
,
payload
,
(
data
)
=>
{
console
.
log
(
'
got back
'
,
data
);
})
}
},
...
...
app/assets/javascripts/repo/repo_store.js
View file @
28d6fd18
...
...
@@ -10,6 +10,7 @@ const RepoStore = {
editMode
:
false
,
isTree
:
false
,
prevURL
:
''
,
projectId
:
''
,
projectName
:
''
,
trees
:
[],
blobs
:
[],
...
...
app/views/projects/tree/_tree_content.html.haml
View file @
28d6fd18
#repo
{
data:
{
url:
repo_url
(
@project
),
'project-name'
=>
@project
.
name
,
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
,
format:
"json"
),
project_url:
namespace_project_path
(
@project
.
namespace
,
@project
)
}
}
#repo
{
data:
{
url:
repo_url
(
@project
),
'project-name'
=>
@project
.
name
,
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
,
format:
"json"
),
project_url:
namespace_project_path
(
@project
.
namespace
,
@project
)
,
project_id:
@project
.
id
}
}
-
if
can_edit_tree?
=
render
'projects/blob/upload'
,
title:
_
(
'Upload New File'
),
placeholder:
_
(
'Upload New File'
),
button_title:
_
(
'Upload file'
),
form_path:
project_create_blob_path
(
@project
,
@id
),
method: :post
...
...
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