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
f0a16fbd
Commit
f0a16fbd
authored
Mar 01, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Admin Emails] The frontend should use the v3 API for now
parent
aa367df9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
app/assets/javascripts/admin_email_select.js
app/assets/javascripts/admin_email_select.js
+2
-1
app/assets/javascripts/api.js
app/assets/javascripts/api.js
+19
-0
No files found.
app/assets/javascripts/admin_email_select.js
View file @
f0a16fbd
...
...
@@ -17,7 +17,8 @@
group_result
=
Api
.
groups
(
query
.
term
,
{},
function
(
groups
)
{
return
groups
;
});
project_result
=
Api
.
projects
(
query
.
term
,
'
id
'
,
function
(
projects
)
{
// Should be replaced with "Api.projects" when API v4 is frozen (9.1)
project_result
=
Api
.
allProjects
(
query
.
term
,
'
id
'
,
function
(
projects
)
{
return
projects
;
});
return
$
.
when
(
project_result
,
group_result
).
done
(
function
(
projects
,
groups
)
{
...
...
app/assets/javascripts/api.js
View file @
f0a16fbd
...
...
@@ -7,6 +7,7 @@
namespacesPath
:
"
/api/:version/namespaces.json
"
,
groupProjectsPath
:
"
/api/:version/groups/:id/projects.json
"
,
projectsPath
:
"
/api/:version/projects.json?simple=true
"
,
allProjectsPath
:
"
/api/:version/projects/all.json?simple=true
"
,
// Deprecated. Valid for API v3 only.
labelsPath
:
"
/:namespace_path/:project_path/labels
"
,
licensePath
:
"
/api/:version/templates/licenses/:key
"
,
gitignorePath
:
"
/api/:version/templates/gitignores/:key
"
,
...
...
@@ -67,6 +68,24 @@
return
callback
(
projects
);
});
},
// Deprecated and should be deleted for 9.1
// Also the 'Api.allProjectsPath' should be deleted as well.
// Basically, the whole commit that adds this comment should be reverted when API v4 is frozen (9.1)
// Details here: https://gitlab.com/gitlab-org/gitlab-ce/issues/28853#note_24410695
allProjects
:
function
(
query
,
order
,
callback
)
{
var
url
=
Api
.
buildUrl
(
Api
.
allProjectsPath
);
return
$
.
ajax
({
url
:
url
,
data
:
{
search
:
query
,
order_by
:
order
,
per_page
:
20
},
dataType
:
"
json
"
}).
done
(
function
(
projects
)
{
return
callback
(
projects
);
});
},
newLabel
:
function
(
namespace_path
,
project_path
,
data
,
callback
)
{
var
url
=
Api
.
buildUrl
(
Api
.
labelsPath
)
.
replace
(
'
:namespace_path
'
,
namespace_path
)
...
...
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