Change setting when demo projects gets archived, stabilize the tour a bit

pull/6743/head
Henriette Dinger 6 years ago
parent 64fb75b854
commit 6bb9cad664
  1. 4
      app/assets/javascripts/onboarding/homescreen_tour.js
  2. 16
      app/assets/javascripts/onboarding/onboarding_tour.js
  3. 17
      app/assets/stylesheets/vendor/_enjoyhint.sass
  4. 14
      app/controllers/projects_controller.rb
  5. 4
      spec/features/onboarding/onboarding_tour_spec.rb

@ -19,11 +19,11 @@
// This will be removed once the project selection is implemented
jQuery(".widget-box.welcome a:contains(" + scrumDemoProjectName + ")").click(function () {
tutorialInstance.trigger('next');
window.location = this.href + '/backlogs';
window.location = this.href + '/backlogs/?start_scrum_onboarding_tour=true';
});
jQuery(".widget-box.welcome a:contains(" + demoProjectName + ")").click(function () {
tutorialInstance.trigger('next');
window.location = this.href + '/work_packages';
window.location = this.href + '/work_packages/?start_onboarding_tour=true';
});
// Disable clicks on other links
$('.widget-box.welcome a').addClass('-disabled').bind('click', preventClickHandler);

@ -48,12 +48,15 @@
homescreenTour();
}
// ------------------------------- Decide for tour depending on backlogs -------------------------------
if (currentTourPart === "startProjectTour" || url.searchParams.get("start_onboarding_tour")) {
// ------------------------------- Tutorial WP page -------------------------------
if (currentTourPart === "startWpTour" || url.searchParams.get("start_onboarding_tour")) {
workPackageTour();
}
// ------------------------------- Tutorial Backlogs page -------------------------------
if (url.searchParams.get("start_scrum_onboarding_tour")) {
if ($('.backlogs-menu-item').length > 0) {
backlogsTour();
} else {
workPackageTour();
}
}
@ -61,11 +64,6 @@
if (currentTourPart === "startTaskBoardTour") {
taskboardTour();
}
// ------------------------------- Tutorial WP page -------------------------------
if (currentTourPart === "startWpTour") {
workPackageTour();
}
}
function demoProjectsLinks() {

@ -1,7 +1,8 @@
@mixin onboarding-button-styles
color: white
border: 2px solid $alternative-color
background: $alternative-color
border: 2px solid
@include varprop(border-color, alternative-color)
@include varprop(background, alternative-color)
-webkit-box-sizing: content-box
box-sizing: content-box
-webkit-transition: background-color 0.3s cubic-bezier(0, 0, 0, 0), color 0.3s cubic-bezier(0, 0, 0, 0), width 0.3s cubic-bezier(0, 0, 0, 0), border-width 0.3s cubic-bezier(0, 0, 0, 0), border-color 0.3s cubic-bezier(0, 0, 0, 0)
@ -9,11 +10,11 @@
-o-transition: background-color 0.3s cubic-bezier(0, 0, 0, 0), color 0.3s cubic-bezier(0, 0, 0, 0), width 0.3s cubic-bezier(0, 0, 0, 0), border-width 0.3s cubic-bezier(0, 0, 0, 0), border-color 0.3s cubic-bezier(0, 0, 0, 0)
transition: background-color 0.3s cubic-bezier(0, 0, 0, 0), color 0.3s cubic-bezier(0, 0, 0, 0), width 0.3s cubic-bezier(0, 0, 0, 0), border-width 0.3s cubic-bezier(0, 0, 0, 0), border-color 0.3s cubic-bezier(0, 0, 0, 0)
&:hover
background: darken($alternative-color, 10%)
border-color: darken($alternative-color, 10%)
@include varprop(border-color, button--alt-highlight-background-hover-color)
@include varprop(background, button--alt-highlight-background-hover-color)
&:active
background: darken($alternative-color, 10%)
border-color: darken($alternative-color, 10%)
@include varprop(border-color, button--alt-highlight-background-hover-color)
@include varprop(background, button--alt-highlight-background-hover-color)
-webkit-transition: none
-moz-transition: none
-o-transition: none
@ -135,7 +136,7 @@
.enjoyhint_btn-transparent
background: transparent
color: $alternative-color
@include varprop(color, alternative-color)
&:hover
color: white
&:active
@ -158,7 +159,7 @@
.enjoyhint_btn
&:hover
color: rgba(255, 255, 255, 1)
background: darken($alternative-color, 10%)
@include varprop(background, button--alt-highlight-background-hover-color)
&:active
border: 2px solid rgba(33, 224, 163, 1)
background: rgba(33, 224, 163, 1)

@ -192,11 +192,13 @@ class ProjectsController < ApplicationController
def archive
flash[:error] = l(:error_can_not_archive_project) unless @project.archive
redirect_to(url_for(controller: '/projects', action: 'index', status: params[:status]))
update_demo_project_settings @project, false
end
def unarchive
@project.unarchive if !@project.active?
redirect_to(url_for(controller: '/projects', action: 'index', status: params[:status]))
update_demo_project_settings @project, true
end
# Delete @project
@ -214,10 +216,7 @@ class ProjectsController < ApplicationController
hide_project_in_layout
# When one of the demo projects gets deleted
if @project_to_destroy.identifier == 'your-scrum-project' || @project_to_destroy.identifier == 'demo-project'
Setting.demo_projects_available = 'false'
end
update_demo_project_settings @project_to_destroy, false
end
def destroy_info
@ -342,4 +341,11 @@ class ProjectsController < ApplicationController
end
true
end
def update_demo_project_settings(project, value)
# e.g. when one of the demo projects gets deleted or a archived
if project.identifier == 'your-scrum-project' || project.identifier == 'demo-project'
Setting.demo_projects_available = value
end
end
end

@ -45,7 +45,7 @@ describe 'onboarding tour for new users', js: true do
it 'I can select a language' do
visit home_path first_time_user: true
expect(page).to have_text 'Please select your language for OpenProject'
expect(page).to have_text 'Please select your language'
select 'Deutsch', :from => 'user_language'
click_button 'Save'
@ -107,7 +107,7 @@ describe 'onboarding tour for new users', js: true do
expect(page).to have_text 'Please select one of the projects with useful demo data to get started.'
find('.welcome').click_link 'Demo project'
expect(page).to have_current_path project_work_packages_path(project.identifier)
expect(page).to have_current_path "/projects/#{project.identifier}/work_packages/?start_onboarding_tour=true"
expect(page).not_to have_selector('.loading-indicator')
expect(page).to have_text 'This is the Work package list'

Loading…
Cancel
Save