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
c47e1c39
Commit
c47e1c39
authored
Sep 04, 2017
by
kushalpandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make query param `simple` part of config
parent
365adfa5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
app/assets/javascripts/api.js
app/assets/javascripts/api.js
+2
-1
spec/javascripts/api_spec.js
spec/javascripts/api_spec.js
+4
-2
spec/javascripts/project_title_spec.js
spec/javascripts/project_title_spec.js
+2
-1
No files found.
app/assets/javascripts/api.js
View file @
c47e1c39
...
...
@@ -5,7 +5,7 @@ const Api = {
groupPath
:
'
/api/:version/groups/:id.json
'
,
namespacesPath
:
'
/api/:version/namespaces.json
'
,
groupProjectsPath
:
'
/api/:version/groups/:id/projects.json
'
,
projectsPath
:
'
/api/:version/projects.json
?simple=true
'
,
projectsPath
:
'
/api/:version/projects.json
'
,
labelsPath
:
'
/:namespace_path/:project_path/labels
'
,
licensePath
:
'
/api/:version/templates/licenses/:key
'
,
gitignorePath
:
'
/api/:version/templates/gitignores/:key
'
,
...
...
@@ -58,6 +58,7 @@ const Api = {
const
defaults
=
{
search
:
query
,
per_page
:
20
,
simple
:
true
,
};
if
(
gon
.
current_user_id
)
{
...
...
spec/javascripts/api_spec.js
View file @
c47e1c39
...
...
@@ -101,12 +101,13 @@ describe('Api', () => {
it
(
'
fetches projects with membership when logged in
'
,
(
done
)
=>
{
const
query
=
'
dummy query
'
;
const
options
=
{
unused
:
'
option
'
};
const
expectedUrl
=
`
${
dummyUrlRoot
}
/api/
${
dummyApiVersion
}
/projects.json
?simple=true
`
;
const
expectedUrl
=
`
${
dummyUrlRoot
}
/api/
${
dummyApiVersion
}
/projects.json`
;
window
.
gon
.
current_user_id
=
1
;
const
expectedData
=
Object
.
assign
({
search
:
query
,
per_page
:
20
,
membership
:
true
,
simple
:
true
,
},
options
);
spyOn
(
jQuery
,
'
ajax
'
).
and
.
callFake
((
request
)
=>
{
expect
(
request
.
url
).
toEqual
(
expectedUrl
);
...
...
@@ -124,10 +125,11 @@ describe('Api', () => {
it
(
'
fetches projects without membership when not logged in
'
,
(
done
)
=>
{
const
query
=
'
dummy query
'
;
const
options
=
{
unused
:
'
option
'
};
const
expectedUrl
=
`
${
dummyUrlRoot
}
/api/
${
dummyApiVersion
}
/projects.json
?simple=true
`
;
const
expectedUrl
=
`
${
dummyUrlRoot
}
/api/
${
dummyApiVersion
}
/projects.json`
;
const
expectedData
=
Object
.
assign
({
search
:
query
,
per_page
:
20
,
simple
:
true
,
},
options
);
spyOn
(
jQuery
,
'
ajax
'
).
and
.
callFake
((
request
)
=>
{
expect
(
request
.
url
).
toEqual
(
expectedUrl
);
...
...
spec/javascripts/project_title_spec.js
View file @
c47e1c39
...
...
@@ -41,12 +41,13 @@ describe('Project Title', () => {
window
.
gon
.
current_user_id
=
1
;
$
(
'
.js-projects-dropdown-toggle
'
).
click
();
expect
(
$menu
).
toHaveClass
(
'
open
'
);
expect
(
reqUrl
).
toBe
(
`/api/
${
dummyApiVersion
}
/projects.json
?simple=true
`
);
expect
(
reqUrl
).
toBe
(
`/api/
${
dummyApiVersion
}
/projects.json`
);
expect
(
reqData
).
toEqual
({
search
:
''
,
order_by
:
'
last_activity_at
'
,
per_page
:
20
,
membership
:
true
,
simple
:
true
,
});
$menu
.
find
(
'
.dropdown-menu-close-icon
'
).
click
();
expect
(
$menu
).
not
.
toHaveClass
(
'
open
'
);
...
...
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