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
Jérome Perrin
gitlab-ce
Commits
563c7de5
Commit
563c7de5
authored
Sep 06, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api js changes not needed for CE
parent
feffc3ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
31 deletions
+2
-31
app/assets/javascripts/api.js
app/assets/javascripts/api.js
+2
-10
spec/javascripts/api_spec.js
spec/javascripts/api_spec.js
+0
-21
No files found.
app/assets/javascripts/api.js
View file @
563c7de5
...
...
@@ -6,8 +6,7 @@ const Api = {
namespacesPath
:
'
/api/:version/namespaces.json
'
,
groupProjectsPath
:
'
/api/:version/groups/:id/projects.json
'
,
projectsPath
:
'
/api/:version/projects.json
'
,
projectLabelsPath
:
'
/:namespace_path/:project_path/labels
'
,
groupLabelsPath
:
'
/groups/:namespace_path/labels
'
,
labelsPath
:
'
/:namespace_path/:project_path/labels
'
,
licensePath
:
'
/api/:version/templates/licenses/:key
'
,
gitignorePath
:
'
/api/:version/templates/gitignores/:key
'
,
gitlabCiYmlPath
:
'
/api/:version/templates/gitlab_ci_ymls/:key
'
,
...
...
@@ -75,14 +74,7 @@ const Api = {
},
newLabel
(
namespacePath
,
projectPath
,
data
,
callback
)
{
let
url
;
if
(
projectPath
)
{
url
=
Api
.
buildUrl
(
Api
.
projectLabelsPath
)
.
replace
(
'
:namespace_path
'
,
namespacePath
)
.
replace
(
'
:project_path
'
,
projectPath
);
}
else
{
url
=
Api
.
buildUrl
(
Api
.
groupLabelsPath
).
replace
(
'
:namespace_path
'
,
namespacePath
);
}
const
url
=
Api
.
buildUrl
(
Api
.
labelsPath
);
return
$
.
ajax
({
url
,
type
:
'
POST
'
,
...
...
spec/javascripts/api_spec.js
View file @
563c7de5
...
...
@@ -167,27 +167,6 @@ describe('Api', () => {
done
();
});
});
it
(
'
creates a new group label
'
,
(
done
)
=>
{
const
namespace
=
'
some namespace
'
;
const
labelData
=
{
some
:
'
data
'
};
const
expectedUrl
=
`
${
dummyUrlRoot
}
/
${
namespace
}
/labels`
;
const
expectedData
=
{
label
:
labelData
,
};
spyOn
(
jQuery
,
'
ajax
'
).
and
.
callFake
((
request
)
=>
{
expect
(
request
.
url
).
toEqual
(
expectedUrl
);
expect
(
request
.
dataType
).
toEqual
(
'
json
'
);
expect
(
request
.
type
).
toEqual
(
'
POST
'
);
expect
(
request
.
data
).
toEqual
(
expectedData
);
return
sendDummyResponse
();
});
Api
.
newLabel
(
namespace
,
null
,
labelData
,
(
response
)
=>
{
expect
(
response
).
toBe
(
dummyResponse
);
done
();
});
});
});
describe
(
'
groupProjects
'
,
()
=>
{
...
...
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