diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-24 18:07:55 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-24 18:07:55 +0000 |
commit | 603c7d4cac5e28bc1c75e50c23ed2cbe56f1aafc (patch) | |
tree | 907f5b8ee1b6f5aad396e95e3327a08400b9e8ea /app/assets/javascripts/ide | |
parent | 120f4aaedc8fe830a3f572491d240d8ee6addefb (diff) | |
download | gitlab-ce-603c7d4cac5e28bc1c75e50c23ed2cbe56f1aafc.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/ide')
13 files changed, 26 insertions, 27 deletions
diff --git a/app/assets/javascripts/ide/components/branches/search_list.vue b/app/assets/javascripts/ide/components/branches/search_list.vue index 31f1dec43ad..76821bcd986 100644 --- a/app/assets/javascripts/ide/components/branches/search_list.vue +++ b/app/assets/javascripts/ide/components/branches/search_list.vue @@ -1,6 +1,6 @@ <script> import { mapActions, mapState } from 'vuex'; -import _ from 'underscore'; +import { debounce } from 'lodash'; import { GlLoadingIcon } from '@gitlab/ui'; import Icon from '~/vue_shared/components/icon.vue'; import Item from './item.vue'; @@ -39,7 +39,7 @@ export default { loadBranches() { this.fetchBranches({ search: this.search }); }, - searchBranches: _.debounce(function debounceSearch() { + searchBranches: debounce(function debounceSearch() { this.loadBranches(); }, 250), focusSearch() { diff --git a/app/assets/javascripts/ide/components/commit_sidebar/actions.vue b/app/assets/javascripts/ide/components/commit_sidebar/actions.vue index 2581c3e9928..beff95eb47b 100644 --- a/app/assets/javascripts/ide/components/commit_sidebar/actions.vue +++ b/app/assets/javascripts/ide/components/commit_sidebar/actions.vue @@ -1,5 +1,5 @@ <script> -import _ from 'underscore'; +import { escape as esc } from 'lodash'; import { mapState, mapGetters, createNamespacedHelpers } from 'vuex'; import { sprintf, s__ } from '~/locale'; import consts from '../../stores/modules/commit/constants'; @@ -22,7 +22,7 @@ export default { commitToCurrentBranchText() { return sprintf( s__('IDE|Commit to %{branchName} branch'), - { branchName: `<strong class="monospace">${_.escape(this.currentBranchId)}</strong>` }, + { branchName: `<strong class="monospace">${esc(this.currentBranchId)}</strong>` }, false, ); }, diff --git a/app/assets/javascripts/ide/components/jobs/detail.vue b/app/assets/javascripts/ide/components/jobs/detail.vue index 7710bfb49ec..504391ffdc7 100644 --- a/app/assets/javascripts/ide/components/jobs/detail.vue +++ b/app/assets/javascripts/ide/components/jobs/detail.vue @@ -1,6 +1,6 @@ <script> import { mapActions, mapState } from 'vuex'; -import _ from 'underscore'; +import { throttle } from 'lodash'; import { __ } from '../../../locale'; import tooltip from '../../../vue_shared/directives/tooltip'; import Icon from '../../../vue_shared/components/icon.vue'; @@ -53,7 +53,7 @@ export default { this.$refs.buildTrace.scrollTo(0, 0); } }, - scrollBuildLog: _.throttle(function buildLogScrollDebounce() { + scrollBuildLog: throttle(function buildLogScrollDebounce() { const { scrollTop } = this.$refs.buildTrace; const { offsetHeight, scrollHeight } = this.$refs.buildTrace; diff --git a/app/assets/javascripts/ide/components/merge_requests/list.vue b/app/assets/javascripts/ide/components/merge_requests/list.vue index 5a8face062b..15c08988977 100644 --- a/app/assets/javascripts/ide/components/merge_requests/list.vue +++ b/app/assets/javascripts/ide/components/merge_requests/list.vue @@ -1,6 +1,6 @@ <script> import { mapActions, mapState } from 'vuex'; -import _ from 'underscore'; +import { debounce } from 'lodash'; import { GlLoadingIcon } from '@gitlab/ui'; import { __ } from '~/locale'; import Icon from '~/vue_shared/components/icon.vue'; @@ -59,7 +59,7 @@ export default { loadMergeRequests() { this.fetchMergeRequests({ type: this.type, search: this.search }); }, - searchMergeRequests: _.debounce(function debounceSearch() { + searchMergeRequests: debounce(function debounceSearch() { this.loadMergeRequests(); }, 250), onSearchFocus() { diff --git a/app/assets/javascripts/ide/components/panes/collapsible_sidebar.vue b/app/assets/javascripts/ide/components/panes/collapsible_sidebar.vue index 7f65d089148..8adf0122fb4 100644 --- a/app/assets/javascripts/ide/components/panes/collapsible_sidebar.vue +++ b/app/assets/javascripts/ide/components/panes/collapsible_sidebar.vue @@ -1,6 +1,5 @@ <script> import { mapActions, mapState } from 'vuex'; -import _ from 'underscore'; import tooltip from '~/vue_shared/directives/tooltip'; import Icon from '~/vue_shared/components/icon.vue'; import ResizablePanel from '../resizable_panel.vue'; @@ -55,7 +54,7 @@ export default { return this.extensionTabs.filter(tab => tab.show); }, tabViews() { - return _.flatten(this.tabs.map(tab => tab.views)); + return this.tabs.map(tab => tab.views).flat(); }, aliveTabViews() { return this.tabViews.filter(view => this.isAliveView(view.name)); diff --git a/app/assets/javascripts/ide/components/pipelines/list.vue b/app/assets/javascripts/ide/components/pipelines/list.vue index 3a63fc32639..343b0b6e90c 100644 --- a/app/assets/javascripts/ide/components/pipelines/list.vue +++ b/app/assets/javascripts/ide/components/pipelines/list.vue @@ -1,6 +1,6 @@ <script> import { mapActions, mapGetters, mapState } from 'vuex'; -import _ from 'underscore'; +import { escape as esc } from 'lodash'; import { GlLoadingIcon } from '@gitlab/ui'; import { sprintf, __ } from '../../../locale'; import Icon from '../../../vue_shared/components/icon.vue'; @@ -35,7 +35,7 @@ export default { return sprintf( __('You can test your .gitlab-ci.yml in %{linkStart}CI Lint%{linkEnd}.'), { - linkStart: `<a href="${_.escape(this.currentProject.web_url)}/-/ci/lint">`, + linkStart: `<a href="${esc(this.currentProject.web_url)}/-/ci/lint">`, linkEnd: '</a>', }, false, diff --git a/app/assets/javascripts/ide/components/preview/clientside.vue b/app/assets/javascripts/ide/components/preview/clientside.vue index aa8d932da6e..86a773499bc 100644 --- a/app/assets/javascripts/ide/components/preview/clientside.vue +++ b/app/assets/javascripts/ide/components/preview/clientside.vue @@ -1,6 +1,6 @@ <script> import { mapActions, mapGetters, mapState } from 'vuex'; -import _ from 'underscore'; +import { isEmpty } from 'lodash'; import { Manager } from 'smooshpack'; import { listen } from 'codesandbox-api'; import { GlLoadingIcon } from '@gitlab/ui'; @@ -78,7 +78,7 @@ export default { .then(() => this.initPreview()); }, beforeDestroy() { - if (!_.isEmpty(this.manager)) { + if (!isEmpty(this.manager)) { this.manager.listener(); } this.manager = {}; @@ -125,7 +125,7 @@ export default { clearTimeout(this.timeout); this.timeout = setTimeout(() => { - if (_.isEmpty(this.manager)) { + if (isEmpty(this.manager)) { this.initPreview(); return; diff --git a/app/assets/javascripts/ide/index.js b/app/assets/javascripts/ide/index.js index 9e9d9df8f82..55a0dd848c8 100644 --- a/app/assets/javascripts/ide/index.js +++ b/app/assets/javascripts/ide/index.js @@ -1,7 +1,7 @@ import Vue from 'vue'; import { mapActions } from 'vuex'; -import _ from 'underscore'; import Translate from '~/vue_shared/translate'; +import { identity } from 'lodash'; import ide from './components/ide.vue'; import store from './stores'; import router from './ide_router'; @@ -31,7 +31,7 @@ Vue.use(Translate); export function initIde(el, options = {}) { if (!el) return null; - const { rootComponent = ide, extendStore = _.identity } = options; + const { rootComponent = ide, extendStore = identity } = options; return new Vue({ el, diff --git a/app/assets/javascripts/ide/lib/diff/controller.js b/app/assets/javascripts/ide/lib/diff/controller.js index 046e562ba2b..234a7f903a1 100644 --- a/app/assets/javascripts/ide/lib/diff/controller.js +++ b/app/assets/javascripts/ide/lib/diff/controller.js @@ -1,5 +1,5 @@ import { Range } from 'monaco-editor'; -import { throttle } from 'underscore'; +import { throttle } from 'lodash'; import DirtyDiffWorker from './diff_worker'; import Disposable from '../common/disposable'; diff --git a/app/assets/javascripts/ide/lib/editor.js b/app/assets/javascripts/ide/lib/editor.js index 3d729463cb4..3aff4d30d81 100644 --- a/app/assets/javascripts/ide/lib/editor.js +++ b/app/assets/javascripts/ide/lib/editor.js @@ -1,4 +1,4 @@ -import _ from 'underscore'; +import { debounce } from 'lodash'; import { editor as monacoEditor, KeyCode, KeyMod } from 'monaco-editor'; import store from '../stores'; import DecorationsController from './decorations/controller'; @@ -38,7 +38,7 @@ export default class Editor { setupThemes(); - this.debouncedUpdate = _.debounce(() => { + this.debouncedUpdate = debounce(() => { this.updateDimensions(); }, 200); } diff --git a/app/assets/javascripts/ide/stores/actions.js b/app/assets/javascripts/ide/stores/actions.js index ddc0925efb9..04cf0ad53d5 100644 --- a/app/assets/javascripts/ide/stores/actions.js +++ b/app/assets/javascripts/ide/stores/actions.js @@ -1,6 +1,6 @@ import $ from 'jquery'; import Vue from 'vue'; -import _ from 'underscore'; +import { escape as esc } from 'lodash'; import { __, sprintf } from '~/locale'; import { visitUrl } from '~/lib/utils/url_utility'; import flash from '~/flash'; @@ -296,7 +296,7 @@ export const getBranchData = ({ commit, state }, { projectId, branchId, force = sprintf( __('Branch not loaded - %{branchId}'), { - branchId: `<strong>${_.escape(projectId)}/${_.escape(branchId)}</strong>`, + branchId: `<strong>${esc(projectId)}/${esc(branchId)}</strong>`, }, false, ), diff --git a/app/assets/javascripts/ide/stores/actions/project.js b/app/assets/javascripts/ide/stores/actions/project.js index 62084892d13..0b168009847 100644 --- a/app/assets/javascripts/ide/stores/actions/project.js +++ b/app/assets/javascripts/ide/stores/actions/project.js @@ -1,4 +1,4 @@ -import _ from 'underscore'; +import { escape as esc } from 'lodash'; import flash from '~/flash'; import { __, sprintf } from '~/locale'; import service from '../../services'; @@ -73,7 +73,7 @@ export const showBranchNotFoundError = ({ dispatch }, branchId) => { text: sprintf( __("Branch %{branchName} was not found in this project's repository."), { - branchName: `<strong>${_.escape(branchId)}</strong>`, + branchName: `<strong>${esc(branchId)}</strong>`, }, false, ), @@ -154,7 +154,7 @@ export const openBranch = ({ dispatch, state, getters }, { projectId, branchId, sprintf( __('An error occurred while getting files for - %{branchId}'), { - branchId: `<strong>${_.escape(projectId)}/${_.escape(branchId)}</strong>`, + branchId: `<strong>${esc(projectId)}/${esc(branchId)}</strong>`, }, false, ), diff --git a/app/assets/javascripts/ide/stores/actions/tree.js b/app/assets/javascripts/ide/stores/actions/tree.js index 828e4ed5eb9..7d48f0adc4c 100644 --- a/app/assets/javascripts/ide/stores/actions/tree.js +++ b/app/assets/javascripts/ide/stores/actions/tree.js @@ -1,4 +1,4 @@ -import _ from 'underscore'; +import { defer } from 'lodash'; import { __ } from '../../../locale'; import service from '../../services'; import * as types from '../mutation_types'; @@ -71,7 +71,7 @@ export const getFiles = ({ state, commit, dispatch }, payload = {}) => // Defer setting the directory data because this triggers some intense rendering. // The entries is all we need to load the file editor. - _.defer(() => dispatch('setDirectoryData', { projectId, branchId, treeList })); + defer(() => dispatch('setDirectoryData', { projectId, branchId, treeList })); resolve(); }) |