diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2018-07-09 14:26:26 +0000 |
---|---|---|
committer | Julius Kvedaras <juliuskvedaras@yahoo.ie> | 2018-07-10 15:43:48 +0100 |
commit | 24aaeb92a7dda548f61c56d0c424c5ea935a07b3 (patch) | |
tree | 0dc6903109752bf4a6308d184b6d688ed5764335 /app | |
parent | 2da13baad3f87b0f101a6205d5b24ef8fcc6315d (diff) | |
download | gitlab-ce-24aaeb92a7dda548f61c56d0c424c5ea935a07b3.tar.gz |
Merge branch '48960-namespace-diff-module' into 'master'
Resolve "Use namespaped module for diffs"
Closes #48960
See merge request gitlab-org/gitlab-ce!20442
Diffstat (limited to 'app')
11 files changed, 17 insertions, 12 deletions
diff --git a/app/assets/javascripts/diffs/components/app.vue b/app/assets/javascripts/diffs/components/app.vue index eb0985e5603..0327fceb38d 100644 --- a/app/assets/javascripts/diffs/components/app.vue +++ b/app/assets/javascripts/diffs/components/app.vue @@ -63,7 +63,8 @@ export default { plainDiffPath: state => state.diffs.plainDiffPath, emailPatchPath: state => state.diffs.emailPatchPath, }), - ...mapGetters(['isParallelView', 'isNotesFetched']), + ...mapGetters('diffs', ['isParallelView']), + ...mapGetters(['isNotesFetched']), targetBranch() { return { branchName: this.targetBranchName, @@ -115,7 +116,7 @@ export default { this.adjustView(); }, methods: { - ...mapActions(['setBaseConfig', 'fetchDiffFiles']), + ...mapActions('diffs', ['setBaseConfig', 'fetchDiffFiles']), fetchData() { this.fetchDiffFiles().catch(() => { createFlash(__('Something went wrong on our end. Please try again!')); diff --git a/app/assets/javascripts/diffs/components/changed_files.vue b/app/assets/javascripts/diffs/components/changed_files.vue index c5ef9fefc2f..9d29357d800 100644 --- a/app/assets/javascripts/diffs/components/changed_files.vue +++ b/app/assets/javascripts/diffs/components/changed_files.vue @@ -31,7 +31,7 @@ export default { }; }, computed: { - ...mapGetters(['isInlineView', 'isParallelView', 'areAllFilesCollapsed']), + ...mapGetters('diffs', ['isInlineView', 'isParallelView', 'areAllFilesCollapsed']), sumAddedLines() { return this.sumValues('addedLines'); }, @@ -66,7 +66,7 @@ export default { document.removeEventListener('scroll', this.handleScroll); }, methods: { - ...mapActions(['setInlineDiffViewType', 'setParallelDiffViewType', 'expandAllFiles']), + ...mapActions('diffs', ['setInlineDiffViewType', 'setParallelDiffViewType', 'expandAllFiles']), pluralize, handleScroll() { if (!this.updating) { diff --git a/app/assets/javascripts/diffs/components/diff_content.vue b/app/assets/javascripts/diffs/components/diff_content.vue index e9f24b7277e..02d5be1821b 100644 --- a/app/assets/javascripts/diffs/components/diff_content.vue +++ b/app/assets/javascripts/diffs/components/diff_content.vue @@ -22,7 +22,7 @@ export default { projectPath: state => state.diffs.projectPath, endpoint: state => state.diffs.endpoint, }), - ...mapGetters(['isInlineView', 'isParallelView']), + ...mapGetters('diffs', ['isInlineView', 'isParallelView']), diffMode() { const diffModeKey = Object.keys(diffModes).find(key => this.diffFile[`${key}File`]); return diffModes[diffModeKey] || diffModes.replaced; diff --git a/app/assets/javascripts/diffs/components/diff_file.vue b/app/assets/javascripts/diffs/components/diff_file.vue index b5a7392830e..060386c3ecb 100644 --- a/app/assets/javascripts/diffs/components/diff_file.vue +++ b/app/assets/javascripts/diffs/components/diff_file.vue @@ -58,7 +58,7 @@ export default { document.removeEventListener('scroll', this.handleScroll); }, methods: { - ...mapActions(['loadCollapsedDiff']), + ...mapActions('diffs', ['loadCollapsedDiff']), handleToggle() { const { collapsed, highlightedDiffLines, parallelDiffLines } = this.file; diff --git a/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue b/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue index d5b9f4aa9cf..ad838a32518 100644 --- a/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue +++ b/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue @@ -108,7 +108,7 @@ export default { }, }, methods: { - ...mapActions(['loadMoreLines', 'showCommentForm']), + ...mapActions('diffs', ['loadMoreLines', 'showCommentForm']), handleCommentButton() { this.showCommentForm({ lineCode: this.lineCode }); }, diff --git a/app/assets/javascripts/diffs/components/diff_line_note_form.vue b/app/assets/javascripts/diffs/components/diff_line_note_form.vue index f48cf80153f..db380e68bd1 100644 --- a/app/assets/javascripts/diffs/components/diff_line_note_form.vue +++ b/app/assets/javascripts/diffs/components/diff_line_note_form.vue @@ -59,7 +59,8 @@ export default { } }, methods: { - ...mapActions(['cancelCommentForm', 'saveNote', 'refetchDiscussionById']), + ...mapActions('diffs', ['cancelCommentForm']), + ...mapActions(['saveNote', 'refetchDiscussionById']), handleCancelCommentForm() { this.autosave.reset(); this.cancelCommentForm({ diff --git a/app/assets/javascripts/diffs/components/inline_diff_table_row.vue b/app/assets/javascripts/diffs/components/inline_diff_table_row.vue index f80915c9abf..8e4715c9862 100644 --- a/app/assets/javascripts/diffs/components/inline_diff_table_row.vue +++ b/app/assets/javascripts/diffs/components/inline_diff_table_row.vue @@ -36,7 +36,7 @@ export default { }; }, computed: { - ...mapGetters(['isInlineView']), + ...mapGetters('diffs', ['isInlineView']), isContextLine() { return this.line.type === CONTEXT_LINE_TYPE; }, diff --git a/app/assets/javascripts/diffs/components/inline_diff_view.vue b/app/assets/javascripts/diffs/components/inline_diff_view.vue index fcaa6537d03..9c1359f7c89 100644 --- a/app/assets/javascripts/diffs/components/inline_diff_view.vue +++ b/app/assets/javascripts/diffs/components/inline_diff_view.vue @@ -20,7 +20,8 @@ export default { }, }, computed: { - ...mapGetters(['commitId', 'discussionsByLineCode']), + ...mapGetters('diffs', ['commitId']), + ...mapGetters(['discussionsByLineCode']), ...mapState({ diffLineCommentForms: state => state.diffs.diffLineCommentForms, }), diff --git a/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue b/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue index 4202780cd0d..b76fc63205b 100644 --- a/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue +++ b/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue @@ -40,7 +40,7 @@ export default { }; }, computed: { - ...mapGetters(['isParallelView']), + ...mapGetters('diffs', ['isParallelView']), isContextLine() { return this.line.left.type === CONTEXT_LINE_TYPE; }, diff --git a/app/assets/javascripts/diffs/components/parallel_diff_view.vue b/app/assets/javascripts/diffs/components/parallel_diff_view.vue index 569fc8b8e47..216865474a6 100644 --- a/app/assets/javascripts/diffs/components/parallel_diff_view.vue +++ b/app/assets/javascripts/diffs/components/parallel_diff_view.vue @@ -21,7 +21,8 @@ export default { }, }, computed: { - ...mapGetters(['commitId', 'discussionsByLineCode']), + ...mapGetters('diffs', ['commitId']), + ...mapGetters(['discussionsByLineCode']), ...mapState({ diffLineCommentForms: state => state.diffs.diffLineCommentForms, }), diff --git a/app/assets/javascripts/diffs/store/modules/index.js b/app/assets/javascripts/diffs/store/modules/index.js index 56c26d1ffad..20d1ebbe049 100644 --- a/app/assets/javascripts/diffs/store/modules/index.js +++ b/app/assets/javascripts/diffs/store/modules/index.js @@ -4,6 +4,7 @@ import mutations from '../mutations'; import createState from './diff_state'; export default { + namespaced: true, state: createState(), getters, actions, |