Commit 7afa85b1 authored by Miguel Rincon's avatar Miguel Rincon

Merge branch 'aa/loading-state-for-continuous-onboarding' into 'master'

Continuous onboarding import loading state

See merge request gitlab-org/gitlab!61239
parents 2c9210d6 292ea2f9
......@@ -50,6 +50,11 @@ module LearnGitlabHelper
}
end
def learn_gitlab_onboarding_available?(project)
OnboardingProgress.onboarding?(project.namespace) &&
LearnGitlab::Project.new(current_user).available?
end
private
def action_urls
......@@ -64,9 +69,4 @@ module LearnGitlabHelper
def onboarding_progress(project)
OnboardingProgress.find_by(namespace: project.namespace) # rubocop: disable CodeReuse/ActiveRecord
end
def learn_gitlab_onboarding_available?(project)
OnboardingProgress.onboarding?(project.namespace) &&
LearnGitlab::Project.new(current_user).available?
end
end
- return unless project
- page_title _('Get started with GitLab')
- unless learn_gitlab_onboarding_available?(project)
= content_for :meta_tags do
%meta{ 'http-equiv': 'refresh', content: '5' }
.row.gl-flex-grow-1.gl-p-5
.gl-display-flex.gl-flex-direction-column.gl-align-items-center.gl-w-full
.gl-display-flex.gl-flex-direction-column.gl-align-items-center.gl-pt-7.gl-mt-7.mw-460
......@@ -8,4 +10,9 @@
%h2.gl-text-center.gl-my-5= _('Get started with GitLab')
%p.gl-text-center.gl-text-gray-700.gl-mb-7= _('Ready to get started with GitLab? Follow these steps to set up your workspace, plan and commit changes, and deploy your project.')
= image_tag 'learn_gitlab/get_started.svg', width: '400', class: 'gl-max-w-full'
%div= link_to s_("Ok, let's go"), project_learn_gitlab_path(project), class: 'btn btn-success gl-button gl-mt-7'
- if learn_gitlab_onboarding_available?(project)
%div= link_to s_("LearnGitlab|Ok, let's go"), project_learn_gitlab_path(project), class: 'btn btn-success gl-button gl-mt-7'
- else
%p.gl-text-center.gl-text-gray-700.gl-mt-7= s_('LearnGitlab|Creating your onboarding experience...')
.gl-spinner-container
.gl-spinner.gl-spinner-md{ aria: { label: _('Loading') } }
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'registrations/welcome/continuous_onboarding_getting_started' do
describe 'project import state' do
let_it_be(:project) { create(:project) }
subject { rendered }
before do
allow(view).to receive(:project).and_return(project)
allow(view).to receive(:learn_gitlab_onboarding_available?).and_return(project_available)
render
end
context 'when onboarding project is ready' do
let_it_be(:project_available) { true }
it { is_expected.to have_content("Ok, let's go") }
it { is_expected.not_to have_content('Creating your onboarding experience...') }
it 'does not have meta refresh tag' do
expect(view.content_for(:meta_tags)).to be_nil
end
end
context 'when onboarding project is not yet ready' do
let_it_be(:project_available) { false }
it { is_expected.not_to have_content("Ok, let's go") }
it { is_expected.to have_content('Creating your onboarding experience...') }
it 'has meta refresh tag' do
expect(view.content_for(:meta_tags)).to include("<meta content=\"5\" http-equiv=\"refresh\">")
end
end
end
end
......@@ -19295,6 +19295,12 @@ msgstr ""
msgid "LearnGitLab|Use your new GitLab workflow to deploy your application, monitor its health, and keep it secure:"
msgstr ""
msgid "LearnGitlab|Creating your onboarding experience..."
msgstr ""
msgid "LearnGitlab|Ok, let's go"
msgstr ""
msgid "LearnGitlab|Trial only"
msgstr ""
......
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