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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
35c8fd55
Commit
35c8fd55
authored
Feb 20, 2018
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to jQuery 3.
parent
86c9c93d
Changes
74
Hide whitespace changes
Inline
Side-by-side
Showing
74 changed files
with
1106 additions
and
238 deletions
+1106
-238
app/assets/javascripts/awards_handler.js
app/assets/javascripts/awards_handler.js
+1
-1
app/assets/javascripts/behaviors/copy_to_clipboard.js
app/assets/javascripts/behaviors/copy_to_clipboard.js
+1
-1
app/assets/javascripts/behaviors/quick_submit.js
app/assets/javascripts/behaviors/quick_submit.js
+1
-1
app/assets/javascripts/behaviors/requires_input.js
app/assets/javascripts/behaviors/requires_input.js
+1
-1
app/assets/javascripts/blob_edit/blob_bundle.js
app/assets/javascripts/blob_edit/blob_bundle.js
+4
-4
app/assets/javascripts/blob_edit/edit_blob.js
app/assets/javascripts/blob_edit/edit_blob.js
+1
-1
app/assets/javascripts/boards/components/new_list_dropdown.js
...assets/javascripts/boards/components/new_list_dropdown.js
+1
-1
app/assets/javascripts/commons/bootstrap.js
app/assets/javascripts/commons/bootstrap.js
+2
-2
app/assets/javascripts/compare.js
app/assets/javascripts/compare.js
+1
-1
app/assets/javascripts/compare_autocomplete.js
app/assets/javascripts/compare_autocomplete.js
+2
-2
app/assets/javascripts/diff.js
app/assets/javascripts/diff.js
+2
-2
app/assets/javascripts/due_date_select.js
app/assets/javascripts/due_date_select.js
+3
-3
app/assets/javascripts/files_comment_button.js
app/assets/javascripts/files_comment_button.js
+1
-1
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+1
-1
app/assets/javascripts/gl_form.js
app/assets/javascripts/gl_form.js
+2
-2
app/assets/javascripts/gpg_badges.js
app/assets/javascripts/gpg_badges.js
+1
-1
app/assets/javascripts/groups_select.js
app/assets/javascripts/groups_select.js
+2
-2
app/assets/javascripts/integrations/integration_settings_form.js
...ets/javascripts/integrations/integration_settings_form.js
+2
-2
app/assets/javascripts/issue_show/components/description.vue
app/assets/javascripts/issue_show/components/description.vue
+1
-0
app/assets/javascripts/issue_status_select.js
app/assets/javascripts/issue_status_select.js
+1
-1
app/assets/javascripts/labels_select.js
app/assets/javascripts/labels_select.js
+9
-9
app/assets/javascripts/layout_nav.js
app/assets/javascripts/layout_nav.js
+1
-1
app/assets/javascripts/lib/utils/text_markdown.js
app/assets/javascripts/lib/utils/text_markdown.js
+1
-1
app/assets/javascripts/line_highlighter.js
app/assets/javascripts/line_highlighter.js
+1
-1
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+1
-1
app/assets/javascripts/members.js
app/assets/javascripts/members.js
+2
-2
app/assets/javascripts/merge_request_tabs.js
app/assets/javascripts/merge_request_tabs.js
+1
-1
app/assets/javascripts/milestone_select.js
app/assets/javascripts/milestone_select.js
+12
-12
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+17
-17
app/assets/javascripts/notifications_dropdown.js
app/assets/javascripts/notifications_dropdown.js
+2
-2
app/assets/javascripts/pager.js
app/assets/javascripts/pager.js
+1
-1
app/assets/javascripts/pages/admin/abuse_reports/abuse_reports.js
...ts/javascripts/pages/admin/abuse_reports/abuse_reports.js
+6
-6
app/assets/javascripts/pages/admin/admin.js
app/assets/javascripts/pages/admin/admin.js
+2
-2
app/assets/javascripts/pages/admin/broadcast_messages/broadcast_message.js
...ripts/pages/admin/broadcast_messages/broadcast_message.js
+1
-1
app/assets/javascripts/pages/projects/project.js
app/assets/javascripts/pages/projects/project.js
+3
-3
app/assets/javascripts/pages/search/show/search.js
app/assets/javascripts/pages/search/show/search.js
+3
-3
app/assets/javascripts/project_select.js
app/assets/javascripts/project_select.js
+7
-7
app/assets/javascripts/prometheus_metrics/prometheus_metrics.js
...sets/javascripts/prometheus_metrics/prometheus_metrics.js
+1
-1
app/assets/javascripts/protected_branches/protected_branch_access_dropdown.js
...ts/protected_branches/protected_branch_access_dropdown.js
+2
-2
app/assets/javascripts/protected_branches/protected_branch_create.js
...javascripts/protected_branches/protected_branch_create.js
+1
-1
app/assets/javascripts/protected_branches/protected_branch_edit.js
...s/javascripts/protected_branches/protected_branch_edit.js
+2
-2
app/assets/javascripts/protected_tags/protected_tag_access_dropdown.js
...vascripts/protected_tags/protected_tag_access_dropdown.js
+2
-2
app/assets/javascripts/protected_tags/protected_tag_create.js
...assets/javascripts/protected_tags/protected_tag_create.js
+1
-1
app/assets/javascripts/protected_tags/protected_tag_edit.js
app/assets/javascripts/protected_tags/protected_tag_edit.js
+1
-1
app/assets/javascripts/ref_select_dropdown.js
app/assets/javascripts/ref_select_dropdown.js
+2
-2
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
+12
-12
app/assets/javascripts/sidebar/lib/sidebar_move_issue.js
app/assets/javascripts/sidebar/lib/sidebar_move_issue.js
+1
-1
app/assets/javascripts/single_file_diff.js
app/assets/javascripts/single_file_diff.js
+1
-1
app/assets/javascripts/star.js
app/assets/javascripts/star.js
+12
-13
app/assets/javascripts/subscription_select.js
app/assets/javascripts/subscription_select.js
+1
-1
app/assets/javascripts/task_list.js
app/assets/javascripts/task_list.js
+1
-1
app/assets/javascripts/templates/issuable_template_selector.js
...ssets/javascripts/templates/issuable_template_selector.js
+3
-3
app/assets/javascripts/user_callout.js
app/assets/javascripts/user_callout.js
+1
-1
app/assets/javascripts/users_select.js
app/assets/javascripts/users_select.js
+42
-42
app/assets/javascripts/vue_shared/components/markdown/field.vue
...sets/javascripts/vue_shared/components/markdown/field.vue
+1
-1
app/views/projects/buttons/_star.html.haml
app/views/projects/buttons/_star.html.haml
+1
-1
package.json
package.json
+1
-1
spec/features/projects/members/share_with_group_spec.rb
spec/features/projects/members/share_with_group_spec.rb
+5
-0
spec/javascripts/ajax_loading_spinner_spec.js
spec/javascripts/ajax_loading_spinner_spec.js
+0
-2
spec/javascripts/awards_handler_spec.js
spec/javascripts/awards_handler_spec.js
+6
-6
spec/javascripts/behaviors/requires_input_spec.js
spec/javascripts/behaviors/requires_input_spec.js
+1
-1
spec/javascripts/feature_highlight/feature_highlight_spec.js
spec/javascripts/feature_highlight/feature_highlight_spec.js
+23
-12
spec/javascripts/gl_dropdown_spec.js
spec/javascripts/gl_dropdown_spec.js
+2
-2
spec/javascripts/merge_request_notes_spec.js
spec/javascripts/merge_request_notes_spec.js
+2
-2
spec/javascripts/pages/admin/abuse_reports/abuse_reports_spec.js
...vascripts/pages/admin/abuse_reports/abuse_reports_spec.js
+3
-3
spec/javascripts/projects/project_new_spec.js
spec/javascripts/projects/project_new_spec.js
+2
-2
spec/javascripts/sidebar/sidebar_move_issue_spec.js
spec/javascripts/sidebar/sidebar_move_issue_spec.js
+3
-3
spec/javascripts/test_bundle.js
spec/javascripts/test_bundle.js
+4
-1
vendor/assets/javascripts/jasmine-jquery.js
vendor/assets/javascripts/jasmine-jquery.js
+851
-0
vendor/assets/javascripts/jquery.atwho.js
vendor/assets/javascripts/jquery.atwho.js
+2
-2
vendor/assets/javascripts/jquery.endless-scroll.js
vendor/assets/javascripts/jquery.endless-scroll.js
+1
-1
vendor/assets/javascripts/peek.js
vendor/assets/javascripts/peek.js
+1
-1
yarn.lock
yarn.lock
+3
-3
No files found.
app/assets/javascripts/awards_handler.js
View file @
35c8fd55
...
...
@@ -312,7 +312,7 @@ class AwardsHandler {
}
getAwardUrl
()
{
return
this
.
getVotesBlock
().
data
(
'
award
-u
rl
'
);
return
this
.
getVotesBlock
().
data
(
'
award
U
rl
'
);
}
checkMutuality
(
votesBlock
,
emoji
)
{
...
...
app/assets/javascripts/behaviors/copy_to_clipboard.js
View file @
35c8fd55
...
...
@@ -2,7 +2,7 @@ import Clipboard from 'clipboard';
function
showTooltip
(
target
,
title
)
{
const
$target
=
$
(
target
);
const
originalTitle
=
$target
.
data
(
'
original
-t
itle
'
);
const
originalTitle
=
$target
.
data
(
'
original
T
itle
'
);
if
(
!
$target
.
data
(
'
hideTooltip
'
))
{
$target
...
...
app/assets/javascripts/behaviors/quick_submit.js
View file @
35c8fd55
...
...
@@ -43,7 +43,7 @@ $(document).on('keydown.quick_submit', '.js-quick-submit', (e) => {
const
$form
=
$
(
e
.
target
).
closest
(
'
form
'
);
const
$submitButton
=
$form
.
find
(
'
input[type=submit], button[type=submit]
'
).
first
();
if
(
!
$submitButton
.
attr
(
'
disabled
'
))
{
if
(
!
$submitButton
.
prop
(
'
disabled
'
))
{
$submitButton
.
trigger
(
'
click
'
,
[
e
]);
if
(
!
isInIssuePage
())
{
...
...
app/assets/javascripts/behaviors/requires_input.js
View file @
35c8fd55
...
...
@@ -40,7 +40,7 @@ $.fn.requiresInput = function requiresInput() {
// based on the option selected
function
hideOrShowHelpBlock
(
form
)
{
const
selected
=
$
(
'
.js-select-namespace option:selected
'
);
if
(
selected
.
length
&&
selected
.
data
(
'
options
-p
arent
'
)
===
'
groups
'
)
{
if
(
selected
.
length
&&
selected
.
data
(
'
options
P
arent
'
)
===
'
groups
'
)
{
form
.
find
(
'
.help-block
'
).
hide
();
}
else
if
(
selected
.
length
)
{
form
.
find
(
'
.help-block
'
).
show
();
...
...
app/assets/javascripts/blob_edit/blob_bundle.js
View file @
35c8fd55
...
...
@@ -10,10 +10,10 @@ $(() => {
const
deleteBlobForm
=
$
(
'
.js-delete-blob-form
'
);
if
(
editBlobForm
.
length
)
{
const
urlRoot
=
editBlobForm
.
data
(
'
relative
-url-r
oot
'
);
const
assetsPath
=
editBlobForm
.
data
(
'
assets
-p
refix
'
);
const
blobLanguage
=
editBlobForm
.
data
(
'
blob
-l
anguage
'
);
const
currentAction
=
$
(
'
.js-file-title
'
).
data
(
'
current
-a
ction
'
);
const
urlRoot
=
editBlobForm
.
data
(
'
relative
UrlR
oot
'
);
const
assetsPath
=
editBlobForm
.
data
(
'
assets
P
refix
'
);
const
blobLanguage
=
editBlobForm
.
data
(
'
blob
L
anguage
'
);
const
currentAction
=
$
(
'
.js-file-title
'
).
data
(
'
current
A
ction
'
);
new
EditBlob
(
`
${
urlRoot
}${
assetsPath
}
`
,
blobLanguage
,
currentAction
);
new
NewCommitForm
(
editBlobForm
);
...
...
app/assets/javascripts/blob_edit/edit_blob.js
View file @
35c8fd55
...
...
@@ -59,7 +59,7 @@ export default class EditBlob {
if
(
paneId
===
'
#preview
'
)
{
this
.
$toggleButton
.
hide
();
axios
.
post
(
currentLink
.
data
(
'
preview
-u
rl
'
),
{
axios
.
post
(
currentLink
.
data
(
'
preview
U
rl
'
),
{
content
:
this
.
editor
.
getValue
(),
})
.
then
(({
data
})
=>
{
...
...
app/assets/javascripts/boards/components/new_list_dropdown.js
View file @
35c8fd55
...
...
@@ -25,7 +25,7 @@ $(document).off('created.label').on('created.label', (e, label) => {
gl
.
issueBoards
.
newListDropdownInit
=
()
=>
{
$
(
'
.js-new-board-list
'
).
each
(
function
()
{
const
$this
=
$
(
this
);
new
CreateLabelDropdown
(
$this
.
closest
(
'
.dropdown
'
).
find
(
'
.dropdown-new-label
'
),
$this
.
data
(
'
namespace
-path
'
),
$this
.
data
(
'
project-p
ath
'
));
new
CreateLabelDropdown
(
$this
.
closest
(
'
.dropdown
'
).
find
(
'
.dropdown-new-label
'
),
$this
.
data
(
'
namespace
Path
'
),
$this
.
data
(
'
projectP
ath
'
));
$this
.
glDropdown
({
data
(
term
,
callback
)
{
...
...
app/assets/javascripts/commons/bootstrap.js
View file @
35c8fd55
...
...
@@ -13,6 +13,6 @@ import 'bootstrap-sass/assets/javascripts/bootstrap/popover';
// custom jQuery functions
$
.
fn
.
extend
({
disable
()
{
return
$
(
this
).
attr
(
'
disabled
'
,
'
disabled
'
).
addClass
(
'
disabled
'
);
},
enable
()
{
return
$
(
this
).
removeAttr
(
'
disabled
'
).
removeClass
(
'
disabled
'
);
},
disable
()
{
return
$
(
this
).
prop
(
'
disabled
'
,
true
).
addClass
(
'
disabled
'
);
},
enable
()
{
return
$
(
this
).
prop
(
'
disabled
'
,
false
).
removeClass
(
'
disabled
'
);
},
});
app/assets/javascripts/compare.js
View file @
35c8fd55
...
...
@@ -13,7 +13,7 @@ export default class Compare {
$dropdown
=
$
(
dropdown
);
return
$dropdown
.
glDropdown
({
selectable
:
true
,
fieldName
:
$dropdown
.
data
(
'
field
-n
ame
'
),
fieldName
:
$dropdown
.
data
(
'
field
N
ame
'
),
filterable
:
true
,
id
:
function
(
obj
,
$el
)
{
return
$el
.
data
(
'
id
'
);
...
...
app/assets/javascripts/compare_autocomplete.js
View file @
35c8fd55
...
...
@@ -9,7 +9,7 @@ export default function initCompareAutocomplete() {
$dropdown
=
$
(
this
);
selected
=
$dropdown
.
data
(
'
selected
'
);
const
$dropdownContainer
=
$dropdown
.
closest
(
'
.dropdown
'
);
const
$fieldInput
=
$
(
`input[name="
${
$dropdown
.
data
(
'
field
-n
ame
'
)}
"]`
,
$dropdownContainer
);
const
$fieldInput
=
$
(
`input[name="
${
$dropdown
.
data
(
'
field
N
ame
'
)}
"]`
,
$dropdownContainer
);
const
$filterInput
=
$
(
'
input[type="search"]
'
,
$dropdownContainer
);
$dropdown
.
glDropdown
({
data
:
function
(
term
,
callback
)
{
...
...
@@ -25,7 +25,7 @@ export default function initCompareAutocomplete() {
selectable
:
true
,
filterable
:
true
,
filterRemote
:
true
,
fieldName
:
$dropdown
.
data
(
'
field
-n
ame
'
),
fieldName
:
$dropdown
.
data
(
'
field
N
ame
'
),
filterInput
:
'
input[type="search"]
'
,
renderRow
:
function
(
ref
)
{
var
link
;
...
...
app/assets/javascripts/diff.js
View file @
35c8fd55
...
...
@@ -68,7 +68,7 @@ export default class Diff {
}
const
file
=
$target
.
parents
(
'
.diff-file
'
);
const
link
=
file
.
data
(
'
blob
-diff-p
ath
'
);
const
link
=
file
.
data
(
'
blob
DiffP
ath
'
);
const
view
=
file
.
data
(
'
view
'
);
const
params
=
{
since
,
to
,
bottom
,
offset
,
unfold
,
view
};
...
...
@@ -121,7 +121,7 @@ export default class Diff {
}
// eslint-disable-next-line class-methods-use-this
diffViewType
()
{
return
$
(
'
.inline-parallel-buttons a.active
'
).
data
(
'
view
-t
ype
'
);
return
$
(
'
.inline-parallel-buttons a.active
'
).
data
(
'
view
T
ype
'
);
}
// eslint-disable-next-line class-methods-use-this
lineNumbers
(
line
)
{
...
...
app/assets/javascripts/due_date_select.js
View file @
35c8fd55
...
...
@@ -17,9 +17,9 @@ class DueDateSelect {
this
.
$value
=
$block
.
find
(
'
.value
'
);
this
.
$valueContent
=
$block
.
find
(
'
.value-content
'
);
this
.
$sidebarValue
=
$
(
'
.js-due-date-sidebar-value
'
,
$block
);
this
.
fieldName
=
$dropdown
.
data
(
'
field
-n
ame
'
);
this
.
abilityName
=
$dropdown
.
data
(
'
ability
-n
ame
'
);
this
.
issueUpdateURL
=
$dropdown
.
data
(
'
issue
-u
pdate
'
);
this
.
fieldName
=
$dropdown
.
data
(
'
field
N
ame
'
);
this
.
abilityName
=
$dropdown
.
data
(
'
ability
N
ame
'
);
this
.
issueUpdateURL
=
$dropdown
.
data
(
'
issue
U
pdate
'
);
this
.
rawSelectedDate
=
null
;
this
.
displayedDate
=
null
;
...
...
app/assets/javascripts/files_comment_button.js
View file @
35c8fd55
...
...
@@ -25,7 +25,7 @@ export default {
if
(
!
this
.
userCanCreateNote
)
{
// data-can-create-note is an empty string when true, otherwise undefined
this
.
userCanCreateNote
=
$diffFile
.
closest
(
DIFF_CONTAINER_SELECTOR
).
data
(
'
can
-create-n
ote
'
)
===
''
;
this
.
userCanCreateNote
=
$diffFile
.
closest
(
DIFF_CONTAINER_SELECTOR
).
data
(
'
can
CreateN
ote
'
)
===
''
;
}
this
.
isParallelView
=
Cookies
.
get
(
'
diff_view
'
)
===
'
parallel
'
;
...
...
app/assets/javascripts/gl_dropdown.js
View file @
35c8fd55
...
...
@@ -485,7 +485,7 @@ GitLabDropdown = (function() {
$target
=
$
(
e
.
target
);
if
(
$target
&&
!
$target
.
hasClass
(
'
dropdown-menu-close
'
)
&&
!
$target
.
hasClass
(
'
dropdown-menu-close-icon
'
)
&&
!
$target
.
data
(
'
is
-l
ink
'
))
{
!
$target
.
data
(
'
is
L
ink
'
))
{
e
.
stopPropagation
();
return
false
;
}
else
{
...
...
app/assets/javascripts/gl_form.js
View file @
35c8fd55
...
...
@@ -12,7 +12,7 @@ export default class GLForm {
this
.
destroy
();
// Setup the form
this
.
setupForm
();
this
.
form
.
data
(
'
gl
-f
orm
'
,
this
);
this
.
form
.
data
(
'
gl
F
orm
'
,
this
);
}
destroy
()
{
...
...
@@ -21,7 +21,7 @@ export default class GLForm {
if
(
this
.
autoComplete
)
{
this
.
autoComplete
.
destroy
();
}
this
.
form
.
data
(
'
gl
-f
orm
'
,
null
);
this
.
form
.
data
(
'
gl
F
orm
'
,
null
);
}
setupForm
()
{
...
...
app/assets/javascripts/gpg_badges.js
View file @
35c8fd55
...
...
@@ -11,7 +11,7 @@ export default class GpgBadges {
badges
.
html
(
'
<i class="fa fa-spinner fa-spin"></i>
'
);
const
params
=
parseQueryStringIntoObject
(
form
.
serialize
());
return
axios
.
get
(
form
.
data
(
'
signatures
-p
ath
'
),
{
params
})
return
axios
.
get
(
form
.
data
(
'
signatures
P
ath
'
),
{
params
})
.
then
(({
data
})
=>
{
data
.
signatures
.
forEach
((
signature
)
=>
{
badges
.
filter
(
`[data-commit-sha="
${
signature
.
commit_sha
}
"]`
).
replaceWith
(
signature
.
html
);
...
...
app/assets/javascripts/groups_select.js
View file @
35c8fd55
...
...
@@ -7,8 +7,8 @@ export default function groupsSelect() {
window
.
GROUP_SELECT_PER_PAGE
=
20
;
$
(
'
.ajax-groups-select
'
).
each
(
function
setAjaxGroupsSelect2
()
{
const
$select
=
$
(
this
);
const
allAvailable
=
$select
.
data
(
'
all
-a
vailable
'
);
const
skipGroups
=
$select
.
data
(
'
skip
-g
roups
'
)
||
[];
const
allAvailable
=
$select
.
data
(
'
all
A
vailable
'
);
const
skipGroups
=
$select
.
data
(
'
skip
G
roups
'
)
||
[];
$select
.
select2
({
placeholder
:
'
Search for a group
'
,
multiple
:
$select
.
hasClass
(
'
multiselect
'
),
...
...
app/assets/javascripts/integrations/integration_settings_form.js
View file @
35c8fd55
...
...
@@ -6,8 +6,8 @@ export default class IntegrationSettingsForm {
this
.
$form
=
$
(
formSelector
);
// Form Metadata
this
.
canTestService
=
this
.
$form
.
data
(
'
can
-t
est
'
);
this
.
testEndPoint
=
this
.
$form
.
data
(
'
test
-u
rl
'
);
this
.
canTestService
=
this
.
$form
.
data
(
'
can
T
est
'
);
this
.
testEndPoint
=
this
.
$form
.
data
(
'
test
U
rl
'
);
// Form Child Elements
this
.
$serviceToggle
=
this
.
$form
.
find
(
'
#service_active
'
);
...
...
app/assets/javascripts/issue_show/components/description.vue
View file @
35c8fd55
...
...
@@ -78,6 +78,7 @@
taskListUpdateSuccess
(
data
)
{
try
{
this
.
checkForSpam
(
data
);
this
.
closeRecaptcha
();
}
catch
(
error
)
{
if
(
error
&&
error
.
name
===
'
SpamError
'
)
this
.
openRecaptcha
();
}
...
...
app/assets/javascripts/issue_status_select.js
View file @
35c8fd55
export
default
function
issueStatusSelect
()
{
$
(
'
.js-issue-status
'
).
each
((
i
,
el
)
=>
{
const
fieldName
=
$
(
el
).
data
(
'
field
-n
ame
'
);
const
fieldName
=
$
(
el
).
data
(
'
field
N
ame
'
);
return
$
(
el
).
glDropdown
({
selectable
:
true
,
fieldName
,
...
...
app/assets/javascripts/labels_select.js
View file @
35c8fd55
...
...
@@ -25,19 +25,19 @@ export default class LabelsSelect {
$dropdown
=
$
(
dropdown
);
$dropdownContainer
=
$dropdown
.
closest
(
'
.labels-filter
'
);
$toggleText
=
$dropdown
.
find
(
'
.dropdown-toggle-text
'
);
namespacePath
=
$dropdown
.
data
(
'
namespace
-p
ath
'
);
projectPath
=
$dropdown
.
data
(
'
project
-p
ath
'
);
namespacePath
=
$dropdown
.
data
(
'
namespace
P
ath
'
);
projectPath
=
$dropdown
.
data
(
'
project
P
ath
'
);
labelUrl
=
$dropdown
.
data
(
'
labels
'
);
issueUpdateURL
=
$dropdown
.
data
(
'
issueUpdate
'
);
selectedLabel
=
$dropdown
.
data
(
'
selected
'
);
if
((
selectedLabel
!=
null
)
&&
!
$dropdown
.
hasClass
(
'
js-multiselect
'
))
{
selectedLabel
=
selectedLabel
.
split
(
'
,
'
);
}
showNo
=
$dropdown
.
data
(
'
show
-n
o
'
);
showAny
=
$dropdown
.
data
(
'
show
-a
ny
'
);
showNo
=
$dropdown
.
data
(
'
show
N
o
'
);
showAny
=
$dropdown
.
data
(
'
show
A
ny
'
);
showMenuAbove
=
$dropdown
.
data
(
'
showMenuAbove
'
);
defaultLabel
=
$dropdown
.
data
(
'
default
-l
abel
'
);
abilityName
=
$dropdown
.
data
(
'
ability
-n
ame
'
);
defaultLabel
=
$dropdown
.
data
(
'
default
L
abel
'
);
abilityName
=
$dropdown
.
data
(
'
ability
N
ame
'
);
$selectbox
=
$dropdown
.
closest
(
'
.selectbox
'
);
$block
=
$selectbox
.
closest
(
'
.block
'
);
$form
=
$dropdown
.
closest
(
'
form, .js-issuable-update
'
);
...
...
@@ -45,11 +45,11 @@ export default class LabelsSelect {
$sidebarLabelTooltip
=
$block
.
find
(
'
.js-sidebar-labels-tooltip
'
);
$value
=
$block
.
find
(
'
.value
'
);
$loading
=
$block
.
find
(
'
.block-loading
'
).
fadeOut
();
fieldName
=
$dropdown
.
data
(
'
field
-n
ame
'
);
fieldName
=
$dropdown
.
data
(
'
field
N
ame
'
);
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
(
'
field
-n
ame
'
)
+
'
"]
'
)
.
find
(
'
input[name="
'
+
$dropdown
.
data
(
'
field
N
ame
'
)
+
'
"]
'
)
.
map
(
function
()
{
return
this
.
value
;
}).
get
();
...
...
@@ -268,7 +268,7 @@ export default class LabelsSelect {
return
defaultLabel
;
}
},
fieldName
:
$dropdown
.
data
(
'
field
-n
ame
'
),
fieldName
:
$dropdown
.
data
(
'
field
N
ame
'
),
id
:
function
(
label
)
{
if
(
label
.
id
<=
0
)
return
label
.
title
;
...
...
app/assets/javascripts/layout_nav.js
View file @
35c8fd55
...
...
@@ -4,7 +4,7 @@ import initFlyOutNav from './fly_out_nav';
function
hideEndFade
(
$scrollingTabs
)
{
$scrollingTabs
.
each
(
function
scrollTabsLoop
()
{
const
$this
=
$
(
this
);
$this
.
siblings
(
'
.fade-right
'
).
toggleClass
(
'
scrolling
'
,
$this
.
width
(
)
<
$this
.
prop
(
'
scrollWidth
'
));
$this
.
siblings
(
'
.fade-right
'
).
toggleClass
(
'
scrolling
'
,
Math
.
round
(
$this
.
width
()
)
<
$this
.
prop
(
'
scrollWidth
'
));
});
}
...
...
app/assets/javascripts/lib/utils/text_markdown.js
View file @
35c8fd55
...
...
@@ -138,7 +138,7 @@ textUtils.init = function(form) {
return
$
(
'
.js-md
'
,
form
).
off
(
'
click
'
).
on
(
'
click
'
,
function
()
{
var
$this
;
$this
=
$
(
this
);
return
self
.
updateText
(
$this
.
closest
(
'
.md-area
'
).
find
(
'
textarea
'
),
$this
.
data
(
'
md
-tag
'
),
$this
.
data
(
'
md-block
'
),
!
$this
.
data
(
'
md-p
repend
'
));
return
self
.
updateText
(
$this
.
closest
(
'
.md-area
'
).
find
(
'
textarea
'
),
$this
.
data
(
'
md
Tag
'
),
$this
.
data
(
'
mdBlock
'
),
!
$this
.
data
(
'
mdP
repend
'
));
});
};
...
...
app/assets/javascripts/line_highlighter.js
View file @
35c8fd55
...
...
@@ -83,7 +83,7 @@ LineHighlighter.prototype.clickHandler = function(event) {
var
current
,
lineNumber
,
range
;
event
.
preventDefault
();
this
.
clearHighlight
();
lineNumber
=
$
(
event
.
target
).
closest
(
'
a
'
).
data
(
'
line
-n
umber
'
);
lineNumber
=
$
(
event
.
target
).
closest
(
'
a
'
).
data
(
'
line
N
umber
'
);
current
=
this
.
hashToRange
(
this
.
_hash
);
if
(
!
(
current
[
0
]
&&
event
.
shiftKey
))
{
// If there's no current selection, or there is but Shift wasn't held,
...
...
app/assets/javascripts/main.js
View file @
35c8fd55
...
...
@@ -220,7 +220,7 @@ $(() => {
$document
.
on
(
'
click
'
,
'
.js-confirm-danger
'
,
(
e
)
=>
{
const
btn
=
$
(
e
.
target
);
const
form
=
btn
.
closest
(
'
form
'
);
const
text
=
btn
.
data
(
'
confirm
-danger-m
essage
'
);
const
text
=
btn
.
data
(
'
confirm
DangerM
essage
'
);
e
.
preventDefault
();
// eslint-disable-next-line no-new
...
...
app/assets/javascripts/members.js
View file @
35c8fd55
...
...
@@ -19,7 +19,7 @@ export default class Members {
isSelectable
(
selected
,
$el
)
{
return
!
$el
.
hasClass
(
'
is-active
'
);
},
fieldName
:
$btn
.
data
(
'
field
-n
ame
'
),
fieldName
:
$btn
.
data
(
'
field
N
ame
'
),
id
(
selected
,
$el
)
{
return
$el
.
data
(
'
id
'
);
},
...
...
@@ -51,7 +51,7 @@ export default class Members {
}
// eslint-disable-next-line class-methods-use-this
getMemberListItems
(
$el
)
{
const
$memberListItem
=
$el
.
is
(
'
.member
'
)
?
$el
:
$
(
`#
${
$el
.
data
(
'
el
-i
d
'
)}
`
);
const
$memberListItem
=
$el
.
is
(
'
.member
'
)
?
$el
:
$
(
`#
${
$el
.
data
(
'
el
I
d
'
)}
`
);
return
{
$memberListItem
,
...
...
app/assets/javascripts/merge_request_tabs.js
View file @
35c8fd55
...
...
@@ -361,7 +361,7 @@ export default class MergeRequestTabs {
}
diffViewType
()
{
return
$
(
'
.inline-parallel-buttons a.active
'
).
data
(
'
view
-t
ype
'
);
return
$
(
'
.inline-parallel-buttons a.active
'
).
data
(
'
view
T
ype
'
);
}
isDiffAction
(
action
)
{
...
...
app/assets/javascripts/milestone_select.js
View file @
35c8fd55
...
...
@@ -24,19 +24,19 @@ export default class MilestoneSelect {
$els
.
each
((
i
,
dropdown
)
=>
{
let
collapsedSidebarLabelTemplate
,
milestoneLinkNoneTemplate
,
milestoneLinkTemplate
,
selectedMilestone
,
selectedMilestoneDefault
;
const
$dropdown
=
$
(
dropdown
);
const
projectId
=
$dropdown
.
data
(
'
project
-i
d
'
);
const
projectId
=
$dropdown
.
data
(
'
project
I
d
'
);
const
milestonesUrl
=
$dropdown
.
data
(
'
milestones
'
);
const
issueUpdateURL
=
$dropdown
.
data
(
'
issueUpdate
'
);
const
showNo
=
$dropdown
.
data
(
'
show
-n
o
'
);
const
showAny
=
$dropdown
.
data
(
'
show
-a
ny
'
);
const
showNo
=
$dropdown
.
data
(
'
show
N
o
'
);
const
showAny
=
$dropdown
.
data
(
'
show
A
ny
'
);
const
showMenuAbove
=
$dropdown
.
data
(
'
showMenuAbove
'
);
const
showUpcoming
=
$dropdown
.
data
(
'
show
-u
pcoming
'
);
const
showStarted
=
$dropdown
.
data
(
'
show
-s
tarted
'
);
const
useId
=
$dropdown
.
data
(
'
use
-i
d
'
);
const
defaultLabel
=
$dropdown
.
data
(
'
default
-l
abel
'
);
const
defaultNo
=
$dropdown
.
data
(
'
default
-n
o
'
);
const
issuableId
=
$dropdown
.
data
(
'
issuable
-i
d
'
);
const
abilityName
=
$dropdown
.
data
(
'
ability
-n
ame
'
);
const
showUpcoming
=
$dropdown
.
data
(
'
show
U
pcoming
'
);
const
showStarted
=
$dropdown
.
data
(
'
show
S
tarted
'
);
const
useId
=
$dropdown
.
data
(
'
use
I
d
'
);
const
defaultLabel
=
$dropdown
.
data
(
'
default
L
abel
'
);
const
defaultNo
=
$dropdown
.
data
(
'
default
N
o
'
);
const
issuableId
=
$dropdown
.
data
(
'
issuable
I
d
'
);
const
abilityName
=
$dropdown
.
data
(
'
ability
N
ame
'
);
const
$selectBox
=
$dropdown
.
closest
(
'
.selectbox
'
);
const
$block
=
$selectBox
.
closest
(
'
.block
'
);
const
$sidebarCollapsedValue
=
$block
.
find
(
'
.sidebar-collapsed-icon
'
);
...
...
@@ -114,7 +114,7 @@ export default class MilestoneSelect {
}
},
defaultLabel
:
defaultLabel
,
fieldName
:
$dropdown
.
data
(
'
field
-n
ame
'
),
fieldName
:
$dropdown
.
data
(
'
field
N
ame
'
),
text
:
milestone
=>
_
.
escape
(
milestone
.
title
),
id
:
(
milestone
)
=>
{
if
(
!
useId
&&
!
$dropdown
.
is
(
'
.js-issuable-form-dropdown
'
))
{
...
...
@@ -166,7 +166,7 @@ export default class MilestoneSelect {
}
if
(
boardsStore
)
{
boardsStore
[
$dropdown
.
data
(
'
field
-n
ame
'
)]
=
selected
.
name
;
boardsStore
[
$dropdown
.
data
(
'
field
N
ame
'
)]
=
selected
.
name
;
e
.
preventDefault
();
}
else
if
(
$dropdown
.
hasClass
(
'
js-filter-submit
'
)
&&
(
isIssueIndex
||
isMRIndex
))
{
return
Issuable
.
filterResults
(
$dropdown
.
closest
(
'
form
'
));
...
...
app/assets/javascripts/notes.js
View file @
35c8fd55
...
...
@@ -219,7 +219,7 @@ export default class Notes {
}
editNote
=
$textarea
.
closest
(
'
.note
'
);
if
(
editNote
.
length
)
{
originalText
=
$textarea
.
closest
(
'
form
'
).
data
(
'
original
-n
ote
'
);
originalText
=
$textarea
.
closest
(
'
form
'
).
data
(
'
original
N
ote
'
);
newText
=
$textarea
.
val
();
if
(
originalText
!==
newText
)
{
if
(
!
confirm
(
'
Are you sure you want to cancel editing this comment?
'
))
{
...
...
@@ -609,9 +609,9 @@ export default class Notes {
*/
addDiscussionNote
(
$form
,
note
,
isNewDiffComment
)
{
if
(
$form
.
attr
(
'
data-resolve-all
'
)
!=
null
)
{
var
projectPath
=
$form
.
data
(
'
project
-p
ath
'
);
var
discussionId
=
$form
.
data
(
'
discussion
-i
d
'
);
var
mergeRequestId
=
$form
.
data
(
'
noteable
-i
id
'
);
var
projectPath
=
$form
.
data
(
'
project
P
ath
'
);
var
discussionId
=
$form
.
data
(
'
discussion
I
d
'
);
var
mergeRequestId
=
$form
.
data
(
'
noteable
I
id
'
);
if
(
ResolveService
!=
null
)
{
ResolveService
.
toggleResolveForDiscussion
(
mergeRequestId
,
discussionId
);
...
...
@@ -751,7 +751,7 @@ export default class Notes {
form
.
removeClass
(
'
current-note-edit-form
'
);
form
.
find
(
'
.js-finish-edit-warning
'
).
hide
();
// Replace markdown textarea text with original note text.
return
form
.
find
(
'
.js-note-text
'
).
val
(
form
.
find
(
'
form.edit-note
'
).
data
(
'
original
-n
ote
'
));
return
form
.
find
(
'
.js-note-text
'
).
val
(
form
.
find
(
'
form.edit-note
'
).
data
(
'
original
N
ote
'
));
}
/**
...
...
@@ -776,7 +776,7 @@ export default class Notes {
var
$note
,
$notes
;
$note
=
$
(
el
);
$notes
=
$note
.
closest
(
'
.discussion-notes
'
);
const
discussionId
=
$
(
'
.notes
'
,
$notes
).
data
(
'
discussion
-i
d
'
);
const
discussionId
=
$
(
'
.notes
'
,
$notes
).
data
(
'
discussion
I
d
'
);
if
(
typeof
gl
.
diffNotesCompileComponents
!==
'
undefined
'
)
{
if
(
gl
.
diffNoteApps
[
noteElId
])
{
...
...
@@ -897,7 +897,7 @@ export default class Notes {
// DiffNote
form
.
find
(
'
#note_position
'
).
val
(
dataHolder
.
attr
(
'
data-position
'
));
form
.
find
(
'
.js-note-discard
'
).
show
().
removeClass
(
'
js-note-discard
'
).
addClass
(
'
js-close-discussion-note-form
'
).
text
(
form
.
find
(
'
.js-close-discussion-note-form
'
).
data
(
'
cancel
-t
ext
'
));
form
.
find
(
'
.js-note-discard
'
).
show
().
removeClass
(
'
js-note-discard
'
).
addClass
(
'
js-close-discussion-note-form
'
).
text
(
form
.
find
(
'
.js-close-discussion-note-form
'
).
data
(
'
cancel
T
ext
'
));
form
.
find
(
'
.js-note-target-close
'
).
remove
();
form
.
find
(
'
.js-note-new-discussion
'
).
remove
();
this
.
setupNoteForm
(
form
);
...
...
@@ -1037,7 +1037,7 @@ export default class Notes {
removeDiscussionNoteForm
(
form
)
{
var
glForm
,
row
;
row
=
form
.
closest
(
'
tr
'
);
glForm
=
form
.
data
(
'
gl
-f
orm
'
);
glForm
=
form
.
data
(
'
gl
F
orm
'
);
glForm
.
destroy
();
form
.
find
(
'
.js-note-text
'
).
data
(
'
autosave
'
).
reset
();
// show the reply button (will only work for replies)
...
...
@@ -1122,8 +1122,8 @@ export default class Notes {
return
discardbtn
.
show
();
}
}
else
{
reopentext
=
reopenbtn
.
data
(
'
original
-t
ext
'
);
closetext
=
closebtn
.
data
(
'
original
-t
ext
'
);
reopentext
=
reopenbtn
.
data
(
'
original
T
ext
'
);
closetext
=
closebtn
.
data
(
'
original
T
ext
'
);
if
(
reopenbtn
.
text
()
!==
reopentext
)
{
reopenbtn
.
text
(
reopentext
);
}
...
...
@@ -1150,9 +1150,9 @@ export default class Notes {
var
$originalContentEl
=
$note
.
find
(
'
.original-note-content
'
);
var
originalContent
=
$originalContentEl
.
text
().
trim
();
var
postUrl
=
$originalContentEl
.
data
(
'
post
-u
rl
'
);
var
targetId
=
$originalContentEl
.
data
(
'
target
-i
d
'
);
var
targetType
=
$originalContentEl
.
data
(
'
target
-t
ype
'
);
var
postUrl
=
$originalContentEl
.
data
(
'
post
U
rl
'
);
var
targetId
=
$originalContentEl
.
data
(
'
target
I
d
'
);
var
targetType
=
$originalContentEl
.
data
(
'
target
T
ype
'
);
this
.
glForm
=
new
GLForm
(
$editForm
.
find
(
'
form
'
),
this
.
enableGFM
);
...
...
@@ -1513,9 +1513,9 @@ export default class Notes {
// If comment intends to resolve discussion, do the same.
if
(
isDiscussionResolve
)
{
$form
.
attr
(
'
data-discussion-id
'
,
$submitBtn
.
data
(
'
discussion
-i
d
'
))
.
attr
(
'
data-discussion-id
'
,
$submitBtn
.
data
(
'
discussion
I
d
'
))
.
attr
(
'
data-resolve-all
'
,
'
true
'
)
.
attr
(
'
data-project-path
'
,
$submitBtn
.
data
(
'
project
-p
ath
'
));
.
attr
(
'
data-project-path
'
,
$submitBtn
.
data
(
'
project
P
ath
'
));
}
// Show final note element on UI
...
...
@@ -1587,7 +1587,7 @@ export default class Notes {
this
.
addNoteError
(
$form
);
});
return
$closeBtn
.
text
(
$closeBtn
.
data
(
'
original
-t
ext
'
));
return
$closeBtn
.
text
(
$closeBtn
.
data
(
'
original
T
ext
'
));
}
/**
...
...
@@ -1642,7 +1642,7 @@ export default class Notes {
this
.
updateNoteError
();
});
return
$closeBtn
.
text
(
$closeBtn
.
data
(
'
original
-t
ext
'
));
return
$closeBtn
.
text
(
$closeBtn
.
data
(
'
original
T
ext
'
));
}
}
...
...
app/assets/javascripts/notifications_dropdown.js
View file @
35c8fd55
...
...
@@ -3,11 +3,11 @@ import Flash from './flash';
export
default
function
notificationsDropdown
()
{
$
(
document
).
on
(
'
click
'
,
'
.update-notification
'
,
function
updateNotificationCallback
(
e
)
{
e
.
preventDefault
();
if
(
$
(
this
).
is
(
'
.is-active
'
)
&&
$
(
this
).
data
(
'
notification
-l
evel
'
)
===
'
custom
'
)
{
if
(
$
(
this
).
is
(
'
.is-active
'
)
&&
$
(
this
).
data
(
'
notification
L
evel
'
)
===
'
custom
'
)
{
return
;
}
const
notificationLevel
=
$
(
this
).
data
(
'
notification
-l
evel
'
);
const
notificationLevel
=
$
(
this
).
data
(
'
notification
L
evel
'
);
const
form
=
$
(
this
).
parents
(
'
.notification-form:first
'
);
form
.
find
(
'
.js-notification-loading
'
).
toggleClass
(
'
fa-bell fa-spin fa-spinner
'
);
...
...
app/assets/javascripts/pager.js
View file @
35c8fd55
...
...
@@ -56,7 +56,7 @@ export default {
},
initLoadMore
()
{
$
(
document
).
unbind
(
'
scroll
'
);
$
(
document
).
off
(
'
scroll
'
);
$
(
document
).
endlessScroll
({
bottomPixels
:
ENDLESS_SCROLL_BOTTOM_PX
,
fireDelay
:
ENDLESS_SCROLL_FIRE_DELAY_MS
,
...
...
app/assets/javascripts/pages/admin/abuse_reports/abuse_reports.js
View file @
35c8fd55
...
...
@@ -15,21 +15,21 @@ export default class AbuseReports {
const
$messageCellElement
=
$
(
this
);
const
reportMessage
=
$messageCellElement
.
text
();
if
(
reportMessage
.
length
>
MAX_MESSAGE_LENGTH
)
{
$messageCellElement
.
data
(
'
original
-m
essage
'
,
reportMessage
);
$messageCellElement
.
data
(
'
message
-t
runcated
'
,
'
true
'
);
$messageCellElement
.
data
(
'
original
M
essage
'
,
reportMessage
);
$messageCellElement
.
data
(
'
message
T
runcated
'
,
'
true
'
);
$messageCellElement
.
text
(
truncate
(
reportMessage
,
MAX_MESSAGE_LENGTH
));
}
}
toggleMessageTruncation
()
{
const
$messageCellElement
=
$
(
this
);
const
originalMessage
=
$messageCellElement
.
data
(
'
original
-m
essage
'
);
const
originalMessage
=
$messageCellElement
.
data
(
'
original
M
essage
'
);
if
(
!
originalMessage
)
return
;
if
(
$messageCellElement
.
data
(
'
message
-t
runcated
'
)
===
'
true
'
)
{
$messageCellElement
.
data
(
'
message
-t
runcated
'
,
'
false
'
);
if
(
$messageCellElement
.
data
(
'
message
T
runcated
'
)
===
'
true
'
)
{
$messageCellElement
.
data
(
'
message
T
runcated
'
,
'
false
'
);
$messageCellElement
.
text
(
originalMessage
);
}
else
{
$messageCellElement
.
data
(
'
message
-t
runcated
'
,
'
true
'
);
$messageCellElement
.
data
(
'
message
T
runcated
'
,
'
true
'
);
$messageCellElement
.
text
(
`
${
originalMessage
.
substr
(
0
,
(
MAX_MESSAGE_LENGTH
-
3
))}
...`
);
}
}
...
...
app/assets/javascripts/pages/admin/admin.js
View file @
35c8fd55
...
...
@@ -16,9 +16,9 @@ export default function adminInit() {
$
(
'
input#user_force_random_password
'
).
on
(
'
change
'
,
function
randomPasswordClick
()
{
const
$elems
=
$
(
'
#user_password, #user_password_confirmation
'
);
if
(
$
(
this
).
attr
(
'
checked
'
))
{
$elems
.
val
(
''
).
attr
(
'
disabled
'
,
true
);
$elems
.
val
(
''
).
prop
(
'
disabled
'
,
true
);
}
else
{
$elems
.
removeAttr
(
'
disabled
'
);
$elems
.
prop
(
'
disabled
'
,
false
);
}
});
...
...
app/assets/javascripts/pages/admin/broadcast_messages/broadcast_message.js
View file @
35c8fd55
...
...
@@ -14,7 +14,7 @@ export default function initBroadcastMessagesForm() {
$
(
'
div.broadcast-message-preview
'
).
css
(
'
color
'
,
previewColor
);
});
const
previewPath
=
$
(
'
textarea#broadcast_message_message
'
).
data
(
'
preview
-p
ath
'
);
const
previewPath
=
$
(
'
textarea#broadcast_message_message
'
).
data
(
'
preview
P
ath
'
);
$
(
'
textarea#broadcast_message_message
'
).
on
(
'
input
'
,
_
.
debounce
(
function
onMessageInput
()
{
const
message
=
$
(
this
).
val
();
...
...
app/assets/javascripts/pages/projects/project.js
View file @
35c8fd55
...
...
@@ -71,7 +71,7 @@ export default class Project {
selected
=
$dropdown
.
data
(
'
selected
'
);
return
$dropdown
.
glDropdown
({
data
(
term
,
callback
)
{
axios
.
get
(
$dropdown
.
data
(
'
refs
-u
rl
'
),
{
axios
.
get
(
$dropdown
.
data
(
'
refs
U
rl
'
),
{
params
:
{
ref
:
$dropdown
.
data
(
'
ref
'
),
search
:
term
,
...
...
@@ -84,8 +84,8 @@ export default class Project {
filterable
:
true
,
filterRemote
:
true
,
filterByText
:
true
,
inputFieldName
:
$dropdown
.
data
(
'
input
-field-n
ame
'
),
fieldName
:
$dropdown
.
data
(
'
field
-n
ame
'
),
inputFieldName
:
$dropdown
.
data
(
'
input
FieldN
ame
'
),
fieldName
:
$dropdown
.
data
(
'
field
N
ame
'
),
renderRow
:
function
(
ref
)
{
var
li
=
refListItem
.
cloneNode
(
false
);
...
...
app/assets/javascripts/pages/search/show/search.js
View file @
35c8fd55
...
...
@@ -9,7 +9,7 @@ export default class Search {
this
.
searchInput
=
'
.js-search-input
'
;
this
.
searchClear
=
'
.js-search-clear
'
;
this
.
groupId
=
$groupDropdown
.
data
(
'
group
-i
d
'
);
this
.
groupId
=
$groupDropdown
.
data
(
'
group
I
d
'
);
this
.
eventListeners
();
$groupDropdown
.
glDropdown
({
...
...
@@ -36,7 +36,7 @@ export default class Search {
return
obj
.
full_name
;
},
toggleLabel
(
obj
)
{
return
`
${(
$groupDropdown
.
data
(
'
default
-l
abel
'
))}
${
obj
.
full_name
}
`
;
return
`
${(
$groupDropdown
.
data
(
'
default
L
abel
'
))}
${
obj
.
full_name
}
`
;
},
clicked
:
()
=>
Search
.
submitSearch
(),
});
...
...
@@ -69,7 +69,7 @@ export default class Search {
return
obj
.
name_with_namespace
;
},
toggleLabel
(
obj
)
{
return
`
${(
$projectDropdown
.
data
(
'
default
-l
abel
'
))}
${
obj
.
name_with_namespace
}
`
;
return
`
${(
$projectDropdown
.
data
(
'
default
L
abel
'
))}
${
obj
.
name_with_namespace
}
`
;
},
clicked
:
()
=>
Search
.
submitSearch
(),
});
...
...
app/assets/javascripts/project_select.js
View file @
35c8fd55
...
...
@@ -5,13 +5,13 @@ import ProjectSelectComboButton from './project_select_combo_button';
export
default
function
projectSelect
()
{
$
(
'
.ajax-project-select
'
).
each
(
function
(
i
,
select
)
{
var
placeholder
;
const
simpleFilter
=
$
(
select
).
data
(
'
simple
-f
ilter
'
)
||
false
;
this
.
groupId
=
$
(
select
).
data
(
'
group
-i
d
'
);
this
.
includeGroups
=
$
(
select
).
data
(
'
include
-g
roups
'
);
this
.
allProjects
=
$
(
select
).
data
(
'
all
-p
rojects
'
)
||
false
;
this
.
orderBy
=
$
(
select
).
data
(
'
order
-b
y
'
)
||
'
id
'
;
this
.
withIssuesEnabled
=
$
(
select
).
data
(
'
with
-issues-e
nabled
'
);
this
.
withMergeRequestsEnabled
=
$
(
select
).
data
(
'
with
-merge-requests-e
nabled
'
);
const
simpleFilter
=
$
(
select
).
data
(
'
simple
F
ilter
'
)
||
false
;
this
.
groupId
=
$
(
select
).
data
(
'
group
I
d
'
);
this
.
includeGroups
=
$
(
select
).
data
(
'
include
G
roups
'
);
this
.
allProjects
=
$
(
select
).
data
(
'
all
P
rojects
'
)
||
false
;
this
.
orderBy
=
$
(
select
).
data
(
'
order
B
y
'
)
||
'
id
'
;
this
.
withIssuesEnabled
=
$
(
select
).
data
(
'
with
IssuesE
nabled
'
);
this
.
withMergeRequestsEnabled
=
$
(
select
).
data
(
'
with
MergeRequestsE
nabled
'
);
placeholder
=
"
Search for project
"
;
if
(
this
.
includeGroups
)
{
...
...
app/assets/javascripts/prometheus_metrics/prometheus_metrics.js
View file @
35c8fd55
...
...
@@ -19,7 +19,7 @@ export default class PrometheusMetrics {
this
.
$missingEnvVarMetricCount
=
this
.
$missingEnvVarPanel
.
find
(
'
.js-env-var-count
'
);
this
.
$missingEnvVarMetricsList
=
this
.
$missingEnvVarPanel
.
find
(
'
.js-missing-var-metrics-list
'
);
this
.
activeMetricsEndpoint
=
this
.
$monitoredMetricsPanel
.
data
(
'
active
-m
etrics
'
);
this
.
activeMetricsEndpoint
=
this
.
$monitoredMetricsPanel
.
data
(
'
active
M
etrics
'
);
this
.
$panelToggle
.
on
(
'
click
'
,
e
=>
this
.
handlePanelToggle
(
e
));
}
...
...
app/assets/javascripts/protected_branches/protected_branch_access_dropdown.js
View file @
35c8fd55
...
...
@@ -9,8 +9,8 @@ export default class ProtectedBranchAccessDropdown {
$dropdown
.
glDropdown
({
data
,
selectable
:
true
,
inputId
:
$dropdown
.
data
(
'
input
-i
d
'
),
fieldName
:
$dropdown
.
data
(
'
field
-n
ame
'
),
inputId
:
$dropdown
.
data
(
'
input
I
d
'
),
fieldName
:
$dropdown
.
data
(
'
field
N
ame
'
),
toggleLabel
(
item
,
$el
)
{
if
(
$el
.
is
(
'
.is-active
'
))
{
return
item
.
text
;
...
...
app/assets/javascripts/protected_branches/protected_branch_create.js
View file @
35c8fd55
...
...
@@ -59,7 +59,7 @@ export default class ProtectedBranchCreate {
);
this
.
savePreviousSelection
(
$allowedToMergeInput
.
val
(),
$allowedToPushInput
.
val
());
this
.
$form
.
find
(
'
input[type="submit"]
'
).
attr
(
'
disabled
'
,
completedForm
);
this
.
$form
.
find
(
'
input[type="submit"]
'
).
prop
(
'
disabled
'
,
completedForm
);
}
static
getProtectedBranches
(
term
,
callback
)
{
...
...
app/assets/javascripts/protected_branches/protected_branch_edit.js
View file @
35c8fd55
...
...
@@ -41,11 +41,11 @@ export default class ProtectedBranchEdit {
axios
.
patch
(
this
.
$wrap
.
data
(
'
url
'
),
{
protected_branch
:
{
merge_access_levels_attributes
:
[{
id
:
this
.
$allowedToMergeDropdown
.
data
(
'
access
-level-i
d
'
),
id
:
this
.
$allowedToMergeDropdown
.
data
(
'
access
LevelI
d
'
),
access_level
:
$allowedToMergeInput
.
val
(),
}],
push_access_levels_attributes
:
[{
id
:
this
.
$allowedToPushDropdown
.
data
(
'
access
-level-i
d
'
),
id
:
this
.
$allowedToPushDropdown
.
data
(
'
access
LevelI
d
'
),
access_level
:
$allowedToPushInput
.
val
(),
}],
},
...
...
app/assets/javascripts/protected_tags/protected_tag_access_dropdown.js
View file @
35c8fd55
...
...
@@ -9,8 +9,8 @@ export default class ProtectedTagAccessDropdown {
this
.
options
.
$dropdown
.
glDropdown
({
data
:
this
.
options
.
data
,
selectable
:
true
,
inputId
:
this
.
options
.
$dropdown
.
data
(
'
input
-i
d
'
),
fieldName
:
this
.
options
.
$dropdown
.
data
(
'
field
-n
ame
'
),
inputId
:
this
.
options
.
$dropdown
.
data
(
'
input
I
d
'
),
fieldName
:
this
.
options
.
$dropdown
.
data
(
'
field
N
ame
'
),
toggleLabel
(
item
,
$el
)
{
if
(
$el
.
is
(
'
.is-active
'
))
{
return
item
.
text
;
...
...
app/assets/javascripts/protected_tags/protected_tag_create.js
View file @
35c8fd55
...
...
@@ -39,7 +39,7 @@ export default class ProtectedTagCreate {
const
$tagInput
=
this
.
$form
.
find
(
'
input[name="protected_tag[name]"]
'
);
const
$allowedToCreateInput
=
this
.
$form
.
find
(
'
#create_access_levels_attributes
'
);
this
.
$form
.
find
(
'
input[type="submit"]
'
).
attr
(
'
disabled
'
,
!
(
$tagInput
.
val
()
&&
$allowedToCreateInput
.
length
));
this
.
$form
.
find
(
'
input[type="submit"]
'
).
prop
(
'
disabled
'
,
!
(
$tagInput
.
val
()
&&
$allowedToCreateInput
.
length
));
}
static
getProtectedTags
(
term
,
callback
)
{
...
...
app/assets/javascripts/protected_tags/protected_tag_edit.js
View file @
35c8fd55
...
...
@@ -31,7 +31,7 @@ export default class ProtectedTagEdit {
axios
.
patch
(
this
.
$wrap
.
data
(
'
url
'
),
{
protected_tag
:
{
create_access_levels_attributes
:
[{
id
:
this
.
$allowedToCreateDropdownButton
.
data
(
'
access
-level-i
d
'
),
id
:
this
.
$allowedToCreateDropdownButton
.
data
(
'
access
LevelI
d
'
),
access_level
:
$allowedToCreateInput
.
val
(),
}],
},
...
...
app/assets/javascripts/ref_select_dropdown.js
View file @
35c8fd55
...
...
@@ -6,7 +6,7 @@ class RefSelectDropdown {
filterable
:
true
,
filterByText
:
true
,
remote
:
false
,
fieldName
:
$dropdownButton
.
data
(
'
field
-n
ame
'
),
fieldName
:
$dropdownButton
.
data
(
'
field
N
ame
'
),
filterInput
:
'
input[type="search"]
'
,
selectable
:
true
,
isSelectable
(
branch
,
$el
)
{
...
...
@@ -24,7 +24,7 @@ class RefSelectDropdown {
});
const
$dropdownContainer
=
$dropdownButton
.
closest
(
'
.dropdown
'
);
const
$fieldInput
=
$
(
`input[name="
${
$dropdownButton
.
data
(
'
field
-n
ame
'
)}
"]`
,
$dropdownContainer
);
const
$fieldInput
=
$
(
`input[name="
${
$dropdownButton
.
data
(
'
field
N
ame
'
)}
"]`
,
$dropdownContainer
);
const
$filterInput
=
$
(
'
input[type="search"]
'
,
$dropdownContainer
);
$filterInput
.
on
(
'
keyup
'
,
(
e
)
=>
{
...
...
app/assets/javascripts/right_sidebar.js
View file @
35c8fd55
...
...
@@ -76,8 +76,8 @@ Sidebar.prototype.toggleTodo = function(e) {
$
(
'
.js-issuable-todo
'
).
disable
().
addClass
(
'
is-loading
'
);
axios
[
ajaxType
](
url
,
{
issuable_id
:
$this
.
data
(
'
issuable
-i
d
'
),
issuable_type
:
$this
.
data
(
'
issuable
-t
ype
'
),
issuable_id
:
$this
.
data
(
'
issuable
I
d
'
),
issuable_type
:
$this
.
data
(
'
issuable
T
ype
'
),
}).
then
(({
data
})
=>
{
this
.
todoUpdateDone
(
data
);
}).
catch
(()
=>
flash
(
`There was an error
${
ajaxType
===
'
post
'
?
'
adding a
'
:
'
deleting the
'
}
todo.`
));
...
...
@@ -96,18 +96,18 @@ Sidebar.prototype.todoUpdateDone = function(data) {
$el
.
removeClass
(
'
is-loading
'
)
.
enable
()
.
attr
(
'
aria-label
'
,
$el
.
data
(
`
${
attrPrefix
}
-t
ext`
))
.
attr
(
'
aria-label
'
,
$el
.
data
(
`
${
attrPrefix
}
T
ext`
))
.
attr
(
'
data-delete-path
'
,
deletePath
)
.
attr
(
'
title
'
,
$el
.
data
(
`
${
attrPrefix
}
-t
ext`
));
.
attr
(
'
title
'
,
$el
.
data
(
`
${
attrPrefix
}
T
ext`
));
if
(
$el
.
hasClass
(
'
has-tooltip
'
))
{
$el
.
tooltip
(
'
fixTitle
'
);
}
if
(
$el
.
data
(
`
${
attrPrefix
}
-i
con`
))
{
$elText
.
html
(
$el
.
data
(
`
${
attrPrefix
}
-i
con`
));
if
(
$el
.
data
(
`
${
attrPrefix
}
I
con`
))
{
$elText
.
html
(
$el
.
data
(
`
${
attrPrefix
}
I
con`
));
}
else
{
$elText
.
text
(
$el
.
data
(
`
${
attrPrefix
}
-t
ext`
));
$elText
.
text
(
$el
.
data
(
`
${
attrPrefix
}
T
ext`
));
}
});
};
...
...
app/assets/javascripts/search_autocomplete.js
View file @
35c8fd55
...
...
@@ -25,32 +25,32 @@ function setSearchOptions() {
if
(
$projectOptionsDataEl
.
length
)
{
gl
.
projectOptions
=
gl
.
projectOptions
||
{};
var
projectPath
=
$projectOptionsDataEl
.
data
(
'
project
-p
ath
'
);
var
projectPath
=
$projectOptionsDataEl
.
data
(
'
project
P
ath
'
);
gl
.
projectOptions
[
projectPath
]
=
{
name
:
$projectOptionsDataEl
.
data
(
'
name
'
),
issuesPath
:
$projectOptionsDataEl
.
data
(
'
issues
-p
ath
'
),
issuesDisabled
:
$projectOptionsDataEl
.
data
(
'
issues
-d
isabled
'
),
mrPath
:
$projectOptionsDataEl
.
data
(
'
mr
-p
ath
'
),
issuesPath
:
$projectOptionsDataEl
.
data
(
'
issues
P
ath
'
),
issuesDisabled
:
$projectOptionsDataEl
.
data
(
'
issues
D
isabled
'
),
mrPath
:
$projectOptionsDataEl
.
data
(
'
mr
P
ath
'
),
};
}
if
(
$groupOptionsDataEl
.
length
)
{
gl
.
groupOptions
=
gl
.
groupOptions
||
{};
var
groupPath
=
$groupOptionsDataEl
.
data
(
'
group
-p
ath
'
);
var
groupPath
=
$groupOptionsDataEl
.
data
(
'
group
P
ath
'
);
gl
.
groupOptions
[
groupPath
]
=
{
name
:
$groupOptionsDataEl
.
data
(
'
name
'
),
issuesPath
:
$groupOptionsDataEl
.
data
(
'
issues
-p
ath
'
),
mrPath
:
$groupOptionsDataEl
.
data
(
'
mr
-p
ath
'
),
issuesPath
:
$groupOptionsDataEl
.
data
(
'
issues
P
ath
'
),
mrPath
:
$groupOptionsDataEl
.
data
(
'
mr
P
ath
'
),
};
}
if
(
$dashboardOptionsDataEl
.
length
)
{
gl
.
dashboardOptions
=
{
issuesPath
:
$dashboardOptionsDataEl
.
data
(
'
issues
-p
ath
'
),
mrPath
:
$dashboardOptionsDataEl
.
data
(
'
mr
-p
ath
'
),
issuesPath
:
$dashboardOptionsDataEl
.
data
(
'
issues
P
ath
'
),
mrPath
:
$dashboardOptionsDataEl
.
data
(
'
mr
P
ath
'
),
};
}
}
...
...
@@ -61,9 +61,9 @@ export default class SearchAutocomplete {
this
.
bindEventContext
();
this
.
wrap
=
wrap
||
$
(
'
.search
'
);
this
.
optsEl
=
optsEl
||
this
.
wrap
.
find
(
'
.search-autocomplete-opts
'
);
this
.
autocompletePath
=
autocompletePath
||
this
.
optsEl
.
data
(
'
autocomplete
-p
ath
'
);
this
.
projectId
=
projectId
||
(
this
.
optsEl
.
data
(
'
autocomplete
-project-i
d
'
)
||
''
);
this
.
projectRef
=
projectRef
||
(
this
.
optsEl
.
data
(
'
autocomplete
-project-r
ef
'
)
||
''
);
this
.
autocompletePath
=
autocompletePath
||
this
.
optsEl
.
data
(
'
autocomplete
P
ath
'
);
this
.
projectId
=
projectId
||
(
this
.
optsEl
.
data
(
'
autocomplete
ProjectI
d
'
)
||
''
);
this
.
projectRef
=
projectRef
||
(
this
.
optsEl
.
data
(
'
autocomplete
ProjectR
ef
'
)
||
''
);
this
.
dropdown
=
this
.
wrap
.
find
(
'
.dropdown
'
);
this
.
dropdownToggle
=
this
.
wrap
.
find
(
'
.js-dropdown-search-toggle
'
);
this
.
dropdownContent
=
this
.
dropdown
.
find
(
'
.dropdown-content
'
);
...
...
app/assets/javascripts/sidebar/lib/sidebar_move_issue.js
View file @
35c8fd55
...
...
@@ -50,7 +50,7 @@ class SidebarMoveIssue {
const
selectedProjectId
=
options
.
isMarking
?
project
.
id
:
0
;
this
.
mediator
.
setMoveToProjectId
(
selectedProjectId
);
this
.
$confirmButton
.
attr
(
'
disabled
'
,
!
isValidProjectId
(
selectedProjectId
));
this
.
$confirmButton
.
prop
(
'
disabled
'
,
!
isValidProjectId
(
selectedProjectId
));
},
});
}
...
...
app/assets/javascripts/single_file_diff.js
View file @
35c8fd55
...
...
@@ -18,7 +18,7 @@ export default class SingleFileDiff {
this
.
toggleDiff
=
this
.
toggleDiff
.
bind
(
this
);
this
.
content
=
$
(
'
.diff-content
'
,
this
.
file
);
this
.
$toggleIcon
=
$
(
'
.diff-toggle-caret
'
,
this
.
file
);
this
.
diffForPath
=
this
.
content
.
find
(
'
[data-diff-for-path]
'
).
data
(
'
diff
-for-p
ath
'
);
this
.
diffForPath
=
this
.
content
.
find
(
'
[data-diff-for-path]
'
).
data
(
'
diff
ForP
ath
'
);
this
.
isOpen
=
!
this
.
diffForPath
;
if
(
this
.
diffForPath
)
{
this
.
collapsedContent
=
this
.
content
;
...
...
app/assets/javascripts/star.js
View file @
35c8fd55
import
Flash
from
'
./flash
'
;
import
{
__
,
s__
}
from
'
./locale
'
;
import
{
spriteIcon
}
from
'
./lib/utils/common_utils
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
export
default
class
Star
{
constructor
()
{
$
(
'
.project-home-panel .toggle-star
'
)
.
on
(
'
ajax:success
'
,
function
handleSuccess
(
e
,
data
)
{
const
$this
=
$
(
this
);
const
$starSpan
=
$this
.
find
(
'
span
'
);
const
$startIcon
=
$this
.
find
(
'
svg
'
);
$
(
'
.project-home-panel .toggle-star
'
).
on
(
'
click
'
,
function
toggleStarClickCallback
()
{
const
$this
=
$
(
this
);
const
$starSpan
=
$this
.
find
(
'
span
'
);
const
$startIcon
=
$this
.
find
(
'
svg
'
);
function
toggleStar
(
isStarred
)
{
axios
.
post
(
$this
.
data
(
'
endpoint
'
))
.
then
(({
data
})
=>
{
const
isStarred
=
$starSpan
.
hasClass
(
'
starred
'
);
$this
.
parent
().
find
(
'
.star-count
'
).
text
(
data
.
star_count
);
if
(
isStarred
)
{
$starSpan
.
removeClass
(
'
starred
'
).
text
(
s__
(
'
StarProject|Star
'
));
$startIcon
.
remove
();
...
...
@@ -21,12 +24,8 @@ export default class Star {
$startIcon
.
remove
();
$this
.
prepend
(
spriteIcon
(
'
star
'
));
}
}
toggleStar
(
$starSpan
.
hasClass
(
'
starred
'
));
})
.
on
(
'
ajax:error
'
,
()
=>
{
Flash
(
'
Star toggle failed. Try again later.
'
,
'
alert
'
);
});
})
.
catch
(()
=>
Flash
(
'
Star toggle failed. Try again later.
'
));
});
}
}
app/assets/javascripts/subscription_select.js
View file @
35c8fd55
export
default
function
subscriptionSelect
()
{
$
(
'
.js-subscription-event
'
).
each
((
i
,
element
)
=>
{
const
fieldName
=
$
(
element
).
data
(
'
field
-n
ame
'
);
const
fieldName
=
$
(
element
).
data
(
'
field
N
ame
'
);
return
$
(
element
).
glDropdown
({
selectable
:
true
,
...
...
app/assets/javascripts/task_list.js
View file @
35c8fd55
...
...
@@ -40,7 +40,7 @@ export default class TaskList {
[
this
.
fieldName
]:
$target
.
val
(),
};
return
axios
.
patch
(
$target
.
data
(
'
update
-u
rl
'
)
||
$
(
'
form.js-issuable-update
'
).
attr
(
'
action
'
),
patchData
)
return
axios
.
patch
(
$target
.
data
(
'
update
U
rl
'
)
||
$
(
'
form.js-issuable-update
'
).
attr
(
'
action
'
),
patchData
)
.
then
(({
data
})
=>
this
.
onSuccess
(
data
))
.
catch
(
err
=>
this
.
onError
(
err
));
}
...
...
app/assets/javascripts/templates/issuable_template_selector.js
View file @
35c8fd55
...
...
@@ -6,9 +6,9 @@ import TemplateSelector from '../blob/template_selector';
export
default
class
IssuableTemplateSelector
extends
TemplateSelector
{
constructor
(...
args
)
{
super
(...
args
);
this
.
projectPath
=
this
.
dropdown
.
data
(
'
project
-p
ath
'
);
this
.
namespacePath
=
this
.
dropdown
.
data
(
'
namespace
-p
ath
'
);
this
.
issuableType
=
this
.
$dropdownContainer
.
data
(
'
issuable
-t
ype
'
);
this
.
projectPath
=
this
.
dropdown
.
data
(
'
project
P
ath
'
);
this
.
namespacePath
=
this
.
dropdown
.
data
(
'
namespace
P
ath
'
);
this
.
issuableType
=
this
.
$dropdownContainer
.
data
(
'
issuable
T
ype
'
);
this
.
titleInput
=
$
(
`#
${
this
.
issuableType
}
_title`
);
const
initialQuery
=
{
...
...
app/assets/javascripts/user_callout.js
View file @
35c8fd55
...
...
@@ -22,7 +22,7 @@ export default class UserCallout {
const
$currentTarget
=
$
(
e
.
currentTarget
);
if
(
this
.
options
.
setCalloutPerProject
)
{
Cookies
.
set
(
this
.
cookieName
,
'
true
'
,
{
expires
:
365
,
path
:
this
.
userCalloutBody
.
data
(
'
project
-p
ath
'
)
});
Cookies
.
set
(
this
.
cookieName
,
'
true
'
,
{
expires
:
365
,
path
:
this
.
userCalloutBody
.
data
(
'
project
P
ath
'
)
});
}
else
{
Cookies
.
set
(
this
.
cookieName
,
'
true
'
,
{
expires
:
365
});
}
...
...
app/assets/javascripts/users_select.js
View file @
35c8fd55
...
...
@@ -34,23 +34,23 @@ function UsersSelect(currentUser, els, options = {}) {
var
options
=
{};
var
$block
,
$collapsedSidebar
,
$dropdown
,
$loading
,
$selectbox
,
$value
,
abilityName
,
assignTo
,
assigneeTemplate
,
collapsedAssigneeTemplate
,
defaultLabel
,
defaultNullUser
,
firstUser
,
issueURL
,
selectedId
,
selectedIdDefault
,
showAnyUser
,
showNullUser
,
showMenuAbove
;
$dropdown
=
$
(
dropdown
);
options
.
projectId
=
$dropdown
.
data
(
'
project
-i
d
'
);
options
.
groupId
=
$dropdown
.
data
(
'
group
-i
d
'
);
options
.
showCurrentUser
=
$dropdown
.
data
(
'
current
-u
ser
'
);
options
.
todoFilter
=
$dropdown
.
data
(
'
todo
-f
ilter
'
);
options
.
todoStateFilter
=
$dropdown
.
data
(
'
todo
-state-f
ilter
'
);
options
.
perPage
=
$dropdown
.
data
(
'
per
-p
age
'
);
showNullUser
=
$dropdown
.
data
(
'
null
-u
ser
'
);
defaultNullUser
=
$dropdown
.
data
(
'
null
-user-d
efault
'
);
options
.
projectId
=
$dropdown
.
data
(
'
project
I
d
'
);
options
.
groupId
=
$dropdown
.
data
(
'
group
I
d
'
);
options
.
showCurrentUser
=
$dropdown
.
data
(
'
current
U
ser
'
);
options
.
todoFilter
=
$dropdown
.
data
(
'
todo
F
ilter
'
);
options
.
todoStateFilter
=
$dropdown
.
data
(
'
todo
StateF
ilter
'
);
options
.
perPage
=
$dropdown
.
data
(
'
per
P
age
'
);
showNullUser
=
$dropdown
.
data
(
'
null
U
ser
'
);
defaultNullUser
=
$dropdown
.
data
(
'
null
UserD
efault
'
);
showMenuAbove
=
$dropdown
.
data
(
'
showMenuAbove
'
);
showAnyUser
=
$dropdown
.
data
(
'
any
-u
ser
'
);
firstUser
=
$dropdown
.
data
(
'
first
-u
ser
'
);
options
.
authorId
=
$dropdown
.
data
(
'
author
-i
d
'
);
defaultLabel
=
$dropdown
.
data
(
'
default
-l
abel
'
);
showAnyUser
=
$dropdown
.
data
(
'
any
U
ser
'
);
firstUser
=
$dropdown
.
data
(
'
first
U
ser
'
);
options
.
authorId
=
$dropdown
.
data
(
'
author
I
d
'
);
defaultLabel
=
$dropdown
.
data
(
'
default
L
abel
'
);
issueURL
=
$dropdown
.
data
(
'
issueUpdate
'
);
$selectbox
=
$dropdown
.
closest
(
'
.selectbox
'
);
$block
=
$selectbox
.
closest
(
'
.block
'
);
abilityName
=
$dropdown
.
data
(
'
ability
-n
ame
'
);
abilityName
=
$dropdown
.
data
(
'
ability
N
ame
'
);
$value
=
$block
.
find
(
'
.value
'
);
$collapsedSidebar
=
$block
.
find
(
'
.sidebar-collapsed-user
'
);
$loading
=
$block
.
find
(
'
.block-loading
'
).
fadeOut
();
...
...
@@ -63,7 +63,7 @@ function UsersSelect(currentUser, els, options = {}) {
const
assignYourself
=
function
()
{
const
unassignedSelected
=
$dropdown
.
closest
(
'
.selectbox
'
)
.
find
(
`input[name='
${
$dropdown
.
data
(
'
field
-n
ame
'
)}
'][value=0]`
);
.
find
(
`input[name='
${
$dropdown
.
data
(
'
field
N
ame
'
)}
'][value=0]`
);
if
(
unassignedSelected
)
{
unassignedSelected
.
remove
();
...
...
@@ -72,7 +72,7 @@ function UsersSelect(currentUser, els, options = {}) {
// Save current selected user to the DOM
const
input
=
document
.
createElement
(
'
input
'
);
input
.
type
=
'
hidden
'
;
input
.
name
=
$dropdown
.
data
(
'
field
-n
ame
'
);
input
.
name
=
$dropdown
.
data
(
'
field
N
ame
'
);
const
currentUserInfo
=
$dropdown
.
data
(
'
currentUserInfo
'
);
...
...
@@ -96,7 +96,7 @@ function UsersSelect(currentUser, els, options = {}) {
const
getSelectedUserInputs
=
function
()
{
return
$selectbox
.
find
(
`input[name="
${
$dropdown
.
data
(
'
field
-n
ame
'
)}
"]`
);
.
find
(
`input[name="
${
$dropdown
.
data
(
'
field
N
ame
'
)}
"]`
);
};
const
getSelected
=
function
()
{
...
...
@@ -106,14 +106,14 @@ function UsersSelect(currentUser, els, options = {}) {
};
const
checkMaxSelect
=
function
()
{
const
maxSelect
=
$dropdown
.
data
(
'
max
-s
elect
'
);
const
maxSelect
=
$dropdown
.
data
(
'
max
S
elect
'
);
if
(
maxSelect
)
{
const
selected
=
getSelected
();
if
(
selected
.
length
>
maxSelect
)
{
const
firstSelectedId
=
selected
[
0
];
const
firstSelected
=
$dropdown
.
closest
(
'
.selectbox
'
)
.
find
(
`input[name='
${
$dropdown
.
data
(
'
field
-n
ame
'
)}
'][value=
${
firstSelectedId
}
]`
);
.
find
(
`input[name='
${
$dropdown
.
data
(
'
field
N
ame
'
)}
'][value=
${
firstSelectedId
}
]`
);
firstSelected
.
remove
();
emitSidebarEvent
(
'
sidebar.removeAssignee
'
,
{
...
...
@@ -158,7 +158,7 @@ function UsersSelect(currentUser, els, options = {}) {
const
currentUserInfo
=
$dropdown
.
data
(
'
currentUserInfo
'
);
$dropdown
.
find
(
'
.dropdown-toggle-text
'
).
text
(
getMultiSelectDropdownTitle
(
currentUserInfo
)).
removeClass
(
'
is-default
'
);
}
else
{
const
$input
=
$
(
`input[name="
${
$dropdown
.
data
(
'
field
-n
ame
'
)}
"]`
);
const
$input
=
$
(
`input[name="
${
$dropdown
.
data
(
'
field
N
ame
'
)}
"]`
);
$input
.
val
(
gon
.
current_user_id
);
selectedId
=
$input
.
val
();
$dropdown
.
find
(
'
.dropdown-toggle-text
'
).
text
(
gon
.
current_user_fullname
).
removeClass
(
'
is-default
'
);
...
...
@@ -293,10 +293,10 @@ function UsersSelect(currentUser, els, options = {}) {
const
selected
=
getSelected
().
filter
(
i
=>
i
!==
0
);
if
(
selected
.
length
>
0
)
{
if
(
$dropdown
.
data
(
'
dropdown
-h
eader
'
))
{
if
(
$dropdown
.
data
(
'
dropdown
H
eader
'
))
{
showDivider
+=
1
;
users
.
splice
(
showDivider
,
0
,
{
header
:
$dropdown
.
data
(
'
dropdown
-h
eader
'
),
header
:
$dropdown
.
data
(
'
dropdown
H
eader
'
),
});
}
...
...
@@ -327,7 +327,7 @@ function UsersSelect(currentUser, els, options = {}) {
fields
:
[
'
name
'
,
'
username
'
]
},
selectable
:
true
,
fieldName
:
$dropdown
.
data
(
'
field
-n
ame
'
),
fieldName
:
$dropdown
.
data
(
'
field
N
ame
'
),
toggleLabel
:
function
(
selected
,
el
,
glDropdown
)
{
const
inputValue
=
glDropdown
.
filterInput
.
val
();
...
...
@@ -362,7 +362,7 @@ function UsersSelect(currentUser, els, options = {}) {
emitSidebarEvent
(
'
sidebar.saveAssignees
'
);
}
if
(
!
$dropdown
.
data
(
'
always
-show-s
electbox
'
))
{
if
(
!
$dropdown
.
data
(
'
always
ShowS
electbox
'
))
{
$selectbox
.
hide
();
// Recalculate where .value is because vue might have changed it
...
...
@@ -373,7 +373,7 @@ function UsersSelect(currentUser, els, options = {}) {
}
},
multiSelect
:
$dropdown
.
hasClass
(
'
js-multiselect
'
),
inputMeta
:
$dropdown
.
data
(
'
input
-m
eta
'
),
inputMeta
:
$dropdown
.
data
(
'
input
M
eta
'
),
clicked
:
function
(
options
)
{
const
{
$el
,
e
,
isMarking
}
=
options
;
const
user
=
options
.
selectedObj
;
...
...
@@ -381,7 +381,7 @@ function UsersSelect(currentUser, els, options = {}) {
if
(
$dropdown
.
hasClass
(
'
js-multiselect
'
))
{
const
isActive
=
$el
.
hasClass
(
'
is-active
'
);
const
previouslySelected
=
$dropdown
.
closest
(
'
.selectbox
'
)
.
find
(
"
input[name='
"
+
(
$dropdown
.
data
(
'
field
-n
ame
'
))
+
"
'][value!=0]
"
);
.
find
(
"
input[name='
"
+
(
$dropdown
.
data
(
'
field
N
ame
'
))
+
"
'][value!=0]
"
);
// Enables support for limiting the number of users selected
// Automatically removes the first on the list if more users are selected
...
...
@@ -400,7 +400,7 @@ function UsersSelect(currentUser, els, options = {}) {
// Remove unassigned selection (if it was previously selected)
const
unassignedSelected
=
$dropdown
.
closest
(
'
.selectbox
'
)
.
find
(
"
input[name='
"
+
(
$dropdown
.
data
(
'
field
-n
ame
'
))
+
"
'][value=0]
"
);
.
find
(
"
input[name='
"
+
(
$dropdown
.
data
(
'
field
N
ame
'
))
+
"
'][value=0]
"
);
if
(
unassignedSelected
)
{
unassignedSelected
.
remove
();
...
...
@@ -408,7 +408,7 @@ function UsersSelect(currentUser, els, options = {}) {
}
else
{
if
(
previouslySelected
.
length
===
0
)
{
// Select unassigned because there is no more selected users
this
.
addInput
(
$dropdown
.
data
(
'
field
-n
ame
'
),
0
,
{});
this
.
addInput
(
$dropdown
.
data
(
'
field
N
ame
'
),
0
,
{});
}
// User unselected
...
...
@@ -440,7 +440,7 @@ function UsersSelect(currentUser, els, options = {}) {
return
;
}
if
(
$el
.
closest
(
'
.add-issues-modal
'
).
length
)
{
gl
.
issueBoards
.
ModalStore
.
store
.
filter
[
$dropdown
.
data
(
'
field
-n
ame
'
)]
=
user
.
id
;
gl
.
issueBoards
.
ModalStore
.
store
.
filter
[
$dropdown
.
data
(
'
field
N
ame
'
)]
=
user
.
id
;
}
else
if
(
handleClick
)
{
e
.
preventDefault
();
handleClick
(
user
,
isMarking
);
...
...
@@ -449,15 +449,15 @@ function UsersSelect(currentUser, els, options = {}) {
}
else
if
(
$dropdown
.
hasClass
(
'
js-filter-submit
'
))
{
return
$dropdown
.
closest
(
'
form
'
).
submit
();
}
else
if
(
!
$dropdown
.
hasClass
(
'
js-multiselect
'
))
{
selected
=
$dropdown
.
closest
(
'
.selectbox
'
).
find
(
"
input[name='
"
+
(
$dropdown
.
data
(
'
field
-n
ame
'
))
+
"
']
"
).
val
();
selected
=
$dropdown
.
closest
(
'
.selectbox
'
).
find
(
"
input[name='
"
+
(
$dropdown
.
data
(
'
field
N
ame
'
))
+
"
']
"
).
val
();
return
assignTo
(
selected
);
}
// Automatically close dropdown after assignee is selected
// since CE has no multiple assignees
// EE does not have a max-select
if
(
$dropdown
.
data
(
'
max
-s
elect
'
)
&&
getSelected
().
length
===
$dropdown
.
data
(
'
max
-s
elect
'
))
{
if
(
$dropdown
.
data
(
'
max
S
elect
'
)
&&
getSelected
().
length
===
$dropdown
.
data
(
'
max
S
elect
'
))
{
// Close the dropdown
$dropdown
.
dropdown
(
'
toggle
'
);
}
...
...
@@ -469,7 +469,7 @@ function UsersSelect(currentUser, els, options = {}) {
const
$el
=
$
(
e
.
currentTarget
);
const
selected
=
getSelected
();
if
(
$dropdown
.
hasClass
(
'
js-issue-board-sidebar
'
)
&&
selected
.
length
===
0
)
{
this
.
addInput
(
$dropdown
.
data
(
'
field
-n
ame
'
),
0
,
{});
this
.
addInput
(
$dropdown
.
data
(
'
field
N
ame
'
),
0
,
{});
}
$el
.
find
(
'
.is-active
'
).
removeClass
(
'
is-active
'
);
...
...
@@ -485,7 +485,7 @@ function UsersSelect(currentUser, els, options = {}) {
highlightSelected
(
selectedId
);
}
},
updateLabel
:
$dropdown
.
data
(
'
dropdown
-t
itle
'
),
updateLabel
:
$dropdown
.
data
(
'
dropdown
T
itle
'
),
renderRow
:
function
(
user
)
{
var
avatar
,
img
,
listClosingTags
,
listWithName
,
listWithUserName
,
username
;
username
=
user
.
username
?
"
@
"
+
user
.
username
:
""
;
...
...
@@ -533,15 +533,15 @@ function UsersSelect(currentUser, els, options = {}) {
var
firstUser
,
showAnyUser
,
showEmailUser
,
showNullUser
;
var
options
=
{};
options
.
skipLdap
=
$
(
select
).
hasClass
(
'
skip_ldap
'
);
options
.
projectId
=
$
(
select
).
data
(
'
project
-i
d
'
);
options
.
groupId
=
$
(
select
).
data
(
'
group
-i
d
'
);
options
.
showCurrentUser
=
$
(
select
).
data
(
'
current
-u
ser
'
);
options
.
authorId
=
$
(
select
).
data
(
'
author
-i
d
'
);
options
.
skipUsers
=
$
(
select
).
data
(
'
skip
-u
sers
'
);
showNullUser
=
$
(
select
).
data
(
'
null
-u
ser
'
);
showAnyUser
=
$
(
select
).
data
(
'
any
-u
ser
'
);
showEmailUser
=
$
(
select
).
data
(
'
email
-u
ser
'
);
firstUser
=
$
(
select
).
data
(
'
first
-u
ser
'
);
options
.
projectId
=
$
(
select
).
data
(
'
project
I
d
'
);
options
.
groupId
=
$
(
select
).
data
(
'
group
I
d
'
);
options
.
showCurrentUser
=
$
(
select
).
data
(
'
current
U
ser
'
);
options
.
authorId
=
$
(
select
).
data
(
'
author
I
d
'
);
options
.
skipUsers
=
$
(
select
).
data
(
'
skip
U
sers
'
);
showNullUser
=
$
(
select
).
data
(
'
null
U
ser
'
);
showAnyUser
=
$
(
select
).
data
(
'
any
U
ser
'
);
showEmailUser
=
$
(
select
).
data
(
'
email
U
ser
'
);
firstUser
=
$
(
select
).
data
(
'
first
U
ser
'
);
return
$
(
select
).
select2
({
placeholder
:
"
Search for a user
"
,
multiple
:
$
(
select
).
hasClass
(
'
multiselect
'
),
...
...
app/assets/javascripts/vue_shared/components/markdown/field.vue
View file @
35c8fd55
...
...
@@ -64,7 +64,7 @@
return
new
GLForm
(
$
(
this
.
$refs
[
'
gl-form
'
]),
this
.
enableAutocomplete
);
},
beforeDestroy
()
{
const
glForm
=
$
(
this
.
$refs
[
'
gl-form
'
]).
data
(
'
gl
-f
orm
'
);
const
glForm
=
$
(
this
.
$refs
[
'
gl-form
'
]).
data
(
'
gl
F
orm
'
);
if
(
glForm
)
{
glForm
.
destroy
();
}
...
...
app/views/projects/buttons/_star.html.haml
View file @
35c8fd55
-
if
current_user
=
link_to
toggle_star_project_path
(
@project
),
{
class:
'btn star-btn toggle-star'
,
method: :post
,
remote:
true
}
do
%button
.btn.btn-default.star-btn.toggle-star
{
type:
"button"
,
data:
{
endpoint:
toggle_star_project_path
(
@project
,
:json
)
}
}
-
if
current_user
.
starred?
(
@project
)
=
sprite_icon
(
'star'
)
%span
.starred
=
_
(
'Unstar'
)
...
...
package.json
View file @
35c8fd55
...
...
@@ -51,7 +51,7 @@
"
glob
"
:
"
^7.1.2
"
,
"
imports-loader
"
:
"
^0.7.1
"
,
"
jed
"
:
"
^1.1.1
"
,
"
jquery
"
:
"
^
2.2.4
"
,
"
jquery
"
:
"
^
3.2.1
"
,
"
jquery-ujs
"
:
"
1.2.2
"
,
"
jquery.waitforimages
"
:
"
^2.2.0
"
,
"
js-cookie
"
:
"
^2.1.3
"
,
...
...
spec/features/projects/members/share_with_group_spec.rb
View file @
35c8fd55
...
...
@@ -149,6 +149,11 @@ feature 'Project > Members > Share with Group', :js do
create
(
:group
).
add_owner
(
master
)
visit
project_settings_members_path
(
project
)
click_link
'Share with group'
find
(
'.ajax-groups-select.select2-container'
)
execute_script
'GROUP_SELECT_PER_PAGE = 1;'
open_select2
'#link_group_id'
end
...
...
spec/javascripts/ajax_loading_spinner_spec.js
View file @
35c8fd55
import
'
jquery
'
;
import
'
jquery-ujs
'
;
import
AjaxLoadingSpinner
from
'
~/ajax_loading_spinner
'
;
describe
(
'
Ajax Loading Spinner
'
,
()
=>
{
...
...
spec/javascripts/awards_handler_spec.js
View file @
35c8fd55
...
...
@@ -138,7 +138,7 @@ import '~/lib/utils/common_utils';
$thumbsUpEmoji
=
$votesBlock
.
find
(
'
[data-name=thumbsup]
'
).
parent
();
$thumbsUpEmoji
.
attr
(
'
data-title
'
,
'
sam
'
);
awardsHandler
.
userAuthored
(
$thumbsUpEmoji
);
return
expect
(
$thumbsUpEmoji
.
data
(
"
original
-t
itle
"
)).
toBe
(
"
You cannot vote on your own issue, MR and note
"
);
return
expect
(
$thumbsUpEmoji
.
data
(
"
original
T
itle
"
)).
toBe
(
"
You cannot vote on your own issue, MR and note
"
);
});
it
(
'
should restore tooltip back to initial vote list
'
,
function
()
{
var
$thumbsUpEmoji
,
$votesBlock
;
...
...
@@ -149,7 +149,7 @@ import '~/lib/utils/common_utils';
awardsHandler
.
userAuthored
(
$thumbsUpEmoji
);
jasmine
.
clock
().
tick
(
2801
);
jasmine
.
clock
().
uninstall
();
return
expect
(
$thumbsUpEmoji
.
data
(
"
original
-t
itle
"
)).
toBe
(
"
sam
"
);
return
expect
(
$thumbsUpEmoji
.
data
(
"
original
T
itle
"
)).
toBe
(
"
sam
"
);
});
});
describe
(
'
::getAwardUrl
'
,
function
()
{
...
...
@@ -194,7 +194,7 @@ import '~/lib/utils/common_utils';
$thumbsUpEmoji
.
attr
(
'
data-title
'
,
'
sam, jerry, max, and andy
'
);
awardsHandler
.
addAward
(
$votesBlock
,
awardUrl
,
'
thumbsup
'
,
false
);
$thumbsUpEmoji
.
tooltip
();
return
expect
(
$thumbsUpEmoji
.
data
(
"
original
-t
itle
"
)).
toBe
(
'
You, sam, jerry, max, and andy
'
);
return
expect
(
$thumbsUpEmoji
.
data
(
"
original
T
itle
"
)).
toBe
(
'
You, sam, jerry, max, and andy
'
);
});
return
it
(
'
handles the special case where "You" is not cleanly comma seperated
'
,
function
()
{
var
$thumbsUpEmoji
,
$votesBlock
,
awardUrl
;
...
...
@@ -204,7 +204,7 @@ import '~/lib/utils/common_utils';
$thumbsUpEmoji
.
attr
(
'
data-title
'
,
'
sam
'
);
awardsHandler
.
addAward
(
$votesBlock
,
awardUrl
,
'
thumbsup
'
,
false
);
$thumbsUpEmoji
.
tooltip
();
return
expect
(
$thumbsUpEmoji
.
data
(
"
original
-t
itle
"
)).
toBe
(
'
You and sam
'
);
return
expect
(
$thumbsUpEmoji
.
data
(
"
original
T
itle
"
)).
toBe
(
'
You and sam
'
);
});
});
describe
(
'
::removeYouToUserList
'
,
function
()
{
...
...
@@ -217,7 +217,7 @@ import '~/lib/utils/common_utils';
$thumbsUpEmoji
.
addClass
(
'
active
'
);
awardsHandler
.
addAward
(
$votesBlock
,
awardUrl
,
'
thumbsup
'
,
false
);
$thumbsUpEmoji
.
tooltip
();
return
expect
(
$thumbsUpEmoji
.
data
(
"
original
-t
itle
"
)).
toBe
(
'
sam, jerry, max, and andy
'
);
return
expect
(
$thumbsUpEmoji
.
data
(
"
original
T
itle
"
)).
toBe
(
'
sam, jerry, max, and andy
'
);
});
return
it
(
'
handles the special case where "You" is not cleanly comma seperated
'
,
function
()
{
var
$thumbsUpEmoji
,
$votesBlock
,
awardUrl
;
...
...
@@ -228,7 +228,7 @@ import '~/lib/utils/common_utils';
$thumbsUpEmoji
.
addClass
(
'
active
'
);
awardsHandler
.
addAward
(
$votesBlock
,
awardUrl
,
'
thumbsup
'
,
false
);
$thumbsUpEmoji
.
tooltip
();
return
expect
(
$thumbsUpEmoji
.
data
(
"
original
-t
itle
"
)).
toBe
(
'
sam
'
);
return
expect
(
$thumbsUpEmoji
.
data
(
"
original
T
itle
"
)).
toBe
(
'
sam
'
);
});
});
describe
(
'
::searchEmojis
'
,
()
=>
{
...
...
spec/javascripts/behaviors/requires_input_spec.js
View file @
35c8fd55
...
...
@@ -15,7 +15,7 @@ describe('requiresInput', () => {
});
it
(
'
enables submit when no field is required
'
,
()
=>
{
$
(
'
*[required=required]
'
).
removeAttr
(
'
required
'
);
$
(
'
*[required=required]
'
).
prop
(
'
required
'
,
false
);
$
(
'
.js-requires-input
'
).
requiresInput
();
expect
(
submitButton
).
not
.
toBeDisabled
();
});
...
...
spec/javascripts/feature_highlight/feature_highlight_spec.js
View file @
35c8fd55
import
*
as
featureHighlightHelper
from
'
~/feature_highlight/feature_highlight_helper
'
;
import
*
as
featureHighlight
from
'
~/feature_highlight/feature_highlight
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
describe
(
'
feature highlight
'
,
()
=>
{
beforeEach
(()
=>
{
setFixtures
(
`
<div>
<div class="js-feature-highlight" data-highlight="test" data-highlight-priority="10" disabled>
<div class="js-feature-highlight" data-highlight="test" data-highlight-priority="10" d
ata-dismiss-endpoint="/test" d
isabled>
Trigger
</div>
</div>
...
...
@@ -19,13 +21,21 @@ describe('feature highlight', () => {
});
describe
(
'
setupFeatureHighlightPopover
'
,
()
=>
{
let
mock
;
const
selector
=
'
.js-feature-highlight[data-highlight=test]
'
;
beforeEach
(()
=>
{
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
'
/test
'
).
reply
(
200
);
spyOn
(
window
,
'
addEventListener
'
);
spyOn
(
window
,
'
removeEventListener
'
);
featureHighlight
.
setupFeatureHighlightPopover
(
'
test
'
,
0
);
});
afterEach
(()
=>
{
mock
.
restore
();
});
it
(
'
setup popover content
'
,
()
=>
{
const
$popoverContent
=
$
(
'
.feature-highlight-popover-content
'
);
const
outerHTML
=
$popoverContent
.
prop
(
'
outerHTML
'
);
...
...
@@ -51,15 +61,6 @@ describe('feature highlight', () => {
},
0
);
});
it
(
'
setup inserted.bs.popover
'
,
()
=>
{
$
(
selector
).
trigger
(
'
mouseenter
'
);
const
popoverId
=
$
(
selector
).
attr
(
'
aria-describedby
'
);
const
spyEvent
=
spyOnEvent
(
`#
${
popoverId
}
.dismiss-feature-highlight`
,
'
click
'
);
$
(
`#
${
popoverId
}
.dismiss-feature-highlight`
).
click
();
expect
(
spyEvent
).
toHaveBeenTriggered
();
});
it
(
'
setup show.bs.popover
'
,
()
=>
{
$
(
selector
).
trigger
(
'
show.bs.popover
'
);
expect
(
window
.
addEventListener
).
toHaveBeenCalledWith
(
'
scroll
'
,
jasmine
.
any
(
Function
));
...
...
@@ -75,9 +76,19 @@ describe('feature highlight', () => {
});
it
(
'
displays popover
'
,
()
=>
{
expect
(
$
(
selector
).
attr
(
'
aria-describedby
'
)).
toBeFalsy
();
expect
(
document
.
querySelector
(
selector
).
getAttribute
(
'
aria-describedby
'
)).
toBeFalsy
();
$
(
selector
).
trigger
(
'
mouseenter
'
);
expect
(
$
(
selector
).
attr
(
'
aria-describedby
'
)).
toBeTruthy
();
expect
(
document
.
querySelector
(
selector
).
getAttribute
(
'
aria-describedby
'
)).
toBeTruthy
();
});
it
(
'
toggles when clicked
'
,
()
=>
{
$
(
selector
).
trigger
(
'
mouseenter
'
);
const
popoverId
=
$
(
selector
).
attr
(
'
aria-describedby
'
);
const
toggleSpy
=
spyOn
(
featureHighlightHelper
.
togglePopover
,
'
call
'
);
$
(
`#
${
popoverId
}
.dismiss-feature-highlight`
).
click
();
expect
(
toggleSpy
).
toHaveBeenCalled
();
});
});
...
...
spec/javascripts/gl_dropdown_spec.js
View file @
35c8fd55
...
...
@@ -64,8 +64,8 @@ describe('glDropdown', function describeDropdown() {
});
afterEach
(()
=>
{
$
(
'
body
'
).
unbind
(
'
keydown
'
);
this
.
dropdownContainerElement
.
unbind
(
'
keyup
'
);
$
(
'
body
'
).
off
(
'
keydown
'
);
this
.
dropdownContainerElement
.
off
(
'
keyup
'
);
});
it
(
'
should open on click
'
,
()
=>
{
...
...
spec/javascripts/merge_request_notes_spec.js
View file @
35c8fd55
...
...
@@ -23,7 +23,7 @@ describe('Merge request notes', () => {
gl
.
utils
.
disableButtonIfEmptyField
=
_
.
noop
;
window
.
project_uploads_path
=
'
http://test.host/uploads
'
;
$
(
'
body
'
).
attr
(
'
data-page
'
,
'
projects:merge_requests:show
'
);
window
.
gon
.
current_user_id
=
$
(
'
.note:last
'
).
data
(
'
author
-i
d
'
);
window
.
gon
.
current_user_id
=
$
(
'
.note:last
'
).
data
(
'
author
I
d
'
);
return
new
Notes
(
''
,
[]);
});
...
...
@@ -76,7 +76,7 @@ describe('Merge request notes', () => {
</form>`
;
setFixtures
(
diffsResponse
.
html
+
noteFormHtml
);
$
(
'
body
'
).
attr
(
'
data-page
'
,
'
projects:merge_requests:show
'
);
window
.
gon
.
current_user_id
=
$
(
'
.note:last
'
).
data
(
'
author
-i
d
'
);
window
.
gon
.
current_user_id
=
$
(
'
.note:last
'
).
data
(
'
author
I
d
'
);
return
new
Notes
(
''
,
[]);
});
...
...
spec/javascripts/pages/admin/abuse_reports/abuse_reports_spec.js
View file @
35c8fd55
...
...
@@ -22,19 +22,19 @@ describe('Abuse Reports', () => {
it
(
'
should truncate long messages
'
,
()
=>
{
const
$longMessage
=
findMessage
(
'
LONG MESSAGE
'
);
expect
(
$longMessage
.
data
(
'
original
-m
essage
'
)).
toEqual
(
jasmine
.
anything
());
expect
(
$longMessage
.
data
(
'
original
M
essage
'
)).
toEqual
(
jasmine
.
anything
());
assertMaxLength
(
$longMessage
);
});
it
(
'
should not truncate short messages
'
,
()
=>
{
const
$shortMessage
=
findMessage
(
'
SHORT MESSAGE
'
);
expect
(
$shortMessage
.
data
(
'
original
-m
essage
'
)).
not
.
toEqual
(
jasmine
.
anything
());
expect
(
$shortMessage
.
data
(
'
original
M
essage
'
)).
not
.
toEqual
(
jasmine
.
anything
());
});
it
(
'
should allow clicking a truncated message to expand and collapse the full message
'
,
()
=>
{
const
$longMessage
=
findMessage
(
'
LONG MESSAGE
'
);
$longMessage
.
click
();
expect
(
$longMessage
.
data
(
'
original
-m
essage
'
).
length
).
toEqual
(
$longMessage
.
text
().
length
);
expect
(
$longMessage
.
data
(
'
original
M
essage
'
).
length
).
toEqual
(
$longMessage
.
text
().
length
);
$longMessage
.
click
();
assertMaxLength
(
$longMessage
);
});
...
...
spec/javascripts/projects/project_new_spec.js
View file @
35c8fd55
...
...
@@ -27,7 +27,7 @@ describe('New Project', () => {
});
it
(
'
does not change project path for disabled $projectImportUrl
'
,
()
=>
{
$projectImportUrl
.
attr
(
'
disabled
'
,
true
);
$projectImportUrl
.
prop
(
'
disabled
'
,
true
);
projectNew
.
deriveProjectPathFromUrl
(
$projectImportUrl
);
...
...
@@ -36,7 +36,7 @@ describe('New Project', () => {
describe
(
'
for enabled $projectImportUrl
'
,
()
=>
{
beforeEach
(()
=>
{
$projectImportUrl
.
attr
(
'
disabled
'
,
false
);
$projectImportUrl
.
prop
(
'
disabled
'
,
false
);
});
it
(
'
does not change project path if it is set by user
'
,
()
=>
{
...
...
spec/javascripts/sidebar/sidebar_move_issue_spec.js
View file @
35c8fd55
...
...
@@ -78,7 +78,7 @@ describe('SidebarMoveIssue', () => {
this
.
sidebarMoveIssue
.
onConfirmClicked
();
expect
(
this
.
mediator
.
moveIssue
).
toHaveBeenCalled
();
expect
(
this
.
$confirmButton
.
attr
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
expect
(
this
.
$confirmButton
.
prop
(
'
disabled
'
)).
toBeTruthy
(
);
expect
(
this
.
$confirmButton
.
hasClass
(
'
is-loading
'
)).
toBe
(
true
);
});
...
...
@@ -93,7 +93,7 @@ describe('SidebarMoveIssue', () => {
// Wait for the move issue request to fail
setTimeout
(()
=>
{
expect
(
window
.
Flash
).
toHaveBeenCalled
();
expect
(
this
.
$confirmButton
.
attr
(
'
disabled
'
)).
toBe
(
undefined
);
expect
(
this
.
$confirmButton
.
prop
(
'
disabled
'
)).
toBeFalsy
(
);
expect
(
this
.
$confirmButton
.
hasClass
(
'
is-loading
'
)).
toBe
(
false
);
done
();
});
...
...
@@ -120,7 +120,7 @@ describe('SidebarMoveIssue', () => {
this
.
$content
.
find
(
'
.js-move-issue-dropdown-item
'
).
eq
(
0
).
trigger
(
'
click
'
);
expect
(
this
.
mediator
.
setMoveToProjectId
).
toHaveBeenCalledWith
(
0
);
expect
(
this
.
$confirmButton
.
attr
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
expect
(
this
.
$confirmButton
.
prop
(
'
disabled
'
)).
toBeTruthy
(
);
done
();
},
0
);
});
...
...
spec/javascripts/test_bundle.js
View file @
35c8fd55
/* eslint-disable jasmine/no-global-setup */
import
$
from
'
jquery
'
;
import
'
jasmine-jquery
'
;
import
'
vendor/
jasmine-jquery
'
;
import
'
~/commons
'
;
import
Vue
from
'
vue
'
;
...
...
@@ -144,6 +144,9 @@ if (process.env.BABEL_ENV === 'coverage') {
describe
(
'
Uncovered files
'
,
function
()
{
const
sourceFiles
=
require
.
context
(
'
~
'
,
true
,
/
\.
js$/
);
$
.
holdReady
(
true
);
sourceFiles
.
keys
().
forEach
(
function
(
path
)
{
// ignore if there is a matching spec file
if
(
testsContext
.
keys
().
indexOf
(
`
${
path
.
replace
(
/
\.
js$/
,
''
)}
_spec`
)
>
-
1
)
{
...
...
vendor/assets/javascripts/jasmine-jquery.js
0 → 100644
View file @
35c8fd55
/* eslint-disable */
/*
Jasmine JQuery 3.0 patched version from this fork : https://github.com/cmrd-senya/jasmine-jquery/blob/jquery3/lib/jasmine-jquery.js
*/
/*!
Jasmine-jQuery: a set of jQuery helpers for Jasmine tests.
Version 2.1.1
https://github.com/velesin/jasmine-jquery
Copyright (c) 2010-2014 Wojciech Zawistowski, Travis Jeffery
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
(
function
(
root
,
factory
)
{
if
(
typeof
module
!==
'
undefined
'
&&
module
.
exports
)
{
factory
(
root
,
root
.
jasmine
,
require
(
'
jquery
'
));
}
else
{
factory
(
root
,
root
.
jasmine
,
root
.
jQuery
);
}
}((
function
()
{
return
this
;
})(),
function
(
window
,
jasmine
,
$
)
{
"
use strict
"
;
jasmine
.
spiedEventsKey
=
function
(
selector
,
eventName
)
{
for
(
var
i
=
0
;;
i
++
)
{
var
key
=
[
eventName
,
i
].
toString
()
if
(
data
.
spiedEvents
[
key
]
===
undefined
||
data
.
spiedEvents
[
key
].
selector
.
is
(
$
(
selector
)))
{
return
key
}
}
}
jasmine
.
getFixtures
=
function
()
{
return
jasmine
.
currentFixtures_
=
jasmine
.
currentFixtures_
||
new
jasmine
.
Fixtures
()
}
jasmine
.
getStyleFixtures
=
function
()
{
return
jasmine
.
currentStyleFixtures_
=
jasmine
.
currentStyleFixtures_
||
new
jasmine
.
StyleFixtures
()
}
jasmine
.
Fixtures
=
function
()
{
this
.
containerId
=
'
jasmine-fixtures
'
this
.
fixturesCache_
=
{}
this
.
fixturesPath
=
'
spec/javascripts/fixtures
'
}
jasmine
.
Fixtures
.
prototype
.
set
=
function
(
html
)
{
this
.
cleanUp
()
return
this
.
createContainer_
(
html
)
}
jasmine
.
Fixtures
.
prototype
.
appendSet
=
function
(
html
)
{
this
.
addToContainer_
(
html
)
}
jasmine
.
Fixtures
.
prototype
.
preload
=
function
()
{
this
.
read
.
apply
(
this
,
arguments
)
}
jasmine
.
Fixtures
.
prototype
.
load
=
function
()
{
this
.
cleanUp
()
this
.
createContainer_
(
this
.
read
.
apply
(
this
,
arguments
))
}
jasmine
.
Fixtures
.
prototype
.
appendLoad
=
function
()
{
this
.
addToContainer_
(
this
.
read
.
apply
(
this
,
arguments
))
}
jasmine
.
Fixtures
.
prototype
.
read
=
function
()
{
var
htmlChunks
=
[]
,
fixtureUrls
=
arguments
for
(
var
urlCount
=
fixtureUrls
.
length
,
urlIndex
=
0
;
urlIndex
<
urlCount
;
urlIndex
++
)
{
htmlChunks
.
push
(
this
.
getFixtureHtml_
(
fixtureUrls
[
urlIndex
]))
}
return
htmlChunks
.
join
(
''
)
}
jasmine
.
Fixtures
.
prototype
.
clearCache
=
function
()
{
this
.
fixturesCache_
=
{}
}
jasmine
.
Fixtures
.
prototype
.
cleanUp
=
function
()
{
$
(
'
#
'
+
this
.
containerId
).
remove
()
}
jasmine
.
Fixtures
.
prototype
.
sandbox
=
function
(
attributes
)
{
var
attributesToSet
=
attributes
||
{}
return
$
(
'
<div id="sandbox" />
'
).
attr
(
attributesToSet
)
}
jasmine
.
Fixtures
.
prototype
.
createContainer_
=
function
(
html
)
{
var
container
=
$
(
'
<div>
'
)
.
attr
(
'
id
'
,
this
.
containerId
)
.
html
(
html
)
$
(
document
.
body
).
append
(
container
)
return
container
}
jasmine
.
Fixtures
.
prototype
.
addToContainer_
=
function
(
html
){
var
container
=
$
(
document
.
body
).
find
(
'
#
'
+
this
.
containerId
).
append
(
html
)
if
(
!
container
.
length
)
{
this
.
createContainer_
(
html
)
}
}
jasmine
.
Fixtures
.
prototype
.
getFixtureHtml_
=
function
(
url
)
{
if
(
typeof
this
.
fixturesCache_
[
url
]
===
'
undefined
'
)
{
this
.
loadFixtureIntoCache_
(
url
)
}
return
this
.
fixturesCache_
[
url
]
}
jasmine
.
Fixtures
.
prototype
.
loadFixtureIntoCache_
=
function
(
relativeUrl
)
{
var
self
=
this
,
url
=
this
.
makeFixtureUrl_
(
relativeUrl
)
,
htmlText
=
''
,
request
=
$
.
ajax
({
async
:
false
,
// must be synchronous to guarantee that no tests are run before fixture is loaded
cache
:
false
,
url
:
url
,
dataType
:
'
html
'
,
success
:
function
(
data
,
status
,
$xhr
)
{
htmlText
=
$xhr
.
responseText
}
}).
fail
(
function
(
$xhr
,
status
,
err
)
{
throw
new
Error
(
'
Fixture could not be loaded:
'
+
url
+
'
(status:
'
+
status
+
'
, message:
'
+
err
.
message
+
'
)
'
)
})
var
scripts
=
$
(
$
.
parseHTML
(
htmlText
,
true
)).
find
(
'
script[src]
'
)
||
[];
scripts
.
each
(
function
(){
$
.
ajax
({
async
:
false
,
// must be synchronous to guarantee that no tests are run before fixture is loaded
cache
:
false
,
dataType
:
'
script
'
,
url
:
$
(
this
).
attr
(
'
src
'
),
success
:
function
(
data
,
status
,
$xhr
)
{
htmlText
+=
'
<script>
'
+
$xhr
.
responseText
+
'
</script>
'
},
error
:
function
(
$xhr
,
status
,
err
)
{
throw
new
Error
(
'
Script could not be loaded:
'
+
url
+
'
(status:
'
+
status
+
'
, message:
'
+
err
.
message
+
'
)
'
)
}
});
})
self
.
fixturesCache_
[
relativeUrl
]
=
htmlText
;
}
jasmine
.
Fixtures
.
prototype
.
makeFixtureUrl_
=
function
(
relativeUrl
){
return
this
.
fixturesPath
.
match
(
'
/$
'
)
?
this
.
fixturesPath
+
relativeUrl
:
this
.
fixturesPath
+
'
/
'
+
relativeUrl
}
jasmine
.
Fixtures
.
prototype
.
proxyCallTo_
=
function
(
methodName
,
passedArguments
)
{
return
this
[
methodName
].
apply
(
this
,
passedArguments
)
}
jasmine
.
StyleFixtures
=
function
()
{
this
.
fixturesCache_
=
{}
this
.
fixturesNodes_
=
[]
this
.
fixturesPath
=
'
spec/javascripts/fixtures
'
}
jasmine
.
StyleFixtures
.
prototype
.
set
=
function
(
css
)
{
this
.
cleanUp
()
this
.
createStyle_
(
css
)
}
jasmine
.
StyleFixtures
.
prototype
.
appendSet
=
function
(
css
)
{
this
.
createStyle_
(
css
)
}
jasmine
.
StyleFixtures
.
prototype
.
preload
=
function
()
{
this
.
read_
.
apply
(
this
,
arguments
)
}
jasmine
.
StyleFixtures
.
prototype
.
load
=
function
()
{
this
.
cleanUp
()
this
.
createStyle_
(
this
.
read_
.
apply
(
this
,
arguments
))
}
jasmine
.
StyleFixtures
.
prototype
.
appendLoad
=
function
()
{
this
.
createStyle_
(
this
.
read_
.
apply
(
this
,
arguments
))
}
jasmine
.
StyleFixtures
.
prototype
.
cleanUp
=
function
()
{
while
(
this
.
fixturesNodes_
.
length
)
{
this
.
fixturesNodes_
.
pop
().
remove
()
}
}
jasmine
.
StyleFixtures
.
prototype
.
createStyle_
=
function
(
html
)
{
var
styleText
=
$
(
'
<div></div>
'
).
html
(
html
).
text
()
,
style
=
$
(
'
<style>
'
+
styleText
+
'
</style>
'
)
this
.
fixturesNodes_
.
push
(
style
)
$
(
'
head
'
).
append
(
style
)
}
jasmine
.
StyleFixtures
.
prototype
.
clearCache
=
jasmine
.
Fixtures
.
prototype
.
clearCache
jasmine
.
StyleFixtures
.
prototype
.
read_
=
jasmine
.
Fixtures
.
prototype
.
read
jasmine
.
StyleFixtures
.
prototype
.
getFixtureHtml_
=
jasmine
.
Fixtures
.
prototype
.
getFixtureHtml_
jasmine
.
StyleFixtures
.
prototype
.
loadFixtureIntoCache_
=
jasmine
.
Fixtures
.
prototype
.
loadFixtureIntoCache_
jasmine
.
StyleFixtures
.
prototype
.
makeFixtureUrl_
=
jasmine
.
Fixtures
.
prototype
.
makeFixtureUrl_
jasmine
.
StyleFixtures
.
prototype
.
proxyCallTo_
=
jasmine
.
Fixtures
.
prototype
.
proxyCallTo_
jasmine
.
getJSONFixtures
=
function
()
{
return
jasmine
.
currentJSONFixtures_
=
jasmine
.
currentJSONFixtures_
||
new
jasmine
.
JSONFixtures
()
}
jasmine
.
JSONFixtures
=
function
()
{
this
.
fixturesCache_
=
{}
this
.
fixturesPath
=
'
spec/javascripts/fixtures/json
'
}
jasmine
.
JSONFixtures
.
prototype
.
load
=
function
()
{
this
.
read
.
apply
(
this
,
arguments
)
return
this
.
fixturesCache_
}
jasmine
.
JSONFixtures
.
prototype
.
read
=
function
()
{
var
fixtureUrls
=
arguments
for
(
var
urlCount
=
fixtureUrls
.
length
,
urlIndex
=
0
;
urlIndex
<
urlCount
;
urlIndex
++
)
{
this
.
getFixtureData_
(
fixtureUrls
[
urlIndex
])
}
return
this
.
fixturesCache_
}
jasmine
.
JSONFixtures
.
prototype
.
clearCache
=
function
()
{
this
.
fixturesCache_
=
{}
}
jasmine
.
JSONFixtures
.
prototype
.
getFixtureData_
=
function
(
url
)
{
if
(
!
this
.
fixturesCache_
[
url
])
this
.
loadFixtureIntoCache_
(
url
)
return
this
.
fixturesCache_
[
url
]
}
jasmine
.
JSONFixtures
.
prototype
.
loadFixtureIntoCache_
=
function
(
relativeUrl
)
{
var
self
=
this
,
url
=
this
.
fixturesPath
.
match
(
'
/$
'
)
?
this
.
fixturesPath
+
relativeUrl
:
this
.
fixturesPath
+
'
/
'
+
relativeUrl
$
.
ajax
({
async
:
false
,
// must be synchronous to guarantee that no tests are run before fixture is loaded
cache
:
false
,
dataType
:
'
json
'
,
url
:
url
,
success
:
function
(
data
)
{
self
.
fixturesCache_
[
relativeUrl
]
=
data
},
error
:
function
(
$xhr
,
status
,
err
)
{
throw
new
Error
(
'
JSONFixture could not be loaded:
'
+
url
+
'
(status:
'
+
status
+
'
, message:
'
+
err
.
message
+
'
)
'
)
}
})
}
jasmine
.
JSONFixtures
.
prototype
.
proxyCallTo_
=
function
(
methodName
,
passedArguments
)
{
return
this
[
methodName
].
apply
(
this
,
passedArguments
)
}
jasmine
.
jQuery
=
function
()
{}
jasmine
.
jQuery
.
browserTagCaseIndependentHtml
=
function
(
html
)
{
return
$
(
'
<div/>
'
).
append
(
html
).
html
()
}
jasmine
.
jQuery
.
elementToString
=
function
(
element
)
{
return
$
(
element
).
map
(
function
()
{
return
this
.
outerHTML
;
}).
toArray
().
join
(
'
,
'
)
}
var
data
=
{
spiedEvents
:
{}
,
handlers
:
[]
}
jasmine
.
jQuery
.
events
=
{
spyOn
:
function
(
selector
,
eventName
)
{
var
handler
=
function
(
e
)
{
var
calls
=
(
typeof
data
.
spiedEvents
[
jasmine
.
spiedEventsKey
(
selector
,
eventName
)]
!==
'
undefined
'
)
?
data
.
spiedEvents
[
jasmine
.
spiedEventsKey
(
selector
,
eventName
)].
calls
:
0
data
.
spiedEvents
[
jasmine
.
spiedEventsKey
(
selector
,
eventName
)]
=
{
selector
:
$
(
selector
),
args
:
jasmine
.
util
.
argsToArray
(
arguments
),
calls
:
++
calls
}
}
$
(
selector
).
on
(
eventName
,
handler
)
data
.
handlers
.
push
(
handler
)
return
{
selector
:
selector
,
eventName
:
eventName
,
handler
:
handler
,
reset
:
function
(){
delete
data
.
spiedEvents
[
jasmine
.
spiedEventsKey
(
selector
,
eventName
)]
},
calls
:
{
count
:
function
()
{
return
data
.
spiedEvents
[
jasmine
.
spiedEventsKey
(
selector
,
eventName
)]
?
data
.
spiedEvents
[
jasmine
.
spiedEventsKey
(
selector
,
eventName
)].
calls
:
0
;
},
any
:
function
()
{
return
data
.
spiedEvents
[
jasmine
.
spiedEventsKey
(
selector
,
eventName
)]
?
!!
data
.
spiedEvents
[
jasmine
.
spiedEventsKey
(
selector
,
eventName
)].
calls
:
false
;
}
}
}
},
args
:
function
(
selector
,
eventName
)
{
var
actualArgs
=
data
.
spiedEvents
[
jasmine
.
spiedEventsKey
(
selector
,
eventName
)].
args
if
(
!
actualArgs
)
{
throw
"
There is no spy for
"
+
eventName
+
"
on
"
+
selector
.
toString
()
+
"
. Make sure to create a spy using spyOnEvent.
"
}
return
actualArgs
},
wasTriggered
:
function
(
selector
,
eventName
)
{
return
!!
(
data
.
spiedEvents
[
jasmine
.
spiedEventsKey
(
selector
,
eventName
)])
},
wasTriggeredWith
:
function
(
selector
,
eventName
,
expectedArgs
,
util
,
customEqualityTesters
)
{
var
actualArgs
=
jasmine
.
jQuery
.
events
.
args
(
selector
,
eventName
).
slice
(
1
)
if
(
Object
.
prototype
.
toString
.
call
(
expectedArgs
)
!==
'
[object Array]
'
)
actualArgs
=
actualArgs
[
0
]
return
util
.
equals
(
actualArgs
,
expectedArgs
,
customEqualityTesters
)
},
wasPrevented
:
function
(
selector
,
eventName
)
{
var
spiedEvent
=
data
.
spiedEvents
[
jasmine
.
spiedEventsKey
(
selector
,
eventName
)]
,
args
=
(
jasmine
.
util
.
isUndefined
(
spiedEvent
))
?
{}
:
spiedEvent
.
args
,
e
=
args
?
args
[
0
]
:
undefined
return
e
&&
e
.
isDefaultPrevented
()
},
wasStopped
:
function
(
selector
,
eventName
)
{
var
spiedEvent
=
data
.
spiedEvents
[
jasmine
.
spiedEventsKey
(
selector
,
eventName
)]
,
args
=
(
jasmine
.
util
.
isUndefined
(
spiedEvent
))
?
{}
:
spiedEvent
.
args
,
e
=
args
?
args
[
0
]
:
undefined
return
e
&&
e
.
isPropagationStopped
()
},
cleanUp
:
function
()
{
data
.
spiedEvents
=
{}
data
.
handlers
=
[]
}
}
var
hasProperty
=
function
(
actualValue
,
expectedValue
)
{
if
(
expectedValue
===
undefined
)
return
actualValue
!==
undefined
return
actualValue
===
expectedValue
}
beforeEach
(
function
()
{
jasmine
.
addMatchers
({
toHaveClass
:
function
()
{
return
{
compare
:
function
(
actual
,
className
)
{
return
{
pass
:
$
(
actual
).
hasClass
(
className
)
}
}
}
},
toHaveCss
:
function
()
{
return
{
compare
:
function
(
actual
,
css
)
{
var
stripCharsRegex
=
/
[\s
;
\"\']
/g
for
(
var
prop
in
css
)
{
var
value
=
css
[
prop
]
// see issue #147 on gh
;
if
((
value
===
'
auto
'
)
&&
(
$
(
actual
).
get
(
0
).
style
[
prop
]
===
'
auto
'
))
continue
var
actualStripped
=
$
(
actual
).
css
(
prop
).
replace
(
stripCharsRegex
,
''
)
var
valueStripped
=
value
.
replace
(
stripCharsRegex
,
''
)
if
(
actualStripped
!==
valueStripped
)
return
{
pass
:
false
}
}
return
{
pass
:
true
}
}
}
},
toBeVisible
:
function
()
{
return
{
compare
:
function
(
actual
)
{
return
{
pass
:
$
(
actual
).
is
(
'
:visible
'
)
}
}
}
},
toBeHidden
:
function
()
{
return
{
compare
:
function
(
actual
)
{
return
{
pass
:
$
(
actual
).
is
(
'
:hidden
'
)
}
}
}
},
toBeSelected
:
function
()
{
return
{
compare
:
function
(
actual
)
{
return
{
pass
:
$
(
actual
).
is
(
'
:selected
'
)
}
}
}
},
toBeChecked
:
function
()
{
return
{
compare
:
function
(
actual
)
{
return
{
pass
:
$
(
actual
).
is
(
'
:checked
'
)
}
}
}
},
toBeEmpty
:
function
()
{
return
{
compare
:
function
(
actual
)
{
return
{
pass
:
$
(
actual
).
is
(
'
:empty
'
)
}
}
}
},
toBeInDOM
:
function
()
{
return
{
compare
:
function
(
actual
)
{
return
{
pass
:
$
.
contains
(
document
.
documentElement
,
$
(
actual
)[
0
])
}
}
}
},
toExist
:
function
()
{
return
{
compare
:
function
(
actual
)
{
return
{
pass
:
$
(
actual
).
length
}
}
}
},
toHaveLength
:
function
()
{
return
{
compare
:
function
(
actual
,
length
)
{
return
{
pass
:
$
(
actual
).
length
===
length
}
}
}
},
toHaveAttr
:
function
()
{
return
{
compare
:
function
(
actual
,
attributeName
,
expectedAttributeValue
)
{
return
{
pass
:
hasProperty
(
$
(
actual
).
attr
(
attributeName
),
expectedAttributeValue
)
}
}
}
},
toHaveProp
:
function
()
{
return
{
compare
:
function
(
actual
,
propertyName
,
expectedPropertyValue
)
{
return
{
pass
:
hasProperty
(
$
(
actual
).
prop
(
propertyName
),
expectedPropertyValue
)
}
}
}
},
toHaveId
:
function
()
{
return
{
compare
:
function
(
actual
,
id
)
{
return
{
pass
:
$
(
actual
).
attr
(
'
id
'
)
==
id
}
}
}
},
toHaveHtml
:
function
()
{
return
{
compare
:
function
(
actual
,
html
)
{
return
{
pass
:
$
(
actual
).
html
()
==
jasmine
.
jQuery
.
browserTagCaseIndependentHtml
(
html
)
}
}
}
},
toContainHtml
:
function
()
{
return
{
compare
:
function
(
actual
,
html
)
{
var
actualHtml
=
$
(
actual
).
html
()
,
expectedHtml
=
jasmine
.
jQuery
.
browserTagCaseIndependentHtml
(
html
)
return
{
pass
:
(
actualHtml
.
indexOf
(
expectedHtml
)
>=
0
)
}
}
}
},
toHaveText
:
function
()
{
return
{
compare
:
function
(
actual
,
text
)
{
var
actualText
=
$
(
actual
).
text
()
var
trimmedText
=
$
.
trim
(
actualText
)
if
(
text
&&
$
.
isFunction
(
text
.
test
))
{
return
{
pass
:
text
.
test
(
actualText
)
||
text
.
test
(
trimmedText
)
}
}
else
{
return
{
pass
:
(
actualText
==
text
||
trimmedText
==
text
)
}
}
}
}
},
toContainText
:
function
()
{
return
{
compare
:
function
(
actual
,
text
)
{
var
trimmedText
=
$
.
trim
(
$
(
actual
).
text
())
if
(
text
&&
$
.
isFunction
(
text
.
test
))
{
return
{
pass
:
text
.
test
(
trimmedText
)
}
}
else
{
return
{
pass
:
trimmedText
.
indexOf
(
text
)
!=
-
1
}
}
}
}
},
toHaveValue
:
function
()
{
return
{
compare
:
function
(
actual
,
value
)
{
return
{
pass
:
$
(
actual
).
val
()
===
value
}
}
}
},
toHaveData
:
function
()
{
return
{
compare
:
function
(
actual
,
key
,
expectedValue
)
{
return
{
pass
:
hasProperty
(
$
(
actual
).
data
(
key
),
expectedValue
)
}
}
}
},
toContainElement
:
function
()
{
return
{
compare
:
function
(
actual
,
selector
)
{
return
{
pass
:
$
(
actual
).
find
(
selector
).
length
}
}
}
},
toBeMatchedBy
:
function
()
{
return
{
compare
:
function
(
actual
,
selector
)
{
return
{
pass
:
$
(
actual
).
filter
(
selector
).
length
}
}
}
},
toBeDisabled
:
function
()
{
return
{
compare
:
function
(
actual
,
selector
)
{
return
{
pass
:
$
(
actual
).
is
(
'
:disabled
'
)
}
}
}
},
toBeFocused
:
function
(
selector
)
{
return
{
compare
:
function
(
actual
,
selector
)
{
return
{
pass
:
$
(
actual
)[
0
]
===
$
(
actual
)[
0
].
ownerDocument
.
activeElement
}
}
}
},
toHandle
:
function
()
{
return
{
compare
:
function
(
actual
,
event
)
{
if
(
!
actual
||
actual
.
length
===
0
)
return
{
pass
:
false
};
var
events
=
$
.
_data
(
$
(
actual
).
get
(
0
),
"
events
"
)
if
(
!
events
||
!
event
||
typeof
event
!==
"
string
"
)
{
return
{
pass
:
false
}
}
var
namespaces
=
event
.
split
(
"
.
"
)
,
eventType
=
namespaces
.
shift
()
,
sortedNamespaces
=
namespaces
.
slice
(
0
).
sort
()
,
namespaceRegExp
=
new
RegExp
(
"
(^|
\\
.)
"
+
sortedNamespaces
.
join
(
"
\\
.(?:.*
\\
.)?
"
)
+
"
(
\\
.|$)
"
)
if
(
events
[
eventType
]
&&
namespaces
.
length
)
{
for
(
var
i
=
0
;
i
<
events
[
eventType
].
length
;
i
++
)
{
var
namespace
=
events
[
eventType
][
i
].
namespace
if
(
namespaceRegExp
.
test
(
namespace
))
return
{
pass
:
true
}
}
}
else
{
return
{
pass
:
(
events
[
eventType
]
&&
events
[
eventType
].
length
>
0
)
}
}
return
{
pass
:
false
}
}
}
},
toHandleWith
:
function
()
{
return
{
compare
:
function
(
actual
,
eventName
,
eventHandler
)
{
if
(
!
actual
||
actual
.
length
===
0
)
return
{
pass
:
false
};
var
normalizedEventName
=
eventName
.
split
(
'
.
'
)[
0
]
,
stack
=
$
.
_data
(
$
(
actual
).
get
(
0
),
"
events
"
)[
normalizedEventName
]
for
(
var
i
=
0
;
i
<
stack
.
length
;
i
++
)
{
if
(
stack
[
i
].
handler
==
eventHandler
)
return
{
pass
:
true
}
}
return
{
pass
:
false
}
}
}
},
toHaveBeenTriggeredOn
:
function
()
{
return
{
compare
:
function
(
actual
,
selector
)
{
var
result
=
{
pass
:
jasmine
.
jQuery
.
events
.
wasTriggered
(
selector
,
actual
)
}
result
.
message
=
result
.
pass
?
"
Expected event
"
+
$
(
actual
)
+
"
not to have been triggered on
"
+
selector
:
"
Expected event
"
+
$
(
actual
)
+
"
to have been triggered on
"
+
selector
return
result
;
}
}
},
toHaveBeenTriggered
:
function
(){
return
{
compare
:
function
(
actual
)
{
var
eventName
=
actual
.
eventName
,
selector
=
actual
.
selector
,
result
=
{
pass
:
jasmine
.
jQuery
.
events
.
wasTriggered
(
selector
,
eventName
)
}
result
.
message
=
result
.
pass
?
"
Expected event
"
+
eventName
+
"
not to have been triggered on
"
+
selector
:
"
Expected event
"
+
eventName
+
"
to have been triggered on
"
+
selector
return
result
}
}
},
toHaveBeenTriggeredOnAndWith
:
function
(
j$
,
customEqualityTesters
)
{
return
{
compare
:
function
(
actual
,
selector
,
expectedArgs
)
{
var
wasTriggered
=
jasmine
.
jQuery
.
events
.
wasTriggered
(
selector
,
actual
)
,
result
=
{
pass
:
wasTriggered
&&
jasmine
.
jQuery
.
events
.
wasTriggeredWith
(
selector
,
actual
,
expectedArgs
,
j$
,
customEqualityTesters
)
}
if
(
wasTriggered
)
{
var
actualArgs
=
jasmine
.
jQuery
.
events
.
args
(
selector
,
actual
,
expectedArgs
)[
1
]
result
.
message
=
result
.
pass
?
"
Expected event
"
+
actual
+
"
not to have been triggered with
"
+
jasmine
.
pp
(
expectedArgs
)
+
"
but it was triggered with
"
+
jasmine
.
pp
(
actualArgs
)
:
"
Expected event
"
+
actual
+
"
to have been triggered with
"
+
jasmine
.
pp
(
expectedArgs
)
+
"
but it was triggered with
"
+
jasmine
.
pp
(
actualArgs
)
}
else
{
// todo check on this
result
.
message
=
result
.
pass
?
"
Expected event
"
+
actual
+
"
not to have been triggered on
"
+
selector
:
"
Expected event
"
+
actual
+
"
to have been triggered on
"
+
selector
}
return
result
}
}
},
toHaveBeenPreventedOn
:
function
()
{
return
{
compare
:
function
(
actual
,
selector
)
{
var
result
=
{
pass
:
jasmine
.
jQuery
.
events
.
wasPrevented
(
selector
,
actual
)
}
result
.
message
=
result
.
pass
?
"
Expected event
"
+
actual
+
"
not to have been prevented on
"
+
selector
:
"
Expected event
"
+
actual
+
"
to have been prevented on
"
+
selector
return
result
}
}
},
toHaveBeenPrevented
:
function
()
{
return
{
compare
:
function
(
actual
)
{
var
eventName
=
actual
.
eventName
,
selector
=
actual
.
selector
,
result
=
{
pass
:
jasmine
.
jQuery
.
events
.
wasPrevented
(
selector
,
eventName
)
}
result
.
message
=
result
.
pass
?
"
Expected event
"
+
eventName
+
"
not to have been prevented on
"
+
selector
:
"
Expected event
"
+
eventName
+
"
to have been prevented on
"
+
selector
return
result
}
}
},
toHaveBeenStoppedOn
:
function
()
{
return
{
compare
:
function
(
actual
,
selector
)
{
var
result
=
{
pass
:
jasmine
.
jQuery
.
events
.
wasStopped
(
selector
,
actual
)
}
result
.
message
=
result
.
pass
?
"
Expected event
"
+
actual
+
"
not to have been stopped on
"
+
selector
:
"
Expected event
"
+
actual
+
"
to have been stopped on
"
+
selector
return
result
;
}
}
},
toHaveBeenStopped
:
function
()
{
return
{
compare
:
function
(
actual
)
{
var
eventName
=
actual
.
eventName
,
selector
=
actual
.
selector
,
result
=
{
pass
:
jasmine
.
jQuery
.
events
.
wasStopped
(
selector
,
eventName
)
}
result
.
message
=
result
.
pass
?
"
Expected event
"
+
eventName
+
"
not to have been stopped on
"
+
selector
:
"
Expected event
"
+
eventName
+
"
to have been stopped on
"
+
selector
return
result
}
}
}
})
jasmine
.
getEnv
().
addCustomEqualityTester
(
function
(
a
,
b
)
{
if
(
a
&&
b
)
{
if
(
a
instanceof
$
||
jasmine
.
isDomNode
(
a
))
{
var
$a
=
$
(
a
)
if
(
b
instanceof
$
)
return
$a
.
length
==
b
.
length
&&
a
.
is
(
b
)
return
$a
.
is
(
b
);
}
if
(
b
instanceof
$
||
jasmine
.
isDomNode
(
b
))
{
var
$b
=
$
(
b
)
if
(
a
instanceof
$
)
return
a
.
length
==
$b
.
length
&&
$b
.
is
(
a
)
return
$
(
b
).
is
(
a
);
}
}
})
jasmine
.
getEnv
().
addCustomEqualityTester
(
function
(
a
,
b
)
{
if
(
a
instanceof
$
&&
b
instanceof
$
&&
a
.
size
()
==
b
.
size
())
return
a
.
is
(
b
)
})
})
afterEach
(
function
()
{
jasmine
.
getFixtures
().
cleanUp
()
jasmine
.
getStyleFixtures
().
cleanUp
()
jasmine
.
jQuery
.
events
.
cleanUp
()
})
window
.
readFixtures
=
function
()
{
return
jasmine
.
getFixtures
().
proxyCallTo_
(
'
read
'
,
arguments
)
}
window
.
preloadFixtures
=
function
()
{
jasmine
.
getFixtures
().
proxyCallTo_
(
'
preload
'
,
arguments
)
}
window
.
loadFixtures
=
function
()
{
jasmine
.
getFixtures
().
proxyCallTo_
(
'
load
'
,
arguments
)
}
window
.
appendLoadFixtures
=
function
()
{
jasmine
.
getFixtures
().
proxyCallTo_
(
'
appendLoad
'
,
arguments
)
}
window
.
setFixtures
=
function
(
html
)
{
return
jasmine
.
getFixtures
().
proxyCallTo_
(
'
set
'
,
arguments
)
}
window
.
appendSetFixtures
=
function
()
{
jasmine
.
getFixtures
().
proxyCallTo_
(
'
appendSet
'
,
arguments
)
}
window
.
sandbox
=
function
(
attributes
)
{
return
jasmine
.
getFixtures
().
sandbox
(
attributes
)
}
window
.
spyOnEvent
=
function
(
selector
,
eventName
)
{
return
jasmine
.
jQuery
.
events
.
spyOn
(
selector
,
eventName
)
}
window
.
preloadStyleFixtures
=
function
()
{
jasmine
.
getStyleFixtures
().
proxyCallTo_
(
'
preload
'
,
arguments
)
}
window
.
loadStyleFixtures
=
function
()
{
jasmine
.
getStyleFixtures
().
proxyCallTo_
(
'
load
'
,
arguments
)
}
window
.
appendLoadStyleFixtures
=
function
()
{
jasmine
.
getStyleFixtures
().
proxyCallTo_
(
'
appendLoad
'
,
arguments
)
}
window
.
setStyleFixtures
=
function
(
html
)
{
jasmine
.
getStyleFixtures
().
proxyCallTo_
(
'
set
'
,
arguments
)
}
window
.
appendSetStyleFixtures
=
function
(
html
)
{
jasmine
.
getStyleFixtures
().
proxyCallTo_
(
'
appendSet
'
,
arguments
)
}
window
.
loadJSONFixtures
=
function
()
{
return
jasmine
.
getJSONFixtures
().
proxyCallTo_
(
'
load
'
,
arguments
)
}
window
.
getJSONFixture
=
function
(
url
)
{
return
jasmine
.
getJSONFixtures
().
proxyCallTo_
(
'
read
'
,
arguments
)[
url
]
}
}));
vendor/assets/javascripts/jquery.atwho.js
View file @
35c8fd55
...
...
@@ -448,7 +448,7 @@ Controller = (function() {
Controller
.
prototype
.
insertContentFor
=
function
(
$li
)
{
var
data
,
tpl
;
tpl
=
this
.
getOpt
(
'
insertTpl
'
);
data
=
$
.
extend
({},
$li
.
data
(
'
item
-d
ata
'
),
{
data
=
$
.
extend
({},
$li
.
data
(
'
item
D
ata
'
),
{
'
atwho-at
'
:
this
.
at
});
return
this
.
callbacks
(
"
tplEval
"
).
call
(
this
,
tpl
,
data
,
"
onInsert
"
);
...
...
@@ -824,7 +824,7 @@ EditableController = (function(superClass) {
this
.
$inputor
.
focus
();
}
suffix
=
(
suffix
=
this
.
getOpt
(
'
suffix
'
))
===
""
?
suffix
:
suffix
||
"
\
u00A0
"
;
data
=
$li
.
data
(
'
item
-d
ata
'
);
data
=
$li
.
data
(
'
item
D
ata
'
);
this
.
query
.
el
.
removeClass
(
'
atwho-query
'
).
addClass
(
'
atwho-inserted
'
).
html
(
content
).
attr
(
'
data-atwho-at-query
'
,
""
+
data
[
'
atwho-at
'
]
+
this
.
query
.
text
);
if
(
range
=
this
.
_getRange
())
{
range
.
setEndAfter
(
this
.
query
.
el
[
0
]);
...
...
vendor/assets/javascripts/jquery.endless-scroll.js
View file @
35c8fd55
...
...
@@ -125,4 +125,4 @@
}
};
})(
jQuery
);
\ No newline at end of file
})(
jQuery
);
vendor/assets/javascripts/peek.js
View file @
35c8fd55
...
...
@@ -10,7 +10,7 @@
(
function
(
$
)
{
var
fetchRequestResults
,
getRequestId
,
peekEnabled
,
updatePerformanceBar
;
getRequestId
=
function
()
{
return
$
(
'
#peek
'
).
data
(
'
request
-i
d
'
);
return
$
(
'
#peek
'
).
data
(
'
request
I
d
'
);
};
peekEnabled
=
function
()
{
return
$
(
'
#peek
'
).
length
;
...
...
yarn.lock
View file @
35c8fd55
...
...
@@ -4211,9 +4211,9 @@ jquery.waitforimages@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/jquery.waitforimages/-/jquery.waitforimages-2.2.0.tgz#63f23131055a1b060dc913e6d874bcc9b9e6b16b"
"jquery@>= 1.9.1", jquery@>=1.8.0, jquery@^
2.2.4
:
version "
2.2.4
"
resolved "https://registry.yarnpkg.com/jquery/-/jquery-
2.2.4.tgz#2c89d6889b5eac522a7eea32c14521559c6cbf02
"
"jquery@>= 1.9.1", jquery@>=1.8.0, jquery@^
3.2.1
:
version "
3.3.1
"
resolved "https://registry.yarnpkg.com/jquery/-/jquery-
3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca
"
js-base64@^2.1.9:
version "2.1.9"
...
...
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