Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
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
Expand all
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
This diff is collapsed.
Click to expand it.
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
This diff is collapsed.
Click to expand it.
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