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
f6569a0a
Commit
f6569a0a
authored
Sep 13, 2019
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix all instances of no-unused-vars
This is part of a larger process of getting rid of all eslint-disable
parent
0b03342f
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
69 additions
and
151 deletions
+69
-151
app/assets/javascripts/blob/template_selector.js
app/assets/javascripts/blob/template_selector.js
+2
-2
app/assets/javascripts/commit/image_file.js
app/assets/javascripts/commit/image_file.js
+5
-14
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+3
-7
app/assets/javascripts/issue.js
app/assets/javascripts/issue.js
+1
-2
app/assets/javascripts/label_manager.js
app/assets/javascripts/label_manager.js
+2
-3
app/assets/javascripts/labels_select.js
app/assets/javascripts/labels_select.js
+4
-21
app/assets/javascripts/lib/utils/text_markdown.js
app/assets/javascripts/lib/utils/text_markdown.js
+2
-2
app/assets/javascripts/milestone_select.js
app/assets/javascripts/milestone_select.js
+3
-5
app/assets/javascripts/network/branch_graph.js
app/assets/javascripts/network/branch_graph.js
+5
-6
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+8
-36
app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_util.js
...ages/projects/graphs/show/stat_graph_contributors_util.js
+2
-2
app/assets/javascripts/profile/gl_crop.js
app/assets/javascripts/profile/gl_crop.js
+6
-7
app/assets/javascripts/project_find_file.js
app/assets/javascripts/project_find_file.js
+2
-3
app/assets/javascripts/right_sidebar.js
app/assets/javascripts/right_sidebar.js
+7
-7
app/assets/javascripts/search_autocomplete.js
app/assets/javascripts/search_autocomplete.js
+4
-5
app/assets/javascripts/users_select.js
app/assets/javascripts/users_select.js
+3
-4
app/assets/javascripts/zen_mode.js
app/assets/javascripts/zen_mode.js
+2
-2
ee/app/assets/javascripts/ldap_groups_select.js
ee/app/assets/javascripts/ldap_groups_select.js
+2
-2
ee/app/assets/javascripts/pages/admin/emails/show/admin_email_select.js
...javascripts/pages/admin/emails/show/admin_email_select.js
+1
-3
ee/app/assets/javascripts/weight_select.js
ee/app/assets/javascripts/weight_select.js
+4
-15
spec/javascripts/boards/boards_store_spec.js
spec/javascripts/boards/boards_store_spec.js
+1
-3
No files found.
app/assets/javascripts/blob/template_selector.js
View file @
f6569a0a
/* eslint-disable class-methods-use-this
, no-unused-vars
*/
/* eslint-disable class-methods-use-this */
import
$
from
'
jquery
'
;
...
...
@@ -61,7 +61,7 @@ export default class TemplateSelector {
return
this
.
requestFile
(
item
);
}
requestFile
(
item
)
{
requestFile
()
{
// This `requestFile` method is an abstract method that should
// be added by all subclasses.
}
...
...
app/assets/javascripts/commit/image_file.js
View file @
f6569a0a
/* eslint-disable func-names, no-var, prefer-arrow-callback, no-else-return, consistent-return, prefer-template, one-var, no-
unused-vars, no-
return-assign, no-unused-expressions, no-sequences */
/* eslint-disable func-names, no-var, prefer-arrow-callback, no-else-return, consistent-return, prefer-template, one-var, no-return-assign, no-unused-expressions, no-sequences */
import
$
from
'
jquery
'
;
...
...
@@ -12,11 +12,8 @@ export default class ImageFile {
this
.
requestImageInfo
(
$
(
'
.two-up.view .frame.deleted img
'
,
this
.
file
),
(
function
(
_this
)
{
return
function
(
deletedWidth
,
deletedHeight
)
{
return
_this
.
requestImageInfo
(
$
(
'
.two-up.view .frame.added img
'
,
_this
.
file
),
function
(
width
,
height
,
)
{
return
function
()
{
return
_this
.
requestImageInfo
(
$
(
'
.two-up.view .frame.added img
'
,
_this
.
file
),
function
()
{
_this
.
initViewModes
();
// Load two-up view after images are loaded
...
...
@@ -112,7 +109,7 @@ export default class ImageFile {
maxHeight
=
0
;
$
(
'
.frame
'
,
view
)
.
each
(
(
function
(
_this
)
{
(
function
()
{
return
function
(
index
,
frame
)
{
var
height
,
width
;
width
=
$
(
frame
).
width
();
...
...
@@ -196,13 +193,7 @@ export default class ImageFile {
return
$
(
'
.onion-skin.view
'
,
this
.
file
).
each
(
(
function
(
_this
)
{
return
function
(
index
,
view
)
{
var
$frame
,
$track
,
$dragger
,
$frameAdded
,
framePadding
,
ref
,
dragging
=
false
;
var
$frame
,
$track
,
$dragger
,
$frameAdded
,
framePadding
,
ref
;
(
ref
=
_this
.
prepareFrames
(
view
)),
([
maxWidth
,
maxHeight
]
=
ref
);
$frame
=
$
(
'
.onion-skin-frame
'
,
view
);
$frameAdded
=
$
(
'
.frame.added
'
,
view
);
...
...
app/assets/javascripts/gl_dropdown.js
View file @
f6569a0a
/* eslint-disable func-names, no-underscore-dangle, no-var, one-var, vars-on-top, no-unused-vars, no-shadow, no-cond-assign, prefer-arrow-callback, no-return-assign, no-else-return, camelcase, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, prefer-template, no-param-reassign, no-loop-func */
/* global fuzzaldrinPlus */
/* eslint-disable func-names, no-underscore-dangle, no-var, one-var, vars-on-top, no-shadow, no-cond-assign, prefer-arrow-callback, no-return-assign, no-else-return, camelcase, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, prefer-template, no-param-reassign, no-loop-func */
import
$
from
'
jquery
'
;
import
_
from
'
underscore
'
;
...
...
@@ -66,12 +65,10 @@ GitLabDropdownInput = (function() {
})();
GitLabDropdownFilter
=
(
function
()
{
var
ARROW_KEY_CODES
,
BLUR_KEYCODES
,
HAS_VALUE_CLASS
;
var
BLUR_KEYCODES
,
HAS_VALUE_CLASS
;
BLUR_KEYCODES
=
[
27
,
40
];
ARROW_KEY_CODES
=
[
38
,
40
];
HAS_VALUE_CLASS
=
'
has-value
'
;
function
GitLabDropdownFilter
(
input
,
options
)
{
...
...
@@ -877,9 +874,8 @@ GitLabDropdown = (function() {
};
GitLabDropdown
.
prototype
.
addArrowKeyEvent
=
function
()
{
var
$input
,
ARROW_KEY_CODES
,
selector
;
var
ARROW_KEY_CODES
,
selector
;
ARROW_KEY_CODES
=
[
38
,
40
];
$input
=
this
.
dropdown
.
find
(
'
.dropdown-input-field
'
);
selector
=
SELECTABLE_CLASSES
;
if
(
this
.
dropdown
.
find
(
'
.dropdown-toggle-page
'
).
length
)
{
selector
=
'
.dropdown-page-one
'
+
selector
;
...
...
app/assets/javascripts/issue.js
View file @
f6569a0a
/* eslint-disable no-var, one-var,
no-unused-vars,
consistent-return */
/* eslint-disable no-var, one-var, consistent-return */
import
$
from
'
jquery
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
{
addDelimiter
}
from
'
./lib/utils/text_utility
'
;
import
flash
from
'
./flash
'
;
import
TaskList
from
'
./task_list
'
;
import
CreateMergeRequestDropdown
from
'
./create_merge_request_dropdown
'
;
import
IssuablesHelper
from
'
./helpers/issuables_helper
'
;
import
{
__
}
from
'
./locale
'
;
...
...
app/assets/javascripts/label_manager.js
View file @
f6569a0a
/* eslint-disable class-methods-use-this, no-underscore-dangle, no-param-reassign,
no-unused-vars,
func-names */
/* eslint-disable class-methods-use-this, no-underscore-dangle, no-param-reassign, func-names */
import
$
from
'
jquery
'
;
import
Sortable
from
'
sortablejs
'
;
...
...
@@ -50,7 +50,7 @@ export default class LabelManager {
$
(
e
.
currentTarget
).
tooltip
(
'
hide
'
);
}
toggleEmptyState
(
$label
,
$btn
,
action
)
{
toggleEmptyState
()
{
this
.
emptyState
.
classList
.
toggle
(
'
hidden
'
,
Boolean
(
this
.
prioritizedLabels
[
0
].
querySelector
(
'
:scope > li
'
)),
...
...
@@ -61,7 +61,6 @@ export default class LabelManager {
if
(
persistState
==
null
)
{
persistState
=
true
;
}
const
_this
=
this
;
const
url
=
$label
.
find
(
'
.js-toggle-priority
'
).
data
(
'
url
'
);
let
$target
=
this
.
prioritizedLabels
;
let
$from
=
this
.
otherLabels
;
...
...
app/assets/javascripts/labels_select.js
View file @
f6569a0a
/* eslint-disable no-useless-return, func-names, no-var, no-underscore-dangle, prefer-arrow-callback, one-var,
no-unused-vars,
prefer-template, no-new, consistent-return, object-shorthand, no-shadow, no-param-reassign, vars-on-top, no-lonely-if, no-else-return, dot-notation, no-empty */
/* eslint-disable no-useless-return, func-names, no-var, no-underscore-dangle, prefer-arrow-callback, one-var, prefer-template, no-new, consistent-return, object-shorthand, no-shadow, no-param-reassign, vars-on-top, no-lonely-if, no-else-return, dot-notation, no-empty */
/* global Issuable */
/* global ListLabel */
...
...
@@ -26,7 +26,6 @@ export default class LabelsSelect {
$els
.
each
(
function
(
i
,
dropdown
)
{
var
$block
,
$colorPreview
,
$dropdown
,
$form
,
$loading
,
...
...
@@ -35,8 +34,6 @@ export default class LabelsSelect {
$value
,
abilityName
,
defaultLabel
,
enableLabelCreateButton
,
issueURLSplit
,
issueUpdateURL
,
labelUrl
,
namespacePath
,
...
...
@@ -47,16 +44,11 @@ export default class LabelsSelect {
showNo
,
$sidebarLabelTooltip
,
initialSelected
,
$toggleText
,
fieldName
,
useId
,
propertyName
,
showMenuAbove
,
$container
,
$dropdownContainer
;
$dropdown
=
$
(
dropdown
);
$dropdownContainer
=
$dropdown
.
closest
(
'
.labels-filter
'
);
$toggleText
=
$dropdown
.
find
(
'
.dropdown-toggle-text
'
);
namespacePath
=
$dropdown
.
data
(
'
namespacePath
'
);
projectPath
=
$dropdown
.
data
(
'
projectPath
'
);
issueUpdateURL
=
$dropdown
.
data
(
'
issueUpdate
'
);
...
...
@@ -77,10 +69,6 @@ export default class LabelsSelect {
$value
=
$block
.
find
(
'
.value
'
);
$loading
=
$block
.
find
(
'
.block-loading
'
).
fadeOut
();
fieldName
=
$dropdown
.
data
(
'
fieldName
'
);
useId
=
$dropdown
.
is
(
'
.js-issuable-form-dropdown, .js-filter-bulk-update, .js-label-sidebar-dropdown
'
,
);
propertyName
=
useId
?
'
id
'
:
'
title
'
;
initialSelected
=
$selectbox
.
find
(
'
input[name="
'
+
$dropdown
.
data
(
'
fieldName
'
)
+
'
"]
'
)
.
map
(
function
()
{
...
...
@@ -124,7 +112,7 @@ export default class LabelsSelect {
axios
.
put
(
issueUpdateURL
,
data
)
.
then
(({
data
})
=>
{
var
labelCount
,
template
,
labelTooltipTitle
,
labelTitles
,
formattedLabels
;
var
labelCount
,
template
,
labelTooltipTitle
,
labelTitles
;
$loading
.
fadeOut
();
$dropdown
.
trigger
(
'
loaded.gl.dropdown
'
);
$selectbox
.
hide
();
...
...
@@ -246,12 +234,10 @@ export default class LabelsSelect {
renderRow
:
function
(
label
)
{
var
linkEl
,
listItemEl
,
color
,
colorEl
,
indeterminate
,
removesAll
,
selectedClass
,
spacing
,
i
,
marked
,
dropdownValue
;
...
...
@@ -378,7 +364,7 @@ export default class LabelsSelect {
}
},
hidden
:
function
()
{
var
isIssueIndex
,
isMRIndex
,
page
,
selectedLabels
;
var
isIssueIndex
,
isMRIndex
,
page
;
page
=
$
(
'
body
'
).
attr
(
'
data-page
'
);
isIssueIndex
=
page
===
'
projects:issues:index
'
;
isMRIndex
=
page
===
'
projects:merge_requests:index
'
;
...
...
@@ -395,9 +381,6 @@ export default class LabelsSelect {
}
if
(
$dropdown
.
hasClass
(
'
js-multiselect
'
))
{
if
(
$dropdown
.
hasClass
(
'
js-filter-submit
'
)
&&
(
isIssueIndex
||
isMRIndex
))
{
selectedLabels
=
$dropdown
.
closest
(
'
form
'
)
.
find
(
"
input:hidden[name='
"
+
$dropdown
.
data
(
'
fieldName
'
)
+
"
']
"
);
Issuable
.
filterResults
(
$dropdown
.
closest
(
'
form
'
));
}
else
if
(
$dropdown
.
hasClass
(
'
js-filter-submit
'
))
{
$dropdown
.
closest
(
'
form
'
).
submit
();
...
...
@@ -495,7 +478,7 @@ export default class LabelsSelect {
}
}
},
opened
:
function
(
e
)
{
opened
:
function
()
{
if
(
$dropdown
.
hasClass
(
'
js-issue-board-sidebar
'
))
{
const
previousSelection
=
$dropdown
.
attr
(
'
data-selected
'
);
this
.
selected
=
previousSelection
?
previousSelection
.
split
(
'
,
'
)
:
[];
...
...
app/assets/javascripts/lib/utils/text_markdown.js
View file @
f6569a0a
/* eslint-disable func-names, no-var, no-param-reassign, one-var, operator-assignment, no-else-return, prefer-template, prefer-arrow-callback, consistent-return
, no-unused-vars
*/
/* eslint-disable func-names, no-var, no-param-reassign, one-var, operator-assignment, no-else-return, prefer-template, prefer-arrow-callback, consistent-return */
import
$
from
'
jquery
'
;
import
{
insertText
}
from
'
~/lib/utils/common_utils
'
;
...
...
@@ -157,7 +157,7 @@ export function insertMarkdownText({
if
(
tag
===
LINK_TAG_PATTERN
)
{
if
(
URL
)
{
try
{
const
ignoredUrl
=
new
URL
(
selected
);
new
URL
(
selected
);
// eslint-disable-line no-new
// valid url
tag
=
'
[text]({text})
'
;
select
=
'
text
'
;
...
...
app/assets/javascripts/milestone_select.js
View file @
f6569a0a
/* eslint-disable one-var,
no-unused-vars,
object-shorthand, no-else-return, no-self-compare, consistent-return, no-param-reassign, no-shadow */
/* eslint-disable one-var, object-shorthand, no-else-return, no-self-compare, consistent-return, no-param-reassign, no-shadow */
/* global Issuable */
/* global ListMilestone */
...
...
@@ -37,7 +37,6 @@ export default class MilestoneSelect {
selectedMilestone
,
selectedMilestoneDefault
;
const
$dropdown
=
$
(
dropdown
);
const
projectId
=
$dropdown
.
data
(
'
projectId
'
);
const
milestonesUrl
=
$dropdown
.
data
(
'
milestones
'
);
const
issueUpdateURL
=
$dropdown
.
data
(
'
issueUpdate
'
);
const
showNo
=
$dropdown
.
data
(
'
showNo
'
);
...
...
@@ -48,7 +47,6 @@ export default class MilestoneSelect {
const
useId
=
$dropdown
.
data
(
'
useId
'
);
const
defaultLabel
=
$dropdown
.
data
(
'
defaultLabel
'
);
const
defaultNo
=
$dropdown
.
data
(
'
defaultNo
'
);
const
issuableId
=
$dropdown
.
data
(
'
issuableId
'
);
const
abilityName
=
$dropdown
.
data
(
'
abilityName
'
);
const
$selectBox
=
$dropdown
.
closest
(
'
.selectbox
'
);
const
$block
=
$selectBox
.
closest
(
'
.block
'
);
...
...
@@ -121,7 +119,7 @@ export default class MilestoneSelect {
fields
:
[
'
title
'
],
},
selectable
:
true
,
toggleLabel
:
(
selected
,
el
,
e
)
=>
{
toggleLabel
:
(
selected
,
el
)
=>
{
if
(
selected
&&
'
id
'
in
selected
&&
$
(
el
).
hasClass
(
'
is-active
'
))
{
return
selected
.
title
;
}
else
{
...
...
@@ -153,7 +151,7 @@ export default class MilestoneSelect {
},
vue
:
$dropdown
.
hasClass
(
'
js-issue-board-sidebar
'
),
clicked
:
clickEvent
=>
{
const
{
$el
,
e
}
=
clickEvent
;
const
{
e
}
=
clickEvent
;
let
selected
=
clickEvent
.
selectedObj
;
let
data
,
modalStoreFilter
;
...
...
app/assets/javascripts/network/branch_graph.js
View file @
f6569a0a
/* eslint-disable func-names, no-var, one-var, no-loop-func, consistent-return,
no-unused-vars,
prefer-template, prefer-arrow-callback, camelcase */
/* eslint-disable func-names, no-var, one-var, no-loop-func, consistent-return, prefer-template, prefer-arrow-callback, camelcase */
import
$
from
'
jquery
'
;
import
{
__
}
from
'
../locale
'
;
import
axios
from
'
../lib/utils/axios_utils
'
;
import
flash
from
'
../flash
'
;
import
Raphael
from
'
./raphael
'
;
export
default
(
function
()
{
...
...
@@ -104,7 +103,7 @@ export default (function() {
};
BranchGraph
.
prototype
.
buildGraph
=
function
()
{
var
cuday
,
cumonth
,
day
,
j
,
len
,
mm
,
ref
;
var
cuday
,
cumonth
,
day
,
len
,
mm
,
ref
;
const
{
r
}
=
this
;
cuday
=
0
;
cumonth
=
''
;
...
...
@@ -178,7 +177,7 @@ export default (function() {
return
$
(
element
).
scroll
(
(
function
(
_this
)
{
return
function
(
event
)
{
return
function
()
{
return
_this
.
renderPartialGraph
();
};
})(
this
),
...
...
@@ -214,7 +213,7 @@ export default (function() {
};
BranchGraph
.
prototype
.
appendLabel
=
function
(
x
,
y
,
commit
)
{
var
label
,
rect
,
shortrefs
,
text
,
textbox
,
triangle
;
var
label
,
rect
,
shortrefs
,
text
,
textbox
;
if
(
!
commit
.
refs
)
{
return
;
...
...
@@ -239,7 +238,7 @@ export default (function() {
'
fill-opacity
'
:
0.5
,
stroke
:
'
none
'
,
});
triangle
=
r
.
path
([
'
M
'
,
x
-
5
,
y
,
'
L
'
,
x
-
15
,
y
-
4
,
'
L
'
,
x
-
15
,
y
+
4
,
'
Z
'
]).
attr
({
r
.
path
([
'
M
'
,
x
-
5
,
y
,
'
L
'
,
x
-
15
,
y
-
4
,
'
L
'
,
x
-
15
,
y
+
4
,
'
Z
'
]).
attr
({
fill
:
'
#000
'
,
'
fill-opacity
'
:
0.5
,
stroke
:
'
none
'
,
...
...
app/assets/javascripts/notes.js
View file @
f6569a0a
...
...
@@ -2,10 +2,9 @@
no-unused-expressions, one-var, default-case,
prefer-template, consistent-return, no-alert, no-return-assign,
no-param-reassign, prefer-arrow-callback, no-else-return, vars-on-top,
no-
unused-vars, no-
shadow, no-useless-escape, class-methods-use-this */
no-shadow, no-useless-escape, class-methods-use-this */
/* global ResolveService */
/* global mrRefreshWidgetUrl */
/*
old_notes_spec.js is the spec for the legacy, jQuery notes application. It has nothing to do with the new, fancy Vue notes app.
...
...
@@ -37,7 +36,6 @@ import {
isMetaKey
,
isInMRPage
,
}
from
'
./lib/utils/common_utils
'
;
import
imageDiffHelper
from
'
./image_diff/helpers/index
'
;
import
{
localTimeAgo
}
from
'
./lib/utils/datetime_utility
'
;
import
{
sprintf
,
s__
,
__
}
from
'
./locale
'
;
...
...
@@ -683,7 +681,7 @@ export default class Notes {
);
}
updateNoteError
(
$parentTimeline
)
{
updateNoteError
()
{
// eslint-disable-next-line no-new
new
Flash
(
__
(
'
Your comment could not be updated! Please check your network connection and try again.
'
),
...
...
@@ -697,7 +695,6 @@ export default class Notes {
*/
addDiscussionNote
(
$form
,
note
,
isNewDiffComment
)
{
if
(
$form
.
attr
(
'
data-resolve-all
'
)
!=
null
)
{
var
projectPath
=
$form
.
data
(
'
projectPath
'
);
var
discussionId
=
$form
.
data
(
'
discussionId
'
);
var
mergeRequestId
=
$form
.
data
(
'
noteableIid
'
);
...
...
@@ -746,7 +743,6 @@ export default class Notes {
if
(
currentContent
===
initialContent
)
{
this
.
removeNoteEditForm
(
$el
);
}
else
{
var
$buttons
=
$el
.
find
(
'
.note-form-actions
'
);
var
isWidgetVisible
=
isInViewport
(
$el
.
get
(
0
));
if
(
!
isWidgetVisible
)
{
...
...
@@ -766,7 +762,7 @@ export default class Notes {
* Replaces the note text with the note edit form
* Adds a data attribute to the form with the original content of the note for cancellations
*/
showEditForm
(
e
,
scrollTo
,
myLastNote
)
{
showEditForm
(
e
)
{
e
.
preventDefault
();
var
$target
=
$
(
e
.
target
);
...
...
@@ -850,16 +846,11 @@ export default class Notes {
* Removes the whole discussion if the last note is being removed.
*/
removeNote
(
e
)
{
var
noteElId
,
noteId
,
dataNoteId
,
$note
,
lineHolder
;
var
noteElId
,
$note
;
$note
=
$
(
e
.
currentTarget
).
closest
(
'
.note
'
);
noteElId
=
$note
.
attr
(
'
id
'
);
noteId
=
$note
.
attr
(
'
data-note-id
'
);
lineHolder
=
$
(
e
.
currentTarget
)
.
closest
(
'
.notes[data-discussion-id]
'
)
.
closest
(
'
.notes_holder
'
)
.
prev
(
'
.line_holder
'
);
$
(
`.note[id="
${
noteElId
}
"]`
).
each
(
(
function
(
_this
)
{
(
function
()
{
// A same note appears in the "Discussion" and in the "Changes" tab, we have
// to remove all. Using $('.note[id='noteId']') ensure we get all the notes,
// where $('#noteId') would return only one.
...
...
@@ -1064,25 +1055,8 @@ export default class Notes {
this
.
setupDiscussionNoteForm
(
$link
,
newForm
);
}
toggleDiffNote
({
target
,
lineType
,
forceShow
,
showReplyInput
=
false
,
currentUsername
,
currentUserAvatar
,
currentUserFullname
,
})
{
var
$link
,
addForm
,
hasNotes
,
newForm
,
noteForm
,
replyButton
,
row
,
rowCssToAdd
,
targetContent
,
isDiffCommentAvatar
;
toggleDiffNote
({
target
,
lineType
,
forceShow
,
showReplyInput
=
false
})
{
var
$link
,
addForm
,
hasNotes
,
newForm
,
noteForm
,
replyButton
,
row
,
rowCssToAdd
;
$link
=
$
(
target
);
row
=
$link
.
closest
(
'
tr
'
);
const
nextRow
=
row
.
next
();
...
...
@@ -1515,7 +1489,7 @@ export default class Notes {
let
tempFormContent
;
// Identify executed quick actions from `formContent`
const
executedCommands
=
availableQuickActions
.
filter
(
(
command
,
index
)
=>
{
const
executedCommands
=
availableQuickActions
.
filter
(
command
=>
{
const
commandRegex
=
new
RegExp
(
`/
${
command
.
name
}
`
);
return
commandRegex
.
test
(
formContent
);
});
...
...
@@ -1840,8 +1814,6 @@ export default class Notes {
const
$noteBody
=
$editingNote
.
find
(
'
.js-task-list-container
'
);
const
$noteBodyText
=
$noteBody
.
find
(
'
.note-text
'
);
const
{
formData
,
formContent
,
formAction
}
=
this
.
getFormData
(
$form
);
const
$diffFile
=
$form
.
closest
(
'
.diff-file
'
);
const
$notesContainer
=
$form
.
closest
(
'
.notes
'
);
// Cache original comment content
const
cachedNoteBodyText
=
$noteBodyText
.
html
();
...
...
app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_util.js
View file @
f6569a0a
/* eslint-disable func-names, object-shorthand, no-var, one-var, camelcase, no-param-reassign, no-return-assign, prefer-arrow-callback, consistent-return, no-
unused-vars, no-
cond-assign, no-else-return */
/* eslint-disable func-names, object-shorthand, no-var, one-var, camelcase, no-param-reassign, no-return-assign, prefer-arrow-callback, consistent-return, no-cond-assign, no-else-return */
import
_
from
'
underscore
'
;
export
default
{
...
...
@@ -126,7 +126,7 @@ export default {
_
.
each
(
_
.
omit
(
log_entry
,
'
author_name
'
,
'
author_email
'
),
(
function
(
_this
)
{
return
function
(
value
,
key
)
{
return
function
(
value
)
{
if
(
_this
.
in_range
(
value
.
date
,
date_range
))
{
parsed_entry
.
dates
[
value
.
date
]
=
value
[
field
];
parsed_entry
.
commits
+=
value
.
commits
;
...
...
app/assets/javascripts/profile/gl_crop.js
View file @
f6569a0a
/* eslint-disable no-useless-escape, no-var, no-underscore-dangle, func-names, no-
unused-vars, no-
return-assign, object-shorthand, one-var, consistent-return, class-methods-use-this */
/* eslint-disable no-useless-escape, no-var, no-underscore-dangle, func-names, no-return-assign, object-shorthand, one-var, consistent-return, class-methods-use-this */
import
$
from
'
jquery
'
;
import
'
cropper
'
;
import
_
from
'
underscore
'
;
(
global
=>
{
(
()
=>
{
// Matches everything but the file name
const
FILENAMEREGEX
=
/^.*
[\\\/]
/
;
...
...
@@ -69,7 +69,7 @@ import _ from 'underscore';
this
.
modalCrop
.
on
(
'
shown.bs.modal
'
,
this
.
onModalShow
);
this
.
modalCrop
.
on
(
'
hidden.bs.modal
'
,
this
.
onModalHide
);
this
.
uploadImageBtn
.
on
(
'
click
'
,
this
.
onUploadImageBtnClick
);
this
.
cropActionsBtn
.
on
(
'
click
'
,
function
(
e
)
{
this
.
cropActionsBtn
.
on
(
'
click
'
,
function
()
{
var
btn
;
btn
=
this
;
return
_this
.
onActionBtnClick
(
btn
);
...
...
@@ -128,10 +128,10 @@ import _ from 'underscore';
}
onActionBtnClick
(
btn
)
{
var
data
,
result
;
var
data
;
data
=
$
(
btn
).
data
();
if
(
this
.
modalCropImg
.
data
(
'
cropper
'
)
&&
data
.
method
)
{
return
(
result
=
this
.
modalCropImg
.
cropper
(
data
.
method
,
data
.
option
)
);
return
this
.
modalCropImg
.
cropper
(
data
.
method
,
data
.
option
);
}
}
...
...
@@ -151,12 +151,11 @@ import _ from 'underscore';
}
dataURLtoBlob
(
dataURL
)
{
var
array
,
binary
,
i
,
len
,
v
;
var
array
,
binary
,
i
,
len
;
binary
=
atob
(
dataURL
.
split
(
'
,
'
)[
1
]);
array
=
[];
for
(
i
=
0
,
len
=
binary
.
length
;
i
<
len
;
i
+=
1
)
{
v
=
binary
[
i
];
array
.
push
(
binary
.
charCodeAt
(
i
));
}
return
new
Blob
([
new
Uint8Array
(
array
)],
{
...
...
app/assets/javascripts/project_find_file.js
View file @
f6569a0a
/* eslint-disable func-names, no-var, consistent-return, one-var, no-cond-assign, prefer-template, no-
unused-vars, no-
return-assign */
/* eslint-disable func-names, no-var, consistent-return, one-var, no-cond-assign, prefer-template, no-return-assign */
import
$
from
'
jquery
'
;
import
fuzzaldrinPlus
from
'
fuzzaldrin-plus
'
;
...
...
@@ -8,9 +8,8 @@ import { __ } from '~/locale';
// highlight text(awefwbwgtc -> <b>a</b>wefw<b>b</b>wgt<b>c</b> )
const
highlighter
=
function
(
element
,
text
,
matches
)
{
var
highlightText
,
j
,
lastIndex
,
len
,
matchIndex
,
matchedChars
,
unmatched
;
var
j
,
lastIndex
,
len
,
matchIndex
,
matchedChars
,
unmatched
;
lastIndex
=
0
;
highlightText
=
''
;
matchedChars
=
[];
for
(
j
=
0
,
len
=
matches
.
length
;
j
<
len
;
j
+=
1
)
{
matchIndex
=
matches
[
j
];
...
...
app/assets/javascripts/right_sidebar.js
View file @
f6569a0a
/* eslint-disable func-names, no-var,
no-unused-vars,
consistent-return, one-var, prefer-template, no-else-return, no-param-reassign */
/* eslint-disable func-names, no-var, consistent-return, one-var, prefer-template, no-else-return, no-param-reassign */
import
$
from
'
jquery
'
;
import
_
from
'
underscore
'
;
...
...
@@ -7,7 +7,7 @@ import flash from './flash';
import
axios
from
'
./lib/utils/axios_utils
'
;
import
{
sprintf
,
s__
,
__
}
from
'
./locale
'
;
function
Sidebar
(
currentUser
)
{
function
Sidebar
()
{
this
.
toggleTodo
=
this
.
toggleTodo
.
bind
(
this
);
this
.
sidebar
=
$
(
'
aside
'
);
...
...
@@ -15,9 +15,9 @@ function Sidebar(currentUser) {
this
.
addEventListeners
();
}
Sidebar
.
initialize
=
function
(
currentUser
)
{
Sidebar
.
initialize
=
function
()
{
if
(
!
this
.
instance
)
{
this
.
instance
=
new
Sidebar
(
currentUser
);
this
.
instance
=
new
Sidebar
();
}
};
...
...
@@ -77,7 +77,7 @@ Sidebar.prototype.sidebarToggleClicked = function(e, triggered) {
};
Sidebar
.
prototype
.
toggleTodo
=
function
(
e
)
{
var
$
btnText
,
$this
,
$todoLoading
,
ajaxType
,
url
;
var
$
this
,
ajaxType
,
url
;
$this
=
$
(
e
.
currentTarget
);
ajaxType
=
$this
.
data
(
'
deletePath
'
)
?
'
delete
'
:
'
post
'
;
...
...
@@ -140,7 +140,7 @@ Sidebar.prototype.todoUpdateDone = function(data) {
});
};
Sidebar
.
prototype
.
sidebarDropdownLoading
=
function
(
e
)
{
Sidebar
.
prototype
.
sidebarDropdownLoading
=
function
()
{
var
$loading
,
$sidebarCollapsedIcon
,
i
,
img
;
$sidebarCollapsedIcon
=
$
(
this
)
.
closest
(
'
.block
'
)
...
...
@@ -157,7 +157,7 @@ Sidebar.prototype.sidebarDropdownLoading = function(e) {
}
};
Sidebar
.
prototype
.
sidebarDropdownLoaded
=
function
(
e
)
{
Sidebar
.
prototype
.
sidebarDropdownLoaded
=
function
()
{
var
$sidebarCollapsedIcon
,
i
,
img
;
$sidebarCollapsedIcon
=
$
(
this
)
.
closest
(
'
.block
'
)
...
...
app/assets/javascripts/search_autocomplete.js
View file @
f6569a0a
/* eslint-disable no-return-assign, one-var, no-var,
no-unused-vars,
consistent-return, object-shorthand, prefer-template, class-methods-use-this, no-lonely-if, vars-on-top */
/* eslint-disable no-return-assign, one-var, no-var, consistent-return, object-shorthand, prefer-template, class-methods-use-this, no-lonely-if, vars-on-top */
import
$
from
'
jquery
'
;
import
{
escape
,
throttle
}
from
'
underscore
'
;
import
{
s__
,
__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
{
getIdenticonBackgroundClass
,
getIdenticonTitle
}
from
'
~/helpers/avatar_helper
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
DropdownUtils
from
'
./filtered_search/dropdown_utils
'
;
import
{
isInGroupsPage
,
isInProjectPage
,
...
...
@@ -142,7 +141,7 @@ export class SearchAutocomplete {
});
}
getSearchText
(
selectedObject
,
el
)
{
getSearchText
(
selectedObject
)
{
return
selectedObject
.
id
?
selectedObject
.
text
:
''
;
}
...
...
@@ -402,7 +401,7 @@ export class SearchAutocomplete {
return
this
.
searchInput
.
val
(
''
).
focus
();
}
onSearchInputBlur
(
e
)
{
onSearchInputBlur
()
{
this
.
isFocused
=
false
;
this
.
wrap
.
removeClass
(
'
search-active
'
);
// If input is blank then restore state
...
...
app/assets/javascripts/users_select.js
View file @
f6569a0a
/* eslint-disable func-names, one-var, no-var, prefer-rest-params, vars-on-top, prefer-arrow-callback, consistent-return, object-shorthand, no-shadow, no-
unused-vars, no-
else-return, no-self-compare, prefer-template, no-unused-expressions, yoda, prefer-spread, camelcase, no-param-reassign */
/* eslint-disable func-names, one-var, no-var, prefer-rest-params, vars-on-top, prefer-arrow-callback, consistent-return, object-shorthand, no-shadow, no-else-return, no-self-compare, prefer-template, no-unused-expressions, yoda, prefer-spread, camelcase, no-param-reassign */
/* global Issuable */
/* global emitSidebarEvent */
...
...
@@ -405,7 +405,7 @@ function UsersSelect(currentUser, els, options = {}) {
}
},
defaultLabel
:
defaultLabel
,
hidden
:
function
(
e
)
{
hidden
:
function
()
{
if
(
$dropdown
.
hasClass
(
'
js-multiselect
'
))
{
emitSidebarEvent
(
'
sidebar.saveAssignees
'
);
}
...
...
@@ -442,7 +442,6 @@ function UsersSelect(currentUser, els, options = {}) {
if
(
user
.
beforeDivider
&&
user
.
name
.
toLowerCase
()
===
'
unassigned
'
)
{
// Unassigned selected
previouslySelected
.
each
((
index
,
element
)
=>
{
const
id
=
parseInt
(
element
.
value
,
10
);
element
.
remove
();
});
emitSidebarEvent
(
'
sidebar.removeAllAssignees
'
);
...
...
@@ -548,7 +547,7 @@ function UsersSelect(currentUser, els, options = {}) {
},
updateLabel
:
$dropdown
.
data
(
'
dropdownTitle
'
),
renderRow
:
function
(
user
)
{
var
avatar
,
img
,
listClosingTags
,
listWithName
,
listWithUserName
,
username
;
var
avatar
,
img
,
username
;
username
=
user
.
username
?
'
@
'
+
user
.
username
:
''
;
avatar
=
user
.
avatar_url
?
user
.
avatar_url
:
gon
.
default_avatar_url
;
...
...
app/assets/javascripts/zen_mode.js
View file @
f6569a0a
/* eslint-disable func-names, prefer-arrow-callback,
no-unused-vars,
consistent-return, camelcase, class-methods-use-this */
/* eslint-disable func-names, prefer-arrow-callback, consistent-return, camelcase, class-methods-use-this */
// Zen Mode (full screen) textarea
//
...
...
@@ -62,7 +62,7 @@ export default class ZenMode {
$
(
document
).
on
(
'
zen_mode:leave
'
,
(
function
(
_this
)
{
return
function
(
e
)
{
return
function
()
{
return
_this
.
exit
();
};
})(
this
),
...
...
ee/app/assets/javascripts/ldap_groups_select.js
View file @
f6569a0a
/* eslint-disable prefer-arrow-callback, no-var, one-var, object-shorthand, consistent-return,
no-unused-vars,
func-names */
/* eslint-disable prefer-arrow-callback, no-var, one-var, object-shorthand, consistent-return, func-names */
import
$
from
'
jquery
'
;
import
Api
from
'
ee/api
'
;
...
...
@@ -44,7 +44,7 @@ export default function initLDAPGroupsSelect() {
formatResult
:
ldapGroupResult
,
formatSelection
:
groupFormatSelection
,
dropdownCssClass
:
'
ajax-groups-dropdown
'
,
formatNoMatches
:
function
(
nomatch
)
{
formatNoMatches
:
function
()
{
return
__
(
'
Match not found; try refining your search query.
'
);
},
});
...
...
ee/app/assets/javascripts/pages/admin/emails/show/admin_email_select.js
View file @
f6569a0a
/* eslint-disable no-var, func-names,
camelcase, no-unused-vars,
object-shorthand, one-var, prefer-arrow-callback, prefer-template, no-else-return */
/* eslint-disable no-var, func-names, object-shorthand, one-var, prefer-arrow-callback, prefer-template, no-else-return */
import
$
from
'
jquery
'
;
import
Api
from
'
~/api
'
;
...
...
@@ -10,8 +10,6 @@ function AdminEmailSelect() {
$
(
'
.ajax-admin-email-select
'
).
each
(
(
function
(
_this
)
{
return
function
(
i
,
select
)
{
var
skip_ldap
;
skip_ldap
=
$
(
select
).
hasClass
(
'
skip_ldap
'
);
return
$
(
select
).
select2
({
placeholder
:
__
(
'
Select group or project
'
),
multiple
:
$
(
select
).
hasClass
(
'
multiselect
'
),
...
...
ee/app/assets/javascripts/weight_select.js
View file @
f6569a0a
/* eslint-disable prefer-arrow-callback, one-var, no-var, object-shorthand, no-shadow, no-
unused-vars, no-
else-return, func-names */
/* eslint-disable prefer-arrow-callback, one-var, no-var, object-shorthand, no-shadow, no-else-return, func-names */
import
$
from
'
jquery
'
;
import
'
~/gl_dropdown
'
;
...
...
@@ -7,23 +7,12 @@ function WeightSelect(els, options = {}) {
const
$els
=
$
(
els
||
'
.js-weight-select
'
);
$els
.
each
(
function
(
i
,
dropdown
)
{
var
$block
,
$dropdown
,
$loading
,
$selectbox
,
$sidebarCollapsedValue
,
$value
,
abilityName
,
updateUrl
,
updateWeight
;
var
$block
,
$dropdown
,
$selectbox
,
$value
;
$dropdown
=
$
(
dropdown
);
updateUrl
=
$dropdown
.
data
(
'
issueUpdate
'
);
$selectbox
=
$dropdown
.
closest
(
'
.selectbox
'
);
$block
=
$selectbox
.
closest
(
'
.block
'
);
$sidebarCollapsedValue
=
$block
.
find
(
'
.sidebar-collapsed-icon span
'
);
$value
=
$block
.
find
(
'
.value
'
);
abilityName
=
$dropdown
.
data
(
'
abilityName
'
);
$loading
=
$block
.
find
(
'
.block-loading
'
).
fadeOut
();
$block
.
find
(
'
.block-loading
'
).
fadeOut
();
const
fieldName
=
options
.
fieldName
||
$dropdown
.
data
(
'
fieldName
'
);
const
inputField
=
$dropdown
.
closest
(
'
.selectbox
'
).
find
(
`input[name='
${
fieldName
}
']`
);
...
...
@@ -37,7 +26,7 @@ function WeightSelect(els, options = {}) {
toggleLabel
:
function
(
selected
,
el
)
{
return
$
(
el
).
data
(
'
id
'
);
},
hidden
:
function
(
e
)
{
hidden
:
function
()
{
$selectbox
.
hide
();
return
$value
.
css
(
'
display
'
,
''
);
},
...
...
spec/javascripts/boards/boards_store_spec.js
View file @
f6569a0a
/* eslint-disable no-unused-vars */
/* global ListIssue */
import
Vue
from
'
vue
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
Cookies
from
'
js-cookie
'
;
...
...
@@ -190,7 +188,7 @@ describe('Store', () => {
it
(
'
moves the position of lists
'
,
()
=>
{
const
listOne
=
boardsStore
.
addList
(
listObj
);
const
listTwo
=
boardsStore
.
addList
(
listObjDuplicate
);
boardsStore
.
addList
(
listObjDuplicate
);
expect
(
boardsStore
.
state
.
lists
.
length
).
toBe
(
2
);
...
...
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