Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-04-24 03:09:23 +00:00
parent 033c2c5acd
commit d3776a363c
6 changed files with 27 additions and 5 deletions

View file

@ -16,7 +16,7 @@ $.fn.renderGFM = function renderGFM() {
renderMath(this.find('.js-render-math'));
renderMermaid(this.find('.js-render-mermaid'));
highlightCurrentUser(this.find('.gfm-project_member').get());
initUserPopovers(this.find('.gfm-project_member').get());
initUserPopovers(this.find('.js-user-link').get());
initMRPopovers(this.find('.gfm-merge_request').get());
renderMetrics(this.find('.js-render-metrics').get());
return this;

View file

@ -0,0 +1,5 @@
---
title: Add user popovers to system notes
merge_request: 24241
author:
type: fixed

View file

@ -11,6 +11,9 @@ You can enable Pages access control on your project, so that only
[members of your project](../../permissions.md#project-members-permissions)
(at least Guest) can access your website:
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For a demonstration, see [Pages access controls](https://www.youtube.com/watch?v=tSPAr5mQYc8).
1. Navigate to your project's **Settings > General** and expand **Visibility, project features, permissions**.
1. Toggle the **Pages** button to enable the access control.

View file

@ -106,7 +106,7 @@ module Banzai
end
def link_class
reference_class(:project_member, tooltip: false)
[reference_class(:project_member, tooltip: false), "js-user-link"].join(" ")
end
def link_to_all(link_content: nil)

View file

@ -3,6 +3,8 @@
require 'spec_helper'
describe 'User sees user popover', :js do
include Spec::Support::Helpers::Features::NotesHelpers
let_it_be(:project) { create(:project, :repository) }
let(:user) { project.creator }
let(:merge_request) do
@ -17,13 +19,13 @@ describe 'User sees user popover', :js do
subject { page }
describe 'hovering over a user link in a merge request' do
let(:popover_selector) { '.user-popover' }
before do
visit project_merge_request_path(project, merge_request)
end
it 'displays user popover' do
popover_selector = '.user-popover'
find('.js-user-link').hover
expect(page).to have_css(popover_selector, visible: true)
@ -32,5 +34,17 @@ describe 'User sees user popover', :js do
expect(page).to have_content(user.name)
end
end
it "displays user popover in system note" do
add_note("/assign @#{user.username}")
wait_for_requests
find('.system-note-message .js-user-link').hover
page.within(popover_selector) do
expect(page).to have_content(user.name)
end
end
end
end

View file

@ -123,7 +123,7 @@ describe Banzai::Filter::UserReferenceFilter do
it 'includes default classes' do
doc = reference_filter("Hey #{reference}")
expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-project_member'
expect(doc.css('a').first.attr('class')).to eq 'gfm gfm-project_member js-user-link'
end
context 'when a project is not specified' do