Commit fb894640 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-11-12

# Conflicts:
#	.gitlab-ci.yml
#	doc/user/markdown.md

[ci skip]
parents 9e1b7e74 a407bba8
...@@ -426,6 +426,11 @@ cloud-native-image: ...@@ -426,6 +426,11 @@ cloud-native-image:
stage: test stage: test
image: ruby:2.4-alpine image: ruby:2.4-alpine
before_script: [] before_script: []
<<<<<<< HEAD
=======
dependencies: []
stage: test
>>>>>>> upstream/master
allow_failure: true allow_failure: true
cache: {} cache: {}
variables: variables:
...@@ -799,6 +804,7 @@ rails5_gemfile_lock_check: ...@@ -799,6 +804,7 @@ rails5_gemfile_lock_check:
ee_compat_check: ee_compat_check:
<<: *rake-exec <<: *rake-exec
dependencies: []
except: except:
- master - master
- tags - tags
...@@ -1042,9 +1048,7 @@ coverage: ...@@ -1042,9 +1048,7 @@ coverage:
lint:javascript:report: lint:javascript:report:
<<: *dedicated-no-docs-and-no-qa-pull-cache-job <<: *dedicated-no-docs-and-no-qa-pull-cache-job
stage: post-test stage: post-test
dependencies: dependencies: []
- compile-assets
- setup-test-env
before_script: [] before_script: []
script: script:
- date - date
...@@ -1098,6 +1102,7 @@ gitlab_git_test: ...@@ -1098,6 +1102,7 @@ gitlab_git_test:
variables: variables:
SETUP_DB: "false" SETUP_DB: "false"
before_script: [] before_script: []
dependencies: []
cache: {} cache: {}
script: script:
- spec/support/prepare-gitlab-git-test-for-commit --check-for-changes - spec/support/prepare-gitlab-git-test-for-commit --check-for-changes
...@@ -1108,6 +1113,7 @@ no_ee_check: ...@@ -1108,6 +1113,7 @@ no_ee_check:
variables: variables:
SETUP_DB: "false" SETUP_DB: "false"
before_script: [] before_script: []
dependencies: []
cache: {} cache: {}
script: script:
- scripts/no-ee-check - scripts/no-ee-check
......
...@@ -479,9 +479,9 @@ GEM ...@@ -479,9 +479,9 @@ GEM
memoizable (0.4.2) memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1) thread_safe (~> 0.3, >= 0.3.1)
method_source (0.9.0) method_source (0.9.0)
mime-types (3.1) mime-types (3.2.2)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521) mime-types-data (3.2018.0812)
mimemagic (0.3.0) mimemagic (0.3.0)
mini_magick (4.8.0) mini_magick (4.8.0)
mini_mime (1.0.1) mini_mime (1.0.1)
...@@ -627,7 +627,7 @@ GEM ...@@ -627,7 +627,7 @@ GEM
get_process_mem (~> 0.2) get_process_mem (~> 0.2)
puma (>= 2.7, < 4) puma (>= 2.7, < 4)
pyu-ruby-sasl (0.0.3.3) pyu-ruby-sasl (0.0.3.3)
rack (1.6.10) rack (1.6.11)
rack-accept (0.4.5) rack-accept (0.4.5)
rack (>= 0.4) rack (>= 0.4)
rack-attack (4.4.1) rack-attack (4.4.1)
...@@ -639,7 +639,7 @@ GEM ...@@ -639,7 +639,7 @@ GEM
httpclient (>= 2.4) httpclient (>= 2.4)
multi_json (>= 1.3.6) multi_json (>= 1.3.6)
rack (>= 1.1) rack (>= 1.1)
rack-protection (2.0.3) rack-protection (2.0.4)
rack rack
rack-proxy (0.6.0) rack-proxy (0.6.0)
rack rack
...@@ -707,7 +707,7 @@ GEM ...@@ -707,7 +707,7 @@ GEM
redis-actionpack (>= 5.0, < 6) redis-actionpack (>= 5.0, < 6)
redis-activesupport (>= 5.0, < 6) redis-activesupport (>= 5.0, < 6)
redis-store (>= 1.2, < 2) redis-store (>= 1.2, < 2)
redis-store (1.4.1) redis-store (1.6.0)
redis (>= 2.2, < 5) redis (>= 2.2, < 5)
regexp_parser (0.5.0) regexp_parser (0.5.0)
representable (3.0.4) representable (3.0.4)
...@@ -833,7 +833,7 @@ GEM ...@@ -833,7 +833,7 @@ GEM
rack rack
shoulda-matchers (3.1.2) shoulda-matchers (3.1.2)
activesupport (>= 4.0.0) activesupport (>= 4.0.0)
sidekiq (5.2.1) sidekiq (5.2.3)
connection_pool (~> 2.2, >= 2.2.2) connection_pool (~> 2.2, >= 2.2.2)
rack-protection (>= 1.5.0) rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 5) redis (>= 3.3.5, < 5)
......
...@@ -575,7 +575,7 @@ GEM ...@@ -575,7 +575,7 @@ GEM
orm_adapter (0.5.0) orm_adapter (0.5.0)
os (1.0.0) os (1.0.0)
parallel (1.12.1) parallel (1.12.1)
parser (2.5.1.2) parser (2.5.3.0)
ast (~> 2.4.0) ast (~> 2.4.0)
parslet (1.8.2) parslet (1.8.2)
peek (1.0.1) peek (1.0.1)
...@@ -643,7 +643,7 @@ GEM ...@@ -643,7 +643,7 @@ GEM
httpclient (>= 2.4) httpclient (>= 2.4)
multi_json (>= 1.3.6) multi_json (>= 1.3.6)
rack (>= 1.1) rack (>= 1.1)
rack-protection (2.0.3) rack-protection (2.0.4)
rack rack
rack-proxy (0.6.0) rack-proxy (0.6.0)
rack rack
...@@ -716,7 +716,7 @@ GEM ...@@ -716,7 +716,7 @@ GEM
redis-actionpack (>= 5.0, < 6) redis-actionpack (>= 5.0, < 6)
redis-activesupport (>= 5.0, < 6) redis-activesupport (>= 5.0, < 6)
redis-store (>= 1.2, < 2) redis-store (>= 1.2, < 2)
redis-store (1.4.1) redis-store (1.6.0)
redis (>= 2.2, < 5) redis (>= 2.2, < 5)
regexp_parser (0.5.0) regexp_parser (0.5.0)
representable (3.0.4) representable (3.0.4)
...@@ -841,7 +841,7 @@ GEM ...@@ -841,7 +841,7 @@ GEM
rack rack
shoulda-matchers (3.1.2) shoulda-matchers (3.1.2)
activesupport (>= 4.0.0) activesupport (>= 4.0.0)
sidekiq (5.2.1) sidekiq (5.2.3)
connection_pool (~> 2.2, >= 2.2.2) connection_pool (~> 2.2, >= 2.2.2)
rack-protection (>= 1.5.0) rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 5) redis (>= 3.3.5, < 5)
......
...@@ -128,6 +128,7 @@ export default { ...@@ -128,6 +128,7 @@ export default {
eventHub.$once('fetchedNotesData', this.setDiscussions); eventHub.$once('fetchedNotesData', this.setDiscussions);
}, },
methods: { methods: {
...mapActions(['startTaskList']),
...mapActions('diffs', [ ...mapActions('diffs', [
'setBaseConfig', 'setBaseConfig',
'fetchDiffFiles', 'fetchDiffFiles',
...@@ -157,7 +158,13 @@ export default { ...@@ -157,7 +158,13 @@ export default {
if (this.isNotesFetched && !this.assignedDiscussions && !this.isLoading) { if (this.isNotesFetched && !this.assignedDiscussions && !this.isLoading) {
this.assignedDiscussions = true; this.assignedDiscussions = true;
requestIdleCallback(() => this.assignDiscussionsToDiff(), { timeout: 1000 }); requestIdleCallback(
() =>
this.assignDiscussionsToDiff()
.then(this.$nextTick)
.then(this.startTaskList),
{ timeout: 1000 },
);
} }
}, },
adjustView() { adjustView() {
......
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
if (search === '') return this.renderTreeList ? this.tree : this.allBlobs; if (search === '') return this.renderTreeList ? this.tree : this.allBlobs;
return this.allBlobs.filter(f => f.name.toLowerCase().indexOf(search) >= 0); return this.allBlobs.filter(f => f.path.toLowerCase().indexOf(search) >= 0);
}, },
rowDisplayTextKey() { rowDisplayTextKey() {
if (this.renderTreeList && this.search.trim() === '') { if (this.renderTreeList && this.search.trim() === '') {
......
...@@ -190,6 +190,7 @@ export const saveDiffDiscussion = ({ dispatch }, { note, formData }) => { ...@@ -190,6 +190,7 @@ export const saveDiffDiscussion = ({ dispatch }, { note, formData }) => {
.then(result => dispatch('updateDiscussion', result.discussion, { root: true })) .then(result => dispatch('updateDiscussion', result.discussion, { root: true }))
.then(discussion => dispatch('assignDiscussionsToDiff', [discussion])) .then(discussion => dispatch('assignDiscussionsToDiff', [discussion]))
.then(() => dispatch('closeDiffFileCommentForm', formData.diffFile.fileHash)) .then(() => dispatch('closeDiffFileCommentForm', formData.diffFile.fileHash))
.then(() => dispatch('startTaskList', null, { root: true }))
.catch(() => createFlash(s__('MergeRequests|Saving the comment failed'))); .catch(() => createFlash(s__('MergeRequests|Saving the comment failed')));
}; };
......
...@@ -6,7 +6,6 @@ import Autosize from 'autosize'; ...@@ -6,7 +6,6 @@ import Autosize from 'autosize';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import Flash from '../../flash'; import Flash from '../../flash';
import Autosave from '../../autosave'; import Autosave from '../../autosave';
import TaskList from '../../task_list';
import { import {
capitalizeFirstCharacter, capitalizeFirstCharacter,
convertToCamelCase, convertToCamelCase,
...@@ -146,7 +145,6 @@ export default { ...@@ -146,7 +145,6 @@ export default {
}); });
this.initAutoSave(); this.initAutoSave();
this.initTaskList();
}, },
methods: { methods: {
...mapActions([ ...mapActions([
...@@ -298,13 +296,6 @@ Please check your network connection and try again.`; ...@@ -298,13 +296,6 @@ Please check your network connection and try again.`;
]); ]);
} }
}, },
initTaskList() {
return new TaskList({
dataType: 'note',
fieldName: 'note',
selector: '.notes',
});
},
resizeTextarea() { resizeTextarea() {
this.$nextTick(() => { this.$nextTick(() => {
Autosize.update(this.$refs.textarea); Autosize.update(this.$refs.textarea);
......
...@@ -4,7 +4,6 @@ import noteEditedText from './note_edited_text.vue'; ...@@ -4,7 +4,6 @@ import noteEditedText from './note_edited_text.vue';
import noteAwardsList from './note_awards_list.vue'; import noteAwardsList from './note_awards_list.vue';
import noteAttachment from './note_attachment.vue'; import noteAttachment from './note_attachment.vue';
import noteForm from './note_form.vue'; import noteForm from './note_form.vue';
import TaskList from '../../task_list';
import autosave from '../mixins/autosave'; import autosave from '../mixins/autosave';
export default { export default {
...@@ -37,14 +36,12 @@ export default { ...@@ -37,14 +36,12 @@ export default {
}, },
mounted() { mounted() {
this.renderGFM(); this.renderGFM();
this.initTaskList();
if (this.isEditing) { if (this.isEditing) {
this.initAutoSave(this.note); this.initAutoSave(this.note);
} }
}, },
updated() { updated() {
this.initTaskList();
this.renderGFM(); this.renderGFM();
if (this.isEditing) { if (this.isEditing) {
...@@ -59,15 +56,6 @@ export default { ...@@ -59,15 +56,6 @@ export default {
renderGFM() { renderGFM() {
$(this.$refs['note-body']).renderGFM(); $(this.$refs['note-body']).renderGFM();
}, },
initTaskList() {
if (this.canEdit) {
this.taskList = new TaskList({
dataType: 'note',
fieldName: 'note',
selector: '.notes',
});
}
},
handleFormUpdate(note, parentElement, callback) { handleFormUpdate(note, parentElement, callback) {
this.$emit('handleFormUpdate', note, parentElement, callback); this.$emit('handleFormUpdate', note, parentElement, callback);
}, },
......
...@@ -46,6 +46,7 @@ export default { ...@@ -46,6 +46,7 @@ export default {
'is-requesting being-posted': this.isRequesting, 'is-requesting being-posted': this.isRequesting,
'disabled-content': this.isDeleting, 'disabled-content': this.isDeleting,
target: this.isTarget, target: this.isTarget,
'is-editable': this.note.current_user.can_edit,
}; };
}, },
canResolve() { canResolve() {
......
...@@ -122,6 +122,7 @@ export default { ...@@ -122,6 +122,7 @@ export default {
setTargetNoteHash: 'setTargetNoteHash', setTargetNoteHash: 'setTargetNoteHash',
toggleDiscussion: 'toggleDiscussion', toggleDiscussion: 'toggleDiscussion',
setNotesFetchedState: 'setNotesFetchedState', setNotesFetchedState: 'setNotesFetchedState',
startTaskList: 'startTaskList',
}), }),
getComponentName(discussion) { getComponentName(discussion) {
if (discussion.isSkeletonNote) { if (discussion.isSkeletonNote) {
...@@ -157,6 +158,7 @@ export default { ...@@ -157,6 +158,7 @@ export default {
this.isFetching = false; this.isFetching = false;
}) })
.then(() => this.$nextTick()) .then(() => this.$nextTick())
.then(() => this.startTaskList())
.then(() => this.checkLocationHash()) .then(() => this.checkLocationHash())
.catch(() => { .catch(() => {
this.setLoadingState(false); this.setLoadingState(false);
......
import Vue from 'vue';
import $ from 'jquery'; import $ from 'jquery';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import Visibility from 'visibilityjs'; import Visibility from 'visibilityjs';
import TaskList from '../../task_list';
import Flash from '../../flash'; import Flash from '../../flash';
import Poll from '../../lib/utils/poll'; import Poll from '../../lib/utils/poll';
import * as types from './mutation_types'; import * as types from './mutation_types';
...@@ -58,12 +60,13 @@ export const deleteNote = ({ commit, dispatch }, note) => ...@@ -58,12 +60,13 @@ export const deleteNote = ({ commit, dispatch }, note) =>
dispatch('updateMergeRequestWidget'); dispatch('updateMergeRequestWidget');
}); });
export const updateNote = ({ commit }, { endpoint, note }) => export const updateNote = ({ commit, dispatch }, { endpoint, note }) =>
service service
.updateNote(endpoint, note) .updateNote(endpoint, note)
.then(res => res.json()) .then(res => res.json())
.then(res => { .then(res => {
commit(types.UPDATE_NOTE, res); commit(types.UPDATE_NOTE, res);
dispatch('startTaskList');
}); });
export const replyToDiscussion = ({ commit }, { endpoint, data }) => export const replyToDiscussion = ({ commit }, { endpoint, data }) =>
...@@ -85,6 +88,7 @@ export const createNewNote = ({ commit, dispatch }, { endpoint, data }) => ...@@ -85,6 +88,7 @@ export const createNewNote = ({ commit, dispatch }, { endpoint, data }) =>
commit(types.ADD_NEW_NOTE, res); commit(types.ADD_NEW_NOTE, res);
dispatch('updateMergeRequestWidget'); dispatch('updateMergeRequestWidget');
dispatch('startTaskList');
} }
return res; return res;
}); });
...@@ -260,6 +264,8 @@ const pollSuccessCallBack = (resp, commit, state, getters, dispatch) => { ...@@ -260,6 +264,8 @@ const pollSuccessCallBack = (resp, commit, state, getters, dispatch) => {
commit(types.ADD_NEW_NOTE, note); commit(types.ADD_NEW_NOTE, note);
} }
}); });
dispatch('startTaskList');
} }
commit(types.SET_LAST_FETCHED_AT, resp.last_fetched_at); commit(types.SET_LAST_FETCHED_AT, resp.last_fetched_at);
...@@ -368,5 +374,16 @@ export const setCommentsDisabled = ({ commit }, data) => { ...@@ -368,5 +374,16 @@ export const setCommentsDisabled = ({ commit }, data) => {
commit(types.DISABLE_COMMENTS, data); commit(types.DISABLE_COMMENTS, data);
}; };
export const startTaskList = ({ dispatch }) =>
Vue.nextTick(
() =>
new TaskList({
dataType: 'note',
fieldName: 'note',
selector: '.notes .is-editable',
onSuccess: () => dispatch('startTaskList'),
}),
);
// prevent babel-plugin-rewire from generating an invalid default during karma tests // prevent babel-plugin-rewire from generating an invalid default during karma tests
export default () => {}; export default () => {};
---
title: Improve initial discussion rendering performance
merge_request: 22607
author:
type: changed
---
title: Changed merge request filtering to be by path instead of name
merge_request:
author:
type: changed
...@@ -24,9 +24,32 @@ The following files require a review from the Documentation team: ...@@ -24,9 +24,32 @@ The following files require a review from the Documentation team:
* #{docs_paths_to_review.map { |path| "`#{path}`" }.join("\n* ")} * #{docs_paths_to_review.map { |path| "`#{path}`" }.join("\n* ")}
To make sure these changes are reviewed, mention `@gl-docsteam` in a separate When your content is ready for review, mention a technical writer in a separate
comment, and explain what needs to be reviewed by the team. Please don't mention comment and explain what needs to be reviewed.
the team until your changes are ready for review.
You are welcome to mention them sooner if you have questions about writing or updating
the documentation. GitLabbers are also welcome to use the [#docs](https://gitlab.slack.com/archives/C16HYA2P5) channel on Slack.
Who to ping [based on DevOps stages](https://about.gitlab.com/handbook/product/categories/#devops-stages):
| Stage | Tech writer |
| ------------- | ----------- |
| ~Create | `@marcia` |
| ~Configure | `@eread` |
| ~Distribution | `@axil` |
| ~Geo | `@eread` |
| ~Gitaly | `@axil` |
| ~Gitter | `@axil` |
| ~Manage | `@eread` |
| ~Monitoring | `@axil` |
| ~Packaging | `@axil` |
| ~Plan | `@mikelewis`|
| ~Release | `marcia` |
| ~Secure | `@axil` |
| ~Verify | `@eread` |
If you are not sure which category the change falls within, or the change is not
part of one of these categories, you can mention the whole team with `@gl-docsteam`.
MARKDOWN MARKDOWN
unless gitlab.mr_labels.include?('Documentation') unless gitlab.mr_labels.include?('Documentation')
......
...@@ -20,7 +20,10 @@ You can use GFM in the following areas: ...@@ -20,7 +20,10 @@ You can use GFM in the following areas:
- Snippets (the snippet must be named with a `.md` extension) - Snippets (the snippet must be named with a `.md` extension)
- Wiki pages - Wiki pages
- Markdown documents inside repositories - Markdown documents inside repositories
<<<<<<< HEAD
- Epics - Epics
=======
>>>>>>> upstream/master
You can also use other rich text files in GitLab. You might have to install a You can also use other rich text files in GitLab. You might have to install a
dependency to do so. Please see the [`github-markup` gem readme](https://github.com/gitlabhq/markup#markups) for more information. dependency to do so. Please see the [`github-markup` gem readme](https://github.com/gitlabhq/markup#markups) for more information.
......
...@@ -116,7 +116,9 @@ code_quality: ...@@ -116,7 +116,9 @@ code_quality:
license_management: license_management:
stage: test stage: test
image: "registry.gitlab.com/gitlab-org/security-products/license-management:$CI_SERVER_VERSION_MAJOR-$CI_SERVER_VERSION_MINOR-stable" image:
name: "registry.gitlab.com/gitlab-org/security-products/license-management:$CI_SERVER_VERSION_MAJOR-$CI_SERVER_VERSION_MINOR-stable"
entrypoint: [""]
allow_failure: true allow_failure: true
script: script:
- license_management - license_management
......
...@@ -76,7 +76,7 @@ describe SendFileUpload do ...@@ -76,7 +76,7 @@ describe SendFileUpload do
it 'sends a file with a custom type' do it 'sends a file with a custom type' do
headers = double headers = double
expected_headers = %r(response-content-disposition=attachment%3Bfilename%3D%22test.js%22&response-content-type=application/javascript) expected_headers = %r(response-content-disposition=attachment%3Bfilename%3D%22test.js%22&response-content-type=application/ecmascript)
expect(Gitlab::Workhorse).to receive(:send_url).with(expected_headers).and_call_original expect(Gitlab::Workhorse).to receive(:send_url).with(expected_headers).and_call_original
expect(headers).to receive(:store).with(Gitlab::Workhorse::SEND_DATA_HEADER, /^send-url:/) expect(headers).to receive(:store).with(Gitlab::Workhorse::SEND_DATA_HEADER, /^send-url:/)
......
...@@ -81,7 +81,7 @@ describe('Diffs tree list component', () => { ...@@ -81,7 +81,7 @@ describe('Diffs tree list component', () => {
}); });
it('filters tree list to blobs matching search', done => { it('filters tree list to blobs matching search', done => {
vm.search = 'index'; vm.search = 'app/index';
vm.$nextTick(() => { vm.$nextTick(() => {
expect(vm.$el.querySelectorAll('.file-row').length).toBe(1); expect(vm.$el.querySelectorAll('.file-row').length).toBe(1);
......
...@@ -396,6 +396,9 @@ describe('Actions Notes Store', () => { ...@@ -396,6 +396,9 @@ describe('Actions Notes Store', () => {
{ {
type: 'updateMergeRequestWidget', type: 'updateMergeRequestWidget',
}, },
{
type: 'startTaskList',
},
], ],
done, done,
); );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment