diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-07 21:08:39 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-07 21:08:39 +0000 |
commit | 0c6bc5443aa6c8f3e4becccb89fc0f135b4c64c8 (patch) | |
tree | 55f13e752e9061c1800cce510a52fc78b13282ca /app/assets/javascripts/notes | |
parent | d7ce7307dca551759ffa972015875f8ebe476927 (diff) | |
download | gitlab-ce-0c6bc5443aa6c8f3e4becccb89fc0f135b4c64c8.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/notes')
5 files changed, 9 insertions, 9 deletions
diff --git a/app/assets/javascripts/notes/components/comment_form.vue b/app/assets/javascripts/notes/components/comment_form.vue index 4ca32b9b005..9a809b71a58 100644 --- a/app/assets/javascripts/notes/components/comment_form.vue +++ b/app/assets/javascripts/notes/components/comment_form.vue @@ -1,7 +1,7 @@ <script> import $ from 'jquery'; import { mapActions, mapGetters, mapState } from 'vuex'; -import _ from 'underscore'; +import { isEmpty } from 'lodash'; import Autosize from 'autosize'; import { __, sprintf } from '~/locale'; import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue'; @@ -161,7 +161,7 @@ export default { 'toggleStateButtonLoading', ]), setIsSubmitButtonDisabled(note, isSubmitting) { - if (!_.isEmpty(note) && !isSubmitting) { + if (!isEmpty(note) && !isSubmitting) { this.isSubmitButtonDisabled = false; } else { this.isSubmitButtonDisabled = true; diff --git a/app/assets/javascripts/notes/components/diff_discussion_header.vue b/app/assets/javascripts/notes/components/diff_discussion_header.vue index 4c9075912ee..50d224a2f08 100644 --- a/app/assets/javascripts/notes/components/diff_discussion_header.vue +++ b/app/assets/javascripts/notes/components/diff_discussion_header.vue @@ -1,6 +1,6 @@ <script> import { mapActions } from 'vuex'; -import _ from 'underscore'; +import { escape } from 'lodash'; import { s__, __, sprintf } from '~/locale'; import { truncateSha } from '~/lib/utils/text_utility'; @@ -45,7 +45,7 @@ export default { return this.notes.length > 1 ? this.lastNote.created_at : null; }, headerText() { - const linkStart = `<a href="${_.escape(this.discussion.discussion_path)}">`; + const linkStart = `<a href="${escape(this.discussion.discussion_path)}">`; const linkEnd = '</a>'; const { commit_id: commitId } = this.discussion; diff --git a/app/assets/javascripts/notes/components/noteable_note.vue b/app/assets/javascripts/notes/components/noteable_note.vue index b3dae69d0bc..dea782683f2 100644 --- a/app/assets/javascripts/notes/components/noteable_note.vue +++ b/app/assets/javascripts/notes/components/noteable_note.vue @@ -1,7 +1,7 @@ <script> import $ from 'jquery'; import { mapGetters, mapActions } from 'vuex'; -import { escape } from 'underscore'; +import { escape } from 'lodash'; import draftMixin from 'ee_else_ce/notes/mixins/draft'; import { truncateSha } from '~/lib/utils/text_utility'; import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue'; diff --git a/app/assets/javascripts/notes/components/toggle_replies_widget.vue b/app/assets/javascripts/notes/components/toggle_replies_widget.vue index f1b0b12bdce..dd132d4f608 100644 --- a/app/assets/javascripts/notes/components/toggle_replies_widget.vue +++ b/app/assets/javascripts/notes/components/toggle_replies_widget.vue @@ -1,5 +1,5 @@ <script> -import _ from 'underscore'; +import { uniqBy } from 'lodash'; import Icon from '~/vue_shared/components/icon.vue'; import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; @@ -27,7 +27,7 @@ export default { uniqueAuthors() { const authors = this.replies.map(reply => reply.author || {}); - return _.uniq(authors, author => author.username); + return uniqBy(authors, author => author.username); }, className() { return this.collapsed ? 'collapsed' : 'expanded'; diff --git a/app/assets/javascripts/notes/stores/getters.js b/app/assets/javascripts/notes/stores/getters.js index 35398999abc..4f8ff8240b2 100644 --- a/app/assets/javascripts/notes/stores/getters.js +++ b/app/assets/javascripts/notes/stores/getters.js @@ -1,4 +1,4 @@ -import _ from 'underscore'; +import { flattenDeep } from 'lodash'; import * as constants from '../constants'; import { collapseSystemNotes } from './collapse_utils'; @@ -50,7 +50,7 @@ const isLastNote = (note, state) => !note.system && state.userData && note.author && note.author.id === state.userData.id; export const getCurrentUserLastNote = state => - _.flatten(reverseNotes(state.discussions).map(note => reverseNotes(note.notes))).find(el => + flattenDeep(reverseNotes(state.discussions).map(note => reverseNotes(note.notes))).find(el => isLastNote(el, state), ); |