Commit graph

20 commits

Author SHA1 Message Date
Bob Van Landuyt
1123057ab7 Feature: delegate all open discussions to Issue
When a merge request can only be merged when all discussions are
resolved. This feature allows to easily delegate those discussions to a
new issue, while marking them as resolved in the merge request.

The user is presented with a new issue, prepared with mentions of all
unresolved discussions, including the first unresolved note of the
discussion, time and link to the note.

When the issue is created, the discussions in the merge request will get
a system note directing the user to the newly created issue.
2016-12-05 20:55:45 +01:00
Sean McGivern
854fbbfb07 Tidy up text emails 2016-11-28 19:40:48 +00:00
hhoopes
a761c59a6b Add keyword arguments to truncated_diff method
* Added keyword arguments to truncated_diff_lines method to allow for using highlighting or not (html templates vs. text)
* Tweaked templates for consistency and format appropriateness
2016-11-25 15:23:49 +00:00
hhoopes
f928dba99b Change diff highlight/truncate for reusability
Previously the `truncated_diff_lines` method for outputting a discussion diff took in already highlighted lines, which meant it wasn't reuseable for truncating ANY lines. In the way it was used, it also meant that for any email truncation, the whole diff was being highlighted before being truncated, meaning wasted time highlighting lines that wouldn't even be used (granted, they were being memoized, so perhaps this wasn't that great of an issue). I refactored truncation away from highlighting, in order to truncate formatted diffs for text templates in email, using `>`s to designate each line, but otherwise retaining the parsing already done to create `diff_lines`.

Additionally, while notes on merge requests or commits had already been tested, there was no existing test for notes on a diff on an MR or commit. Added mailer tests for such, and a unit test for truncating diff lines.
2016-11-25 15:23:49 +00:00
Alejandro Rodríguez
ea155ccc3e Optimize discussion notes resolving and unresolving
Use `update_all` to only require one query per discussion to
update the notes resolved status. Some changes had to be made to
the discussion spec to accout for the fact that notes are not
individually updated now
2016-09-06 12:14:09 -03:00
Douwe Maan
080924f979 Fix bug where notes weren’t shown in discussion when the code had changed after creation 2016-08-19 12:38:40 -05:00
Douwe Maan
4a13aa9f34 Store discussion_id on Note for faster discussion lookup. 2016-08-17 12:16:46 -05:00
Douwe Maan
41007f6d3c Address review feedback 2016-08-16 11:04:26 -05:00
Douwe Maan
f48642e260 Add specs for Discussion and MergeRequest models 2016-08-12 15:49:36 -05:00
Douwe Maan
538e66d71c Merge branch 'master' into diff-line-comment-vuejs
# Conflicts:
#	app/models/discussion.rb
#	db/schema.rb
2016-08-03 15:32:00 -07:00
Paco Guzman
8716ff7f63 Speedup DiffNote#active? on discussions, preloading noteables and avoid touching git repository to return diff_refs when possible
- Preloading noteable we share the same noteable instance when more than one 
discussion refers to the same noteable.
- Any other call to that object that is cached in that object will be for any 
discussion.
- In those cases where merge_request_diff has all the sha stored to build a diff_refs get that 
diff_refs using directly those sha instead accessing to the git repository to first get the 
commits and later the sha.
2016-08-02 16:04:15 +02:00
Douwe Maan
d9a949c17c Use correct user for 'Discussion resolved by...' 2016-07-28 21:14:45 -06:00
Phil Hughes
b53ccd112d Fixed close merge request not hiding 2016-07-27 10:17:05 +01:00
Douwe Maan
c6d96fdfbc Fix Discussion#resolved? to be false for commit discussions 2016-07-26 16:48:33 -06:00
Douwe Maan
b3180d3486 Add resolved and last updated status to collapsed discussions 2016-07-25 22:49:21 -06:00
Douwe Maan
d76d051b22 Collapse/hide resolved discussions 2016-07-25 22:46:13 -06:00
Douwe Maan
ed6c8238f3 Add access checks for diff note and discussion resolution 2016-07-25 22:40:44 -06:00
Douwe Maan
bbab5d014f Add methods to resolve diff notes and discussions 2016-07-25 22:37:22 -06:00
Douwe Maan
c9aee48ced Add resolved methods on Discussion 2016-07-25 22:36:03 -06:00
Douwe Maan
79214be727 Add Discussion model to represent MR/diff discussion 2016-07-20 16:18:18 -06:00