diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 12:08:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 12:08:51 +0300 |
commit | 38149afcf95e7669a7a99828c579d185b70c04dc (patch) | |
tree | 3a90504bd926407c0cc60f44e20dba08217b928b /app/assets/javascripts/diffs/store | |
parent | be660fe1d28a65ad61be24c71e66ae90f6488dc4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/diffs/store')
-rw-r--r-- | app/assets/javascripts/diffs/store/utils.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/assets/javascripts/diffs/store/utils.js b/app/assets/javascripts/diffs/store/utils.js index 29133c814ea..9c788e283b9 100644 --- a/app/assets/javascripts/diffs/store/utils.js +++ b/app/assets/javascripts/diffs/store/utils.js @@ -1,4 +1,4 @@ -import _ from 'underscore'; +import { property, isEqual } from 'lodash'; import { truncatePathMiddleToLength } from '~/lib/utils/text_utility'; import { diffModes, diffViewerModes } from '~/ide/constants'; import { @@ -442,7 +442,7 @@ export function isDiscussionApplicableToLine({ discussion, diffPosition, latestD const originalRefs = discussion.original_position; const refs = discussion.position; - return _.isEqual(refs, diffPositionCopy) || _.isEqual(originalRefs, diffPositionCopy); + return isEqual(refs, diffPositionCopy) || isEqual(originalRefs, diffPositionCopy); } // eslint-disable-next-line @@ -578,10 +578,10 @@ export const convertExpandLines = ({ for (let i = 0, diffLinesLength = diffLines.length; i < diffLinesLength; i += 1) { const line = diffLines[i]; - if (_.property(typeKey)(line) === 'match') { + if (property(typeKey)(line) === 'match') { const beforeLine = diffLines[i - 1]; const afterLine = diffLines[i + 1]; - const newLineProperty = _.property(newLineKey); + const newLineProperty = property(newLineKey); const beforeLineIndex = newLineProperty(beforeLine) || 0; const afterLineIndex = newLineProperty(afterLine) - 1 || dataLength; @@ -589,7 +589,7 @@ export const convertExpandLines = ({ ...data.slice(beforeLineIndex, afterLineIndex).map((l, index) => mapLine({ line: Object.assign(l, { hasForm: false, discussions: [] }), - oldLine: (_.property(oldLineKey)(beforeLine) || 0) + index + 1, + oldLine: (property(oldLineKey)(beforeLine) || 0) + index + 1, newLine: (newLineProperty(beforeLine) || 0) + index + 1, }), ), |