Commit Graph

69 Commits

Author SHA1 Message Date
Phil Hughes 12edecd002
Add headers to files in the tree list on merge requests
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54807
2019-01-08 09:31:23 +00:00
Phil Hughes 70ba4ba285 Merge branch '51606-expanding-a-diff-while-having-an-open-comment-form-will-always-scroll-down-to-the-comment' into 'master'
Resolve "Expanding a diff while having an open comment form will always scroll down to the comment"

Closes #51606

See merge request gitlab-org/gitlab-ce!23849
2018-12-20 09:32:56 +00:00
Sam Bigelow 9c18798275 Utilize :key to minimize extra rerenders
The diff notes automatically focus on mount, and when using the index
(as opposed to line_code) for the v-bind:key, the comment form gets
unnecessarily remounted, and therefore refocused.
2018-12-17 20:25:41 -05:00
Phil Hughes e64c9c2112
Fixed duplicated inline diff discussions
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/55388
2018-12-14 21:32:41 +00:00
Phil Hughes efbb950131
Added test 2018-12-12 19:45:23 +00:00
Phil Hughes 210e90dfce
Fixed notes not being applied to diff lines
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/55248, https://gitlab.com/gitlab-org/gitlab-ce/issues/55245
2018-12-12 19:29:48 +00:00
André Luís 85daddbec9 Resolve "Navigating unresolved discussions on Merge Request page" 2018-12-08 07:19:03 +00:00
Mike Greiling 7c4e996c74 Merge branch 'winh-merge-request-diff-discussion-commit-id' into 'master'
Pass commit when posting diff discussions

See merge request gitlab-org/gitlab-ce!23371
2018-12-07 09:06:14 +00:00
Phil Hughes 2ed65be1c3
Fixed renamed and mode changed diff viewers
Renders mode changed and renamed file merge request diff
viewers on the frontend.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52607
2018-12-06 14:39:29 +00:00
Winnie Hellmann e7439c3104 Pass commit when posting diff discussions 2018-12-05 22:36:51 +01:00
Filipa Lacerda cfe484795d Merge branch 'diff-expand-commit-file' into 'master'
Fixed expanding diff commit files

Closes #50662

See merge request gitlab-org/gitlab-ce!23591
2018-12-05 18:04:35 +00:00
Phil Hughes d3a8fb6e79
Fixed expanding diff commit files
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/50662
2018-12-05 14:12:51 +00:00
Phil Hughes 6dfede5a6d
Fixed multiple discussions getting added to diff lines
Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/8195
2018-12-05 11:42:41 +00:00
Phil Hughes 9afc3069b0
Fixed diff files not expanding
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54868
2018-12-04 17:51:57 +00:00
Sam Bigelow 44a0121ad4 Resolve "Merge request refactor does not highlight selected line" 2018-11-30 08:48:47 +00:00
Phil Hughes adf8ad9eee
Improve discussion rendering performance
Improve the renderign of new and existing discussions
by reducing the number of watchers on each object & array.
Previously every discussion change would trigger an update for every
discussion component.

Also tidied up some components to get them closer to our docs.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51506
2018-11-27 11:40:39 +00:00
George Tsiolis 4a2b19706c Rename diffs store variable 2018-11-15 18:16:27 +02:00
Phil Hughes 234563ba30
Made diff & note data consistent
This caused many pain points when working with it.
Part of the data was camel cased the other snake case.
Other parts where snake case & then getting converted in components,
this conversion has the potential for leaking memory.

This changes that & makes it consistent with what it returned from the
API, snake case.
2018-11-14 19:16:46 +00:00
Oswaldo Ferreira f9b4130bb7 Comment on any expanded diff line on MRs 2018-11-09 16:56:48 -02:00
Oswaldo Ferreira 198402b38b Revert "Merge branch 'osw-comment-on-any-line-on-diffs' into 'master'"
This reverts commit a82a595728, reversing
changes made to e7df959b8f.
2018-11-07 19:57:26 -02:00
Phil Hughes e354a64e89
Show expand all button on merge request diffs
This restores the behaviour of showing the expand all button on diffs
even when only a single file is collapsed.
Previously the button would only show when all files are collapsed.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51737
2018-11-07 13:03:13 +00:00
Douwe Maan a82a595728 Merge branch 'osw-comment-on-any-line-on-diffs' into 'master'
Comment on any expanded diff line on MRs

See merge request gitlab-org/gitlab-ce!22398
2018-11-07 11:56:46 +00:00
Oswaldo Ferreira ec66ef1b74 Comment on any expanded diff line on MRs 2018-11-06 17:39:31 -02:00
Phil Hughes f7df9ddb52
Re-implemented image commenting on diffs
This re-implements image commenting in merge request diffs.
This feature was previously lost when the merge request
page was refactored into Vue.

With this, we create an overlay component. The overlay
component handles displaying the comment badges
and the comment form badge.
Badges are displayed based on the position attribute
sent with the discussion.

Comment forms for diff files are controlled through
a different state property. This is so we don't
tie comment forms to diff files directly creating
deep nested state. Instead we create a flat array
which holds the file hash & the X & Y position of
the comment form.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/48956
2018-11-05 14:02:41 +00:00
Phil Hughes 605e7fddc8
Fixes diff discussions not being fully removed
This fixes a bug where a discussion on a none changed line
would not get fully removed and therefore leave the comment row
empty. This was caused by the discussiob being added
to the right when it shouldnt of been

This also fixes a very rare edge case where discussions would get added
twice to diff lines causing a Vue rendering warning

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53317
2018-10-30 10:41:25 +00:00
Phil Hughes 81944ec925
Fixed action & mutation specs 2018-10-25 12:57:08 +01:00
Phil Hughes 80a689fab8
Impove diff discussion data
Pre-request to https://gitlab.com/gitlab-org/gitlab-ce/issues/48956
2018-10-24 13:30:30 +01:00
Phil Hughes 9fd5a78d8b
Fixed failing specs
Added tests to file row truncated text computed prop
2018-10-23 09:12:37 +01:00
Phil Hughes 2d00e7fce5
Add list mode to file browser in diffs
This adds toggle buttons to switch between file & tree list.
For file list, it renders the truncated paths with the ellipsis
at the start of the path.

When focusing the input, it hides the toggle buttons.
On blur, the buttons get shown again.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51859
2018-10-23 09:12:36 +01:00
Johann Hubert Sonntagbauer 6f5723a169 enable jasmine/new-line-before-expect 2018-10-17 06:57:29 +02:00
Phil Hughes 14ed916cf2 Merge branch '51958-fix-mr-discussion-loading' into 'master'
Fix MR discussion not loaded issue

Closes #51958

See merge request gitlab-org/gitlab-ce!21982
2018-10-04 07:37:24 +00:00
Phil Hughes 33c4c5b8f3
Added file tree to merge request diffs
This file tree displays all the diff files in a tree like format
Each file is taken and converted into a tree with folders
Each folder can be toggled open & closed
Clicking a file will scroll to the diff file & highlight with a glow affect

Searching the tree list will search only files & return a list of the
files without any folders

Each file row contains an icon to show changed, new file or deleted
Each row will also contain the added & removed lines count

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/14249
2018-10-03 10:05:43 +01:00
Mark Chao f09303b00a Fix MR discussion not loaded issue
Display `formatter` as the sole content of `position` object.
This means `diff_file` data is not referenced, which is the
caseu of "IOError: not opened for reading".
2018-10-01 22:37:43 +08:00
Phil Hughes f1a3eff8d5 Fixed utils spec 2018-09-21 11:59:45 +01:00
Phil Hughes 78f64e83ab Changed `true` string to a boolean
Fixed toBeTruthy to toBe(true) in spec
2018-09-21 11:59:44 +01:00
Phil Hughes e3cc9d53d2 Fixed karma spec for getNoteFormData
Fixed toggling new notes caused by not returning the stores discussion
2018-09-21 11:59:44 +01:00
Phil Hughes 2497c29ef0 Use returned discussion from API
We now use the returned discussion instead of re-fetching
all of the discussions and filtering out the ones we don't need.
This speeds up the process of creating a diff discussions
by saving us another API request before we can render the discussion
2018-09-21 11:59:41 +01:00
André Luís 38beacc926 Resolve "Link to file in Changes tab of MR no longer works for all files after incremental rendering improvement" 2018-09-20 08:21:17 +00:00
Phil Hughes 90673dbcb8
Changed isDiscussionApplicableToLine to accept an object 2018-09-18 16:27:53 +01:00
Phil Hughes c48f0c1aed
Added specs to isDiscussionApplicableToLine
It now tests for the latest diff check
2018-09-17 10:49:41 +01:00
Phil Hughes 5eef5f242a
Updated LegacyDiffNote logic 2018-09-17 09:50:38 +01:00
Phil Hughes ef4e3b6ed3
Moved legacy diff note check into util method
Un-commented out expect checks in mutation spec
2018-09-17 09:50:37 +01:00
Phil Hughes f9e290b9db
Fixed diff store actions spec
Updated diff mutations and utils spec to check for legacy notes
2018-09-17 09:50:37 +01:00
Tim Zallmann 12b48e61af Resolve "On master, inline diff view contains extra `+` and `-` signs" 2018-09-10 08:50:41 +00:00
André Luís 04c0d12d1a Resolve "Merge requests show outdated discussions on changes tab" 2018-09-08 06:37:41 +00:00
Tim Zallmann d2cbe07398 Adapted so utils + actions don't include any mutations and mutations are always against state 2018-09-07 17:13:11 +02:00
Tim Zallmann 982da16bf2 Made the discussion tests artificial to have them stable, mocked RAF + RIC 2018-09-07 12:25:50 +02:00
Tim Zallmann b8ecb2c7eb Added new tests for newly added mutations, actions, utils 2018-09-07 12:25:50 +02:00
Tim Zallmann a0dc392362 Fix Linting Error 2018-09-07 12:25:50 +02:00
Tim Zallmann d3cf0c247b Fix for Karma, Static Analysis and RSPec for MR Page 2018-09-07 12:25:50 +02:00