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
1877bf55
Commit
1877bf55
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 31 files - 7 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
7e9741c5
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
77 additions
and
110 deletions
+77
-110
.prettierignore
.prettierignore
+0
-33
app/assets/javascripts/behaviors/preview_markdown.js
app/assets/javascripts/behaviors/preview_markdown.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/behaviors/secret_values.js
app/assets/javascripts/behaviors/secret_values.js
+2
-2
app/assets/javascripts/behaviors/shortcuts/keybindings.js
app/assets/javascripts/behaviors/shortcuts/keybindings.js
+4
-4
app/assets/javascripts/behaviors/shortcuts/shortcuts.js
app/assets/javascripts/behaviors/shortcuts/shortcuts.js
+2
-2
app/assets/javascripts/behaviors/shortcuts/shortcuts_blob.js
app/assets/javascripts/behaviors/shortcuts/shortcuts_blob.js
+1
-1
app/assets/javascripts/behaviors/shortcuts/shortcuts_issuable.js
...ets/javascripts/behaviors/shortcuts/shortcuts_issuable.js
+2
-2
app/assets/javascripts/blob/3d_viewer/index.js
app/assets/javascripts/blob/3d_viewer/index.js
+2
-2
app/assets/javascripts/blob/balsamiq/balsamiq_viewer.js
app/assets/javascripts/blob/balsamiq/balsamiq_viewer.js
+2
-2
app/assets/javascripts/blob/blob_file_dropzone.js
app/assets/javascripts/blob/blob_file_dropzone.js
+1
-1
app/assets/javascripts/blob/blob_line_permalink_updater.js
app/assets/javascripts/blob/blob_line_permalink_updater.js
+3
-3
app/assets/javascripts/blob/components/blob_content_error.vue
...assets/javascripts/blob/components/blob_content_error.vue
+1
-1
app/assets/javascripts/blob/file_template_mediator.js
app/assets/javascripts/blob/file_template_mediator.js
+12
-12
app/assets/javascripts/blob/notebook/notebook_viewer.vue
app/assets/javascripts/blob/notebook/notebook_viewer.vue
+3
-3
app/assets/javascripts/blob/openapi/index.js
app/assets/javascripts/blob/openapi/index.js
+1
-1
app/assets/javascripts/blob/sketch/index.js
app/assets/javascripts/blob/sketch/index.js
+3
-3
app/assets/javascripts/blob/stl_viewer.js
app/assets/javascripts/blob/stl_viewer.js
+2
-2
app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js
app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js
+1
-1
app/assets/javascripts/blob/template_selector.js
app/assets/javascripts/blob/template_selector.js
+4
-4
app/assets/javascripts/blob/template_selectors/ci_syntax_yaml_selector.js
...cripts/blob/template_selectors/ci_syntax_yaml_selector.js
+2
-2
app/assets/javascripts/blob/template_selectors/ci_yaml_selector.js
...s/javascripts/blob/template_selectors/ci_yaml_selector.js
+2
-2
app/assets/javascripts/blob/template_selectors/dockerfile_selector.js
...avascripts/blob/template_selectors/dockerfile_selector.js
+2
-2
app/assets/javascripts/blob/template_selectors/gitignore_selector.js
...javascripts/blob/template_selectors/gitignore_selector.js
+2
-2
app/assets/javascripts/blob/template_selectors/license_selector.js
...s/javascripts/blob/template_selectors/license_selector.js
+2
-2
app/assets/javascripts/blob/template_selectors/metrics_dashboard_selector.js
...pts/blob/template_selectors/metrics_dashboard_selector.js
+2
-2
app/assets/javascripts/blob/template_selectors/type_selector.js
...sets/javascripts/blob/template_selectors/type_selector.js
+2
-2
app/assets/javascripts/blob/viewer/index.js
app/assets/javascripts/blob/viewer/index.js
+5
-5
app/assets/javascripts/blob_edit/blob_bundle.js
app/assets/javascripts/blob_edit/blob_bundle.js
+1
-1
app/assets/javascripts/blob_edit/edit_blob.js
app/assets/javascripts/blob_edit/edit_blob.js
+2
-2
app/assets/javascripts/boards/boards_util.js
app/assets/javascripts/boards/boards_util.js
+6
-6
No files found.
.prettierignore
View file @
1877bf55
...
...
@@ -10,39 +10,6 @@ doc/api/graphql/reference/gitlab_schema.graphql
*.scss
*.md
## nice-swanson
app/assets/javascripts/behaviors/preview_markdown.js
app/assets/javascripts/behaviors/quick_submit.js
app/assets/javascripts/behaviors/requires_input.js
app/assets/javascripts/behaviors/secret_values.js
app/assets/javascripts/behaviors/shortcuts/keybindings.js
app/assets/javascripts/behaviors/shortcuts/shortcuts.js
app/assets/javascripts/behaviors/shortcuts/shortcuts_blob.js
app/assets/javascripts/behaviors/shortcuts/shortcuts_issuable.js
app/assets/javascripts/blob/3d_viewer/index.js
app/assets/javascripts/blob/balsamiq/balsamiq_viewer.js
app/assets/javascripts/blob/blob_file_dropzone.js
app/assets/javascripts/blob/blob_line_permalink_updater.js
app/assets/javascripts/blob/components/blob_content_error.vue
app/assets/javascripts/blob/file_template_mediator.js
app/assets/javascripts/blob/notebook/notebook_viewer.vue
app/assets/javascripts/blob/openapi/index.js
app/assets/javascripts/blob/sketch/index.js
app/assets/javascripts/blob/stl_viewer.js
app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js
app/assets/javascripts/blob/template_selector.js
app/assets/javascripts/blob/template_selectors/ci_syntax_yaml_selector.js
app/assets/javascripts/blob/template_selectors/ci_yaml_selector.js
app/assets/javascripts/blob/template_selectors/dockerfile_selector.js
app/assets/javascripts/blob/template_selectors/gitignore_selector.js
app/assets/javascripts/blob/template_selectors/license_selector.js
app/assets/javascripts/blob/template_selectors/metrics_dashboard_selector.js
app/assets/javascripts/blob/template_selectors/type_selector.js
app/assets/javascripts/blob/viewer/index.js
app/assets/javascripts/blob_edit/blob_bundle.js
app/assets/javascripts/blob_edit/edit_blob.js
app/assets/javascripts/boards/boards_util.js
## keen-chatelet
app/assets/javascripts/boards/components/board_assignee_dropdown.vue
app/assets/javascripts/boards/components/board_card_layout.vue
...
...
app/assets/javascripts/behaviors/preview_markdown.js
View file @
1877bf55
...
...
@@ -41,7 +41,7 @@ MarkdownPreview.prototype.showPreview = function ($form) {
this
.
hideReferencedUsers
(
$form
);
}
else
{
preview
.
addClass
(
'
md-preview-loading
'
).
text
(
__
(
'
Loading...
'
));
this
.
fetchMarkdownPreview
(
mdText
,
url
,
response
=>
{
this
.
fetchMarkdownPreview
(
mdText
,
url
,
(
response
)
=>
{
let
body
;
if
(
response
.
body
.
length
>
0
)
{
({
body
}
=
response
);
...
...
app/assets/javascripts/behaviors/quick_submit.js
View file @
1877bf55
...
...
@@ -30,7 +30,7 @@ function keyCodeIs(e, keyCode) {
return
e
.
keyCode
===
keyCode
;
}
$
(
document
).
on
(
'
keydown.quick_submit
'
,
'
.js-quick-submit
'
,
e
=>
{
$
(
document
).
on
(
'
keydown.quick_submit
'
,
'
.js-quick-submit
'
,
(
e
)
=>
{
// Enter
if
(
!
keyCodeIs
(
e
,
13
))
{
return
;
...
...
app/assets/javascripts/behaviors/requires_input.js
View file @
1877bf55
...
...
@@ -23,7 +23,7 @@ $.fn.requiresInput = function requiresInput() {
function
requireInput
()
{
// Collect the input values of *all* required fields
const
values
=
Array
.
from
(
$
(
fieldSelector
,
$form
)).
map
(
field
=>
field
.
value
);
const
values
=
Array
.
from
(
$
(
fieldSelector
,
$form
)).
map
(
(
field
)
=>
field
.
value
);
// Disable the button if any required fields are empty
if
(
values
.
length
&&
values
.
some
(
isEmpty
))
{
...
...
app/assets/javascripts/behaviors/secret_values.js
View file @
1877bf55
...
...
@@ -30,12 +30,12 @@ export default class SecretValues {
updateDom
(
isRevealed
)
{
const
values
=
this
.
container
.
querySelectorAll
(
this
.
valueSelector
);
values
.
forEach
(
value
=>
{
values
.
forEach
(
(
value
)
=>
{
value
.
classList
.
toggle
(
'
hide
'
,
!
isRevealed
);
});
const
placeholders
=
this
.
container
.
querySelectorAll
(
this
.
placeholderSelector
);
placeholders
.
forEach
(
placeholder
=>
{
placeholders
.
forEach
(
(
placeholder
)
=>
{
placeholder
.
classList
.
toggle
(
'
hide
'
,
isRevealed
);
});
...
...
app/assets/javascripts/behaviors/shortcuts/keybindings.js
View file @
1877bf55
...
...
@@ -49,10 +49,10 @@ export const keybindingGroups = [
// For each keybinding object, add a `customKeys` property populated with the
// user's custom keybindings (if the command has been customized).
// `customKeys` will be `undefined` if the command hasn't been customized.
.
map
(
group
=>
{
.
map
(
(
group
)
=>
{
return
{
...
group
,
keybindings
:
group
.
keybindings
.
map
(
binding
=>
({
keybindings
:
group
.
keybindings
.
map
(
(
binding
)
=>
({
...
binding
,
customKeys
:
customizations
[
binding
.
command
],
})),
...
...
@@ -66,7 +66,7 @@ export const keybindingGroups = [
* @example
* { "globalShortcuts.togglePerformanceBar": ["p e r f"] }
*/
const
commandToKeys
=
flatten
(
keybindingGroups
.
map
(
group
=>
group
.
keybindings
)).
reduce
(
const
commandToKeys
=
flatten
(
keybindingGroups
.
map
(
(
group
)
=>
group
.
keybindings
)).
reduce
(
(
acc
,
binding
)
=>
{
acc
[
binding
.
command
]
=
binding
.
customKeys
||
binding
.
defaultKeys
;
return
acc
;
...
...
@@ -87,7 +87,7 @@ const commandToKeys = flatten(keybindingGroups.map(group => group.keybindings)).
*
* Mousetrap.bind(keysFor(TOGGLE_PERFORMANCE_BAR), handler);
*/
export
const
keysFor
=
command
=>
{
export
const
keysFor
=
(
command
)
=>
{
if
(
shouldDisableShortcuts
())
{
return
[];
}
...
...
app/assets/javascripts/behaviors/shortcuts/shortcuts.js
View file @
1877bf55
...
...
@@ -197,7 +197,7 @@ export default class Shortcuts {
$textarea
.
data
(
LOCAL_MOUSETRAP_DATA_KEY
,
localMousetrap
);
toolbarBtnToShortcutsMap
.
forEach
((
keyboardShortcuts
,
$toolbarBtn
)
=>
{
localMousetrap
.
bind
(
keyboardShortcuts
,
e
=>
{
localMousetrap
.
bind
(
keyboardShortcuts
,
(
e
)
=>
{
e
.
preventDefault
();
handler
(
$toolbarBtn
);
...
...
@@ -231,7 +231,7 @@ export default class Shortcuts {
const
localMousetrap
=
$textarea
.
data
(
LOCAL_MOUSETRAP_DATA_KEY
);
if
(
localMousetrap
)
{
getToolbarBtnToShortcutsMap
(
$textarea
).
forEach
(
keyboardShortcuts
=>
{
getToolbarBtnToShortcutsMap
(
$textarea
).
forEach
(
(
keyboardShortcuts
)
=>
{
localMousetrap
.
unbind
(
keyboardShortcuts
);
});
}
...
...
app/assets/javascripts/behaviors/shortcuts/shortcuts_blob.js
View file @
1877bf55
...
...
@@ -53,7 +53,7 @@ export default class ShortcutsBlob extends Shortcuts {
shortcircuitPermalinkButton
()
{
const
button
=
this
.
options
.
fileBlobPermalinkUrlElement
;
const
handleButton
=
e
=>
{
const
handleButton
=
(
e
)
=>
{
if
(
!
eventHasModifierKeys
(
e
))
{
e
.
preventDefault
();
this
.
moveToFilePermalink
();
...
...
app/assets/javascripts/behaviors/shortcuts/shortcuts_issuable.js
View file @
1877bf55
...
...
@@ -39,7 +39,7 @@ export default class ShortcutsIssuable extends Shortcuts {
// ... Or come from a message
if
(
!
foundMessage
)
{
if
(
documentFragment
.
originalNodes
)
{
documentFragment
.
originalNodes
.
forEach
(
e
=>
{
documentFragment
.
originalNodes
.
forEach
(
(
e
)
=>
{
let
node
=
e
;
do
{
// Text nodes don't define the `matches` method
...
...
@@ -62,7 +62,7 @@ export default class ShortcutsIssuable extends Shortcuts {
const
blockquoteEl
=
document
.
createElement
(
'
blockquote
'
);
blockquoteEl
.
appendChild
(
el
);
CopyAsGFM
.
nodeToGFM
(
blockquoteEl
)
.
then
(
text
=>
{
.
then
(
(
text
)
=>
{
if
(
text
.
trim
()
===
''
)
{
return
false
;
}
...
...
app/assets/javascripts/blob/3d_viewer/index.js
View file @
1877bf55
...
...
@@ -68,7 +68,7 @@ export default class Renderer {
}
loadFile
()
{
this
.
loader
.
load
(
this
.
container
.
dataset
.
endpoint
,
geo
=>
{
this
.
loader
.
load
(
this
.
container
.
dataset
.
endpoint
,
(
geo
)
=>
{
const
obj
=
new
MeshObject
(
geo
);
this
.
objects
.
push
(
obj
);
...
...
@@ -99,7 +99,7 @@ export default class Renderer {
}
changeObjectMaterials
(
type
)
{
this
.
objects
.
forEach
(
obj
=>
{
this
.
objects
.
forEach
(
(
obj
)
=>
{
obj
.
changeMaterial
(
type
);
});
}
...
...
app/assets/javascripts/blob/balsamiq/balsamiq_viewer.js
View file @
1877bf55
...
...
@@ -28,7 +28,7 @@ class BalsamiqViewer {
.
then
(({
data
})
=>
{
this
.
renderFile
(
data
);
})
.
catch
(
e
=>
{
.
catch
(
(
e
)
=>
{
throw
new
Error
(
e
);
});
}
...
...
@@ -39,7 +39,7 @@ class BalsamiqViewer {
this
.
initDatabase
(
fileBuffer
);
const
previews
=
this
.
getPreviews
();
previews
.
forEach
(
preview
=>
{
previews
.
forEach
(
(
preview
)
=>
{
const
renderedPreview
=
this
.
renderPreview
(
preview
);
container
.
appendChild
(
renderedPreview
);
...
...
app/assets/javascripts/blob/blob_file_dropzone.js
View file @
1877bf55
...
...
@@ -80,7 +80,7 @@ export default class BlobFileDropzone {
},
});
submitButton
.
on
(
'
click
'
,
e
=>
{
submitButton
.
on
(
'
click
'
,
(
e
)
=>
{
e
.
preventDefault
();
e
.
stopPropagation
();
if
(
dropzone
[
0
].
dropzone
.
getQueuedFiles
().
length
===
0
)
{
...
...
app/assets/javascripts/blob/blob_line_permalink_updater.js
View file @
1877bf55
...
...
@@ -2,12 +2,12 @@ import { getLocationHash } from '../lib/utils/url_utility';
const
lineNumberRe
=
/^L
[
0-9
]
+/
;
const
updateLineNumbersOnBlobPermalinks
=
linksToUpdate
=>
{
const
updateLineNumbersOnBlobPermalinks
=
(
linksToUpdate
)
=>
{
const
hash
=
getLocationHash
();
if
(
hash
&&
lineNumberRe
.
test
(
hash
))
{
const
hashUrlString
=
`#
${
hash
}
`
;
[].
concat
(
Array
.
prototype
.
slice
.
call
(
linksToUpdate
)).
forEach
(
permalinkButton
=>
{
[].
concat
(
Array
.
prototype
.
slice
.
call
(
linksToUpdate
)).
forEach
(
(
permalinkButton
)
=>
{
const
baseHref
=
permalinkButton
.
getAttribute
(
'
data-original-href
'
)
||
(()
=>
{
...
...
@@ -28,7 +28,7 @@ function BlobLinePermalinkUpdater(blobContentHolder, lineNumberSelector, element
},
0
);
};
blobContentHolder
.
addEventListener
(
'
click
'
,
e
=>
{
blobContentHolder
.
addEventListener
(
'
click
'
,
(
e
)
=>
{
if
(
e
.
target
.
matches
(
lineNumberSelector
))
{
updateBlameAndBlobPermalinkCb
();
}
...
...
app/assets/javascripts/blob/components/blob_content_error.vue
View file @
1877bf55
...
...
@@ -25,7 +25,7 @@ export default {
},
renderErrorReason
()
{
const
defaultReasonPath
=
Object
.
keys
(
BLOB_RENDER_ERRORS
.
REASONS
).
find
(
reason
=>
BLOB_RENDER_ERRORS
.
REASONS
[
reason
].
id
===
this
.
viewerError
,
(
reason
)
=>
BLOB_RENDER_ERRORS
.
REASONS
[
reason
].
id
===
this
.
viewerError
,
);
const
defaultReason
=
BLOB_RENDER_ERRORS
.
REASONS
[
defaultReasonPath
].
text
;
return
this
.
notStoredExternally
...
...
app/assets/javascripts/blob/file_template_mediator.js
View file @
1877bf55
...
...
@@ -38,14 +38,14 @@ export default class FileTemplateMediator {
MetricsDashboardSelector
,
DockerfileSelector
,
LicenseSelector
,
].
map
(
TemplateSelectorClass
=>
new
TemplateSelectorClass
({
mediator
:
this
}));
].
map
(
(
TemplateSelectorClass
)
=>
new
TemplateSelectorClass
({
mediator
:
this
}));
}
initTemplateTypeSelector
()
{
this
.
typeSelector
=
new
FileTemplateTypeSelector
({
mediator
:
this
,
dropdownData
:
this
.
templateSelectors
.
map
(
templateSelector
=>
{
.
map
(
(
templateSelector
)
=>
{
const
cfg
=
templateSelector
.
config
;
return
{
...
...
@@ -55,7 +55,7 @@ export default class FileTemplateMediator {
};
})
.
reduce
(
(
acc
,
current
)
=>
(
acc
.
find
(
item
=>
item
.
id
===
current
.
id
)
?
acc
:
[...
acc
,
current
]),
(
acc
,
current
)
=>
(
acc
.
find
(
(
item
)
=>
item
.
id
===
current
.
id
)
?
acc
:
[...
acc
,
current
]),
[],
),
});
...
...
@@ -99,7 +99,7 @@ export default class FileTemplateMediator {
}
listenForPreviewMode
()
{
this
.
$navLinks
.
on
(
'
click
'
,
'
a
'
,
e
=>
{
this
.
$navLinks
.
on
(
'
click
'
,
'
a
'
,
(
e
)
=>
{
const
urlPieces
=
e
.
target
.
href
.
split
(
'
#
'
);
const
hash
=
urlPieces
[
1
];
if
(
hash
===
'
preview
'
)
{
...
...
@@ -115,7 +115,7 @@ export default class FileTemplateMediator {
e
.
preventDefault
();
}
this
.
templateSelectors
.
forEach
(
selector
=>
{
this
.
templateSelectors
.
forEach
(
(
selector
)
=>
{
if
(
selector
.
config
.
key
===
item
.
key
)
{
selector
.
show
();
}
else
{
...
...
@@ -138,7 +138,7 @@ export default class FileTemplateMediator {
selector
.
renderLoading
();
this
.
fetchFileTemplate
(
selector
.
config
.
type
,
query
,
data
)
.
then
(
file
=>
{
.
then
(
(
file
)
=>
{
this
.
setEditorContent
(
file
);
this
.
setFilename
(
name
);
selector
.
renderLoaded
();
...
...
@@ -157,12 +157,12 @@ export default class FileTemplateMediator {
initPopover
(
suggestCommitChanges
);
}
})
.
catch
(
err
=>
new
Flash
(
`An error occurred while fetching the template:
${
err
}
`
));
.
catch
(
(
err
)
=>
new
Flash
(
`An error occurred while fetching the template:
${
err
}
`
));
}
displayMatchedTemplateSelector
()
{
const
currentInput
=
this
.
getFilename
();
this
.
templateSelectors
.
forEach
(
selector
=>
{
this
.
templateSelectors
.
forEach
(
(
selector
)
=>
{
const
match
=
selector
.
config
.
pattern
.
test
(
currentInput
);
if
(
match
)
{
...
...
@@ -174,8 +174,8 @@ export default class FileTemplateMediator {
}
fetchFileTemplate
(
type
,
query
,
data
=
{})
{
return
new
Promise
(
resolve
=>
{
const
resolveFile
=
file
=>
resolve
(
file
);
return
new
Promise
(
(
resolve
)
=>
{
const
resolveFile
=
(
file
)
=>
resolve
(
file
);
Api
.
projectTemplate
(
this
.
projectId
,
type
,
query
,
data
,
resolveFile
);
});
...
...
@@ -194,7 +194,7 @@ export default class FileTemplateMediator {
}
findTemplateSelectorByKey
(
key
)
{
return
this
.
templateSelectors
.
find
(
selector
=>
selector
.
config
.
key
===
key
);
return
this
.
templateSelectors
.
find
(
(
selector
)
=>
selector
.
config
.
key
===
key
);
}
hideTemplateSelectorMenu
()
{
...
...
@@ -250,6 +250,6 @@ export default class FileTemplateMediator {
}
getSelected
()
{
return
this
.
templateSelectors
.
find
(
selector
=>
selector
.
selected
);
return
this
.
templateSelectors
.
find
(
(
selector
)
=>
selector
.
selected
);
}
}
app/assets/javascripts/blob/notebook/notebook_viewer.vue
View file @
1877bf55
...
...
@@ -45,12 +45,12 @@ export default {
loadFile
()
{
axios
.
get
(
this
.
endpoint
)
.
then
(
res
=>
res
.
data
)
.
then
(
data
=>
{
.
then
(
(
res
)
=>
res
.
data
)
.
then
(
(
data
)
=>
{
this
.
json
=
data
;
this
.
loading
=
false
;
})
.
catch
(
e
=>
{
.
catch
(
(
e
)
=>
{
if
(
e
.
status
!==
200
)
{
this
.
loadError
=
true
;
}
...
...
app/assets/javascripts/blob/openapi/index.js
View file @
1877bf55
...
...
@@ -12,7 +12,7 @@ export default () => {
dom_id
:
'
#js-openapi-viewer
'
,
});
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
flash
(
__
(
'
Something went wrong while initializing the OpenAPI viewer
'
));
throw
error
;
});
...
...
app/assets/javascripts/blob/sketch/index.js
View file @
1877bf55
...
...
@@ -12,9 +12,9 @@ export default class SketchLoader {
load
()
{
return
this
.
getZipFile
()
.
then
(
data
=>
JSZip
.
loadAsync
(
data
))
.
then
(
asyncResult
=>
asyncResult
.
files
[
'
previews/preview.png
'
].
async
(
'
uint8array
'
))
.
then
(
content
=>
{
.
then
(
(
data
)
=>
JSZip
.
loadAsync
(
data
))
.
then
(
(
asyncResult
)
=>
asyncResult
.
files
[
'
previews/preview.png
'
].
async
(
'
uint8array
'
))
.
then
(
(
content
)
=>
{
const
url
=
window
.
URL
||
window
.
webkitURL
;
const
blob
=
new
Blob
([
new
Uint8Array
(
content
)],
{
type
:
'
image/png
'
,
...
...
app/assets/javascripts/blob/stl_viewer.js
View file @
1877bf55
...
...
@@ -3,8 +3,8 @@ import Renderer from './3d_viewer';
export
default
()
=>
{
const
viewer
=
new
Renderer
(
document
.
getElementById
(
'
js-stl-viewer
'
));
[].
slice
.
call
(
document
.
querySelectorAll
(
'
.js-material-changer
'
)).
forEach
(
el
=>
{
el
.
addEventListener
(
'
click
'
,
e
=>
{
[].
slice
.
call
(
document
.
querySelectorAll
(
'
.js-material-changer
'
)).
forEach
(
(
el
)
=>
{
el
.
addEventListener
(
'
click
'
,
(
e
)
=>
{
const
{
target
}
=
e
;
e
.
preventDefault
();
...
...
app/assets/javascripts/blob/suggest_gitlab_ci_yml/index.js
View file @
1877bf55
import
Vue
from
'
vue
'
;
import
Popover
from
'
./components/popover.vue
'
;
export
default
el
=>
export
default
(
el
)
=>
new
Vue
({
el
,
render
(
createElement
)
{
...
...
app/assets/javascripts/blob/template_selector.js
View file @
1877bf55
...
...
@@ -26,12 +26,12 @@ export default class TemplateSelector {
data
,
filterable
:
true
,
selectable
:
true
,
toggleLabel
:
item
=>
item
.
name
,
toggleLabel
:
(
item
)
=>
item
.
name
,
search
:
{
fields
:
[
'
name
'
],
},
clicked
:
options
=>
this
.
onDropdownClicked
(
options
),
text
:
item
=>
item
.
name
,
clicked
:
(
options
)
=>
this
.
onDropdownClicked
(
options
),
text
:
(
item
)
=>
item
.
name
,
});
}
...
...
@@ -46,7 +46,7 @@ export default class TemplateSelector {
}
listenForFilenameInput
()
{
return
this
.
$filenameInput
.
on
(
'
keyup blur
'
,
e
=>
this
.
renderMatchedDropdown
(
e
));
return
this
.
$filenameInput
.
on
(
'
keyup blur
'
,
(
e
)
=>
this
.
renderMatchedDropdown
(
e
));
}
renderMatchedDropdown
()
{
...
...
app/assets/javascripts/blob/template_selectors/ci_syntax_yaml_selector.js
View file @
1877bf55
...
...
@@ -22,8 +22,8 @@ export default class BlobCiSyntaxYamlSelector extends FileTemplateSelector {
search
:
{
fields
:
[
'
name
'
],
},
clicked
:
options
=>
this
.
reportSelectionName
(
options
),
text
:
item
=>
item
.
name
,
clicked
:
(
options
)
=>
this
.
reportSelectionName
(
options
),
text
:
(
item
)
=>
item
.
name
,
});
}
}
app/assets/javascripts/blob/template_selectors/ci_yaml_selector.js
View file @
1877bf55
...
...
@@ -23,8 +23,8 @@ export default class BlobCiYamlSelector extends FileTemplateSelector {
search
:
{
fields
:
[
'
name
'
],
},
clicked
:
options
=>
this
.
reportSelectionName
(
options
),
text
:
item
=>
item
.
name
,
clicked
:
(
options
)
=>
this
.
reportSelectionName
(
options
),
text
:
(
item
)
=>
item
.
name
,
});
}
}
app/assets/javascripts/blob/template_selectors/dockerfile_selector.js
View file @
1877bf55
...
...
@@ -24,8 +24,8 @@ export default class DockerfileSelector extends FileTemplateSelector {
search: {
fields: ['name'],
},
clicked:
options
=> this.reportSelectionName(options),
text:
item
=> item.name,
clicked:
(options)
=> this.reportSelectionName(options),
text:
(item)
=> item.name,
});
}
}
app/assets/javascripts/blob/template_selectors/gitignore_selector.js
View file @
1877bf55
...
...
@@ -22,8 +22,8 @@ export default class BlobGitignoreSelector extends FileTemplateSelector {
search
:
{
fields
:
[
'
name
'
],
},
clicked
:
options
=>
this
.
reportSelectionName
(
options
),
text
:
item
=>
item
.
name
,
clicked
:
(
options
)
=>
this
.
reportSelectionName
(
options
),
text
:
(
item
)
=>
item
.
name
,
});
}
}
app/assets/javascripts/blob/template_selectors/license_selector.js
View file @
1877bf55
...
...
@@ -22,7 +22,7 @@ export default class BlobLicenseSelector extends FileTemplateSelector {
search
:
{
fields
:
[
'
name
'
],
},
clicked
:
options
=>
{
clicked
:
(
options
)
=>
{
const
{
e
}
=
options
;
const
el
=
options
.
$el
;
const
query
=
options
.
selectedObj
;
...
...
@@ -39,7 +39,7 @@ export default class BlobLicenseSelector extends FileTemplateSelector {
data
,
});
},
text
:
item
=>
item
.
name
,
text
:
(
item
)
=>
item
.
name
,
});
}
}
app/assets/javascripts/blob/template_selectors/metrics_dashboard_selector.js
View file @
1877bf55
...
...
@@ -22,8 +22,8 @@ export default class MetricsDashboardSelector extends FileTemplateSelector {
search
:
{
fields
:
[
'
name
'
],
},
clicked
:
options
=>
this
.
reportSelectionName
(
options
),
text
:
item
=>
item
.
name
,
clicked
:
(
options
)
=>
this
.
reportSelectionName
(
options
),
text
:
(
item
)
=>
item
.
name
,
});
}
}
app/assets/javascripts/blob/template_selectors/type_selector.js
View file @
1877bf55
...
...
@@ -17,8 +17,8 @@ export default class FileTemplateTypeSelector extends FileTemplateSelector {
data
:
this
.
config
.
dropdownData
,
filterable
:
false
,
selectable
:
true
,
clicked
:
options
=>
this
.
mediator
.
selectTemplateTypeOptions
(
options
),
text
:
item
=>
item
.
name
,
clicked
:
(
options
)
=>
this
.
mediator
.
selectTemplateTypeOptions
(
options
),
text
:
(
item
)
=>
item
.
name
,
});
}
}
app/assets/javascripts/blob/viewer/index.js
View file @
1877bf55
...
...
@@ -7,7 +7,7 @@ import eventHub from '../../notes/event_hub';
import
{
__
}
from
'
~/locale
'
;
import
{
fixTitle
}
from
'
~/tooltips
'
;
const
loadRichBlobViewer
=
type
=>
{
const
loadRichBlobViewer
=
(
type
)
=>
{
switch
(
type
)
{
case
'
balsamiq
'
:
return
import
(
/* webpackChunkName: 'balsamiq_viewer' */
'
../balsamiq_viewer
'
);
...
...
@@ -30,8 +30,8 @@ export const handleBlobRichViewer = (viewer, type) => {
if
(
!
viewer
||
!
type
)
return
;
loadRichBlobViewer
(
type
)
.
then
(
module
=>
module
?.
default
(
viewer
))
.
catch
(
error
=>
{
.
then
(
(
module
)
=>
module
?.
default
(
viewer
))
.
catch
(
(
error
)
=>
{
Flash
(
__
(
'
Error loading file viewer.
'
));
throw
error
;
});
...
...
@@ -84,7 +84,7 @@ export default class BlobViewer {
initBindings
()
{
if
(
this
.
switcherBtns
.
length
)
{
Array
.
from
(
this
.
switcherBtns
).
forEach
(
el
=>
{
Array
.
from
(
this
.
switcherBtns
).
forEach
(
(
el
)
=>
{
el
.
addEventListener
(
'
click
'
,
this
.
switchViewHandler
.
bind
(
this
));
});
}
...
...
@@ -155,7 +155,7 @@ export default class BlobViewer {
this
.
toggleCopyButtonState
();
BlobViewer
.
loadViewer
(
newViewer
)
.
then
(
viewer
=>
{
.
then
(
(
viewer
)
=>
{
$
(
viewer
).
renderGFM
();
this
.
$fileHolder
.
trigger
(
'
highlight:line
'
);
...
...
app/assets/javascripts/blob_edit/blob_bundle.js
View file @
1877bf55
...
...
@@ -75,7 +75,7 @@ export default () => {
});
initPopovers
();
})
.
catch
(
e
=>
createFlash
(
e
));
.
catch
(
(
e
)
=>
createFlash
(
e
));
cancelLink
.
on
(
'
click
'
,
()
=>
{
window
.
onbeforeunload
=
null
;
...
...
app/assets/javascripts/blob_edit/edit_blob.js
View file @
1877bf55
...
...
@@ -21,7 +21,7 @@ export default class EditBlob {
this
.
editor
.
use
(
new
MarkdownExtension
());
addEditorMarkdownListeners
(
this
.
editor
);
})
.
catch
(
e
=>
createFlash
(
`
${
BLOB_EDITOR_ERROR
}
:
${
e
}
`
));
.
catch
(
(
e
)
=>
createFlash
(
`
${
BLOB_EDITOR_ERROR
}
:
${
e
}
`
));
}
this
.
initModePanesAndLinks
();
...
...
@@ -66,7 +66,7 @@ export default class EditBlob {
initModePanesAndLinks
()
{
this
.
$editModePanes
=
$
(
'
.js-edit-mode-pane
'
);
this
.
$editModeLinks
=
$
(
'
.js-edit-mode a
'
);
this
.
$editModeLinks
.
on
(
'
click
'
,
e
=>
this
.
editModeLinkClickHandler
(
e
));
this
.
$editModeLinks
.
on
(
'
click
'
,
(
e
)
=>
this
.
editModeLinkClickHandler
(
e
));
}
editModeLinkClickHandler
(
e
)
{
...
...
app/assets/javascripts/boards/boards_util.js
View file @
1877bf55
...
...
@@ -41,14 +41,14 @@ export function formatListIssues(listIssues) {
const
listData
=
listIssues
.
nodes
.
reduce
((
map
,
list
)
=>
{
listIssuesCount
=
list
.
issues
.
count
;
let
sortedIssues
=
list
.
issues
.
edges
.
map
(
issueNode
=>
({
let
sortedIssues
=
list
.
issues
.
edges
.
map
(
(
issueNode
)
=>
({
...
issueNode
.
node
,
}));
sortedIssues
=
sortBy
(
sortedIssues
,
'
relativePosition
'
);
return
{
...
map
,
[
list
.
id
]:
sortedIssues
.
map
(
i
=>
{
[
list
.
id
]:
sortedIssues
.
map
(
(
i
)
=>
{
const
id
=
getIdFromGraphQLId
(
i
.
id
);
const
listIssue
=
{
...
...
@@ -97,23 +97,23 @@ export function moveIssueListHelper(issue, fromList, toList) {
const
updatedIssue
=
issue
;
if
(
toList
.
listType
===
ListType
.
label
&&
!
updatedIssue
.
labels
.
find
(
label
=>
label
.
id
===
toList
.
label
.
id
)
!
updatedIssue
.
labels
.
find
(
(
label
)
=>
label
.
id
===
toList
.
label
.
id
)
)
{
updatedIssue
.
labels
.
push
(
toList
.
label
);
}
if
(
fromList
?.
label
&&
fromList
.
listType
===
ListType
.
label
)
{
updatedIssue
.
labels
=
updatedIssue
.
labels
.
filter
(
label
=>
fromList
.
label
.
id
!==
label
.
id
);
updatedIssue
.
labels
=
updatedIssue
.
labels
.
filter
(
(
label
)
=>
fromList
.
label
.
id
!==
label
.
id
);
}
if
(
toList
.
listType
===
ListType
.
assignee
&&
!
updatedIssue
.
assignees
.
find
(
assignee
=>
assignee
.
id
===
toList
.
assignee
.
id
)
!
updatedIssue
.
assignees
.
find
(
(
assignee
)
=>
assignee
.
id
===
toList
.
assignee
.
id
)
)
{
updatedIssue
.
assignees
.
push
(
toList
.
assignee
);
}
if
(
fromList
?.
assignee
&&
fromList
.
listType
===
ListType
.
assignee
)
{
updatedIssue
.
assignees
=
updatedIssue
.
assignees
.
filter
(
assignee
=>
assignee
.
id
!==
fromList
.
assignee
.
id
,
(
assignee
)
=>
assignee
.
id
!==
fromList
.
assignee
.
id
,
);
}
...
...
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