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
8a510657
Commit
8a510657
authored
Apr 02, 2020
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaces underscore with lodash
parent
befbd1f4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
12 deletions
+14
-12
ee/app/assets/javascripts/ide/components/terminal_sync/terminal_sync_status.vue
...pts/ide/components/terminal_sync/terminal_sync_status.vue
+2
-2
ee/app/assets/javascripts/ide/lib/mirror.js
ee/app/assets/javascripts/ide/lib/mirror.js
+6
-5
ee/app/assets/javascripts/ide/stores/modules/terminal/messages.js
...ssets/javascripts/ide/stores/modules/terminal/messages.js
+3
-3
ee/app/assets/javascripts/ide/stores/plugins/terminal_sync.js
...pp/assets/javascripts/ide/stores/plugins/terminal_sync.js
+2
-2
ee/spec/frontend/ide/stores/plugins/terminal_sync_spec.js
ee/spec/frontend/ide/stores/plugins/terminal_sync_spec.js
+1
-0
No files found.
ee/app/assets/javascripts/ide/components/terminal_sync/terminal_sync_status.vue
View file @
8a510657
<
script
>
<
script
>
import
_
from
'
underscore
'
;
import
{
throttle
}
from
'
lodash
'
;
import
{
GlTooltipDirective
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlTooltipDirective
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
mapState
}
from
'
vuex
'
;
import
{
mapState
}
from
'
vuex
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
...
@@ -49,7 +49,7 @@ export default {
...
@@ -49,7 +49,7 @@ export default {
watch
:
{
watch
:
{
// We want to throttle the `isLoading` updates so that
// We want to throttle the `isLoading` updates so that
// the user actually sees an indicator that changes are sent.
// the user actually sees an indicator that changes are sent.
isLoadingState
:
_
.
throttle
(
function
watchIsLoadingState
(
val
)
{
isLoadingState
:
throttle
(
function
watchIsLoadingState
(
val
)
{
this
.
isLoading
=
val
;
this
.
isLoading
=
val
;
},
150
),
},
150
),
},
},
...
...
ee/app/assets/javascripts/ide/lib/mirror.js
View file @
8a510657
import
_
from
'
underscore
'
;
import
createDiff
from
'
./create_diff
'
;
import
createDiff
from
'
./create_diff
'
;
import
{
getWebSocketUrl
,
mergeUrlParams
}
from
'
~/lib/utils/url_utility
'
;
import
{
getWebSocketUrl
,
mergeUrlParams
}
from
'
~/lib/utils/url_utility
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
...
@@ -9,6 +8,8 @@ export const MSG_CONNECTION_ERROR = __('Could not connect to Web IDE file mirror
...
@@ -9,6 +8,8 @@ export const MSG_CONNECTION_ERROR = __('Could not connect to Web IDE file mirror
// Before actually connecting to the service, we must delay a bit
// Before actually connecting to the service, we must delay a bit
// so that the service has sufficiently started.
// so that the service has sufficiently started.
const
noop
=
()
=>
{};
export
const
SERVICE_DELAY
=
8000
;
export
const
SERVICE_DELAY
=
8000
;
const
cancellableWait
=
time
=>
{
const
cancellableWait
=
time
=>
{
...
@@ -62,12 +63,12 @@ export const canConnect = ({ services = [] }) => services.some(name => name ===
...
@@ -62,12 +63,12 @@ export const canConnect = ({ services = [] }) => services.some(name => name ===
export
const
createMirror
=
()
=>
{
export
const
createMirror
=
()
=>
{
let
socket
=
null
;
let
socket
=
null
;
let
cancelHandler
=
_
.
noop
;
let
cancelHandler
=
noop
;
let
nextMessageHandler
=
_
.
noop
;
let
nextMessageHandler
=
noop
;
const
cancelConnect
=
()
=>
{
const
cancelConnect
=
()
=>
{
cancelHandler
();
cancelHandler
();
cancelHandler
=
_
.
noop
;
cancelHandler
=
noop
;
};
};
const
onCancelConnect
=
fn
=>
{
const
onCancelConnect
=
fn
=>
{
...
@@ -76,7 +77,7 @@ export const createMirror = () => {
...
@@ -76,7 +77,7 @@ export const createMirror = () => {
const
receiveMessage
=
ev
=>
{
const
receiveMessage
=
ev
=>
{
const
handle
=
nextMessageHandler
;
const
handle
=
nextMessageHandler
;
nextMessageHandler
=
_
.
noop
;
nextMessageHandler
=
noop
;
handle
(
JSON
.
parse
(
ev
.
data
));
handle
(
JSON
.
parse
(
ev
.
data
));
};
};
...
...
ee/app/assets/javascripts/ide/stores/modules/terminal/messages.js
View file @
8a510657
import
_
from
'
underscore
'
;
import
{
escape
as
esc
}
from
'
lodash
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
import
httpStatus
from
'
~/lib/utils/http_status
'
;
import
httpStatus
from
'
~/lib/utils/http_status
'
;
...
@@ -32,7 +32,7 @@ export const configCheckError = (status, helpUrl) => {
...
@@ -32,7 +32,7 @@ export const configCheckError = (status, helpUrl) => {
return
sprintf
(
return
sprintf
(
ERROR_CONFIG
,
ERROR_CONFIG
,
{
{
helpStart
:
`<a href="
${
_
.
escape
(
helpUrl
)}
" target="_blank">`
,
helpStart
:
`<a href="
${
esc
(
helpUrl
)}
" target="_blank">`
,
helpEnd
:
'
</a>
'
,
helpEnd
:
'
</a>
'
,
},
},
false
,
false
,
...
@@ -48,7 +48,7 @@ export const runnersCheckEmpty = helpUrl =>
...
@@ -48,7 +48,7 @@ export const runnersCheckEmpty = helpUrl =>
sprintf
(
sprintf
(
EMPTY_RUNNERS
,
EMPTY_RUNNERS
,
{
{
helpStart
:
`<a href="
${
_
.
escape
(
helpUrl
)}
" target="_blank">`
,
helpStart
:
`<a href="
${
esc
(
helpUrl
)}
" target="_blank">`
,
helpEnd
:
'
</a>
'
,
helpEnd
:
'
</a>
'
,
},
},
false
,
false
,
...
...
ee/app/assets/javascripts/ide/stores/plugins/terminal_sync.js
View file @
8a510657
import
_
from
'
underscore
'
;
import
{
debounce
}
from
'
lodash
'
;
import
eventHub
from
'
~/ide/eventhub
'
;
import
eventHub
from
'
~/ide/eventhub
'
;
import
terminalSyncModule
from
'
../modules/terminal_sync
'
;
import
terminalSyncModule
from
'
../modules/terminal_sync
'
;
import
{
isEndingStatus
,
isRunningStatus
}
from
'
../../utils
'
;
import
{
isEndingStatus
,
isRunningStatus
}
from
'
../../utils
'
;
...
@@ -15,7 +15,7 @@ export default function createMirrorPlugin() {
...
@@ -15,7 +15,7 @@ export default function createMirrorPlugin() {
return
store
=>
{
return
store
=>
{
store
.
registerModule
(
'
terminalSync
'
,
terminalSyncModule
());
store
.
registerModule
(
'
terminalSync
'
,
terminalSyncModule
());
const
upload
=
_
.
debounce
(()
=>
{
const
upload
=
debounce
(()
=>
{
store
.
dispatch
(
`terminalSync/upload`
);
store
.
dispatch
(
`terminalSync/upload`
);
},
UPLOAD_DEBOUNCE
);
},
UPLOAD_DEBOUNCE
);
...
...
ee/spec/frontend/ide/stores/plugins/terminal_sync_spec.js
View file @
8a510657
...
@@ -6,6 +6,7 @@ import { createStore } from '~/ide/stores';
...
@@ -6,6 +6,7 @@ import { createStore } from '~/ide/stores';
import
eventHub
from
'
~/ide/eventhub
'
;
import
eventHub
from
'
~/ide/eventhub
'
;
jest
.
mock
(
'
ee/ide/lib/mirror
'
);
jest
.
mock
(
'
ee/ide/lib/mirror
'
);
jest
.
mock
(
'
lodash/debounce
'
,
()
=>
jest
.
fn
);
const
ACTION_START
=
'
terminalSync/start
'
;
const
ACTION_START
=
'
terminalSync/start
'
;
const
ACTION_STOP
=
'
terminalSync/stop
'
;
const
ACTION_STOP
=
'
terminalSync/stop
'
;
...
...
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