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
ab42a638
Commit
ab42a638
authored
Oct 31, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ee-38869-issue' into 'master'
Port of 38869-issue to EE See merge request gitlab-org/gitlab-ee!3232
parents
f0c835e5
0e97c011
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
53 deletions
+40
-53
app/assets/javascripts/header.js
app/assets/javascripts/header.js
+8
-6
app/assets/javascripts/init_legacy_filters.js
app/assets/javascripts/init_legacy_filters.js
+2
-2
app/assets/javascripts/issuable_bulk_update_sidebar.js
app/assets/javascripts/issuable_bulk_update_sidebar.js
+2
-3
app/assets/javascripts/issue.js
app/assets/javascripts/issue.js
+1
-3
app/assets/javascripts/issue_status_select.js
app/assets/javascripts/issue_status_select.js
+23
-34
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+2
-4
spec/javascripts/header_spec.js
spec/javascripts/header_spec.js
+2
-1
No files found.
app/assets/javascripts/header.js
View file @
ab42a638
...
...
@@ -7,10 +7,12 @@ import { highCountTrim } from '~/lib/utils/text_utility';
* @param {jQuery.Event} e
* @param {String} count
*/
$
(
document
).
on
(
'
todo:toggle
'
,
(
e
,
count
)
=>
{
const
parsedCount
=
parseInt
(
count
,
10
);
const
$todoPendingCount
=
$
(
'
.todos-count
'
);
export
default
function
initTodoToggle
()
{
$
(
document
).
on
(
'
todo:toggle
'
,
(
e
,
count
)
=>
{
const
parsedCount
=
parseInt
(
count
,
10
);
const
$todoPendingCount
=
$
(
'
.todos-count
'
);
$todoPendingCount
.
text
(
highCountTrim
(
parsedCount
));
$todoPendingCount
.
toggleClass
(
'
hidden
'
,
parsedCount
===
0
);
});
$todoPendingCount
.
text
(
highCountTrim
(
parsedCount
));
$todoPendingCount
.
toggleClass
(
'
hidden
'
,
parsedCount
===
0
);
});
}
app/assets/javascripts/init_legacy_filters.js
View file @
ab42a638
/* eslint-disable no-new */
/* global LabelsSelect */
/* global MilestoneSelect */
/* global IssueStatusSelect */
/* global SubscriptionSelect */
/* global WeightSelect */
import
UsersSelect
from
'
./users_select
'
;
import
issueStatusSelect
from
'
./issue_status_select
'
;
export
default
()
=>
{
new
UsersSelect
();
new
LabelsSelect
();
new
MilestoneSelect
();
new
I
ssueStatusSelect
();
i
ssueStatusSelect
();
new
SubscriptionSelect
();
new
WeightSelect
();
};
app/assets/javascripts/issuable_bulk_update_sidebar.js
View file @
ab42a638
/* eslint-disable class-methods-use-this, no-new */
/* global LabelsSelect */
/* global MilestoneSelect */
/* global IssueStatusSelect */
/* global SubscriptionSelect */
import
IssuableBulkUpdateActions
from
'
./issuable_bulk_update_actions
'
;
import
'
./milestone_select
'
;
import
'
./issue_status_select
'
;
import
issueStatusSelect
from
'
./issue_status_select
'
;
import
'
./subscription_select
'
;
import
'
./labels_select
'
;
...
...
@@ -49,7 +48,7 @@ export default class IssuableBulkUpdateSidebar {
initDropdowns
()
{
new
LabelsSelect
();
new
MilestoneSelect
();
new
I
ssueStatusSelect
();
i
ssueStatusSelect
();
new
SubscriptionSelect
();
}
...
...
app/assets/javascripts/issue.js
View file @
ab42a638
...
...
@@ -6,7 +6,7 @@ import TaskList from './task_list';
import
CreateMergeRequestDropdown
from
'
./create_merge_request_dropdown
'
;
import
IssuablesHelper
from
'
./helpers/issuables_helper
'
;
class
Issue
{
export
default
class
Issue
{
constructor
()
{
if
(
$
(
'
a.btn-close
'
).
length
)
{
this
.
taskList
=
new
TaskList
({
...
...
@@ -147,5 +147,3 @@ class Issue {
});
}
}
export
default
Issue
;
app/assets/javascripts/issue_status_select.js
View file @
ab42a638
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, quotes, object-shorthand, no-unused-vars, no-shadow, one-var, one-var-declaration-per-line, comma-dangle, max-len */
(
function
()
{
this
.
IssueStatusSelect
=
(
function
()
{
function
IssueStatusSelect
()
{
$
(
'
.js-issue-status
'
).
each
(
function
(
i
,
el
)
{
var
fieldName
;
fieldName
=
$
(
el
).
data
(
"
field-name
"
);
return
$
(
el
).
glDropdown
({
selectable
:
true
,
fieldName
:
fieldName
,
toggleLabel
:
(
function
(
_this
)
{
return
function
(
selected
,
el
,
instance
)
{
var
$item
,
label
;
label
=
'
Author
'
;
$item
=
instance
.
dropdown
.
find
(
'
.is-active
'
);
if
(
$item
.
length
)
{
label
=
$item
.
text
();
}
return
label
;
};
})(
this
),
clicked
:
function
(
options
)
{
return
options
.
e
.
preventDefault
();
},
id
:
function
(
obj
,
el
)
{
return
$
(
el
).
data
(
"
id
"
);
}
});
});
}
return
IssueStatusSelect
;
})();
}).
call
(
window
);
export
default
function
issueStatusSelect
()
{
$
(
'
.js-issue-status
'
).
each
((
i
,
el
)
=>
{
const
fieldName
=
$
(
el
).
data
(
'
field-name
'
);
return
$
(
el
).
glDropdown
({
selectable
:
true
,
fieldName
,
toggleLabel
(
selected
,
element
,
instance
)
{
let
label
=
'
Author
'
;
const
$item
=
instance
.
dropdown
.
find
(
'
.is-active
'
);
if
(
$item
.
length
)
{
label
=
$item
.
text
();
}
return
label
;
},
clicked
(
options
)
{
return
options
.
e
.
preventDefault
();
},
id
(
obj
,
element
)
{
return
$
(
element
).
data
(
'
id
'
);
},
});
});
}
app/assets/javascripts/main.js
View file @
ab42a638
...
...
@@ -56,11 +56,8 @@ import './gl_dropdown';
import
'
./gl_field_error
'
;
import
'
./gl_field_errors
'
;
import
'
./gl_form
'
;
import
'
./header
'
;
import
initTodoToggle
from
'
./header
'
;
import
initImporterStatus
from
'
./importer_status
'
;
import
'
./issuable_form
'
;
import
'
./issue
'
;
import
'
./issue_status_select
'
;
import
'
./labels_select
'
;
import
'
./layout_nav
'
;
import
LazyLoader
from
'
./lazy_loader
'
;
...
...
@@ -148,6 +145,7 @@ $(function () {
initBreadcrumbs
();
initImporterStatus
();
initTodoToggle
();
// Set the default path for all cookies to GitLab's root directory
Cookies
.
defaults
.
path
=
gon
.
relative_url_root
||
'
/
'
;
...
...
spec/javascripts/header_spec.js
View file @
ab42a638
import
'
~/header
'
;
import
initTodoToggle
from
'
~/header
'
;
describe
(
'
Header
'
,
function
()
{
const
todosPendingCount
=
'
.todos-count
'
;
...
...
@@ -14,6 +14,7 @@ describe('Header', function () {
preloadFixtures
(
fixtureTemplate
);
beforeEach
(()
=>
{
initTodoToggle
();
loadFixtures
(
fixtureTemplate
);
});
...
...
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