Commit Graph

25 Commits

Author SHA1 Message Date
Yorick Peterse daad7144ec
Support Markdown rendering using multiple projects
This refactors the Markdown pipeline so it supports the rendering of
multiple documents that may belong to different projects. An example of
where this happens is when displaying the event feed of a group. In this
case we retrieve events for all projects in the group. Previously we
would group events per project and render these chunks separately, but
this would result in many SQL queries being executed. By extending the
Markdown pipeline to support this out of the box we can drastically
reduce the number of SQL queries.

To achieve this we introduce a new object to the pipeline:
Banzai::RenderContext. This object simply wraps two other objects: an
optional Project instance, and an optional User instance. On its own
this wouldn't be very helpful, but a RenderContext can also be used to
associate HTML documents with specific Project instances. This work is
done in Banzai::ObjectRenderer and allows us to reuse as many queries
(and results) as possible.
2018-04-11 14:10:19 +02:00
🙈 jacopo beschi 🙉 729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Sean McGivern 0054e1567b Merge branch 'ce-backport-3615' into 'master'
Refactor banzai to support referencing from group context

See merge request gitlab-org/gitlab-ce!15766
2017-12-07 12:47:46 +00:00
Jarka Kadlecova 0c2fdb1c34 Refactor banzai to support referencing from group context 2017-12-06 19:16:22 +01:00
haseeb e54307121f show status of issue links in wiki page 2017-12-04 16:27:47 +00:00
Annabel Dunstone Gray 48b8a39f86 Merge branch '39497-inline-edit-issue-on-mobile' into 'master'
Add inline editing to issues on mobile

Closes #39497

See merge request gitlab-org/gitlab-ce!15438
2017-11-20 18:43:57 +00:00
Eric Eastwood 6c4f280263 Add inline editing to issues on mobile
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/39497
2017-11-18 18:05:17 -06: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
Francisco Javier López bf0331dc72 Resolve "DashboardController#activity.json is slow due to SQL" 2017-11-06 16:52:56 +00:00
Tim Zallmann 57497f6f30 Resolve "Editor icons" 2017-11-06 12:04:55 +00:00
Tiago Botelho 6d8e102c74 Adds cacheless render to Banzai object render 2017-09-06 15:35:35 +01:00
Toon Claes abc82a2508 Fix ProjectCacheWorker for plain READMEs
The ProjectCacheWorker refreshes cache periodically, but it runs outside Rails
context. So include the ActionView helpers so the `content_tag` method is
available.
2017-05-18 21:10:10 +02:00
Robert Speicher cb2f739d48 Merge branch '27144-enforce-rubocop-trailing_commas-no_comma-style' into 'master'
Resolve "Use consistent style for trailing commas"

Closes #27144

See merge request !11063
2017-05-10 21:43:34 +00: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
Robert Speicher 99996b6bc7 Merge branch 'bvl-security-9-1-markup-pipeline'
(security-9-1) Render asciidoc & other markup using banzai in a pipeline

See merge request !2098
2017-05-10 16:44:20 +02:00
Douwe Maan 0be3187a56 Pull preserve into render helpers 2017-04-28 11:37:19 -05:00
Toon Claes 35fd7e6c53 Avoid including the MarkupHelper 2017-04-27 13:22:18 +02:00
Toon Claes 5473f3dcd6 Add commit to the Banzai::post_process context 2017-04-27 13:22:17 +02:00
Toon Claes af114f1280 `markdown` helper is not used with pre-rendered content 2017-04-27 13:22:17 +02:00
Toon Claes 677101b916 Make the `_unsafe` methods private 2017-04-27 13:22:17 +02:00
Toon Claes 310c3b21d1 Single quotes in MarkupHelper where possible 2017-04-27 13:22:17 +02:00
Douwe Maan 4f2d6b3e21 Refactor MarkupHelper 2017-04-27 13:22:17 +02:00
Toon Claes 05e0f50453 Cache the rendered README, but post-process on show
Because the post-processing of the rendered README is dependent on the
context (i.e. the current user), do the post-processing when the
README is being displayed.
2017-04-27 13:22:17 +02:00
Toon Claes ef4d4446e9 Move some methods from ApplicationHelper to MarkupHelper 2017-04-27 13:22:17 +02:00
Toon Claes d95bffc6da Rename GitlabMarkdownHelper -> MarkupHelper
It does more than solely GitLab Markdown, so rename to MarkupHelper.
2017-04-27 13:22:17 +02:00
Renamed from app/helpers/gitlab_markdown_helper.rb (Browse further)