Commit Graph

187 Commits

Author SHA1 Message Date
Filipa Lacerda fe10964a68 Merge branch 'fix-diffs-not-rendering' into 'master'
Fix diff files not rendering

See merge request gitlab-org/gitlab-ce!25358
2019-02-18 16:19:19 +00:00
Phil Hughes 512f9624fa
Fix diff files not rendering
Fixes some diff files not rendering when the renderIt
property is updated.
Previously it was using a local copy of renderIt which meant
Vue wouldn't update it when the files renderIt property was updates
2019-02-18 15:16:04 +00:00
Filipa Lacerda fea813ab93 Merge branch 'diff-tree-resizable' into 'master'
Make the file tree in merge requests resizable

Closes #51857

See merge request gitlab-org/gitlab-ce!25097
2019-02-18 12:53:03 +00:00
Natalia Tepluhina bf8f32da7f Replaced part of diff file properties with diff viewer
- replaced file.too_large
- replaced file.text
- replaced file.collapsed
2019-02-15 17:56:50 +00:00
Phil Hughes d17de657fe
Make the file tree in merge requests resizable
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51857
2019-02-15 10:33:33 +00:00
Phil Hughes a64bc0c1cd
Fixed diff rendering causing a duplicate key warning
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56797
2019-02-13 11:06:43 +00:00
Phil Hughes 81597427d0 Merge branch '52347-lines-changed-statistics-is-not-easily-visible-in-mr-changes-view' into 'master'
Resolve "Lines changed statistics is not easily visible in MR changes view"

Closes #52347

See merge request gitlab-org/gitlab-ce!24569
2019-02-07 08:05:53 +00:00
Sam Bigelow 2a2f48a5b1 Clearly display diff statistics for MRs
Put the statistics in the compare-versions header for the entire MR
Put them in the file header for each individual file
2019-02-06 11:11:09 -06:00
Phil Hughes 6e5461d67f
Added fuzzy file finder to merge requests
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53304
2019-02-05 11:29:49 +00:00
Filipa Lacerda e055f7d3ca Merge branch 'diff-fix-folder-path-commas' into 'master'
Fixed diff tree folders being rendered incorrectly

See merge request gitlab-org/gitlab-ce!24635
2019-01-25 09:36:50 +00:00
Phil Hughes f10d75ecf6
Fixed diff tree folders being rendered incorrectly 2019-01-24 16:14:14 +00:00
Phil Hughes 2f40aa68d9
Added dropdown for diff settings
Dropdown includes buttons for tree view rendering mode
and buttons for the compare view (inline or side-by-side)

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/55491
2019-01-24 14:48:03 +00:00
Douwe Maan 03df54b226
Trim first char of diff line text on diff discussions
Before, diff file `higlighted_diff_lines`/`parallel_diff_lines` and
diff discussion `truncated_diff_lines` were inconsistent: `text` and
`rich_text` on the latter included the leading +/-/<space> character,
like on the backend, while the former had no `text` and its `rich_text`
had dropped this char.

This resulted in a bug when the suggestions feature expected these diff
line objects to be identical in format and thus interchangeable, which
was not the case.
2019-01-22 17:00:16 +01:00
Sam Bigelow a0146dceb6 Resolve "Merge request file browser should always be possible show/hide" 2019-01-22 08:29:41 +00:00
Filipa Lacerda 75ead9a4f3 Merge branch 'diff-tree-collapse-directories' into 'master'
Collapses directory structure in merge request tree

Closes #53069

See merge request gitlab-org/gitlab-ce!24392
2019-01-18 11:19:32 +00:00
Phil Hughes 24b98a8793
Added specs for mutations & utils methods 2019-01-16 17:24:05 +00:00
Natalia Tepluhina 7407dfdc20 Resolve "In Merge Request diff screen, master is not a hyperlink" 2019-01-16 13:18:10 +00:00
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
Tim Zallmann 30038a40b0 Fixed Data Attribute Test 2019-01-06 15:57:15 +01:00
Tim Zallmann 7b325fa60c Added Spec for Vue Commit Item 2019-01-06 08:59:39 +01: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
Fatih Acet 2f4fe2b503 Merge branch 'inline-duplicated-discussions' into 'master'
Fixed duplicated inline diff discussions

Closes #55388

See merge request gitlab-org/gitlab-ce!23843
2018-12-17 12:51:50 +00:00
Nick Thomas 8d2e1b724b Merge branch '54786-mr-empty-file-display' into 'master'
Display empty files properly on MR diffs

Closes #54786

See merge request gitlab-org/gitlab-ce!23671
2018-12-15 12:21:54 +00: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
Sean Nichols 9f9eb03f3d Fix diff table rendering for empty files and improve tests 2018-12-13 23:52:31 -05:00
Oswaldo Ferreira ed3034bbb7 Allow suggesting single line changes in diffs 2018-12-13 19:17:19 +00:00
Phil Hughes ee2f3cac35
Fix diff changes empty state
The empty state now only gets shown when no files exist in the branch.
If the user is reviewing 2 versions with no files, we don't show the state.

Refactors the diff app spec to use Vue test utils.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/48635
2018-12-13 10:57:45 +00:00
Sean Nichols 4d2448e03a Add tests and move empty file message into own component 2018-12-13 01:49:32 -05: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
Oswaldo Ferreira 26b94bcc7d Remove unused data from discussions endpoint
We don't need a series of attributes to render diff files on
discussions.json request. Therefore this MR removes lots of unnecessary
attributes from the request, mainly the highlighted diff lines, which
are pretty expensive.
2018-12-06 17:07:49 -08: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
Filipa Lacerda 2cd710732e Merge branch 'expand-diff-bug' into 'master'
Fixed diff files not expanding

Closes #54868

See merge request gitlab-org/gitlab-ce!23555
2018-12-05 09:11:31 +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
Phil Hughes 7aa8803083 Updated variable name to forceExpanded 2018-12-04 13:27:18 +00:00
Phil Hughes b8ee8c2787
Fixed multiple diff line discussions not expanding
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53600
2018-12-04 10:58:02 +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
Phil Hughes 93c614ce92
Show toggle tree button on merge request commits
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53019
2018-11-22 12:04:18 +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
Phil Hughes 8e265bc359
Fix collapsed files not fully fully expanding
This fixes files that are collapsed by default not expanding
when the expand all button is clicked.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53866
2018-11-13 13:42:04 +00:00
Douwe Maan 56834e6bb2 Merge branch 'osw-comment-on-any-line-on-diffs-w-feature-flag' into 'master'
Comment on any expanded diff line on MRs (with feature-flag)

Closes #13950

See merge request gitlab-org/gitlab-ce!22914
2018-11-12 15:36:48 +00:00
Phil Hughes eaca2033d5
Changed diff tree filtering to path
Previously it was using name which could make it hard
to filter for the file you want in a certain folder.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53781
2018-11-12 14:42:22 +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 35faecb06b
Restored width & height properties 2018-11-06 10:17:59 +00: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
Jacques Erasmus 4508343d16 Fix broken "Show whitespace changes" button on MR "Changes" tab 2018-10-29 16:16:40 +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
Mike Greiling f666026d71
Prettify all spec files 2018-10-17 11:18:17 -05:00
Johann Hubert Sonntagbauer 6f5723a169 enable jasmine/new-line-before-expect 2018-10-17 06:57:29 +02:00
Jacques Erasmus a577cfcbb2 Fix broken file name navigation on MRs 2018-10-11 22:32:28 +00:00
Johann Hubert Sonntagbauer db4c1f665f enable jasmine/prefer-jasmine-matcher 2018-10-09 20:30:03 +02:00
Oswaldo Ferreira caf10464c0 Fix LFS uploaded images not being rendered 2018-10-05 22:36:20 +00:00
Fatih Acet d7a3ccb4ce Merge branch '49329-mr-show-commit-details' into 'master'
Add signature badge and pipeline status to commit details in MR diff

Closes #49329

See merge request gitlab-org/gitlab-ce!22079
2018-10-04 11:37:33 +00: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
Mike Greiling dfb9ac3a5f Merge branch '_acet-fix-diff-file-header' into 'master'
Fix showing diff file header for renamed files

Closes #48887

See merge request gitlab-org/gitlab-ce!22089
2018-10-03 20:54:04 +00:00
Fatih Acet 8aedb71c49
Fix showing diff file header for renamed files 2018-10-03 21:37:54 +02:00
Paul Slaughter becb86ea4e Add pipeline status to diffs/commit_item
**Notes:**
- Also exposes commit.pipeline_status_path in diffs.json
2018-10-03 13:18:21 -05:00
Paul Slaughter 5a286eb7a3 Add signature badge to diffs/commit_item
**Notes:**
- Also exposes commit.signature_html in diffs.json
2018-10-03 13:18:20 -05: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
Paul Slaughter f390184249 Resolve "Commit details are not displayed when reviewing an MR commit by commit" 2018-09-26 08:28:50 +00: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
Paul Slaughter ae5600b868 Create specs for diffs/components/app and update modules to export factory functions 2018-09-14 08:25:13 +00:00
André Luís 06025e4a26 Display click to expand on collapsed diffs 2018-09-13 12:34:18 +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
Mike Greiling 6d1b585034 Merge branch 'tz-mr-new-datastructure' into 'master'
Vue MR Page - Data structure update

See merge request gitlab-org/gitlab-ce!21062
2018-09-07 23:27:24 +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 d4d5ed59f9 Fixes based on MR discussion around naming, mutations, handling of state 2018-09-07 16:20:57 +02:00
Jan Provaznik d95c1f0335 Use ResourceLabelEvent for tracking label changes 2018-09-07 13:39:20 +00: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