Commit bf02cc68 authored by Alex Buijs's avatar Alex Buijs Committed by Filipa Lacerda

Do not show the onboarding welcome page on mobile devices

parent a44e3004
import Vue from 'vue';
import WelcomePage from './components/welcome_page.vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import { redirectTo } from '~/lib/utils/url_utility';
import onboardingUtils from './../utils';
import breakpointInstance from '~/breakpoints';
export default function() {
const el = document.getElementById('js-onboarding-welcome');
......@@ -11,6 +14,11 @@ export default function() {
const { userAvatarUrl, projectFullPath, skipUrl, fromHelpMenu } = el.dataset;
if (!breakpointInstance.isDesktop()) {
onboardingUtils.updateOnboardingDismissed(true);
return redirectTo(skipUrl);
}
return new Vue({
el,
render(h) {
......
---
title: Resolve Make sure not to redirect to the onboarding welcome page on mobile
devices
merge_request: 14842
author:
type: fixed
......@@ -3,6 +3,8 @@
require 'spec_helper'
describe 'User Onboarding' do
include MobileHelpers
let(:user) { create(:user) }
let(:project) { create(:project) }
......@@ -18,15 +20,29 @@ describe 'User Onboarding' do
end
describe 'help menu' do
it 'shows the "Learn GitLab" item in the help menu' do
before do
visit root_dashboard_path
find('.header-help-dropdown-toggle').click
end
it 'shows the "Learn GitLab" item in the help menu' do
page.within('.header-help') do
expect(page).to have_link('Learn GitLab', href: explore_onboarding_index_path(from_help_menu: true))
end
end
context 'when on a mobile device' do
before do
resize_screen_sm
end
it 'does not show the "Learn GitLab" item in the help menu' do
page.within('.header-help') do
expect(page).not_to have_link('Learn GitLab')
end
end
end
end
describe 'welcome page' do
......@@ -40,6 +56,17 @@ describe 'User Onboarding' do
expect(page).to have_content('Welcome to the Guided GitLab Tour')
end
context 'when on a mobile device' do
before do
resize_screen_sm
end
it 'does not show the "Learn GitLab" welcome page' do
visit explore_onboarding_index_path
expect(page).not_to have_content('Welcome to the Guided GitLab Tour')
end
end
end
describe 'onboarding helper' do
......
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