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
888002a6
Commit
888002a6
authored
Dec 22, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 30 files: 3 of 8
Mandatory not to break master. Automatically created with prettier.
parent
c152d514
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
85 additions
and
128 deletions
+85
-128
app/assets/javascripts/filtered_search/available_dropdown_mappings.js
...avascripts/filtered_search/available_dropdown_mappings.js
+3
-2
app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js
...ascripts/filtered_search/filtered_search_visual_tokens.js
+2
-1
app/assets/javascripts/gfm_auto_complete.js
app/assets/javascripts/gfm_auto_complete.js
+2
-8
app/assets/javascripts/gl_form.js
app/assets/javascripts/gl_form.js
+2
-6
app/assets/javascripts/groups/components/group_item.vue
app/assets/javascripts/groups/components/group_item.vue
+1
-1
app/assets/javascripts/groups/groups_filterable_list.js
app/assets/javascripts/groups/groups_filterable_list.js
+1
-4
app/assets/javascripts/ide/components/nav_dropdown.vue
app/assets/javascripts/ide/components/nav_dropdown.vue
+1
-3
app/assets/javascripts/ide/lib/editorconfig/parser.js
app/assets/javascripts/ide/lib/editorconfig/parser.js
+6
-1
app/assets/javascripts/ide/lib/languages/hcl.js
app/assets/javascripts/ide/lib/languages/hcl.js
+10
-2
app/assets/javascripts/ide/lib/languages/vue.js
app/assets/javascripts/ide/lib/languages/vue.js
+7
-1
app/assets/javascripts/ide/stores/utils.js
app/assets/javascripts/ide/stores/utils.js
+1
-6
app/assets/javascripts/ide/utils.js
app/assets/javascripts/ide/utils.js
+1
-6
app/assets/javascripts/incidents/components/incidents_list.vue
...ssets/javascripts/incidents/components/incidents_list.vue
+1
-3
app/assets/javascripts/invite_members/components/invite_members_modal.vue
...cripts/invite_members/components/invite_members_modal.vue
+1
-1
app/assets/javascripts/issuable/auto_width_dropdown_select.js
...assets/javascripts/issuable/auto_width_dropdown_select.js
+1
-4
app/assets/javascripts/issuable_form.js
app/assets/javascripts/issuable_form.js
+6
-6
app/assets/javascripts/issuable_index.js
app/assets/javascripts/issuable_index.js
+1
-3
app/assets/javascripts/issuable_show/components/issuable_edit_form.vue
...vascripts/issuable_show/components/issuable_edit_form.vue
+1
-2
app/assets/javascripts/issuable_suggestions/index.js
app/assets/javascripts/issuable_suggestions/index.js
+1
-1
app/assets/javascripts/issue.js
app/assets/javascripts/issue.js
+1
-5
app/assets/javascripts/issue_show/components/fields/description.vue
.../javascripts/issue_show/components/fields/description.vue
+1
-2
app/assets/javascripts/jobs/components/manual_variables_form.vue
...ets/javascripts/jobs/components/manual_variables_form.vue
+4
-1
app/assets/javascripts/label_manager.js
app/assets/javascripts/label_manager.js
+1
-1
app/assets/javascripts/labels_select.js
app/assets/javascripts/labels_select.js
+6
-11
app/assets/javascripts/lib/utils/common_utils.js
app/assets/javascripts/lib/utils/common_utils.js
+1
-1
app/assets/javascripts/lib/utils/text_markdown.js
app/assets/javascripts/lib/utils/text_markdown.js
+3
-9
app/assets/javascripts/line_highlighter.js
app/assets/javascripts/line_highlighter.js
+11
-13
app/assets/javascripts/logs/components/environment_logs.vue
app/assets/javascripts/logs/components/environment_logs.vue
+2
-6
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+5
-15
app/assets/javascripts/member_expiration_date.js
app/assets/javascripts/member_expiration_date.js
+1
-3
No files found.
app/assets/javascripts/filtered_search/available_dropdown_mappings.js
View file @
888002a6
...
...
@@ -200,8 +200,9 @@ export default class AvailableDropdownMappings {
}
getMergeRequestTargetBranchesEndpoint
()
{
const
endpoint
=
`
${
gon
.
relative_url_root
||
''
}
/autocomplete/merge_request_target_branches.json`
;
const
endpoint
=
`
${
gon
.
relative_url_root
||
''
}
/autocomplete/merge_request_target_branches.json`
;
const
params
=
{
group_id
:
this
.
getGroupId
(),
...
...
app/assets/javascripts/filtered_search/filtered_search_visual_tokens.js
View file @
888002a6
...
...
@@ -193,7 +193,8 @@ export default class FilteredSearchVisualTokens {
});
}
else
if
(
!
isLastVisualTokenValid
&&
(
lastVisualToken
&&
!
lastVisualToken
.
querySelector
(
'
.operator
'
))
lastVisualToken
&&
!
lastVisualToken
.
querySelector
(
'
.operator
'
)
)
{
const
tokensContainer
=
FilteredSearchContainer
.
container
.
querySelector
(
'
.tokens-container
'
);
tokensContainer
.
removeChild
(
lastVisualToken
);
...
...
app/assets/javascripts/gfm_auto_complete.js
View file @
888002a6
...
...
@@ -285,10 +285,7 @@ class GfmAutoComplete {
...
this
.
getDefaultCallbacks
(),
beforeSave
:
membersBeforeSave
,
matcher
(
flag
,
subtext
)
{
const
subtextNodes
=
subtext
.
split
(
/
\n
+/g
)
.
pop
()
.
split
(
GfmAutoComplete
.
regexSubtext
);
const
subtextNodes
=
subtext
.
split
(
/
\n
+/g
).
pop
().
split
(
GfmAutoComplete
.
regexSubtext
);
// Check if @ is followed by '/assign', '/reassign', '/unassign' or '/cc' commands.
command
=
subtextNodes
.
find
(
node
=>
{
...
...
@@ -465,10 +462,7 @@ class GfmAutoComplete {
}));
},
matcher
(
flag
,
subtext
)
{
const
subtextNodes
=
subtext
.
split
(
/
\n
+/g
)
.
pop
()
.
split
(
GfmAutoComplete
.
regexSubtext
);
const
subtextNodes
=
subtext
.
split
(
/
\n
+/g
).
pop
().
split
(
GfmAutoComplete
.
regexSubtext
);
// Check if ~ is followed by '/label', '/relabel' or '/unlabel' commands.
command
=
subtextNodes
.
find
(
node
=>
{
...
...
app/assets/javascripts/gl_form.js
View file @
888002a6
...
...
@@ -108,14 +108,10 @@ export default class GLForm {
addEventListeners
()
{
this
.
textarea
.
on
(
'
focus
'
,
function
focusTextArea
()
{
$
(
this
)
.
closest
(
'
.md-area
'
)
.
addClass
(
'
is-focused
'
);
$
(
this
).
closest
(
'
.md-area
'
).
addClass
(
'
is-focused
'
);
});
this
.
textarea
.
on
(
'
blur
'
,
function
blurTextArea
()
{
$
(
this
)
.
closest
(
'
.md-area
'
)
.
removeClass
(
'
is-focused
'
);
$
(
this
).
closest
(
'
.md-area
'
).
removeClass
(
'
is-focused
'
);
});
}
...
...
app/assets/javascripts/groups/components/group_item.vue
View file @
888002a6
...
...
@@ -126,7 +126,7 @@ export default {
/>
<div
:class=
"
{ 'd-sm-flex': !group.isChildrenLoading }"
class="avatar-container rect-avatar s32 d-none flex-grow-0 flex-shrink-0
"
class="avatar-container rect-avatar s32 d-none flex-grow-0 flex-shrink-0"
>
<a
:href=
"group.relativePath"
class=
"no-expand"
>
<img
...
...
app/assets/javascripts/groups/groups_filterable_list.js
View file @
888002a6
...
...
@@ -65,10 +65,7 @@ export default class GroupFilterableList extends FilterableList {
setDefaultFilterOption
()
{
const
defaultOption
=
$
.
trim
(
this
.
$dropdown
.
find
(
'
.dropdown-menu li.js-filter-sort-order a
'
)
.
first
()
.
text
(),
this
.
$dropdown
.
find
(
'
.dropdown-menu li.js-filter-sort-order a
'
).
first
().
text
(),
);
this
.
$dropdown
.
find
(
'
.dropdown-label
'
).
text
(
defaultOption
);
}
...
...
app/assets/javascripts/ide/components/nav_dropdown.vue
View file @
888002a6
...
...
@@ -31,9 +31,7 @@ export default {
},
removeDropdownListeners
()
{
// eslint-disable-next-line @gitlab/no-global-event-off
$
(
this
.
$refs
.
dropdown
)
.
off
(
'
show.bs.dropdown
'
)
.
off
(
'
hide.bs.dropdown
'
);
$
(
this
.
$refs
.
dropdown
).
off
(
'
show.bs.dropdown
'
).
off
(
'
hide.bs.dropdown
'
);
},
showDropdown
()
{
this
.
isVisibleDropdown
=
true
;
...
...
app/assets/javascripts/ide/lib/editorconfig/parser.js
View file @
888002a6
...
...
@@ -50,5 +50,10 @@ export function getRulesWithTraversal(filePath, getFileContent) {
return
Promise
.
all
(
editorconfigPaths
.
map
(
path
=>
getFileContent
(
path
).
then
(
content
=>
({
path
,
content
}))),
).
then
(
results
=>
getRulesWithConfigs
(
filePath
,
results
.
filter
(
x
=>
x
.
content
)));
).
then
(
results
=>
getRulesWithConfigs
(
filePath
,
results
.
filter
(
x
=>
x
.
content
),
),
);
}
app/assets/javascripts/ide/lib/languages/hcl.js
View file @
888002a6
...
...
@@ -11,7 +11,11 @@ const conf = {
lineComment
:
'
//
'
,
blockComment
:
[
'
/*
'
,
'
*/
'
],
},
brackets
:
[[
'
{
'
,
'
}
'
],
[
'
[
'
,
'
]
'
],
[
'
(
'
,
'
)
'
]],
brackets
:
[
[
'
{
'
,
'
}
'
],
[
'
[
'
,
'
]
'
],
[
'
(
'
,
'
)
'
],
],
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
...
...
@@ -161,7 +165,11 @@ const language = {
[
/
\/\/
.*$/
,
'
comment
'
],
[
/#.*$/
,
'
comment
'
],
],
comment
:
[[
/
[^\/
*
]
+/
,
'
comment
'
],
[
/
\*\/
/
,
'
comment
'
,
'
@pop
'
],
[
/
[\/
*
]
/
,
'
comment
'
]],
comment
:
[
[
/
[^\/
*
]
+/
,
'
comment
'
],
[
/
\*\/
/
,
'
comment
'
,
'
@pop
'
],
[
/
[\/
*
]
/
,
'
comment
'
],
],
string
:
[
[
/
\$\{
/
,
{
token
:
'
delimiter
'
,
next
:
'
@stringExpression
'
}],
[
/
[^\\
"
\$]
+/
,
'
string
'
],
...
...
app/assets/javascripts/ide/lib/languages/vue.js
View file @
888002a6
...
...
@@ -37,7 +37,13 @@ const conf = {
blockComment
:
[
'
{{!--
'
,
'
--}}
'
],
},
brackets
:
[[
'
<!--
'
,
'
-->
'
],
[
'
<
'
,
'
>
'
],
[
'
{{
'
,
'
}}
'
],
[
'
{
'
,
'
}
'
],
[
'
(
'
,
'
)
'
]],
brackets
:
[
[
'
<!--
'
,
'
-->
'
],
[
'
<
'
,
'
>
'
],
[
'
{{
'
,
'
}}
'
],
[
'
{
'
,
'
}
'
],
[
'
(
'
,
'
)
'
],
],
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
...
...
app/assets/javascripts/ide/stores/utils.js
View file @
888002a6
...
...
@@ -254,12 +254,7 @@ export function extractMarkdownImagesFromEntries(mdFile, entries) {
const
imageContent
=
entries
[
imagePath
]?.
content
||
entries
[
imagePath
]?.
raw
;
if
(
!
isAbsolute
(
path
)
&&
imageContent
)
{
const
ext
=
path
.
includes
(
'
.
'
)
?
path
.
split
(
'
.
'
)
.
pop
()
.
trim
()
:
'
jpeg
'
;
const
ext
=
path
.
includes
(
'
.
'
)
?
path
.
split
(
'
.
'
).
pop
().
trim
()
:
'
jpeg
'
;
const
src
=
`data:image/
${
ext
}
;base64,
${
imageContent
}
`
;
i
+=
1
;
const
key
=
`{{
${
prefix
}${
i
}
}}`
;
...
...
app/assets/javascripts/ide/utils.js
View file @
888002a6
...
...
@@ -154,12 +154,7 @@ export function getFileEOL(content = '') {
*/
export
function
addNumericSuffix
(
filename
,
randomize
=
false
)
{
return
filename
.
replace
(
/
([
_-
]?)(\d
*
)(\.
.+
?
$|$
)
/
,
(
_
,
before
,
number
,
after
)
=>
{
const
n
=
randomize
?
Math
.
random
()
.
toString
()
.
substring
(
2
,
7
)
.
slice
(
-
5
)
:
Number
(
number
)
+
1
;
const
n
=
randomize
?
Math
.
random
().
toString
().
substring
(
2
,
7
).
slice
(
-
5
)
:
Number
(
number
)
+
1
;
return
`
${
before
||
'
-
'
}${
n
}${
after
}
`
;
});
}
...
...
app/assets/javascripts/incidents/components/incidents_list.vue
View file @
888002a6
...
...
@@ -265,9 +265,7 @@ export default {
if
(
field
?.
sortKey
)
{
sortKey
=
field
.
sortKey
;
}
else
{
sortKey
=
convertToSnakeCase
(
sortBy
)
.
replace
(
/_.*/
,
''
)
.
toUpperCase
();
sortKey
=
convertToSnakeCase
(
sortBy
).
replace
(
/_.*/
,
''
).
toUpperCase
();
}
this
.
pagination
=
initialPaginationState
;
...
...
app/assets/javascripts/invite_members/components/invite_members_modal.vue
View file @
888002a6
...
...
@@ -195,7 +195,7 @@ export default {
<div
class=
"gl-mt-2"
>
<gl-sprintf
:message=
"$options.labels.readMoreText"
>
<
template
#link=
"{
content
}"
>
<
template
#link=
"{
content
}"
>
<gl-link
:href=
"helpLink"
target=
"_blank"
>
{{
content
}}
</gl-link>
</
template
>
</gl-sprintf>
...
...
app/assets/javascripts/issuable/auto_width_dropdown_select.js
View file @
888002a6
...
...
@@ -37,10 +37,7 @@ class AutoWidthDropdownSelect {
// We have to look at the parent because
// `offsetParent` on a `display: none;` is `null`
const
offsetParentWidth
=
$
(
this
)
.
parent
()
.
offsetParent
()
.
width
();
const
offsetParentWidth
=
$
(
this
).
parent
().
offsetParent
().
width
();
// Reset any width to let it naturally flow
$dropdown
.
css
(
'
width
'
,
'
auto
'
);
if
(
$dropdown
.
outerWidth
(
false
)
>
offsetParentWidth
)
{
...
...
app/assets/javascripts/issuable_form.js
View file @
888002a6
...
...
@@ -52,12 +52,12 @@ export default class IssuableForm {
/* eslint-disable @gitlab/require-i18n-strings */
this
.
wipRegex
=
new
RegExp
(
'
^
\\
s*(
'
+
// Line start, then any amount of leading whitespace
'
draft
\\
s-
\\
s
'
+
// Draft_-_ where "_" are *exactly* one whitespace
'
|
\\
[(draft|wip)
\\
]
\\
s*
'
+
// [Draft] or [WIP] and any following whitespace
'
|(draft|wip):
\\
s*
'
+
// Draft: or WIP: and any following whitespace
'
|(draft|wip)
\\
s+
'
+
// Draft_ or WIP_ where "_" is at least one whitespace
'
|
\\
(draft
\\
)
\\
s*
'
+
// (Draft) and any following whitespace
'
)+
'
+
// At least one repeated match of the preceding parenthetical
'
draft
\\
s-
\\
s
'
+
// Draft_-_ where "_" are *exactly* one whitespace
'
|
\\
[(draft|wip)
\\
]
\\
s*
'
+
// [Draft] or [WIP] and any following whitespace
'
|(draft|wip):
\\
s*
'
+
// Draft: or WIP: and any following whitespace
'
|(draft|wip)
\\
s+
'
+
// Draft_ or WIP_ where "_" is at least one whitespace
'
|
\\
(draft
\\
)
\\
s*
'
+
// (Draft) and any following whitespace
'
)+
'
+
// At least one repeated match of the preceding parenthetical
'
\\
s*
'
,
// Any amount of trailing whitespace
'
i
'
,
// Match any case(s)
);
...
...
app/assets/javascripts/issuable_index.js
View file @
888002a6
...
...
@@ -21,9 +21,7 @@ export default class IssuableIndex {
axios
.
put
(
$resetToken
.
attr
(
'
href
'
))
.
then
(({
data
})
=>
{
$
(
'
#issuable_email
'
)
.
val
(
data
.
new_address
)
.
focus
();
$
(
'
#issuable_email
'
).
val
(
data
.
new_address
).
focus
();
$resetToken
.
text
(
s__
(
'
EmailToken|reset it
'
));
})
...
...
app/assets/javascripts/issuable_show/components/issuable_edit_form.vue
View file @
888002a6
...
...
@@ -141,8 +141,7 @@ export default {
:data-supports-quick-actions=
"enableAutocomplete"
:aria-label=
"__('Description')"
:placeholder=
"__('Write a comment or drag your files here…')"
class=
"note-textarea js-gfm-input js-autosize markdown-area
qa-description-textarea"
class=
"note-textarea js-gfm-input js-autosize markdown-area qa-description-textarea"
dir=
"auto"
@
keydown=
"handleKeydown($event, 'description')"
></textarea>
...
...
app/assets/javascripts/issuable_suggestions/index.js
View file @
888002a6
...
...
@@ -5,7 +5,7 @@ import App from './components/app.vue';
Vue
.
use
(
VueApollo
);
export
default
function
()
{
export
default
function
()
{
const
el
=
document
.
getElementById
(
'
js-suggestions
'
);
const
issueTitle
=
document
.
getElementById
(
'
issue_title
'
);
const
{
projectPath
}
=
el
.
dataset
;
...
...
app/assets/javascripts/issue.js
View file @
888002a6
...
...
@@ -54,11 +54,7 @@ export default class Issue {
$
(
document
).
trigger
(
'
issuable:change
'
,
isClosed
);
let
numProjectIssues
=
Number
(
projectIssuesCounter
.
first
()
.
text
()
.
trim
()
.
replace
(
/
[^\d]
/
,
''
),
projectIssuesCounter
.
first
().
text
().
trim
().
replace
(
/
[^\d]
/
,
''
),
);
numProjectIssues
=
isClosed
?
numProjectIssues
-
1
:
numProjectIssues
+
1
;
projectIssuesCounter
.
text
(
addDelimiter
(
numProjectIssues
));
...
...
app/assets/javascripts/issue_show/components/fields/description.vue
View file @
888002a6
...
...
@@ -53,8 +53,7 @@ export default {
id=
"issue-description"
ref=
"textarea"
v-model=
"formState.description"
class=
"note-textarea js-gfm-input js-autosize markdown-area
qa-description-textarea"
class=
"note-textarea js-gfm-input js-autosize markdown-area qa-description-textarea"
dir=
"auto"
:data-supports-quick-actions=
"!glFeatures.tributeAutocomplete"
:aria-label=
"__('Description')"
...
...
app/assets/javascripts/jobs/components/manual_variables_form.vue
View file @
888002a6
...
...
@@ -93,7 +93,10 @@ export default {
this
.
secretValue
=
''
;
},
deleteVariable
(
id
)
{
this
.
variables
.
splice
(
this
.
variables
.
findIndex
(
el
=>
el
.
id
===
id
),
1
);
this
.
variables
.
splice
(
this
.
variables
.
findIndex
(
el
=>
el
.
id
===
id
),
1
,
);
},
},
};
...
...
app/assets/javascripts/label_manager.js
View file @
888002a6
...
...
@@ -135,7 +135,7 @@ export default class LabelManager {
getSortedLabelsIds
()
{
const
sortedIds
=
[];
this
.
prioritizedLabels
.
find
(
'
> li
'
).
each
(
function
()
{
this
.
prioritizedLabels
.
find
(
'
> li
'
).
each
(
function
()
{
const
id
=
$
(
this
).
data
(
'
id
'
);
if
(
id
)
{
...
...
app/assets/javascripts/labels_select.js
View file @
888002a6
...
...
@@ -49,7 +49,7 @@ export default class LabelsSelect {
const
fieldName
=
$dropdown
.
data
(
'
fieldName
'
);
let
initialSelected
=
$selectbox
.
find
(
`input[name="
${
$dropdown
.
data
(
'
fieldName
'
)}
"]`
)
.
map
(
function
()
{
.
map
(
function
()
{
return
this
.
value
;
})
.
get
();
...
...
@@ -64,11 +64,11 @@ export default class LabelsSelect {
);
}
const
saveLabelData
=
function
()
{
const
saveLabelData
=
function
()
{
const
selected
=
$dropdown
.
closest
(
'
.selectbox
'
)
.
find
(
`input[name='
${
fieldName
}
']`
)
.
map
(
function
()
{
.
map
(
function
()
{
return
this
.
value
;
})
.
get
();
...
...
@@ -210,9 +210,7 @@ export default class LabelsSelect {
}
}
else
{
if
(
this
.
id
(
label
))
{
const
dropdownValue
=
this
.
id
(
label
)
.
toString
()
.
replace
(
/'/g
,
"
\\
'
"
);
const
dropdownValue
=
this
.
id
(
label
).
toString
().
replace
(
/'/g
,
"
\\
'
"
);
if
(
$form
.
find
(
...
...
@@ -346,10 +344,7 @@ export default class LabelsSelect {
const
isMRIndex
=
page
===
'
projects:merge_requests:index
'
;
if
(
$dropdown
.
parent
().
find
(
'
.is-active:not(.dropdown-clear-active)
'
).
length
)
{
$dropdown
.
parent
()
.
find
(
'
.dropdown-clear-active
'
)
.
removeClass
(
'
is-active
'
);
$dropdown
.
parent
().
find
(
'
.dropdown-clear-active
'
).
removeClass
(
'
is-active
'
);
}
if
(
$dropdown
.
hasClass
(
'
js-issuable-form-dropdown
'
))
{
...
...
@@ -559,7 +554,7 @@ export default class LabelsSelect {
// eslint-disable-next-line class-methods-use-this
setOriginalDropdownData
(
$container
,
$dropdown
)
{
const
labels
=
[];
$container
.
find
(
'
[name="label_name[]"]
'
).
map
(
function
()
{
$container
.
find
(
'
[name="label_name[]"]
'
).
map
(
function
()
{
return
labels
.
push
(
this
.
value
);
});
$dropdown
.
data
(
'
marked
'
,
labels
);
...
...
app/assets/javascripts/lib/utils/common_utils.js
View file @
888002a6
...
...
@@ -68,7 +68,7 @@ export const disableButtonIfEmptyField = (fieldSelector, buttonSelector, eventNa
closestSubmit
.
disable
();
}
// eslint-disable-next-line func-names
return
field
.
on
(
eventName
,
function
()
{
return
field
.
on
(
eventName
,
function
()
{
if
(
rstrip
(
$
(
this
).
val
())
===
''
)
{
return
closestSubmit
.
disable
();
}
...
...
app/assets/javascripts/lib/utils/text_markdown.js
View file @
888002a6
...
...
@@ -14,18 +14,12 @@ function addBlockTags(blockTag, selected) {
}
function
lineBefore
(
text
,
textarea
)
{
const
split
=
text
.
substring
(
0
,
textarea
.
selectionStart
)
.
trim
()
.
split
(
'
\n
'
);
const
split
=
text
.
substring
(
0
,
textarea
.
selectionStart
).
trim
().
split
(
'
\n
'
);
return
split
[
split
.
length
-
1
];
}
function
lineAfter
(
text
,
textarea
)
{
return
text
.
substring
(
textarea
.
selectionEnd
)
.
trim
()
.
split
(
'
\n
'
)[
0
];
return
text
.
substring
(
textarea
.
selectionEnd
).
trim
().
split
(
'
\n
'
)[
0
];
}
function
convertMonacoSelectionToAceFormat
(
sel
)
{
...
...
@@ -342,7 +336,7 @@ export function addMarkdownListeners(form) {
// eslint-disable-next-line @gitlab/no-global-event-off
const
$allToolbarBtns
=
$
(
'
.js-md
'
,
form
)
.
off
(
'
click
'
)
.
on
(
'
click
'
,
function
()
{
.
on
(
'
click
'
,
function
()
{
const
$toolbarBtn
=
$
(
this
);
return
updateTextForToolbarBtn
(
$toolbarBtn
);
...
...
app/assets/javascripts/line_highlighter.js
View file @
888002a6
...
...
@@ -32,7 +32,7 @@ import 'vendor/jquery.scrollTo';
// </div>
//
const
LineHighlighter
=
function
(
options
=
{})
{
const
LineHighlighter
=
function
(
options
=
{})
{
options
.
highlightLineClass
=
options
.
highlightLineClass
||
'
hll
'
;
options
.
fileHolderSelector
=
options
.
fileHolderSelector
||
'
.file-holder
'
;
options
.
scrollFileHolder
=
options
.
scrollFileHolder
||
false
;
...
...
@@ -50,7 +50,7 @@ const LineHighlighter = function(options = {}) {
this
.
highlightHash
();
};
LineHighlighter
.
prototype
.
bindEvents
=
function
()
{
LineHighlighter
.
prototype
.
bindEvents
=
function
()
{
const
$fileHolder
=
$
(
this
.
options
.
fileHolderSelector
);
$fileHolder
.
on
(
'
click
'
,
'
a[data-line-number]
'
,
this
.
clickHandler
);
...
...
@@ -58,7 +58,7 @@ LineHighlighter.prototype.bindEvents = function() {
window
.
addEventListener
(
'
hashchange
'
,
e
=>
this
.
highlightHash
(
e
.
target
.
location
.
hash
));
};
LineHighlighter
.
prototype
.
highlightHash
=
function
(
newHash
)
{
LineHighlighter
.
prototype
.
highlightHash
=
function
(
newHash
)
{
let
range
;
if
(
newHash
&&
typeof
newHash
===
'
string
'
)
this
.
_hash
=
newHash
;
...
...
@@ -83,13 +83,11 @@ LineHighlighter.prototype.highlightHash = function(newHash) {
}
};
LineHighlighter
.
prototype
.
clickHandler
=
function
(
event
)
{
LineHighlighter
.
prototype
.
clickHandler
=
function
(
event
)
{
let
range
;
event
.
preventDefault
();
this
.
clearHighlight
();
const
lineNumber
=
$
(
event
.
target
)
.
closest
(
'
a
'
)
.
data
(
'
lineNumber
'
);
const
lineNumber
=
$
(
event
.
target
).
closest
(
'
a
'
).
data
(
'
lineNumber
'
);
const
current
=
this
.
hashToRange
(
this
.
_hash
);
if
(
!
(
current
[
0
]
&&
event
.
shiftKey
))
{
// If there's no current selection, or there is but Shift wasn't held,
...
...
@@ -107,7 +105,7 @@ LineHighlighter.prototype.clickHandler = function(event) {
}
};
LineHighlighter
.
prototype
.
clearHighlight
=
function
()
{
LineHighlighter
.
prototype
.
clearHighlight
=
function
()
{
return
$
(
`.
${
this
.
highlightLineClass
}
`
).
removeClass
(
this
.
highlightLineClass
);
};
...
...
@@ -122,7 +120,7 @@ LineHighlighter.prototype.clearHighlight = function() {
// hashToRange('#foo') # => [null, null]
//
// Returns an Array
LineHighlighter
.
prototype
.
hashToRange
=
function
(
hash
)
{
LineHighlighter
.
prototype
.
hashToRange
=
function
(
hash
)
{
// ?L(\d+)(?:-(\d+))?$/)
const
matches
=
hash
.
match
(
/^#
?
L
(\d
+
)(?:
-
(\d
+
))?
$/
);
if
(
matches
&&
matches
.
length
)
{
...
...
@@ -136,14 +134,14 @@ LineHighlighter.prototype.hashToRange = function(hash) {
// Highlight a single line
//
// lineNumber - Line number to highlight
LineHighlighter
.
prototype
.
highlightLine
=
function
(
lineNumber
)
{
LineHighlighter
.
prototype
.
highlightLine
=
function
(
lineNumber
)
{
return
$
(
`#LC
${
lineNumber
}
`
).
addClass
(
this
.
highlightLineClass
);
};
// Highlight all lines within a range
//
// range - Array containing the starting and ending line numbers
LineHighlighter
.
prototype
.
highlightRange
=
function
(
range
)
{
LineHighlighter
.
prototype
.
highlightRange
=
function
(
range
)
{
if
(
range
[
1
])
{
const
results
=
[];
const
ref
=
range
[
0
]
<=
range
[
1
]
?
range
:
range
.
reverse
();
...
...
@@ -158,7 +156,7 @@ LineHighlighter.prototype.highlightRange = function(range) {
};
// Set the URL hash string
LineHighlighter
.
prototype
.
setHash
=
function
(
firstLineNumber
,
lastLineNumber
)
{
LineHighlighter
.
prototype
.
setHash
=
function
(
firstLineNumber
,
lastLineNumber
)
{
let
hash
;
if
(
lastLineNumber
)
{
hash
=
`#L
${
firstLineNumber
}
-
${
lastLineNumber
}
`
;
...
...
@@ -172,7 +170,7 @@ LineHighlighter.prototype.setHash = function(firstLineNumber, lastLineNumber) {
// Make the actual hash change in the browser
//
// This method is stubbed in tests.
LineHighlighter
.
prototype
.
__setLocationHash__
=
function
(
value
)
{
LineHighlighter
.
prototype
.
__setLocationHash__
=
function
(
value
)
{
return
window
.
history
.
pushState
(
{
url
:
value
,
...
...
app/assets/javascripts/logs/components/environment_logs.vue
View file @
888002a6
...
...
@@ -246,9 +246,7 @@ export default {
</div>
{{
trace
}}
</code></pre>
</
template
>
<
template
#default
><div></div
></
template
>
<
template
#default
><div></div></
template
>
</gl-infinite-scroll>
<div
ref=
"logFooter"
class=
"py-2 px-3 text-white bg-secondary-900"
>
...
...
@@ -262,9 +260,7 @@ export default {
>
<
template
#fetched
>
{{
logs
.
lines
.
length
}}
</
template
>
</gl-sprintf>
<
template
v-else
>
{{
s__
(
'
Environments|Currently showing all results.
'
)
}}
</
template
>
<
template
v-else
>
{{
s__
(
'
Environments|Currently showing all results.
'
)
}}
</
template
>
</div>
</div>
</template>
app/assets/javascripts/main.js
View file @
888002a6
...
...
@@ -53,7 +53,7 @@ window.$ = jQuery;
jQuery
.
ajaxSetup
({
converters
:
{
// eslint-disable-next-line @gitlab/require-i18n-strings, func-names
'
text script
'
:
function
(
text
)
{
'
text script
'
:
function
(
text
)
{
jQuery
.
globalEval
(
text
,
{
nonce
:
getCspNonceValue
()
});
return
text
;
},
...
...
@@ -137,9 +137,7 @@ function deferredInitialisation() {
$
(
'
.remove-row
'
).
on
(
'
ajax:success
'
,
function
removeRowAjaxSuccessCallback
()
{
tooltips
.
dispose
(
this
);
$
(
this
)
.
closest
(
'
li
'
)
.
addClass
(
'
gl-display-none!
'
);
$
(
this
).
closest
(
'
li
'
).
addClass
(
'
gl-display-none!
'
);
});
$
(
'
.js-remove-tr
'
).
on
(
'
ajax:before
'
,
function
removeTRAjaxBeforeCallback
()
{
...
...
@@ -147,9 +145,7 @@ function deferredInitialisation() {
});
$
(
'
.js-remove-tr
'
).
on
(
'
ajax:success
'
,
function
removeTRAjaxSuccessCallback
()
{
$
(
this
)
.
closest
(
'
tr
'
)
.
addClass
(
'
gl-display-none!
'
);
$
(
this
).
closest
(
'
tr
'
).
addClass
(
'
gl-display-none!
'
);
});
const
glTooltipDelay
=
localStorage
.
getItem
(
'
gl-tooltip-delay
'
);
...
...
@@ -278,15 +274,9 @@ document.addEventListener('DOMContentLoaded', () => {
$this
.
toggleClass
(
'
active
'
);
if
(
$this
.
hasClass
(
'
active
'
))
{
notesHolders
.
show
()
.
find
(
'
.hide, .content
'
)
.
show
();
notesHolders
.
show
().
find
(
'
.hide, .content
'
).
show
();
}
else
{
notesHolders
.
hide
()
.
find
(
'
.content
'
)
.
hide
();
notesHolders
.
hide
().
find
(
'
.content
'
).
hide
();
}
$
(
document
).
trigger
(
'
toggle.comments
'
);
...
...
app/assets/javascripts/member_expiration_date.js
View file @
888002a6
...
...
@@ -41,9 +41,7 @@ export default function memberExpirationDate(selector = '.js-access-expiration-d
inputs
.
next
(
'
.js-clear-input
'
).
on
(
'
click
'
,
function
clicked
(
event
)
{
event
.
preventDefault
();
const
input
=
$
(
this
)
.
closest
(
'
.clearable-input
'
)
.
find
(
selector
);
const
input
=
$
(
this
).
closest
(
'
.clearable-input
'
).
find
(
selector
);
const
calendar
=
input
.
data
(
'
pikaday
'
);
calendar
.
setDate
(
null
);
...
...
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