Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8de0b794
Commit
8de0b794
authored
Nov 19, 2021
by
Linjie Zhang
Committed by
Alex Pooley
Nov 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add controller prepend mod for JH content validation service
parent
6d1dd372
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
26 additions
and
2 deletions
+26
-2
app/controllers/concerns/snippets/blobs_actions.rb
app/controllers/concerns/snippets/blobs_actions.rb
+2
-0
app/controllers/concerns/wiki_actions.rb
app/controllers/concerns/wiki_actions.rb
+8
-1
app/controllers/projects/blame_controller.rb
app/controllers/projects/blame_controller.rb
+2
-0
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+2
-0
app/controllers/projects/merge_requests/diffs_controller.rb
app/controllers/projects/merge_requests/diffs_controller.rb
+1
-0
app/controllers/projects/raw_controller.rb
app/controllers/projects/raw_controller.rb
+2
-0
app/graphql/resolvers/snippets/blobs_resolver.rb
app/graphql/resolvers/snippets/blobs_resolver.rb
+2
-0
app/presenters/snippet_blob_presenter.rb
app/presenters/snippet_blob_presenter.rb
+2
-0
app/serializers/diff_file_entity.rb
app/serializers/diff_file_entity.rb
+2
-0
spec/controllers/projects/merge_requests/diffs_controller_spec.rb
...trollers/projects/merge_requests/diffs_controller_spec.rb
+2
-1
spec/requests/projects/merge_requests/diffs_spec.rb
spec/requests/projects/merge_requests/diffs_spec.rb
+1
-0
No files found.
app/controllers/concerns/snippets/blobs_actions.rb
View file @
8de0b794
...
...
@@ -51,3 +51,5 @@ module Snippets::BlobsActions
params
[
:snippet_id
]
end
end
Snippets
::
BlobsActions
.
prepend_mod
app/controllers/concerns/wiki_actions.rb
View file @
8de0b794
...
...
@@ -83,7 +83,8 @@ module WikiActions
render
'shared/wikis/show'
elsif
file_blob
send_blob
(
wiki
.
repository
,
file_blob
)
# This is needed by [GitLab JH](https://gitlab.com/gitlab-jh/gitlab/-/issues/247)
send_wiki_file_blob
(
wiki
,
file_blob
)
elsif
show_create_form?
# Assign a title to the WikiPage unless `id` is a randomly generated slug from #new
title
=
params
[
:id
]
unless
params
[
:random_title
].
present?
...
...
@@ -305,4 +306,10 @@ module WikiActions
view:
diff_view
}
end
def
send_wiki_file_blob
(
wiki
,
file_blob
)
send_blob
(
wiki
.
repository
,
file_blob
)
end
end
WikiActions
.
prepend_mod
app/controllers/projects/blame_controller.rb
View file @
8de0b794
...
...
@@ -27,3 +27,5 @@ class Projects::BlameController < Projects::ApplicationController
@blame
=
Gitlab
::
View
::
Presenter
::
Factory
.
new
(
@blame
,
project:
@project
,
path:
@path
).
fabricate!
end
end
Projects
::
BlameController
.
prepend_mod
app/controllers/projects/blob_controller.rb
View file @
8de0b794
...
...
@@ -298,3 +298,5 @@ class Projects::BlobController < Projects::ApplicationController
experiment
(
:code_quality_walkthrough
,
namespace:
@project
.
root_ancestor
).
track
(
:commit_created
)
end
end
Projects
::
BlobController
.
prepend_mod
app/controllers/projects/merge_requests/diffs_controller.rb
View file @
8de0b794
...
...
@@ -36,6 +36,7 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic
options
=
{
environment:
environment
,
merge_request:
@merge_request
,
commit:
commit
,
diff_view:
diff_view
,
merge_ref_head_diff:
render_merge_ref_head_diff?
,
pagination_data:
diffs
.
pagination_data
,
...
...
app/controllers/projects/raw_controller.rb
View file @
8de0b794
...
...
@@ -51,3 +51,5 @@ class Projects::RawController < Projects::ApplicationController
.
raw_blob_request_limit
end
end
Projects
::
RawController
.
prepend_mod
app/graphql/resolvers/snippets/blobs_resolver.rb
View file @
8de0b794
...
...
@@ -35,3 +35,5 @@ module Resolvers
end
end
end
Resolvers
::
Snippets
::
BlobsResolver
.
prepend_mod
app/presenters/snippet_blob_presenter.rb
View file @
8de0b794
...
...
@@ -57,3 +57,5 @@ class SnippetBlobPresenter < BlobPresenter
gitlab_raw_snippet_blob_url
(
snippet
,
blob
.
path
,
only_path:
only_path
)
end
end
SnippetBlobPresenter
.
prepend_mod
app/serializers/diff_file_entity.rb
View file @
8de0b794
...
...
@@ -90,3 +90,5 @@ class DiffFileEntity < DiffFileBaseEntity
options
.
fetch
(
:diff_view
,
:inline
).
to_sym
end
end
DiffFileEntity
.
prepend_mod
spec/controllers/projects/merge_requests/diffs_controller_spec.rb
View file @
8de0b794
...
...
@@ -496,6 +496,7 @@ RSpec.describe Projects::MergeRequests::DiffsController do
{
environment:
nil
,
merge_request:
merge_request
,
commit:
nil
,
diff_view: :inline
,
merge_ref_head_diff:
nil
,
allow_tree_conflicts:
true
,
...
...
@@ -552,7 +553,7 @@ RSpec.describe Projects::MergeRequests::DiffsController do
it_behaves_like
'serializes diffs with expected arguments'
do
let
(
:collection
)
{
Gitlab
::
Diff
::
FileCollection
::
Commit
}
let
(
:expected_options
)
{
collection_arguments
}
let
(
:expected_options
)
{
collection_arguments
.
merge
(
commit:
merge_request
.
commits
(
limit:
1
).
first
)
}
end
end
...
...
spec/requests/projects/merge_requests/diffs_spec.rb
View file @
8de0b794
...
...
@@ -31,6 +31,7 @@ RSpec.describe 'Merge Requests Diffs' do
{
environment:
nil
,
merge_request:
merge_request
,
commit:
nil
,
diff_view: :inline
,
merge_ref_head_diff:
nil
,
allow_tree_conflicts:
true
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment