mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Add ENV variable for lookbook and enable it
This commit is contained in:
@@ -31,6 +31,7 @@ jobs:
|
||||
echo "OPENPROJECT_SHOW__SETTING__MISMATCH__WARNING=false" >> .env.pullpreview
|
||||
echo "OPENPROJECT_FEATURE__STORAGES__MODULE__ACTIVE=true" >> .env.pullpreview
|
||||
echo "OPENPROJECT_FEATURE__SHOW__CHANGES__ACTIVE=true" >> .env.pullpreview
|
||||
echo "OPENPROJECT_LOOKBOOK__ENABLED=true" >> .env.pullpreview
|
||||
echo "OPENPROJECT_HSTS=false" >> .env.pullpreview
|
||||
- name: Boot as BIM edition
|
||||
if: contains(github.ref, 'bim/') || contains(github.head_ref, 'bim/')
|
||||
|
||||
@@ -206,6 +206,8 @@ gem "store_attribute", "~> 1.0"
|
||||
gem "appsignal", "~> 3.0", require: false
|
||||
|
||||
gem 'view_component'
|
||||
# Lookbook
|
||||
gem 'lookbook', '~> 2.0.3'
|
||||
|
||||
gem 'turbo-rails', "~> 1.1"
|
||||
|
||||
@@ -275,9 +277,6 @@ group :development do
|
||||
gem 'spring'
|
||||
gem 'spring-commands-rspec'
|
||||
|
||||
# Lookbook
|
||||
gem 'lookbook', '~> 2.0.3'
|
||||
|
||||
gem 'colored2'
|
||||
|
||||
# git hooks manager
|
||||
|
||||
@@ -216,6 +216,7 @@ PATH
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
Ascii85 (1.1.0)
|
||||
actioncable (7.0.6)
|
||||
actionpack (= 7.0.6)
|
||||
activesupport (= 7.0.6)
|
||||
@@ -305,6 +306,7 @@ GEM
|
||||
addressable (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 @@ GEM
|
||||
gravatar_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 @@ GEM
|
||||
ast (~> 2.4.1)
|
||||
racc
|
||||
pdf-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
|
||||
ttfunk
|
||||
pg (1.5.3)
|
||||
plaintext (0.3.4)
|
||||
activesupport (> 2.2.1)
|
||||
@@ -871,6 +882,7 @@ GEM
|
||||
ruby-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 @@ DEPENDENCIES
|
||||
ox
|
||||
paper_trail (~> 12.3)
|
||||
parallel_tests (~> 4.0)
|
||||
pdf-inspector (~> 1.2)
|
||||
pg (~> 1.5.0)
|
||||
plaintext (~> 0.3.2)
|
||||
prawn (~> 2.2)
|
||||
|
||||
@@ -590,6 +590,12 @@ module Settings
|
||||
login_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: true
|
||||
|
||||
@@ -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').read
|
||||
|
||||
+1
-1
@@ -601,7 +601,7 @@ OpenProject::Application.routes.draw do
|
||||
get 'callback', controller: 'oauth_clients', action: :callback
|
||||
end
|
||||
|
||||
if Rails.env.development?
|
||||
if OpenProject::Configuration.lookbook_enabled?
|
||||
mount Lookbook::Engine, at: "/lookbook"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -190,6 +190,10 @@ module OpenProject
|
||||
Integer(ENV['STATSD_PORT'].presence || statsd['port'].presence)
|
||||
end
|
||||
|
||||
def lookbook_enabled?
|
||||
self['lookbook_enabled']
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
##
|
||||
|
||||
Reference in New Issue
Block a user