Commit Graph

115 Commits

Author SHA1 Message Date
gfyoung 1993a4449a Enable frozen string for app/helpers/**/*.rb
Partially addresses #47424.
2018-09-06 17:33:46 -07:00
blackst0ne eddf3febd7 [Rails5] Add `safe_params` helper
Rails 5.0 requires to explicitly permit attributes when building a URL
using current `params` object.

The `safe_params` helper allows developers to just call `safe_params.merge(...)`
instead of manually adding `permit` to every call.

https://github.com/rails/rails/pull/20868
2018-04-08 15:35:30 +11:00
Filipa Lacerda 2ecac881e7
Render modified icon for moved file 2018-02-13 18:12:19 +00:00
Phil Hughes 500a3de7b4
Fix changes dropdown ellipsis working across browsers
Closes #41561
2018-01-09 11:29:57 +00:00
Douwe Maan e8d0d6ba9e Use app host instead of asset host when rendering image blob or diff 2017-12-12 09:48:06 +01:00
Rémy Coutable 4f09d099e9 Merge branch '18040-rubocop-line-break-after-guard-clause' into 'master'
Adds Rubocop rule for line break after guard clause

Closes #18040

See merge request gitlab-org/gitlab-ce!15188
2017-11-20 09:22:14 +00:00
Phil Hughes 8e7f84b510
updated to use new sprite icons 2017-11-17 14:51:28 +00:00
Jacopo 181cd299f9 Adds Rubocop rule for line break after guard clause
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
2017-11-16 17:58:29 +01:00
Douwe Maan b74c643c66 Only copy old/new code when selecting left/right side of parallel diff 2017-10-02 18:39:25 +02:00
Mike Greiling 7767ceef47 Merge branch 'master' into ide
* master: (177 commits)
  Add changelog
  Bump gitlab-shell version to 5.8.0 to fix Git for Windows 2.14
  Make contextual sidebar collapsible
  Fixed sidebar context header hover colors
  Use correct `Environment`-class within `Gitlab` namespace
  Remove gl.Activities from Commits page
  Move `let` calls inside the `describe` block using them
  Add `/assign me` alias support for assigning issuables to oneself
  GRPC::Unavailable (< GRPC::BadStatus) is wrapped in a CommandError
  Use `broken_storage` in the fs_shards_spec.
  Eager load project creators for project dashboards
  Memoize a user's personal projects count
  Remove redundant query from User#recent_push
  Improve checking if projects would be returned
  Change spelling of gitlab-shell
  Remove unused #tree-holder
  Add custom linter for inline JavaScript to haml_lint
  Rename user_can_admin? because it's more accurate
  Synchronous zanata community contribution translation
  Add Korean translation to i18n
  ...
2017-08-07 15:20:09 -05:00
Phil Hughes 85582b0537
Moved changed files into a dropdown
This makes navigating through diff files quickly. Currently we just
toggle a list, which could be pretty big. This moves it into a dropdown
to make it much easier.

Also includes a filter bar to quickly search for certain
files/extensions.

Closes #29778
2017-08-03 17:03:49 +01:00
Luke "Jared" Bennett 0ac012f0ad
Merge remote-tracking branch 'origin/master' into ide 2017-07-31 17:24:13 +01:00
Sean McGivern fdfb4bbe5c Fix diff commenting results just after changing view
When you change the diff view (inline / side-by-side), we set a cookie based on
that new view. When you add a comment, we choose the style to use in the
response based on that cookie.

However, when you have just changed diff style, the request cookie will contain
the old value, so we should use the view param instead.
2017-07-28 13:59:57 +01:00
Luke "Jared" Bennett 6448368b5b
Merge remote-tracking branch 'origin/master' into ide 2017-07-20 17:51:07 +01:00
Douwe Maan fe13f11041 Create and use project path helpers that only need a project, no namespace 2017-07-05 11:11:59 -05:00
Dmitriy Zaporozhets 397a0a1db2 Merge remote-tracking branch 'origin/master' into dm-tree-json 2017-06-22 10:19:26 +02:00
Douwe Maan 5e8aca2152 Don't display comment on unchanged line on both sides in parallel diff 2017-06-19 11:50:46 -05:00
Douwe Maan 7944254563 Implement diff viewers 2017-06-14 10:12:21 -05:00
Sean McGivern c1ee45953e Merge branch 'fix_diff_line_comments' into 'master'
Fix: A diff comment on a change at last line of a file shows as two comments in discussion

Closes #32353

See merge request !11802
2017-06-01 10:30:46 +00:00
Valery Sizov 563c1ca01c Fix: A diff comment on a change at last line of a file shows as two comments in discussion 2017-05-31 18:38:10 +03:00
Douwe Maan aed0387f97 Consistent diff and blob size limit names 2017-05-29 17:02:02 -05:00
Douwe Maan 2ae9c890e7 Add experimental JSON format for tree controller 2017-05-26 13:51:24 -05:00
Douwe Maan 7c479d88a9 Pass fallback_diff_refs to Diff::File instead of using view helpers 2017-05-23 15:37:05 -05:00
Douwe Maan 7e09a9b7dc Clean up diff rendering 2017-05-23 15:37:05 -05:00
Douwe Maan d9a0188d2f Add question mark to Gitlab::Diff::File predicate methods 2017-05-23 15:37:04 -05:00
Douwe Maan ff82acf343 Consistently use monospace font for commit SHAs and branch and tag names 2017-05-12 09:55:25 -05:00
Rémy Coutable d40e1f547e Enable the Style/TrailingCommaInLiteral cop
Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-10 18:25:45 +02:00
Douwe Maan 48a0e9f6ae Fix specs 2017-04-09 22:27:45 -05:00
Douwe Maan fe26b8af94
Correctly display multiple separate discussions on the same diff line 2017-04-05 17:44:14 +01:00
Felipe Artur ca0cf5a3cd Show 'too many changes' message for merge request 2017-01-12 13:41:29 -02:00
Robert Speicher edf7dbfacd Merge branch 'html-safe-diff-line-content' into 'security'
Don't accidentally mark unsafe diff lines as HTML safe

Fixes potential XSS issue when a legacy diff note is created on a merge
request whose diff contained HTML

See https://gitlab.com/gitlab-org/gitlab-ce/issues/25249

See merge request !2040
2016-12-08 21:38:35 -03:00
Hiroyuki Sato bea83d2579 Remove an extra leading space from diff content 2016-11-04 14:05:49 +09:00
Paco Guzman 5689e8a082 Avoid commit lookup on diff_helper 2016-08-10 13:09:07 +02:00
Tim Masliuchenko b6d545df51 Add unfold links for Side-by-Side view 2016-08-04 09:09:59 +03:00
Paco Guzman c86c1905b5 switch from diff_file_collection to diffs
So we have raw_diffs too
2016-08-03 07:00:20 +02:00
Paco Guzman 8f359ea917 Move to Gitlab::Diff::FileCollection
Instead calling diff_collection.count use diff_collection.size which is cache on the diff_collection
2016-08-03 07:00:20 +02:00
Paco Guzman cd7c2cb6dd Cache highlighted diff lines for merge requests
Introducing the concept of SafeDiffs which relates 
diffs with UI highlighting.
2016-08-03 07:00:19 +02:00
Robert Speicher 34c083a184 Merge branch 'rubocop/enable-access-modifiers-cops' into 'master'
Enable Rubocop cops that check access modifiers

## What does this MR do?

This MR enables Rubocop cops that detect methods that should be restricted but are the part of public API because of access modifiers used improperly.

This also fixes existing offenses.

## Why was this MR needed?

Some method in our codebase are public instead of being private because it is sometimes difficult to get it right without static analysis.

## What are the relevant issue numbers?

See #17478  
Closes #17372 

See merge request !5014
2016-07-29 15:58:09 +00:00
Douwe Maan 79214be727 Add Discussion model to represent MR/diff discussion 2016-07-20 16:18:18 -06:00
Grzegorz Bizon c0ebfea6ba Fix some useless access modifiers in the code 2016-07-19 14:16:54 +02:00
Paco Guzman a404ab380d Collapsed diffs lines/size don't accumulate to overflow diffs. 2016-07-18 14:43:28 -06:00
Jacob Schatz 0452e0a57e Merge branch 'master' into faster-diffs 2016-07-11 17:19:17 -04:00
Sean McGivern 5266ae87c4 Support renames in diff_for_path actions 2016-07-11 09:31:34 +01:00
Sean McGivern ea1827c9a4 Make expand_all param more explicit 2016-07-08 13:54:09 +01:00
Sean McGivern ff55398aaf DRY up diff_for_path actions
1. Move render method to a concern, not a helper.
2. Let DiffHelper#diff_options automatically add the path option.
3. Move more instance var definitions to before filters.
2016-07-08 13:53:51 +01:00
Sean McGivern c082d92fb9 Allow expanding all diffs at once 2016-07-08 13:53:17 +01:00
Sean McGivern 90a6be190f Ensure only renderable text diffs are collapsed
Other diffs (those that are too large to render anyway, image diffs,
diffs suppressed by .gitattributes) should be rendered immediately.
2016-07-08 13:53:17 +01:00
Sean McGivern 78496e8c38 Disable overflow messages
With the option to expand and collapse individual diffs, these aren't
needed any more.
2016-07-08 10:57:21 +01:00
Sean McGivern b6b26692ea Collapse large diffs by default
When rendering a list of diff files, skip those where the diff is over
10 KB and provide an endpoint to render individually instead.
2016-07-08 10:56:55 +01:00
Douwe Maan 5a8f727fd5 Merge branch 'master' into faster-diffs
# Conflicts:
#	app/helpers/notes_helper.rb
#	app/views/projects/diffs/_line.html.haml
#	app/views/projects/diffs/_parallel_view.html.haml
#	app/views/projects/diffs/_text_file.html.haml
#	features/steps/shared/diff_note.rb
2016-07-07 18:05:34 -04:00