Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add a setting to know for each view type whether it has been seeded or not. This information can be used for example in the onboarding tour

Henriette Darge6567682d9660
diff --git a/app/seeders/demo_data/query_builder.rb b/app/seeders/demo_data/query_builder.rb
index 4abe8665287..17ba39c7f0f 100644
--- a/app/seeders/demo_data/query_builder.rb
+++ b/app/seeders/demo_data/query_builder.rb
@@ -74,10 +74,15 @@ module DemoData
end
def create_view(query)
+ type = config.fetch(:module, 'work_packages_table')
View.create!(
- type: config.fetch(:module, 'work_packages_table'),
+ type: type,
query: query
)
+
+ # Save information that a view has been seeded.
+ # This information can be used for example in the onboarding tour
+ Setting["demo_view_of_type_#{type}_seeded"] = 'true'
end
def set_project!(attr)
diff --git a/app/views/layouts/_common_head.html.erb b/app/views/layouts/_common_head.html.erb
index 1cb58073b30..1940d6b5da0 100644
--- a/app/views/layouts/_common_head.html.erb
+++ b/app/views/layouts/_common_head.html.erb
@@ -21,6 +21,7 @@
<% if Setting.demo_projects_available %><meta name="demo_projects_available" content="true"/><% end %>
<% if Setting.boards_demo_data_available %><meta name="boards_demo_data_available" content="true"/><% end %>
+<% if Setting.demo_view_of_type_team_planner_seeded %><meta name="demo_view_of_type_team_planner_seeded" content="true"/><% end %>
<%= csrf_meta_tags %>
<%= initializer_meta_tag %>
@@ -53,4 +54,4 @@
<% end %>
<% end %>
<% end %>
-<%= crowdin_in_context_translation %>
\ No newline at end of file
+<%= crowdin_in_context_translation %>
diff --git a/config/settings.yml b/config/settings.yml
index 8af73f083df..021a5e6f875 100644
--- a/config/settings.yml
+++ b/config/settings.yml
@@ -350,6 +350,10 @@ demo_projects_available:
default: false
boards_demo_data_available:
default: false
+demo_view_of_type_work_packages_table_seeded:
+ default: false
+demo_view_of_type_team_planner_seeded:
+ default: false
security_badge_displayed:
default: true
installation_uuid:
diff --git a/frontend/src/app/core/setup/globals/onboarding/onboarding_tour.ts b/frontend/src/app/core/setup/globals/onboarding/onboarding_tour.ts
index c2419b08257..5e7b4e12ef4 100644
--- a/frontend/src/app/core/setup/globals/onboarding/onboarding_tour.ts
+++ b/frontend/src/app/core/setup/globals/onboarding/onboarding_tour.ts
@@ -77,8 +77,7 @@ function mainTour() {
initializeTour('mainTourFinished');
const boardsDemoDataAvailable = jQuery('meta[name=boards_demo_data_available]').attr('content') === 'true';
- // TODO
- const teamPlannerDemoDataAvailable = true;
+ const teamPlannerDemoDataAvailable = jQuery('meta[name=demo_view_of_type_team_planner_seeded]').attr('content') === 'true';
const eeTokenAvailable = !jQuery('body').hasClass('ee-banners-visible');
waitForElement('.work-package--results-tbody', '#content', () => {
diff --git a/modules/team_planner/spec/features/onboarding/team_planner_onboarding_tour_spec.rb b/modules/team_planner/spec/features/onboarding/team_planner_onboarding_tour_spec.rb
index 8274225a84f..b3100d12b94 100644
--- a/modules/team_planner/spec/features/onboarding/team_planner_onboarding_tour_spec.rb
+++ b/modules/team_planner/spec/features/onboarding/team_planner_onboarding_tour_spec.rb
@@ -65,7 +65,7 @@ describe 'team planner onboarding tour', js: true do
login_as user
allow(Setting).to receive(:demo_projects_available).and_return(true)
- allow(Setting).to receive(:team_planner_demo_data_available).and_return(true)
+ allow(Setting).to receive(:demo_view_of_type_team_planner_seeded).and_return(true)
end
after do