Commit 89444975 authored by Tim Zallmann's avatar Tim Zallmann

Added Display of a promotion

parent 62c77c52
......@@ -368,6 +368,10 @@ import initGroupAnalytics from './init_group_analytics';
shortcut_handler = new ShortcutsNavigation();
GpgBadges.fetch();
break;
case 'projects:edit':
new UsersSelect();
new UserCallout();
break;
case 'projects:imports:show':
new ProjectImport();
break;
......
......@@ -289,6 +289,7 @@ table.u2f-registrations {
margin: 20px -5px 0;
.bordered-box {
padding: 32px;
border: 1px solid $blue-300;
border-radius: $border-radius-default;
background-color: $blue-25;
......@@ -296,10 +297,6 @@ table.u2f-registrations {
display: flex;
justify-content: center;
align-items: center;
}
.landing {
padding: 32px;
.close {
position: absolute;
......
.user-callout.promotion-callout {
margin: 20px 0 0;
.bordered-box {
padding: 20px;
border-color: $border-color;
background-color: $white-light;
align-items: flex-start;
.close {
.dismiss-icon {
color: $gray-darkest;
}
&:hover {
.dismiss-icon {
color: $text-color;
}
}
}
.svg-container {
margin-right: 15px;
}
}
}
......@@ -67,5 +67,17 @@ module LicenseHelper
uri.to_s
end
def new_trial_url
return_to_url = URI.encode(Gitlab.config.gitlab.url)
uri = URI.parse(Gitlab::SUBSCRIPTIONS_URL)
uri.path = '/trials/new'
uri.query = "return_to=#{return_to_url}"
uri.to_s
end
def show_promotions
true
end
extend self
end
<svg xmlns="http://www.w3.org/2000/svg" width="78" height="82" viewBox="0 0 78 82"><g fill="none" fill-rule="evenodd"><path fill="#F9F9F9" d="M2.12 42c-.08.99-.12 1.99-.12 3 0 20.435 16.565 37 37 37s37-16.565 37-37c0-1.01-.04-2.01-.12-3C74.353 61.032 58.425 76 39 76 19.575 76 3.647 61.032 2.12 42z"/><path fill="#EEE" fill-rule="nonzero" d="M39 78C17.46 78 0 60.54 0 39S17.46 0 39 0s39 17.46 39 39-17.46 39-39 39zm0-4c19.33 0 35-15.67 35-35S58.33 4 39 4 4 19.67 4 39s15.67 35 35 35z"/><rect width="7" height="1" x="59" y="38" fill="#E1DBF2" rx=".5"/><path fill="#6B4FBB" d="M60.5 42a3.5 3.5 0 0 0 0-7v7z"/><rect width="7" height="1" x="12" y="38" fill="#E1DBF2" transform="matrix(-1 0 0 1 31 0)" rx=".5"/><path fill="#6B4FBB" d="M17.5 42a3.5 3.5 0 0 1 0-7v7z"/><path fill="#E1DBF1" fill-rule="nonzero" d="M39 58c10.493 0 19-8.507 19-19s-8.507-19-19-19-19 8.507-19 19 8.507 19 19 19zm0 4c-12.703 0-23-10.297-23-23s10.297-23 23-23 23 10.297 23 23-10.297 23-23 23z"/><path fill="#6B4FBB" d="M35 56a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/><path fill="#E1DBF1" fill-rule="nonzero" d="M26.5 40c0 4.143 3.355 7.5 7.494 7.5h10.012A7.497 7.497 0 0 0 51.5 40c0-4.143-3.355-7.5-7.494-7.5H33.994A7.497 7.497 0 0 0 26.5 40zm-3 0c0-5.799 4.698-10.5 10.494-10.5h10.012C49.802 29.5 54.5 34.2 54.5 40c0 5.799-4.698 10.5-10.494 10.5H33.994C28.198 50.5 23.5 45.8 23.5 40z"/><path fill="#6B4FBB" fill-rule="nonzero" d="M35.255 42.406a1 1 0 1 1 1.872-.703 2.001 2.001 0 0 0 3.76-.038 1 1 0 1 1 1.886.665 4 4 0 0 1-7.518.076zM31.5 40a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm15 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"/><path fill="#6B4FBB" d="M38 22h2a1 1 0 0 1 0 2h-2a1 1 0 0 1 0-2zm0 3h2a1 1 0 0 1 0 2h-2a1 1 0 0 1 0-2z" style="mix-blend-mode:multiply"/></g></svg>
\ No newline at end of file
.user-callout.promotion-callout{ id: 'promote_service_desk', data: { uid: 'promote_service_desk_dismissed' } }
.bordered-box.content-block
%button.btn.btn-default.close.js-close-callout{ type: 'button', 'aria-label' => 'Dismiss service desk promotion' }
= icon('times', class: 'dismiss-icon', 'aria-hidden' => 'true')
.svg-container
= custom_icon('icon_service_desk')
.user-callout-copy
%h4
- if Gitlab.com?
Upgrade your plan to activate Service Desk.
- else
Improve customer support with GitLab Service Desk.
%p
GitLab Service Desk is a simple way to allow people to create issues in your GitLab instance without needing their own user account. It provides a unique email address for end users to create issues in a project, and replies can be sent either through the GitLab interface or by email. End users will only see the thread through email.
%a{ href: 'https://docs.gitlab.com/ee/user/project/service_desk.html', target: '_blank' } Read more
- if current_user.admin?
- if Gitlab.com?
= link_to 'Upgrade your plan', 'https://about.gitlab.com/gitlab-com/', class: 'btn btn-primary'
- else
= link_to 'Start GtiLab Enterprise Edition trial', new_trial_url, class: 'btn btn-primary'
- else
%p
Contact your Administrator to upgrade your plan.
require 'spec_helper'
describe 'Promotion', js: true do
let(:user) { create(:user) }
let(:project) { create(:empty_project, path: 'gitlab', name: 'sample') }
before do
sign_in(user)
project.team << [user, :master]
end
describe 'for service desk', js: true do
it 'should appear in project edit page' do
visit edit_project_path(project)
expect(find('#promote_service_desk')).to have_content 'Improve customer support with GitLab Service Desk.'
end
it 'does not show when cookie is set' do
visit edit_project_path(project)
within('#promote_service_desk') do
find('.close').trigger('click')
end
visit edit_project_path(project)
expect(page).not_to have_selector('#promote_service_desk')
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment