diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-27 00:07:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-27 00:07:57 +0300 |
commit | 2ff7b07dbc1f16c5cb70f8484d061b0a00005985 (patch) | |
tree | 5f34fb50dd223ab91ed1080db8a71847af562a36 /app/assets/javascripts/mr_notes | |
parent | 5f825c2edec69e9a23e100c949c6c40e88ae5235 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/mr_notes')
-rw-r--r-- | app/assets/javascripts/mr_notes/init.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/assets/javascripts/mr_notes/init.js b/app/assets/javascripts/mr_notes/init.js index e8e3376cee2..28f294589ae 100644 --- a/app/assets/javascripts/mr_notes/init.js +++ b/app/assets/javascripts/mr_notes/init.js @@ -1,12 +1,13 @@ -import { parseBoolean } from '~/lib/utils/common_utils'; +import { parseBoolean, getCookie } from '~/lib/utils/common_utils'; import mrNotes from '~/mr_notes/stores'; -import { getLocationHash } from '~/lib/utils/url_utility'; +import { getLocationHash, getParameterValues } from '~/lib/utils/url_utility'; import eventHub from '~/notes/event_hub'; import { initReviewBar } from '~/batch_comments'; import { initDiscussionCounter } from '~/mr_notes/discussion_counter'; import { initOverviewTabCounter } from '~/mr_notes/init_count'; import { getDerivedMergeRequestInformation } from '~/diffs/utils/merge_request'; import { getReviewsForMergeRequest } from '~/diffs/utils/file_reviews'; +import { DIFF_VIEW_COOKIE_NAME, INLINE_DIFF_VIEW_TYPE } from '~/diffs/constants'; function setupMrNotesState(store, notesDataset, diffsDataset) { const noteableData = JSON.parse(notesDataset.noteableData); @@ -37,6 +38,8 @@ function setupMrNotesState(store, notesDataset, diffsDataset) { viewDiffsFileByFile: parseBoolean(diffsDataset.fileByFileDefault), defaultSuggestionCommitMessage: diffsDataset.defaultSuggestionCommitMessage, mrReviews: getReviewsForMergeRequest(mrPath), + diffViewType: + getParameterValues('view')[0] || getCookie(DIFF_VIEW_COOKIE_NAME) || INLINE_DIFF_VIEW_TYPE, }); } |