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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Add ENV variable for lookbook and enable it
Oliver Güntheracf01ea473b2
diff --git a/.github/workflows/pullpreview.yml b/.github/workflows/pullpreview.ymlindex 6456db167c4..c55088cc8cf 100644--- a/.github/workflows/pullpreview.yml+++ b/.github/workflows/pullpreview.yml@@ -31,6 +31,7 @@ jobs:echo "OPENPROJECT_SHOW__SETTING__MISMATCH__WARNING=false" >> .env.pullpreviewecho "OPENPROJECT_FEATURE__STORAGES__MODULE__ACTIVE=true" >> .env.pullpreviewecho "OPENPROJECT_FEATURE__SHOW__CHANGES__ACTIVE=true" >> .env.pullpreview+ echo "OPENPROJECT_LOOKBOOK__ENABLED=true" >> .env.pullpreviewecho "OPENPROJECT_HSTS=false" >> .env.pullpreview- name: Boot as BIM editionif: contains(github.ref, 'bim/') || contains(github.head_ref, 'bim/')diff --git a/Gemfile b/Gemfileindex 905a8d683f0..bfb5ad1f750 100644--- a/Gemfile+++ b/Gemfile@@ -206,6 +206,8 @@ gem "store_attribute", "~> 1.0"gem "appsignal", "~> 3.0", require: falsegem 'view_component'+# Lookbook+gem 'lookbook', '~> 2.0.3'gem 'turbo-rails', "~> 1.1"@@ -275,9 +277,6 @@ group :development dogem 'spring'gem 'spring-commands-rspec'- # Lookbook- gem 'lookbook', '~> 2.0.3'-gem 'colored2'# git hooks managerdiff --git a/Gemfile.lock b/Gemfile.lockindex f2a2ad4da1b..524c187f5e9 100644--- a/Gemfile.lock+++ b/Gemfile.lock@@ -216,6 +216,7 @@ PATHGEMremote: https://rubygems.org/specs:+ Ascii85 (1.1.0)actioncable (7.0.6)actionpack (= 7.0.6)activesupport (= 7.0.6)@@ -305,6 +306,7 @@ GEMaddressable (2.8.4)public_suffix (>= 2.0.2, < 6.0)aes_key_wrap (1.1.0)+ afm (0.2.2)airbrake (13.0.3)airbrake-ruby (~> 6.0)airbrake-ruby (6.2.1)@@ -532,6 +534,7 @@ GEMgravatar_image_tag (1.2.0)hana (1.3.7)hashdiff (1.0.1)+ hashery (2.1.2)hashie (3.6.0)html-pipeline (2.14.3)activesupport (>= 2)@@ -685,6 +688,14 @@ GEMast (~> 2.4.1)raccpdf-core (0.9.0)+ pdf-inspector (1.3.0)+ pdf-reader (>= 1.0, < 3.0.a)+ pdf-reader (2.11.0)+ Ascii85 (~> 1.0)+ afm (~> 0.2.1)+ hashery (~> 2.0)+ ruby-rc4+ ttfunkpg (1.5.3)plaintext (0.3.4)activesupport (> 2.2.1)@@ -871,6 +882,7 @@ GEMruby-ole (1.2.12.2)ruby-prof (1.6.3)ruby-progressbar (1.13.0)+ ruby-rc4 (0.1.5)ruby-saml (1.15.0)nokogiri (>= 1.13.10)rexml@@ -1100,6 +1112,7 @@ DEPENDENCIESoxpaper_trail (~> 12.3)parallel_tests (~> 4.0)+ pdf-inspector (~> 1.2)pg (~> 1.5.0)plaintext (~> 0.3.2)prawn (~> 2.2)diff --git a/config/constants/settings/definition.rb b/config/constants/settings/definition.rbindex 4dbc0c2a744..07fd90daa37 100644--- a/config/constants/settings/definition.rb+++ b/config/constants/settings/definition.rb@@ -590,6 +590,12 @@ module Settingslogin_required: {default: false},+ lookbook_enabled: {+ description: 'Enable the Lookbook component documentation tool. Discouraged for production environments.',+ default: -> { Rails.env.development? },+ format: :boolean,+ writable: false+ },lost_password: {description: 'Activate or deactivate lost password form',default: truediff --git a/config/initializers/lookbook.rb b/config/initializers/lookbook.rbindex 673f8be96e5..42969443890 100644--- a/config/initializers/lookbook.rb+++ b/config/initializers/lookbook.rb@@ -1,5 +1,5 @@OpenProject::Application.configure do- next unless Rails.env.development?+ next unless OpenProject::Configuration.lookbook_enabled?config.lookbook.project_name = "OpenProject Lookbook"config.lookbook.project_logo = Rails.root.join('app/assets/images/icon_logo_white.svg').readdiff --git a/config/routes.rb b/config/routes.rbindex 336caecabf3..4b1b03687b8 100644--- a/config/routes.rb+++ b/config/routes.rb@@ -601,7 +601,7 @@ OpenProject::Application.routes.draw doget 'callback', controller: 'oauth_clients', action: :callbackend- if Rails.env.development?+ if OpenProject::Configuration.lookbook_enabled?mount Lookbook::Engine, at: "/lookbook"endenddiff --git a/lib_static/open_project/configuration/helpers.rb b/lib_static/open_project/configuration/helpers.rbindex 018406951fb..98e44561058 100644--- a/lib_static/open_project/configuration/helpers.rb+++ b/lib_static/open_project/configuration/helpers.rb@@ -190,6 +190,10 @@ module OpenProjectInteger(ENV['STATSD_PORT'].presence || statsd['port'].presence)end+ def lookbook_enabled?+ self['lookbook_enabled']+ end+private##