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
29e147a2
Commit
29e147a2
authored
Apr 15, 2020
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaces last instances
* across multiple files
parent
6147fdcd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
30 deletions
+26
-30
app/assets/javascripts/gfm_auto_complete.js
app/assets/javascripts/gfm_auto_complete.js
+1
-2
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+5
-5
app/assets/javascripts/issuable_bulk_update_actions.js
app/assets/javascripts/issuable_bulk_update_actions.js
+4
-4
app/assets/javascripts/milestone_select.js
app/assets/javascripts/milestone_select.js
+7
-7
app/assets/javascripts/search_autocomplete.js
app/assets/javascripts/search_autocomplete.js
+2
-2
app/assets/javascripts/tracking.js
app/assets/javascripts/tracking.js
+2
-2
spec/frontend/releases/components/release_block_spec.js
spec/frontend/releases/components/release_block_spec.js
+5
-8
No files found.
app/assets/javascripts/gfm_auto_complete.js
View file @
29e147a2
...
...
@@ -5,7 +5,6 @@ import SidebarMediator from '~/sidebar/sidebar_mediator';
import
glRegexp
from
'
./lib/utils/regexp
'
;
import
AjaxCache
from
'
./lib/utils/ajax_cache
'
;
import
{
spriteIcon
}
from
'
./lib/utils/common_utils
'
;
import
_
from
'
underscore
'
;
function
sanitize
(
str
)
{
return
str
.
replace
(
/<
(?:
.|
\n)
*
?
>/gm
,
''
);
...
...
@@ -138,7 +137,7 @@ class GfmAutoComplete {
tpl
+=
'
<%- referencePrefix %>
'
;
}
}
return
_
.
template
(
tpl
)({
referencePrefix
});
return
template
(
tpl
,
{
interpolate
:
/<%=
([\s\S]
+
?)
%>/g
}
)({
referencePrefix
});
},
suffix
:
''
,
callbacks
:
{
...
...
app/assets/javascripts/gl_dropdown.js
View file @
29e147a2
/* eslint-disable max-classes-per-file, one-var, consistent-return */
import
$
from
'
jquery
'
;
import
_
from
'
underscore
'
;
import
{
escape
as
esc
}
from
'
lodash
'
;
import
fuzzaldrinPlus
from
'
fuzzaldrin-plus
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
{
visitUrl
}
from
'
./lib/utils/url_utility
'
;
...
...
@@ -145,7 +145,7 @@ class GitLabDropdownFilter {
// { prop: 'foo' },
// { prop: 'baz' }
// ]
if
(
_
.
isArray
(
data
))
{
if
(
Array
.
isArray
(
data
))
{
results
=
fuzzaldrinPlus
.
filter
(
data
,
searchText
,
{
key
:
this
.
options
.
keys
,
});
...
...
@@ -261,14 +261,14 @@ class GitLabDropdown {
// If no input is passed create a default one
self
=
this
;
// If selector was passed
if
(
_
.
isString
(
this
.
filterInput
)
)
{
if
(
typeof
this
.
filterInput
===
'
string
'
)
{
this
.
filterInput
=
this
.
getElement
(
this
.
filterInput
);
}
const
searchFields
=
this
.
options
.
search
?
this
.
options
.
search
.
fields
:
[];
if
(
this
.
options
.
data
)
{
// If we provided data
// data could be an array of objects or a group of arrays
if
(
_
.
isObject
(
this
.
options
.
data
)
&&
!
_
.
isFunction
(
this
.
options
.
data
))
{
if
(
typeof
this
.
options
.
data
===
'
object
'
&&
!
(
this
.
options
.
data
instanceof
Function
))
{
this
.
fullData
=
this
.
options
.
data
;
currentIndex
=
-
1
;
this
.
parseData
(
this
.
options
.
data
);
...
...
@@ -610,7 +610,7 @@ class GitLabDropdown {
// eslint-disable-next-line class-methods-use-this
highlightTemplate
(
text
,
template
)
{
return
`"<b>
${
_
.
escape
(
text
)}
</b>"
${
template
}
`
;
return
`"<b>
${
esc
(
text
)}
</b>"
${
template
}
`
;
}
// eslint-disable-next-line class-methods-use-this
...
...
app/assets/javascripts/issuable_bulk_update_actions.js
View file @
29e147a2
/* eslint-disable consistent-return, func-names, array-callback-return */
import
$
from
'
jquery
'
;
import
_
from
'
underscore
'
;
import
{
intersection
}
from
'
lodash
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
Flash
from
'
./flash
'
;
import
{
__
}
from
'
./locale
'
;
...
...
@@ -111,7 +111,7 @@ export default {
this
.
getElement
(
'
.selected-issuable:checked
'
).
each
((
i
,
el
)
=>
{
labelIds
.
push
(
this
.
getElement
(
`#
${
this
.
prefixId
}${
el
.
dataset
.
id
}
`
).
data
(
'
labels
'
));
});
return
_
.
intersection
.
apply
(
this
,
labelIds
);
return
intersection
.
apply
(
this
,
labelIds
);
},
// From issuable's initial bulk selection
...
...
@@ -120,7 +120,7 @@ export default {
this
.
getElement
(
'
.selected-issuable:checked
'
).
each
((
i
,
el
)
=>
{
labelIds
.
push
(
this
.
getElement
(
`#
${
this
.
prefixId
}${
el
.
dataset
.
id
}
`
).
data
(
'
labels
'
));
});
return
_
.
intersection
.
apply
(
this
,
labelIds
);
return
intersection
.
apply
(
this
,
labelIds
);
},
// From issuable's initial bulk selection
...
...
@@ -144,7 +144,7 @@ export default {
// Add uniqueIds to add it as argument for _.intersection
labelIds
.
unshift
(
uniqueIds
);
// Return IDs that are present but not in all selected issueables
return
_
.
difference
(
uniqueIds
,
_
.
intersection
.
apply
(
this
,
labelIds
));
return
uniqueIds
.
filter
(
x
=>
!
intersection
.
apply
(
this
,
labelIds
).
includes
(
x
));
},
getElement
(
selector
)
{
...
...
app/assets/javascripts/milestone_select.js
View file @
29e147a2
...
...
@@ -3,7 +3,7 @@
/* global ListMilestone */
import
$
from
'
jquery
'
;
import
_
from
'
underscore
'
;
import
{
template
,
escape
as
esc
}
from
'
lodash
'
;
import
{
__
}
from
'
~/locale
'
;
import
'
~/gl_dropdown
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
...
...
@@ -60,7 +60,7 @@ export default class MilestoneSelect {
selectedMilestone
=
$dropdown
.
data
(
'
selected
'
)
||
selectedMilestoneDefault
;
if
(
issueUpdateURL
)
{
milestoneLinkTemplate
=
_
.
template
(
milestoneLinkTemplate
=
template
(
'
<a href="<%- web_url %>" class="bold has-tooltip" data-container="body" title="<%- remaining %>"><%- title %></a>
'
,
);
milestoneLinkNoneTemplate
=
`<span class="no-value">
${
__
(
'
None
'
)}
</span>`
;
...
...
@@ -106,12 +106,12 @@ export default class MilestoneSelect {
if
(
showMenuAbove
)
{
$dropdown
.
data
(
'
glDropdown
'
).
positionMenuAbove
();
}
$
(
`[data-milestone-id="
${
_
.
escape
(
selectedMilestone
)}
"] > a`
).
addClass
(
'
is-active
'
);
$
(
`[data-milestone-id="
${
esc
(
selectedMilestone
)}
"] > a`
).
addClass
(
'
is-active
'
);
}),
renderRow
:
milestone
=>
`
<li data-milestone-id="
${
_
.
escape
(
milestone
.
name
)}
">
<li data-milestone-id="
${
esc
(
milestone
.
name
)}
">
<a href='#' class='dropdown-menu-milestone-link'>
${
_
.
escape
(
milestone
.
title
)}
${
esc
(
milestone
.
title
)}
</a>
</li>
`
,
...
...
@@ -129,7 +129,7 @@ export default class MilestoneSelect {
},
defaultLabel
,
fieldName
:
$dropdown
.
data
(
'
fieldName
'
),
text
:
milestone
=>
_
.
escape
(
milestone
.
title
),
text
:
milestone
=>
esc
(
milestone
.
title
),
id
:
milestone
=>
{
if
(
!
useId
&&
!
$dropdown
.
is
(
'
.js-issuable-form-dropdown
'
))
{
return
milestone
.
name
;
...
...
@@ -148,7 +148,7 @@ export default class MilestoneSelect {
selectedMilestone
=
$dropdown
[
0
].
dataset
.
selected
||
selectedMilestoneDefault
;
}
$
(
'
a.is-active
'
,
$el
).
removeClass
(
'
is-active
'
);
$
(
`[data-milestone-id="
${
_
.
escape
(
selectedMilestone
)}
"] > a`
,
$el
).
addClass
(
'
is-active
'
);
$
(
`[data-milestone-id="
${
esc
(
selectedMilestone
)}
"] > a`
,
$el
).
addClass
(
'
is-active
'
);
},
vue
:
$dropdown
.
hasClass
(
'
js-issue-board-sidebar
'
),
clicked
:
clickEvent
=>
{
...
...
app/assets/javascripts/search_autocomplete.js
View file @
29e147a2
/* eslint-disable no-return-assign, consistent-return, class-methods-use-this */
import
$
from
'
jquery
'
;
import
{
escape
,
throttle
}
from
'
underscore
'
;
import
{
escape
as
esc
,
throttle
}
from
'
lodash
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
import
{
getIdenticonBackgroundClass
,
getIdenticonTitle
}
from
'
~/helpers/avatar_helper
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
...
...
@@ -448,7 +448,7 @@ export class SearchAutocomplete {
const
avatar
=
avatarUrl
?
`<img class="search-item-avatar" src="
${
avatarUrl
}
" />`
:
`<div class="s16 avatar identicon
${
getIdenticonBackgroundClass
(
id
)}
">
${
getIdenticonTitle
(
esc
ape
(
label
),
esc
(
label
),
)}
</div>`
;
return
avatar
;
...
...
app/assets/javascripts/tracking.js
View file @
29e147a2
import
_
from
'
underscore
'
;
import
{
omitBy
,
isUndefined
}
from
'
lodash
'
;
const
DEFAULT_SNOWPLOW_OPTIONS
=
{
namespace
:
'
gl
'
,
...
...
@@ -29,7 +29,7 @@ const eventHandler = (e, func, opts = {}) => {
context
:
el
.
dataset
.
trackContext
,
};
func
(
opts
.
category
,
action
+
(
opts
.
suffix
||
''
),
_
.
omit
(
data
,
_
.
isUndefined
));
func
(
opts
.
category
,
action
+
(
opts
.
suffix
||
''
),
omitBy
(
data
,
isUndefined
));
};
const
eventHandlers
=
(
category
,
func
)
=>
{
...
...
spec/frontend/releases/components/release_block_spec.js
View file @
29e147a2
import
$
from
'
jquery
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
first
}
from
'
underscore
'
;
import
EvidenceBlock
from
'
~/releases/components/evidence_block.vue
'
;
import
ReleaseBlock
from
'
~/releases/components/release_block.vue
'
;
import
ReleaseBlockFooter
from
'
~/releases/components/release_block_footer.vue
'
;
...
...
@@ -80,11 +79,11 @@ describe('Release block', () => {
);
expect
(
wrapper
.
find
(
'
.js-sources-dropdown li a
'
).
attributes
().
href
).
toEqual
(
first
(
release
.
assets
.
sources
)
.
url
,
release
.
assets
.
sources
[
0
]
.
url
,
);
expect
(
wrapper
.
find
(
'
.js-sources-dropdown li a
'
).
text
()).
toContain
(
first
(
release
.
assets
.
sources
)
.
format
,
release
.
assets
.
sources
[
0
]
.
format
,
);
});
...
...
@@ -92,12 +91,10 @@ describe('Release block', () => {
expect
(
wrapper
.
findAll
(
'
.js-assets-list li
'
).
length
).
toEqual
(
release
.
assets
.
links
.
length
);
expect
(
wrapper
.
find
(
'
.js-assets-list li a
'
).
attributes
().
href
).
toEqual
(
first
(
release
.
assets
.
links
)
.
directAssetUrl
,
release
.
assets
.
links
[
0
]
.
directAssetUrl
,
);
expect
(
wrapper
.
find
(
'
.js-assets-list li a
'
).
text
()).
toContain
(
first
(
release
.
assets
.
links
).
name
,
);
expect
(
wrapper
.
find
(
'
.js-assets-list li a
'
).
text
()).
toContain
(
release
.
assets
.
links
[
0
].
name
);
});
it
(
'
renders author avatar
'
,
()
=>
{
...
...
@@ -264,7 +261,7 @@ describe('Release block', () => {
});
it
(
'
renders a link to the milestone with a tooltip
'
,
()
=>
{
const
milestone
=
first
(
release
.
milestones
)
;
const
milestone
=
release
.
milestones
[
0
]
;
const
milestoneLink
=
wrapper
.
find
(
'
.js-milestone-link
'
);
expect
(
milestoneLink
.
exists
()).
toBe
(
true
);
...
...
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