Commit Graph

83 Commits

Author SHA1 Message Date
Jarka Kadlecova 8c3a03c1b9 Display comments for personal snippets 2017-05-02 13:07:53 +02:00
Douwe Maan 09330dd17c Remove unused code 2017-04-05 12:56:31 -05:00
Douwe Maan 21e10888c3
Address review comments 2017-04-05 17:44:14 +01:00
Douwe Maan fe26b8af94
Correctly display multiple separate discussions on the same diff line 2017-04-05 17:44:14 +01:00
Douwe Maan bb8cc94668
Don't use original_discussion_id 2017-04-05 17:44:14 +01:00
Douwe Maan 79889a6aa3
Add specs 2017-04-05 17:44:14 +01:00
Douwe Maan 9c30b0e918
Fix some specs 2017-04-05 17:44:14 +01:00
Douwe Maan 08bbb9fce6
Add option to start a new discussion on an MR 2017-04-05 17:44:14 +01:00
Adam Niedzielski 0a31efb577 Remove query parameters from notes polling endpoint to make caching easier 2017-03-01 16:34:28 +01:00
mhasbini 9f949d4e24 add /award slash command
add /award slash command; Allow posting of just an emoji in comment
2017-02-28 22:38:19 +02:00
dixpac 0dacf3c169 Fix inconsistent naming for services that delete things
* Changed name of delete_user_service and worker to destroy
* Move and change delete_group_service to Groups::DestroyService
* Rename Notes::DeleteService to Notes::DestroyService
2017-02-08 09:16:43 +01:00
Jarka Kadlecova 7ab3dd4b30 support `/merge` slash comand for MRs 2017-01-11 08:48:07 -05:00
Douwe Maan 12db4cc0e7 Merge branch 'jej-note-search-uses-finder' into 'security'
Fix missing Note access checks in by moving Note#search to updated NoteFinder

Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867

## Which fixes are in this MR?

⚠️ - Potentially untested  
💣 - No test coverage  
🚥 - Test coverage of some sort exists (a test failed when error raised)  
🚦 - Test coverage of return value (a test failed when nil used)  
 - Permissions check tested

### Note lookup without access check

- [x]  app/finders/notes_finder.rb:13 :download_code check
- [x]  app/finders/notes_finder.rb:19 `SnippetsFinder`
- [x]  app/models/note.rb:121 [`Issue#visible_to_user`]
- [x]  lib/gitlab/project_search_results.rb:113
  - This is the only use of `app/models/note.rb:121` above, but importantly has no access checks at all. This means it leaks MR comments and snippets when those features are `team-only` in addition to the issue comments which would be fixed by `app/models/note.rb:121`.
  - It is only called from SearchController where `can?(current_user, :download_code, @project)` is checked, so commit comments are not leaked.

### Previous discussions
- [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#b915c5267a63628b0bafd23d37792ae73ceae272_13_13 `: download_code` check on commit
- [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#b915c5267a63628b0bafd23d37792ae73ceae272_19_19 `SnippetsFinder` should be used
  - `SnippetsFinder` should check if the snippets feature is enabled -> https://gitlab.com/gitlab-org/gitlab-ce/issues/25223

###  Acceptance criteria met?
- [x] Tests added for new code
- [x] TODO comments removed
- [x] Squashed and removed skipped tests
- [x] Changelog entry
- [ ] State Gitlab versions affected and issue severity in description
- [ ] Create technical debt issue for NotesFinder.
  - Either split into `NotesFinder::ForTarget` and `NotesFinder::Search` or consider object per notable type such as `NotesFinder::OnIssue`. For the first option could create `NotesFinder::Base` which is either inherited from or which can be included in the other two.
  - Avoid case statement anti-pattern in this finder with use of `NotesFinder::OnCommit` etc. Consider something on the finder for this? `Model.finder(user, project)`
  - Move `inc_author` to the controller, and implement `related_notes` to replace `non_diff_notes`/`mr_and_commit_notes`

See merge request !2035
2016-12-15 11:40:12 -03:00
Douwe Maan ba5e98bb70 Backport Note#commands_changes from EE 2016-11-24 14:32:32 +08:00
Ruben Davila 452d1d0824 Backport some changes done from Time Tracking feature in EE. 2016-11-18 21:19:04 -05:00
Douwe Maan 579951720a Merge branch 'diff-line-comment-vuejs' into 'master'
Diff line comments resolve

## What does this MR do?

Diff line comments can be resolved.

Part of #10325 

To do:

- [x] Backend (@DouweM)
  - [x] Fix https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5022#note_13319326. Will be made easier by https://gitlab.com/gitlab-org/gitlab-ce/issues/17237#note_13370331
  - [x] System note when all discussions are resolved
  - [x] Notification when all discussions are resolved
  - [x] Write unit tests
  - [x] Look at resolve time https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5022#note_13912743 - Fixed by 4a13aa9
- [x] Frontend (@iamphill)
  - [x] Fix bugs
  - [x] Write more feature tests 
- [x] Frontend (@connorshea)
  - [x] Address frontend feedback
  - [x] Feature specs for Jump feature
  - [x] Documentation
  - [x] Add Vue.js in a standard way

See merge request !5022
2016-08-19 02:24:34 +00:00
Douwe Maan 41007f6d3c Address review feedback 2016-08-16 11:04:26 -05:00
Rémy Coutable 0eea8c8857 Support slash commands in noteable description and notes
Some important things to note:

- commands are removed from noteable.description / note.note
- commands are translated to params so that they are treated as normal
  params in noteable Creation services
- the logic is not in the models but in the Creation services, which is
  the right place for advanced logic that has nothing to do with what
  models should be responsible of!
- UI/JS needs to be updated to handle notes which consist of commands
  only
- the `/merge` command is not handled yet

Other improvements:

- Don't process commands in commit notes and display a flash is note is only commands
- Add autocomplete for slash commands
- Add description and params to slash command DSL methods
- Ensure replying by email with a commands-only note works
- Use :subscription_event instead of calling noteable.subscribe
- Support :todo_event in IssuableBaseService

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-13 00:05:57 +02:00
Douwe Maan e257200459 Add specs for NotesController and DiscussionsController 2016-08-12 16:24:09 -05:00
Douwe Maan 9b115ce4d3 Actually don't send resolved notifications when deleting a note 2016-08-04 13:44:28 -07:00
Douwe Maan 1bee660b96 Don't send resolved notifications when deleting a note 2016-07-28 21:14:41 -06:00
Douwe Maan fa4a613517 Add 'Resolved all discussions' system note 2016-07-28 20:39:35 -06:00
Douwe Maan 1c2eefef3f Backend tweaks 2016-07-28 20:09:36 -06:00
Phil Hughes 2247d8a4fd Updates the text above discussions when resolving notes & discussions 2016-07-27 18:34:04 +01:00
Phil Hughes a678fef836 Added resolved by users name into tooltip 2016-07-26 15:47:19 +01:00
Douwe Maan eeb41c759e Add endpoints to resolve diff notes and discussions 2016-07-25 22:45:23 -06:00
Phil Hughes 4af0146fa5 Assigns to variable rather than using VueJS method 2016-07-24 13:10:54 -06:00
Phil Hughes a55c1232b5 Resolve all endpoint 2016-07-24 13:10:54 -06:00
Phil Hughes b550e6ee67 Posts to rails to update note eventually 2016-07-24 13:10:38 -06:00
Douwe Maan 79214be727 Add Discussion model to represent MR/diff discussion 2016-07-20 16:18:18 -06:00
Douwe Maan 29d574868a Display new diff notes and allow creation through the web interface 2016-07-06 18:51:00 -04:00
Yorick Peterse d470f3d195
Support for rendering/redacting multiple documents
This commit changes the way certain documents are rendered (currently
only Notes) and how documents are redacted. Previously both rendering
and redacting would run on a per document basis. The result of this was
that for every document we'd have to run countless queries just to
figure out if we could display a set of links or not.

This commit changes things around so that redacting Markdown documents
is no longer tied into the html-pipeline Gem. This in turn allows it to
redact multiple documents in a single pass, thus reducing the number of
queries needed.

In turn rendering issue/merge request notes has been adjusted to take
advantage of this new setup. Instead of rendering Markdown somewhere
deep down in a view the Markdown is rendered and redacted in the
controller (taking the current user and all that into account). This has
been done in such a way that the "markdown()" helper method can still be
used on its own.

This particular commit also paves the way for caching rendered HTML on
object level. Right now there's an accessor method Note#note_html which
is used for setting/getting the rendered HTML. Once we cache HTML on row
level we can simply change this field to be a column and call a "save"
whenever needed and we're pretty much done.
2016-06-24 11:46:39 +02:00
ZJ van de Weg 2f9c2149a3 Backend awardables on comments 2016-06-06 11:03:39 +02:00
Fatih Acet 6c89e2fd41 Merge branch 'awardables' of gitlab.com:gitlab-org/gitlab-ce into awardables 2016-05-18 13:23:40 -05:00
Fatih Acet bb883387f9 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into awardables
# Conflicts:
#	app/controllers/projects/merge_requests_controller.rb
#	app/models/note.rb
#	db/schema.rb
#	spec/models/note_spec.rb
2016-05-18 13:05:53 -05:00
Dmitriy Zaporozhets 253a017b01
Merge branch 'meinac/gitlab-ce-change_deprecated_render_usage'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-05-18 12:48:23 -05:00
ZJ van de Weg e0cabb67d0 Fix latests concerns 2016-05-18 08:47:15 -05:00
Douwe Maan 99d3e21f19 Extract LegacyDiffNote out of Note 2016-05-13 17:31:43 -05:00
Zeger-Jan van de Weg dccf8a9fc8 Add tests on Awardables and Award Emoji 2016-05-10 12:03:13 +02:00
Zeger-Jan van de Weg 3bdc57f0a7 Create table for award emoji 2016-05-06 10:47:11 +02:00
Robert Schilling 9aefaa41ab Fix code review issues 2016-04-12 14:24:05 +02:00
Robert Schilling ba21c00f01 Delete notes via API 2016-04-12 14:24:05 +02:00
Mehmet Emin İNAÇ 6a0ea605e8 Change deprecated usage of rendering without response body
`render nothing: true` has been deprecated.
For more information see [pr](https://github.com/rails/rails/pull/20336)
2016-03-16 03:16:25 +02:00
Josh Frye f9218898ec [WIP] Background process note logic for #3948 2016-01-28 13:04:42 -05:00
Rémy Coutable 491c2248c0 Fix diff comments loaded by AJAX to load comment with diff in discussion tab
This commits also fixes two minor issues:
- Ensure notes that the current user is not allowed to see are not
  returned in the AJAX notes loading
- Ensure the notes counter badge is decremented of 1 instead of 2
2016-01-19 18:22:01 +01:00
Valery Sizov a48dd40a92 base implementation of emoji picker [ci skip] 2015-12-22 23:12:23 +02:00
Dmitriy Zaporozhets 40104746d6 Merge remote-tracking branch 'origin/feature/update-rubocop' 2015-12-16 13:44:50 +01:00
Gabriel Mazetto b5291f9599 Fixed Rubocop offenses 2015-12-15 00:53:52 -02:00
Robert Speicher 118d96906a Fix note polling
Closes #4032
2015-12-12 12:38:12 -05:00
Grzegorz Bizon a527f5c27f Notify user when award-emoji comment is invalid 2015-12-03 13:38:59 +01:00