diff options
Diffstat (limited to 'app')
6 files changed, 11 insertions, 5 deletions
diff --git a/app/assets/javascripts/behaviors/markdown/copy_as_gfm.js b/app/assets/javascripts/behaviors/markdown/copy_as_gfm.js index 318b7f77c7b..03c1b5a0169 100644 --- a/app/assets/javascripts/behaviors/markdown/copy_as_gfm.js +++ b/app/assets/javascripts/behaviors/markdown/copy_as_gfm.js @@ -183,7 +183,7 @@ export class CopyAsGFM { } // Export CopyAsGFM as a global for rspec to access -// see /spec/features/copy_as_gfm_spec.rb +// see /spec/features/markdown/copy_as_gfm_spec.rb if (process.env.NODE_ENV !== 'production') { window.CopyAsGFM = CopyAsGFM; } diff --git a/app/assets/javascripts/behaviors/markdown/editor_extensions.js b/app/assets/javascripts/behaviors/markdown/editor_extensions.js index 8bd2145db1c..308e31e7047 100644 --- a/app/assets/javascripts/behaviors/markdown/editor_extensions.js +++ b/app/assets/javascripts/behaviors/markdown/editor_extensions.js @@ -53,7 +53,7 @@ import InlineHTML from './marks/inline_html'; // The nodes and marks referenced here transform that same HTML to GFM to be copied to the clipboard. // Every filter in lib/banzai/pipeline/gfm_pipeline.rb that generates HTML // from GFM should have a node or mark here. -// The GFM-to-HTML-to-GFM cycle is tested in spec/features/copy_as_gfm_spec.rb. +// The GFM-to-HTML-to-GFM cycle is tested in spec/features/markdown/copy_as_gfm_spec.rb. export default [ new Doc(), diff --git a/app/assets/javascripts/vue_shared/components/lib/utils/diff_utils.js b/app/assets/javascripts/vue_shared/components/lib/utils/diff_utils.js index d1aba99ac22..188ab1769a4 100644 --- a/app/assets/javascripts/vue_shared/components/lib/utils/diff_utils.js +++ b/app/assets/javascripts/vue_shared/components/lib/utils/diff_utils.js @@ -12,6 +12,7 @@ function cleanSuggestionLine(line = {}) { return { ...line, text: trimFirstCharOfLineContent(line.text), + rich_text: trimFirstCharOfLineContent(line.rich_text), }; } diff --git a/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_row.vue b/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_row.vue index c09bdfec250..97d93eaaf3f 100644 --- a/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_row.vue +++ b/app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_row.vue @@ -24,7 +24,8 @@ export default { {{ line.new_line }} </td> <td class="line_content" :class="lineType"> - <span v-if="line.text">{{ line.text }}</span> + <span v-if="line.rich_text" v-html="line.rich_text"></span> + <span v-else-if="line.text">{{ line.text }}</span> <!-- TODO: replace this hack with zero-width whitespace when we have rich_text from BE --> <span v-else>​</span> </td> diff --git a/app/serializers/suggestion_entity.rb b/app/serializers/suggestion_entity.rb index 2dd62e19e29..4fb19fbc074 100644 --- a/app/serializers/suggestion_entity.rb +++ b/app/serializers/suggestion_entity.rb @@ -4,7 +4,9 @@ class SuggestionEntity < API::Entities::Suggestion include RequestAwareEntity unexpose :from_line, :to_line, :from_content, :to_content - expose :diff_lines, using: DiffLineEntity + expose :diff_lines, using: DiffLineEntity do |suggestion| + Gitlab::Diff::Highlight.new(suggestion.diff_lines).highlight + end expose :current_user do expose :can_apply do |suggestion| Ability.allowed?(current_user, :apply_suggestion, suggestion) diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb index a14e0515a1f..a781eacc40e 100644 --- a/app/services/quick_actions/interpret_service.rb +++ b/app/services/quick_actions/interpret_service.rb @@ -84,7 +84,9 @@ module QuickActions # rubocop: enable CodeReuse/ActiveRecord def find_milestones(project, params = {}) - MilestonesFinder.new(params.merge(project_ids: [project.id], group_ids: [project.group&.id])).execute + group_ids = project.group.self_and_ancestors.select(:id) if project.group + + MilestonesFinder.new(params.merge(project_ids: [project.id], group_ids: group_ids)).execute end def parent |