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
f8b5265b
Commit
f8b5265b
authored
Aug 03, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CE->EE: Fix errors brought up by static analysis
parent
5703e313
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
63 deletions
+1
-63
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+0
-1
app/assets/javascripts/filtered_search/dropdown_utils.js
app/assets/javascripts/filtered_search/dropdown_utils.js
+0
-60
spec/finders/issues_finder_spec.rb
spec/finders/issues_finder_spec.rb
+1
-1
spec/spec_helper.rb
spec/spec_helper.rb
+0
-1
No files found.
app/assets/javascripts/dispatcher.js
View file @
f8b5265b
...
...
@@ -449,7 +449,6 @@ import initGroupAnalytics from './init_group_analytics';
new
BlobViewer
();
new
NewCommitForm
(
$
(
'
.js-create-dir-form
'
));
if
(
document
.
querySelector
(
'
.js-tree-content
'
).
dataset
.
pathLocksAvailable
===
'
true
'
)
{
PathLocks
.
init
(
document
.
querySelector
(
'
.js-tree-content
'
).
dataset
.
pathLocksToggle
,
...
...
app/assets/javascripts/filtered_search/dropdown_utils.js
View file @
f8b5265b
...
...
@@ -135,66 +135,6 @@ class DropdownUtils {
return
updatedItem
;
}
static
mergeDuplicateLabels
(
dataMap
,
newLabel
)
{
const
updatedMap
=
dataMap
;
const
key
=
newLabel
.
title
;
const
hasKeyProperty
=
Object
.
prototype
.
hasOwnProperty
.
call
(
updatedMap
,
key
);
if
(
!
hasKeyProperty
)
{
updatedMap
[
key
]
=
newLabel
;
}
else
{
const
existing
=
updatedMap
[
key
];
if
(
!
existing
.
multipleColors
)
{
existing
.
multipleColors
=
[
existing
.
color
];
}
existing
.
multipleColors
.
push
(
newLabel
.
color
);
}
return
updatedMap
;
}
static
duplicateLabelColor
(
labelColors
)
{
const
colors
=
labelColors
;
const
spacing
=
100
/
colors
.
length
;
// Reduce the colors to 4
colors
.
length
=
Math
.
min
(
colors
.
length
,
4
);
const
color
=
colors
.
map
((
c
,
i
)
=>
{
const
percentFirst
=
Math
.
floor
(
spacing
*
i
);
const
percentSecond
=
Math
.
floor
(
spacing
*
(
i
+
1
));
return
`
${
c
}
${
percentFirst
}
%,
${
c
}
${
percentSecond
}
%`
;
}).
join
(
'
,
'
);
return
`linear-gradient(
${
color
}
)`
;
}
static
duplicateLabelPreprocessing
(
data
)
{
const
results
=
[];
const
dataMap
=
{};
data
.
forEach
(
DropdownUtils
.
mergeDuplicateLabels
.
bind
(
null
,
dataMap
));
Object
.
keys
(
dataMap
)
.
forEach
((
key
)
=>
{
const
label
=
dataMap
[
key
];
if
(
label
.
multipleColors
)
{
label
.
color
=
DropdownUtils
.
duplicateLabelColor
(
label
.
multipleColors
);
label
.
text_color
=
'
#000000
'
;
}
results
.
push
(
label
);
});
results
.
preprocessed
=
true
;
return
results
;
}
static
setDataValueIfSelected
(
filter
,
selected
)
{
const
dataValue
=
selected
.
getAttribute
(
'
data-value
'
);
...
...
spec/finders/issues_finder_spec.rb
View file @
f8b5265b
...
...
@@ -388,7 +388,7 @@ describe IssuesFinder do
end
context
'for an admin'
do
let
(
:admin_user
)
{
create
(
:user
,
:admin
)
}
let
(
:admin_user
)
{
create
(
:user
,
:admin
)
}
subject
{
described_class
.
new
(
admin_user
,
params
).
with_confidentiality_access_check
}
...
...
spec/spec_helper.rb
View file @
f8b5265b
...
...
@@ -65,7 +65,6 @@ RSpec.configure do |config|
config
.
include
EE
::
LicenseHelpers
config
.
include
Rails
.
application
.
routes
.
url_helpers
,
type: :routing
config
.
infer_spec_type_from_file_location!
config
.
define_derived_metadata
(
file_path:
%r{/spec/requests/(ci/)?api/}
)
do
|
metadata
|
...
...
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