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
0da213c9
Commit
0da213c9
authored
Feb 07, 2017
by
Ruben Davila
Browse files
Options
Browse Files
Download
Plain Diff
Merge CE/master into ce-to-ee
parents
9c1deaf9
980ffa20
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
138 additions
and
15 deletions
+138
-15
app/assets/javascripts/sidebar.js.es6
app/assets/javascripts/sidebar.js.es6
+12
-11
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+4
-4
changelogs/unreleased/27822-default-bulk-assign-labels.yml
changelogs/unreleased/27822-default-bulk-assign-labels.yml
+4
-0
changelogs/unreleased/no-sidebar-on-action-btn-click.yml
changelogs/unreleased/no-sidebar-on-action-btn-click.yml
+4
-0
spec/javascripts/fixtures/projects.rb
spec/javascripts/fixtures/projects.rb
+28
-0
spec/javascripts/project_dashboard_spec.js.es6
spec/javascripts/project_dashboard_spec.js.es6
+86
-0
No files found.
app/assets/javascripts/sidebar.js.es6
View file @
0da213c9
/* eslint-disable arrow-parens, class-methods-use-this, no-param-reassign */
/* global Cookies */
((global) => {
let singleton;
(() => {
const pinnedStateCookie = 'pin_nav';
const sidebarBreakpoint = 1024;
...
...
@@ -23,11 +21,12 @@
class Sidebar {
constructor() {
if (!singleton) {
singleton = this;
singleton.init();
if (!
Sidebar.
singleton) {
Sidebar.
singleton = this;
Sidebar.
singleton.init();
}
return singleton;
return Sidebar.singleton;
}
init() {
...
...
@@ -39,7 +38,7 @@
$(document)
.on('click', sidebarToggleSelector, () => this.toggleSidebar())
.on('click', pinnedToggleSelector, () => this.togglePinnedState())
.on('click', 'html, body', (e) => this.handleClickEvent(e))
.on('click', 'html, body
, a, button
', (e) => this.handleClickEvent(e))
.on('DOMContentLoaded', () => this.renderState())
.on('todo:toggle', (e, count) => this.updateTodoCount(count));
this.renderState();
...
...
@@ -88,10 +87,12 @@
$pinnedToggle.attr('title', tooltipText).tooltip('fixTitle').tooltip(tooltipState);
if (this.isExpanded) {
setTimeout(() => $(sidebarContentSelector).niceScroll().updateScrollBar(), 200);
const sidebarContent = $(sidebarContentSelector);
setTimeout(() => { sidebarContent.niceScroll().updateScrollBar(); }, 200);
}
}
}
global.Sidebar = Sidebar;
})(window.gl || (window.gl = {}));
window.gl = window.gl || {};
gl.Sidebar = Sidebar;
})();
app/views/shared/issuable/_filter.html.haml
View file @
0da213c9
...
...
@@ -54,7 +54,7 @@
.issues_bulk_update.hide
=
form_tag
[
:bulk_update
,
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
type
],
method: :post
,
class:
'bulk-update'
do
.filter-item.inline
=
dropdown_tag
(
"Status"
,
options:
{
toggle_class:
"js-issue-status"
,
title:
"Change status"
,
dropdown_class:
"dropdown-menu-status dropdown-menu-selectable"
,
data:
{
field_name:
"update[state_event]"
}
}
)
do
=
dropdown_tag
(
"Status"
,
options:
{
toggle_class:
"js-issue-status"
,
title:
"Change status"
,
dropdown_class:
"dropdown-menu-status dropdown-menu-selectable"
,
data:
{
field_name:
"update[state_event]"
,
default_label:
"Status"
}
}
)
do
%ul
%li
%a
{
href:
"#"
,
data:
{
id:
"reopen"
}
}
Open
...
...
@@ -62,13 +62,13 @@
%a
{
href:
"#"
,
data:
{
id:
"close"
}
}
Closed
.filter-item.inline
=
dropdown_tag
(
"Assignee"
,
options:
{
toggle_class:
"js-user-search js-update-assignee js-filter-submit js-filter-bulk-update"
,
title:
"Assign to"
,
filter:
true
,
dropdown_class:
"dropdown-menu-user dropdown-menu-selectable"
,
placeholder:
"Search authors"
,
data:
{
first_user:
(
current_user
.
username
if
current_user
),
null_user:
true
,
current_user:
true
,
project_id:
@project
.
id
,
field_name:
"update[assignee_id]"
}
})
placeholder:
"Search authors"
,
data:
{
first_user:
(
current_user
.
username
if
current_user
),
null_user:
true
,
current_user:
true
,
project_id:
@project
.
id
,
field_name:
"update[assignee_id]"
,
default_label:
"Assignee"
}
})
.filter-item.inline
=
dropdown_tag
(
"Milestone"
,
options:
{
title:
"Assign milestone"
,
toggle_class:
'js-milestone-select js-extra-options js-filter-submit js-filter-bulk-update'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable dropdown-menu-milestone"
,
placeholder:
"Search milestones"
,
data:
{
show_no:
true
,
field_name:
"update[milestone_id]"
,
project_id:
@project
.
id
,
milestones:
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:json
),
use_id:
true
}
})
=
dropdown_tag
(
"Milestone"
,
options:
{
title:
"Assign milestone"
,
toggle_class:
'js-milestone-select js-extra-options js-filter-submit js-filter-bulk-update'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable dropdown-menu-milestone"
,
placeholder:
"Search milestones"
,
data:
{
show_no:
true
,
field_name:
"update[milestone_id]"
,
default_label:
"Milestone"
,
project_id:
@project
.
id
,
milestones:
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:json
),
use_id:
true
}
})
.filter-item.inline.labels-filter
=
render
"shared/issuable/label_dropdown"
,
classes:
[
'js-filter-bulk-update'
,
'js-multiselect'
],
dropdown_title:
'Apply a label'
,
show_create:
false
,
show_footer:
false
,
extra_options:
false
,
filter_submit:
false
,
data_options:
{
persist_when_hide:
"true"
,
field_name:
"update[label_ids][]"
,
show_no:
false
,
show_any:
false
,
use_id:
true
}
.filter-item.inline
=
dropdown_tag
(
"Subscription"
,
options:
{
toggle_class:
"js-subscription-event"
,
title:
"Change subscription"
,
dropdown_class:
"dropdown-menu-selectable"
,
data:
{
field_name:
"update[subscription_event]"
}
}
)
do
=
dropdown_tag
(
"Subscription"
,
options:
{
toggle_class:
"js-subscription-event"
,
title:
"Change subscription"
,
dropdown_class:
"dropdown-menu-selectable"
,
data:
{
field_name:
"update[subscription_event]"
,
default_label:
"Subscription"
}
}
)
do
%ul
%li
%a
{
href:
"#"
,
data:
{
id:
"subscribe"
}
}
Subscribe
...
...
changelogs/unreleased/27822-default-bulk-assign-labels.yml
0 → 100644
View file @
0da213c9
---
title
:
Add default labels to bulk assign dropdowns
merge_request
:
author
:
changelogs/unreleased/no-sidebar-on-action-btn-click.yml
0 → 100644
View file @
0da213c9
---
title
:
dismiss sidebar on repo buttons click
merge_request
:
8798
author
:
Adam Pahlevi
spec/javascripts/fixtures/projects.rb
0 → 100644
View file @
0da213c9
require
'spec_helper'
describe
ProjectsController
,
'(JavaScript fixtures)'
,
type: :controller
do
include
JavaScriptFixturesHelpers
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:namespace
)
{
create
(
:namespace
,
name:
'frontend-fixtures'
)}
let
(
:project
)
{
create
(
:project
,
namespace:
namespace
,
path:
'builds-project'
)
}
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'projects/'
)
end
before
(
:each
)
do
sign_in
(
admin
)
end
it
'projects/dashboard.html.raw'
do
|
example
|
get
:show
,
namespace_id:
project
.
namespace
.
to_param
,
id:
project
.
to_param
expect
(
response
).
to
be_success
store_frontend_fixture
(
response
,
example
.
description
)
end
end
spec/javascripts/project_dashboard_spec.js.es6
0 → 100644
View file @
0da213c9
require('~/sidebar');
(() => {
describe('Project dashboard page', () => {
let $pageWithSidebar = null;
let $sidebarToggle = null;
let sidebar = null;
const fixtureTemplate = 'projects/dashboard.html.raw';
const assertSidebarStateExpanded = (shouldBeExpanded) => {
expect(sidebar.isExpanded).toBe(shouldBeExpanded);
expect($pageWithSidebar.hasClass('page-sidebar-expanded')).toBe(shouldBeExpanded);
};
preloadFixtures(fixtureTemplate);
beforeEach(() => {
loadFixtures(fixtureTemplate);
$pageWithSidebar = $('.page-with-sidebar');
$sidebarToggle = $('.toggle-nav-collapse');
// otherwise instantiating the Sidebar for the second time
// won't do anything, as the Sidebar is a singleton class
gl.Sidebar.singleton = null;
sidebar = new gl.Sidebar();
});
it('can show the sidebar when the toggler is clicked', () => {
assertSidebarStateExpanded(false);
$sidebarToggle.click();
assertSidebarStateExpanded(true);
});
it('should dismiss the sidebar when clone button clicked', () => {
$sidebarToggle.click();
assertSidebarStateExpanded(true);
const cloneButton = $('.project-clone-holder a.clone-dropdown-btn');
cloneButton.click();
assertSidebarStateExpanded(false);
});
it('should dismiss the sidebar when download button clicked', () => {
$sidebarToggle.click();
assertSidebarStateExpanded(true);
const downloadButton = $('.project-action-button .btn:has(i.fa-download)');
downloadButton.click();
assertSidebarStateExpanded(false);
});
it('should dismiss the sidebar when add button clicked', () => {
$sidebarToggle.click();
assertSidebarStateExpanded(true);
const addButton = $('.project-action-button .btn:has(i.fa-plus)');
addButton.click();
assertSidebarStateExpanded(false);
});
it('should dismiss the sidebar when notification button clicked', () => {
$sidebarToggle.click();
assertSidebarStateExpanded(true);
const notifButton = $('.js-notification-toggle-btns .notifications-btn');
notifButton.click();
assertSidebarStateExpanded(false);
});
it('should dismiss the sidebar when clicking on the body', () => {
$sidebarToggle.click();
assertSidebarStateExpanded(true);
$('body').click();
assertSidebarStateExpanded(false);
});
it('should dismiss the sidebar when clicking on the project description header', () => {
$sidebarToggle.click();
assertSidebarStateExpanded(true);
$('.project-home-panel').click();
assertSidebarStateExpanded(false);
});
});
})();
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