BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d0f5b3c2
Commit
d0f5b3c2
authored
Sep 05, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '35010-remove-goto-project-from-breadcrumb' into 'master'
Remove project select dropdown from breadcrumb Closes #35010 See merge request !14010
parents
e0f28e09
29ff4aa0
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
7 additions
and
164 deletions
+7
-164
project.js
app/assets/javascripts/project.js
+0
-4
project_select.js
app/assets/javascripts/project_select.js
+0
-42
projects_helper.rb
app/helpers/projects_helper.rb
+0
-6
project.html.haml
app/views/layouts/project.html.haml
+0
-8
35010-remove-goto-project-from-breadcrumb.yml
.../unreleased/35010-remove-goto-project-from-breadcrumb.yml
+5
-0
projects_spec.rb
spec/features/projects_spec.rb
+0
-43
project_title_spec.js
spec/javascripts/project_title_spec.js
+0
-60
projects_service_spec.js
...cripts/projects_dropdown/service/projects_service_spec.js
+2
-1
No files found.
app/assets/javascripts/project.js
View file @
d0f5b3c2
...
...
@@ -53,10 +53,6 @@ import Cookies from 'js-cookie';
return
_this
.
changeProject
(
$
(
e
.
currentTarget
).
val
());
};
})(
this
));
return
$
(
'.js-projects-dropdown-toggle'
).
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
return
$
(
'.js-projects-dropdown'
).
select2
(
'open'
);
});
};
Project
.
prototype
.
changeProject
=
function
(
url
)
{
...
...
app/assets/javascripts/project_select.js
View file @
d0f5b3c2
...
...
@@ -5,48 +5,6 @@ import ProjectSelectComboButton from './project_select_combo_button';
(
function
()
{
this
.
ProjectSelect
=
(
function
()
{
function
ProjectSelect
()
{
$
(
'.js-projects-dropdown-toggle'
).
each
(
function
(
i
,
dropdown
)
{
var
$dropdown
;
$dropdown
=
$
(
dropdown
);
return
$dropdown
.
glDropdown
({
filterable
:
true
,
filterRemote
:
true
,
search
:
{
fields
:
[
'name_with_namespace'
]
},
data
:
function
(
term
,
callback
)
{
var
finalCallback
,
projectsCallback
;
var
orderBy
=
$dropdown
.
data
(
'order-by'
);
finalCallback
=
function
(
projects
)
{
return
callback
(
projects
);
};
if
(
this
.
includeGroups
)
{
projectsCallback
=
function
(
projects
)
{
var
groupsCallback
;
groupsCallback
=
function
(
groups
)
{
var
data
;
data
=
groups
.
concat
(
projects
);
return
finalCallback
(
data
);
};
return
Api
.
groups
(
term
,
{},
groupsCallback
);
};
}
else
{
projectsCallback
=
finalCallback
;
}
if
(
this
.
groupId
)
{
return
Api
.
groupProjects
(
this
.
groupId
,
term
,
projectsCallback
);
}
else
{
return
Api
.
projects
(
term
,
{
order_by
:
orderBy
},
projectsCallback
);
}
},
url
:
function
(
project
)
{
return
project
.
web_url
;
},
text
:
function
(
project
)
{
return
project
.
name_with_namespace
;
}
});
});
$
(
'.ajax-project-select'
).
each
(
function
(
i
,
select
)
{
var
placeholder
;
this
.
groupId
=
$
(
select
).
data
(
'group-id'
);
...
...
app/helpers/projects_helper.rb
View file @
d0f5b3c2
...
...
@@ -72,12 +72,6 @@ module ProjectsHelper
output
.
html_safe
end
if
current_user
project_link
<<
button_tag
(
type:
'button'
,
class:
'dropdown-toggle-caret js-projects-dropdown-toggle'
,
aria:
{
label:
'Toggle switch project dropdown'
},
data:
{
target:
'.js-dropdown-menu-projects'
,
toggle:
'dropdown'
,
order_by:
'last_activity_at'
})
do
icon
(
"chevron-down"
)
end
end
"
#{
namespace_link
}
/
#{
project_link
}
"
.
html_safe
end
...
...
app/views/layouts/project.html.haml
View file @
d0f5b3c2
...
...
@@ -14,12 +14,4 @@
:javascript
window
.
uploads_path
=
"
#{
project_uploads_path
(
project
)
}
"
;
-
content_for
:header_content
do
.js-dropdown-menu-projects
.dropdown-menu.dropdown-select.dropdown-menu-projects
=
dropdown_title
(
"Go to a project"
)
=
dropdown_filter
(
"Search your projects"
)
=
dropdown_content
=
dropdown_loading
=
render
template:
"layouts/application"
changelogs/unreleased/35010-remove-goto-project-from-breadcrumb.yml
0 → 100644
View file @
d0f5b3c2
---
title
:
Remove project select dropdown from breadcrumb
merge_request
:
14010
author
:
type
:
changed
spec/features/projects_spec.rb
View file @
d0f5b3c2
...
...
@@ -95,49 +95,6 @@ feature 'Project' do
end
end
describe
'project title'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
before
do
sign_in
(
user
)
project
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
visit
project_path
(
project
)
end
it
'clicks toggle and shows dropdown'
,
js:
true
do
find
(
'.js-projects-dropdown-toggle'
).
click
expect
(
page
).
to
have_css
(
'.dropdown-menu-projects .dropdown-content li'
,
count:
1
)
end
end
describe
'project title'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:project2
)
{
create
(
:project
,
namespace:
user
.
namespace
,
path:
'test'
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
context
'on issues page'
,
js:
true
do
before
do
sign_in
(
user
)
project
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
project2
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
visit
project_issue_path
(
project
,
issue
)
end
it
'clicks toggle and shows dropdown'
do
find
(
'.js-projects-dropdown-toggle'
).
click
expect
(
page
).
to
have_css
(
'.dropdown-menu-projects .dropdown-content li'
,
count:
2
)
page
.
within
'.dropdown-menu-projects'
do
click_link
project
.
name_with_namespace
end
expect
(
page
).
to
have_content
project
.
name
end
end
end
describe
'tree view (default view is set to Files)'
do
let
(
:user
)
{
create
(
:user
,
project_view:
'files'
)
}
let
(
:project
)
{
create
(
:forked_project_with_submodules
)
}
...
...
spec/javascripts/project_title_spec.js
deleted
100644 → 0
View file @
e0f28e09
/* global Project */
import
'select2/select2'
;
import
'~/gl_dropdown'
;
import
'~/api'
;
import
'~/project_select'
;
import
'~/project'
;
describe
(
'Project Title'
,
()
=>
{
const
dummyApiVersion
=
'v3000'
;
preloadFixtures
(
'issues/open-issue.html.raw'
);
loadJSONFixtures
(
'projects.json'
);
beforeEach
(()
=>
{
loadFixtures
(
'issues/open-issue.html.raw'
);
window
.
gon
=
{};
window
.
gon
.
api_version
=
dummyApiVersion
;
// eslint-disable-next-line no-new
new
Project
();
});
describe
(
'project list'
,
()
=>
{
let
reqUrl
;
let
reqData
;
beforeEach
(()
=>
{
const
fakeResponseData
=
getJSONFixture
(
'projects.json'
);
spyOn
(
jQuery
,
'ajax'
).
and
.
callFake
((
req
)
=>
{
const
def
=
$
.
Deferred
();
reqUrl
=
req
.
url
;
reqData
=
req
.
data
;
def
.
resolve
(
fakeResponseData
);
return
def
.
promise
();
});
});
it
(
'toggles dropdown'
,
()
=>
{
const
$menu
=
$
(
'.js-dropdown-menu-projects'
);
window
.
gon
.
current_user_id
=
1
;
$
(
'.js-projects-dropdown-toggle'
).
click
();
expect
(
$menu
).
toHaveClass
(
'open'
);
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'
);
});
});
afterEach
(()
=>
{
window
.
gon
=
{};
});
});
spec/javascripts/projects_dropdown/service/projects_service_spec.js
View file @
d0f5b3c2
...
...
@@ -15,6 +15,7 @@ describe('ProjectsService', () => {
beforeEach
(()
=>
{
gon
.
api_version
=
currentSession
.
apiVersion
;
gon
.
current_user_id
=
1
;
service
=
new
ProjectsService
(
currentSession
.
username
);
});
...
...
@@ -35,7 +36,7 @@ describe('ProjectsService', () => {
const
queryParams
=
{
simple
:
false
,
per_page
:
20
,
membership
:
fals
e
,
membership
:
tru
e
,
order_by
:
'last_activity_at'
,
search
:
searchQuery
,
};
...
...
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