diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-01-23 09:40:38 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-01-23 09:40:38 +0000 |
commit | fcfda3ef82992e5f56573dffb56b2a5896c24aff (patch) | |
tree | 6b55ddc2f937617f0e3b2402d1780272c9d69e7a | |
parent | ae1358e48383c9f39c9ffaeaff7a409fae00f442 (diff) | |
parent | 4167f19b0a52dc55a45a4fd455788e7484cb0692 (diff) | |
download | gitlab-ce-fcfda3ef82992e5f56573dffb56b2a5896c24aff.tar.gz |
Merge branch 'tz-upgrade-vue-again' into 'master'
Upgraded all vue libraries
See merge request gitlab-org/gitlab-ce!16413
17 files changed, 78 insertions, 64 deletions
diff --git a/app/assets/javascripts/environments/components/environments_table.vue b/app/assets/javascripts/environments/components/environments_table.vue index 858acf293a1..b4eca47957e 100644 --- a/app/assets/javascripts/environments/components/environments_table.vue +++ b/app/assets/javascripts/environments/components/environments_table.vue @@ -99,7 +99,7 @@ export default { > <div v-if="model.isLoadingFolderContent" - :key="i"> + :key="`loading-item-${i}`"> <loading-icon size="2" /> </div> @@ -110,10 +110,10 @@ export default { :model="children" :can-create-deployment="canCreateDeployment" :can-read-environment="canReadEnvironment" - :key="index" + :key="`env-item-${i}-${index}`" /> - <div :key="i"> + <div :key="`sub-div-${i}`"> <div class="text-center prepend-top-10"> <a :href="folderUrl(model)" diff --git a/app/assets/javascripts/ide/components/repo_tabs.vue b/app/assets/javascripts/ide/components/repo_tabs.vue index ab0bef4f0ac..ca363bba0ef 100644 --- a/app/assets/javascripts/ide/components/repo_tabs.vue +++ b/app/assets/javascripts/ide/components/repo_tabs.vue @@ -20,7 +20,7 @@ > <repo-tab v-for="tab in openFiles" - :key="tab.id" + :key="tab.key" :tab="tab" /> </ul> diff --git a/package.json b/package.json index f8d7a29eb7d..eb502ede62a 100644 --- a/package.json +++ b/package.json @@ -75,11 +75,11 @@ "underscore": "^1.8.3", "url-loader": "^0.5.8", "visibilityjs": "^1.2.4", - "vue": "^2.5.8", - "vue-loader": "^13.5.0", - "vue-resource": "^1.3.4", + "vue": "^2.5.13", + "vue-loader": "^13.7.0", + "vue-resource": "^1.3.5", "vue-router": "^3.0.1", - "vue-template-compiler": "^2.5.8", + "vue-template-compiler": "^2.5.13", "vuex": "^3.0.1", "webpack": "^3.5.5", "webpack-bundle-analyzer": "^2.8.2", diff --git a/spec/javascripts/boards/board_list_spec.js b/spec/javascripts/boards/board_list_spec.js index b7cc3a8813e..9ffdac9be97 100644 --- a/spec/javascripts/boards/board_list_spec.js +++ b/spec/javascripts/boards/board_list_spec.js @@ -184,9 +184,9 @@ describe('Board list component', () => { component.$refs.list.style.height = '100px'; component.$refs.list.style.overflow = 'scroll'; - for (let i = 0; i < 19; i += 1) { - const issue = component.list.issues[0]; - issue.id += 1; + for (let i = 1; i < 20; i += 1) { + const issue = Object.assign({}, component.list.issues[0]); + issue.id += i; component.list.issues.push(issue); } diff --git a/spec/javascripts/pipelines/graph/job_component_spec.js b/spec/javascripts/pipelines/graph/job_component_spec.js index 35e36e9c353..c3dc7b53d0f 100644 --- a/spec/javascripts/pipelines/graph/job_component_spec.js +++ b/spec/javascripts/pipelines/graph/job_component_spec.js @@ -61,14 +61,14 @@ describe('pipeline graph job component', () => { it('it should render status and name', () => { component = mountComponent(JobComponent, { job: { - id: 4256, + id: 4257, name: 'test', status: { icon: 'icon_status_success', text: 'passed', label: 'passed', group: 'success', - details_path: '/root/ci-mock/builds/4256', + details_path: '/root/ci-mock/builds/4257', has_details: false, }, }, @@ -118,7 +118,7 @@ describe('pipeline graph job component', () => { it('should not render status label when it is not provided', () => { component = mountComponent(JobComponent, { job: { - id: 4256, + id: 4258, name: 'test', status: { icon: 'icon_status_success', @@ -132,7 +132,7 @@ describe('pipeline graph job component', () => { it('should not render status label when it is provided', () => { component = mountComponent(JobComponent, { job: { - id: 4256, + id: 4259, name: 'test', status: { icon: 'icon_status_success', diff --git a/spec/javascripts/pipelines/graph/stage_column_component_spec.js b/spec/javascripts/pipelines/graph/stage_column_component_spec.js index 063ab53681b..f744f1af5e6 100644 --- a/spec/javascripts/pipelines/graph/stage_column_component_spec.js +++ b/spec/javascripts/pipelines/graph/stage_column_component_spec.js @@ -4,18 +4,18 @@ import stageColumnComponent from '~/pipelines/components/graph/stage_column_comp describe('stage column component', () => { let component; const mockJob = { - id: 4256, + id: 4250, name: 'test', status: { icon: 'icon_status_success', text: 'passed', label: 'passed', group: 'success', - details_path: '/root/ci-mock/builds/4256', + details_path: '/root/ci-mock/builds/4250', action: { icon: 'retry', title: 'Retry', - path: '/root/ci-mock/builds/4256/retry', + path: '/root/ci-mock/builds/4250/retry', method: 'post', }, }, @@ -24,10 +24,17 @@ describe('stage column component', () => { beforeEach(() => { const StageColumnComponent = Vue.extend(stageColumnComponent); + const mockJobs = []; + for (let i = 0; i < 3; i += 1) { + const mockedJob = Object.assign({}, mockJob); + mockedJob.id += i; + mockJobs.push(mockedJob); + } + component = new StageColumnComponent({ propsData: { title: 'foo', - jobs: [mockJob, mockJob, mockJob], + jobs: mockJobs, }, }).$mount(); }); diff --git a/spec/javascripts/repo/components/commit_sidebar/list_collapsed_spec.js b/spec/javascripts/repo/components/commit_sidebar/list_collapsed_spec.js index c4d3866c922..debde1bb357 100644 --- a/spec/javascripts/repo/components/commit_sidebar/list_collapsed_spec.js +++ b/spec/javascripts/repo/components/commit_sidebar/list_collapsed_spec.js @@ -12,7 +12,7 @@ describe('Multi-file editor commit sidebar list collapsed', () => { vm = createComponentWithStore(Component, store); - vm.$store.state.openFiles.push(file(), file()); + vm.$store.state.openFiles.push(file('file1'), file('file2')); vm.$store.state.openFiles[0].tempFile = true; vm.$store.state.openFiles.forEach((f) => { Object.assign(f, { diff --git a/spec/javascripts/repo/components/commit_sidebar/list_item_spec.js b/spec/javascripts/repo/components/commit_sidebar/list_item_spec.js index fc7c9ae9dd7..4b20fdf70d6 100644 --- a/spec/javascripts/repo/components/commit_sidebar/list_item_spec.js +++ b/spec/javascripts/repo/components/commit_sidebar/list_item_spec.js @@ -10,7 +10,7 @@ describe('Multi-file editor commit sidebar list item', () => { beforeEach(() => { const Component = Vue.extend(listItem); - f = file(); + f = file('test-file'); vm = mountComponent(Component, { file: f, diff --git a/spec/javascripts/repo/components/repo_commit_section_spec.js b/spec/javascripts/repo/components/repo_commit_section_spec.js index cd93fb3ccbf..676ac09f2c9 100644 --- a/spec/javascripts/repo/components/repo_commit_section_spec.js +++ b/spec/javascripts/repo/components/repo_commit_section_spec.js @@ -29,7 +29,7 @@ describe('RepoCommitSection', () => { comp.$store.state.rightPanelCollapsed = false; comp.$store.state.currentBranch = 'master'; - comp.$store.state.openFiles = [file(), file()]; + comp.$store.state.openFiles = [file('file1'), file('file2')]; comp.$store.state.openFiles.forEach(f => Object.assign(f, { changed: true, content: 'testing', diff --git a/spec/javascripts/repo/components/repo_file_spec.js b/spec/javascripts/repo/components/repo_file_spec.js index 0810da87e80..27b55ed1f87 100644 --- a/spec/javascripts/repo/components/repo_file_spec.js +++ b/spec/javascripts/repo/components/repo_file_spec.js @@ -25,7 +25,7 @@ describe('RepoFile', () => { vm = new RepoFile({ store, propsData: { - file: file(), + file: file('t4'), }, }); spyOn(vm, 'timeFormated').and.returnValue(updated); @@ -39,7 +39,7 @@ describe('RepoFile', () => { it('does render if hasFiles is true and is loading tree', () => { vm = createComponent({ - file: file(), + file: file('t1'), }); expect(vm.$el.querySelector('.fa-spin.fa-spinner')).toBeFalsy(); @@ -47,7 +47,7 @@ describe('RepoFile', () => { it('does not render commit message and datetime if mini', (done) => { vm = createComponent({ - file: file(), + file: file('t2'), }); vm.$store.state.openFiles.push(vm.file); @@ -61,7 +61,7 @@ describe('RepoFile', () => { it('fires clickFile when the link is clicked', () => { vm = createComponent({ - file: file(), + file: file('t3'), }); spyOn(vm, 'clickFile'); diff --git a/spec/javascripts/repo/components/repo_tab_spec.js b/spec/javascripts/repo/components/repo_tab_spec.js index 507bca983df..933e8d3a06a 100644 --- a/spec/javascripts/repo/components/repo_tab_spec.js +++ b/spec/javascripts/repo/components/repo_tab_spec.js @@ -56,7 +56,7 @@ describe('RepoTab', () => { }); it('renders an fa-circle icon if tab is changed', () => { - const tab = file(); + const tab = file('changedFile'); tab.changed = true; vm = createComponent({ tab, @@ -68,7 +68,7 @@ describe('RepoTab', () => { describe('methods', () => { describe('closeTab', () => { it('does not close tab if is changed', (done) => { - const tab = file(); + const tab = file('closeFile'); tab.changed = true; tab.opened = true; vm = createComponent({ diff --git a/spec/javascripts/repo/components/repo_tabs_spec.js b/spec/javascripts/repo/components/repo_tabs_spec.js index 0beaf643793..2c363364d70 100644 --- a/spec/javascripts/repo/components/repo_tabs_spec.js +++ b/spec/javascripts/repo/components/repo_tabs_spec.js @@ -4,7 +4,7 @@ import repoTabs from '~/ide/components/repo_tabs.vue'; import { file, resetStore } from '../helpers'; describe('RepoTabs', () => { - const openedFiles = [file(), file()]; + const openedFiles = [file('open1'), file('open2')]; let vm; function createComponent() { diff --git a/spec/javascripts/repo/stores/actions/file_spec.js b/spec/javascripts/repo/stores/actions/file_spec.js index 8ce01d3bf12..e2d8f002e27 100644 --- a/spec/javascripts/repo/stores/actions/file_spec.js +++ b/spec/javascripts/repo/stores/actions/file_spec.js @@ -18,7 +18,7 @@ describe('Multi-file store file actions', () => { oldGetLastCommitData = store._actions.getLastCommitData; // eslint-disable-line store._actions.getLastCommitData = [getLastCommitDataSpy]; // eslint-disable-line - localFile = file(); + localFile = file('testFile'); localFile.active = true; localFile.opened = true; localFile.parentTreeUrl = 'parentTreeUrl'; @@ -81,7 +81,7 @@ describe('Multi-file store file actions', () => { }); it('sets next file as active', (done) => { - const f = file(); + const f = file('otherfile'); store.state.openFiles.push(f); expect(f.active).toBeFalsy(); @@ -119,7 +119,7 @@ describe('Multi-file store file actions', () => { }); it('calls scrollToTab', (done) => { - store.dispatch('setFileActive', file()) + store.dispatch('setFileActive', file('setThisActive')) .then(() => { expect(scrollToTabSpy).toHaveBeenCalled(); @@ -128,7 +128,7 @@ describe('Multi-file store file actions', () => { }); it('sets the file active', (done) => { - const localFile = file(); + const localFile = file('activeFile'); store.dispatch('setFileActive', localFile) .then(() => { @@ -139,7 +139,7 @@ describe('Multi-file store file actions', () => { }); it('returns early if file is already active', (done) => { - const localFile = file(); + const localFile = file('earlyActive'); localFile.active = true; store.dispatch('setFileActive', localFile) @@ -151,11 +151,11 @@ describe('Multi-file store file actions', () => { }); it('sets current active file to not active', (done) => { - const localFile = file(); + const localFile = file('currentActive'); localFile.active = true; store.state.openFiles.push(localFile); - store.dispatch('setFileActive', file()) + store.dispatch('setFileActive', file('newActive')) .then(() => { expect(localFile.active).toBeFalsy(); @@ -166,7 +166,7 @@ describe('Multi-file store file actions', () => { it('resets location.hash for line highlighting', (done) => { location.hash = 'test'; - store.dispatch('setFileActive', file()) + store.dispatch('setFileActive', file('otherActive')) .then(() => { expect(location.hash).not.toBe('test'); @@ -176,7 +176,7 @@ describe('Multi-file store file actions', () => { }); describe('getFileData', () => { - let localFile = file(); + let localFile; beforeEach(() => { spyOn(service, 'getFileData').and.returnValue(Promise.resolve({ @@ -194,10 +194,17 @@ describe('Multi-file store file actions', () => { }), })); - localFile = file(); + localFile = file('newCreate'); localFile.url = 'getFileDataURL'; }); + afterEach(() => { + store.dispatch('closeFile', { + file: localFile, + force: true, + }); + }); + it('calls the service', (done) => { store.dispatch('getFileData', localFile) .then(() => { @@ -268,7 +275,7 @@ describe('Multi-file store file actions', () => { beforeEach(() => { spyOn(service, 'getRawFileData').and.returnValue(Promise.resolve('raw')); - tmpFile = file(); + tmpFile = file('tmpFile'); }); it('calls getRawFileData service method', (done) => { @@ -294,7 +301,7 @@ describe('Multi-file store file actions', () => { let tmpFile; beforeEach(() => { - tmpFile = file(); + tmpFile = file('tmpFile'); }); it('updates file content', (done) => { diff --git a/spec/javascripts/repo/stores/actions_spec.js b/spec/javascripts/repo/stores/actions_spec.js index 853ef7f3224..8d830c67290 100644 --- a/spec/javascripts/repo/stores/actions_spec.js +++ b/spec/javascripts/repo/stores/actions_spec.js @@ -48,14 +48,14 @@ describe('Multi-file store actions', () => { describe('discardAllChanges', () => { beforeEach(() => { - store.state.openFiles.push(file()); + store.state.openFiles.push(file('discardAll')); store.state.openFiles[0].changed = true; }); }); describe('closeAllFiles', () => { beforeEach(() => { - store.state.openFiles.push(file()); + store.state.openFiles.push(file('closeAll')); store.state.openFiles[0].opened = true; }); @@ -97,7 +97,7 @@ describe('Multi-file store actions', () => { it('opens discard popup if there are changed files', (done) => { store.state.editMode = true; - store.state.openFiles.push(file()); + store.state.openFiles.push(file('discardChanges')); store.state.openFiles[0].changed = true; store.dispatch('toggleEditMode') @@ -111,7 +111,7 @@ describe('Multi-file store actions', () => { it('can force closed if there are changed files', (done) => { store.state.editMode = true; - store.state.openFiles.push(file()); + store.state.openFiles.push(file('forceClose')); store.state.openFiles[0].changed = true; store.dispatch('toggleEditMode', true) @@ -124,7 +124,7 @@ describe('Multi-file store actions', () => { }); it('discards file changes', (done) => { - const f = file(); + const f = file('discard'); store.state.editMode = true; store.state.openFiles.push(f); f.changed = true; @@ -285,8 +285,8 @@ describe('Multi-file store actions', () => { }); it('adds commit data to changed files', (done) => { - const changedFile = file(); - const f = file(); + const changedFile = file('changed'); + const f = file('newfile'); changedFile.changed = true; store.state.openFiles.push(changedFile, f); diff --git a/spec/javascripts/repo/stores/mutations/file_spec.js b/spec/javascripts/repo/stores/mutations/file_spec.js index 947a60587df..6e204ef0404 100644 --- a/spec/javascripts/repo/stores/mutations/file_spec.js +++ b/spec/javascripts/repo/stores/mutations/file_spec.js @@ -117,7 +117,7 @@ describe('Multi-file store file mutations', () => { describe('CREATE_TMP_FILE', () => { it('adds file into parent tree', () => { - const f = file(); + const f = file('tmpFile'); mutations.CREATE_TMP_FILE(localState, { file: f, diff --git a/spec/javascripts/repo/stores/mutations/tree_spec.js b/spec/javascripts/repo/stores/mutations/tree_spec.js index cf1248ba28b..e6ca8ea139e 100644 --- a/spec/javascripts/repo/stores/mutations/tree_spec.js +++ b/spec/javascripts/repo/stores/mutations/tree_spec.js @@ -57,7 +57,7 @@ describe('Multi-file store tree mutations', () => { describe('CREATE_TMP_TREE', () => { it('adds tree into parent tree', () => { - const tmpEntry = file(); + const tmpEntry = file('tmpTree'); mutations.CREATE_TMP_TREE(localState, { tmpEntry, diff --git a/yarn.lock b/yarn.lock index 6bd28c12f05..c3345db9c83 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3383,7 +3383,7 @@ got@^3.2.0: read-all-stream "^3.0.0" timed-out "^2.0.0" -got@^7.0.0: +got@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" dependencies: @@ -7594,9 +7594,9 @@ vue-hot-reload-api@^2.2.0: version "2.2.4" resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.2.4.tgz#683bd1d026c0d3b3c937d5875679e9a87ec6cd8f" -vue-loader@^13.5.0: - version "13.5.0" - resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-13.5.0.tgz#52f7b3790a267eff80012b77ea187a54586dd5d4" +vue-loader@^13.7.0: + version "13.7.0" + resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-13.7.0.tgz#4d6a35b169c2a0a488842fb95c85052105fa9729" dependencies: consolidate "^0.14.0" hash-sum "^1.0.2" @@ -7612,11 +7612,11 @@ vue-loader@^13.5.0: vue-style-loader "^3.0.0" vue-template-es2015-compiler "^1.6.0" -vue-resource@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/vue-resource/-/vue-resource-1.3.4.tgz#9fc0bdf6a2f5cab430129fc99d347b3deae7b099" +vue-resource@^1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/vue-resource/-/vue-resource-1.3.5.tgz#021d8713e9d86a77e83169dfdd8eab6047369a71" dependencies: - got "^7.0.0" + got "^7.1.0" vue-router@^3.0.1: version "3.0.1" @@ -7629,9 +7629,9 @@ vue-style-loader@^3.0.0: hash-sum "^1.0.2" loader-utils "^1.0.2" -vue-template-compiler@^2.5.8: - version "2.5.8" - resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.5.8.tgz#826ae77e1d5faa7fa5fca554f33872dde38de674" +vue-template-compiler@^2.5.13: + version "2.5.13" + resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.5.13.tgz#12a2aa0ecd6158ac5e5f14d294b0993f399c3d38" dependencies: de-indent "^1.0.2" he "^1.1.0" @@ -7640,9 +7640,9 @@ vue-template-es2015-compiler@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.6.0.tgz#dc42697133302ce3017524356a6c61b7b69b4a18" -vue@^2.5.8: - version "2.5.8" - resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.8.tgz#f855c1c27255184a82225f4bef225473e8faf15b" +vue@^2.5.13: + version "2.5.13" + resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.13.tgz#95bd31e20efcf7a7f39239c9aa6787ce8cf578e1" vuex@^3.0.1: version "3.0.1" |