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

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

@ -1,7 +1,8 @@
@mixin onboarding-button-styles @mixin onboarding-button-styles
color: white color: white
border: 2px solid $alternative-color border: 2px solid
background: $alternative-color @include varprop(border-color, alternative-color)
@include varprop(background, alternative-color)
-webkit-box-sizing: content-box -webkit-box-sizing: content-box
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) -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) -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) 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 &:hover
background: darken($alternative-color, 10%) @include varprop(border-color, button--alt-highlight-background-hover-color)
border-color: darken($alternative-color, 10%) @include varprop(background, button--alt-highlight-background-hover-color)
&:active &:active
background: darken($alternative-color, 10%) @include varprop(border-color, button--alt-highlight-background-hover-color)
border-color: darken($alternative-color, 10%) @include varprop(background, button--alt-highlight-background-hover-color)
-webkit-transition: none -webkit-transition: none
-moz-transition: none -moz-transition: none
-o-transition: none -o-transition: none
@ -135,7 +136,7 @@
.enjoyhint_btn-transparent .enjoyhint_btn-transparent
background: transparent background: transparent
color: $alternative-color @include varprop(color, alternative-color)
&:hover &:hover
color: white color: white
&:active &:active
@ -158,7 +159,7 @@
.enjoyhint_btn .enjoyhint_btn
&:hover &:hover
color: rgba(255, 255, 255, 1) color: rgba(255, 255, 255, 1)
background: darken($alternative-color, 10%) @include varprop(background, button--alt-highlight-background-hover-color)
&:active &:active
border: 2px solid rgba(33, 224, 163, 1) border: 2px solid rgba(33, 224, 163, 1)
background: rgba(33, 224, 163, 1) background: rgba(33, 224, 163, 1)

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

@ -45,7 +45,7 @@ describe 'onboarding tour for new users', js: true do
it 'I can select a language' do it 'I can select a language' do
visit home_path first_time_user: true 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' select 'Deutsch', :from => 'user_language'
click_button 'Save' 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.' expect(page).to have_text 'Please select one of the projects with useful demo data to get started.'
find('.welcome').click_link 'Demo project' 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).not_to have_selector('.loading-indicator')
expect(page).to have_text 'This is the Work package list' expect(page).to have_text 'This is the Work package list'

Loading…
Cancel
Save