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
a46d0bbb
Commit
a46d0bbb
authored
Aug 19, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pluralize dropdown label
parent
b7ff3b3b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
app/assets/javascripts/protected_branch_access_dropdown.js.es6
...ssets/javascripts/protected_branch_access_dropdown.js.es6
+6
-4
No files found.
app/assets/javascripts/protected_branch_access_dropdown.js.es6
View file @
a46d0bbb
...
...
@@ -51,12 +51,14 @@
let types = _.groupBy(currentItems, (item) => { return item.dataset.type; });
let label = [];
if (_.isEmpty(types)) {
label.push(this.defaultLabel);
} else {
if (currentItems.length) {
Object.keys(types).map((type) => {
label.push(`${types[type].length} ${type}`);
let numberOfTypes = types[type].length;
let text = numberOfTypes === 1 ? type : `${type}s`;
label.push(`${numberOfTypes} ${text}`);
});
} else {
label.push(this.defaultLabel);
}
return label.join(' and ');
...
...
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