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
8ce8303f
Commit
8ce8303f
authored
Dec 05, 2018
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add projectRunners to api.js
- This is needed by the Web Terminal to check environment
parent
83a95a02
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
app/assets/javascripts/api.js
app/assets/javascripts/api.js
+10
-0
spec/javascripts/api_spec.js
spec/javascripts/api_spec.js
+17
-0
No files found.
app/assets/javascripts/api.js
View file @
8ce8303f
...
...
@@ -14,6 +14,7 @@ const Api = {
projectMergeRequestPath
:
'
/api/:version/projects/:id/merge_requests/:mrid
'
,
projectMergeRequestChangesPath
:
'
/api/:version/projects/:id/merge_requests/:mrid/changes
'
,
projectMergeRequestVersionsPath
:
'
/api/:version/projects/:id/merge_requests/:mrid/versions
'
,
projectRunnersPath
:
'
/api/:version/projects/:id/runners
'
,
mergeRequestsPath
:
'
/api/:version/merge_requests
'
,
groupLabelsPath
:
'
/groups/:namespace_path/-/labels
'
,
issuableTemplatePath
:
'
/:namespace_path/:project_path/templates/:type/:key
'
,
...
...
@@ -124,6 +125,15 @@ const Api = {
return
axios
.
get
(
url
);
},
projectRunners
(
projectPath
,
config
=
{})
{
const
url
=
Api
.
buildUrl
(
Api
.
projectRunnersPath
).
replace
(
'
:id
'
,
encodeURIComponent
(
projectPath
),
);
return
axios
.
get
(
url
,
config
);
},
mergeRequests
(
params
=
{})
{
const
url
=
Api
.
buildUrl
(
Api
.
mergeRequestsPath
);
...
...
spec/javascripts/api_spec.js
View file @
8ce8303f
...
...
@@ -180,6 +180,23 @@ describe('Api', () => {
});
});
describe
(
'
projectRunners
'
,
()
=>
{
it
(
'
fetches the runners of a project
'
,
done
=>
{
const
projectPath
=
7
;
const
params
=
{
scope
:
'
active
'
};
const
mockData
=
[{
id
:
4
}];
const
expectedUrl
=
`
${
dummyUrlRoot
}
/api/
${
dummyApiVersion
}
/projects/
${
projectPath
}
/runners`
;
mock
.
onGet
(
expectedUrl
,
{
params
}).
reply
(
200
,
mockData
);
Api
.
projectRunners
(
projectPath
,
{
params
})
.
then
(({
data
})
=>
{
expect
(
data
).
toEqual
(
mockData
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
describe
(
'
newLabel
'
,
()
=>
{
it
(
'
creates a new label
'
,
done
=>
{
const
namespace
=
'
some namespace
'
;
...
...
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