Skip to content

Commit

Permalink
make onetrust id configurable
Browse files Browse the repository at this point in the history
Signed-off-by: ayush-billore <ayush.billore@progress.com>
  • Loading branch information
ayush-billore committed Feb 6, 2024
1 parent 83312ba commit f77fe99
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs-chef-io/content/supermarket/config_rb_supermarket.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ Use these settings to set up [Google Analytics](https://analytics.google.com) tr

Default value: `"false"`.

`default['supermarket']['onetrust_id']`

: The Onetrust ID for Supermarket.

Default value: `nil`.

### Nginx

This configuration file has the following settings for nginx:
Expand Down
2 changes: 2 additions & 0 deletions omnibus/cookbooks/omnibus-supermarket/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@
default['supermarket']['enable_gtag'] = 'false'
# This controls whether your Supermarket will reach out to Onetrust
default['supermarket']['enable_onetrust'] = 'false'
# This config enables you to set value of onetrust id
default['supermarket']['onetrust_id'] = nil

# ### robots.txt Settings
#
Expand Down
4 changes: 2 additions & 2 deletions src/supermarket/app/views/application/_analytics.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if onetrust_enabled? %>
<%= javascript_include_tag "https://cdn.cookielaw.org/consent/e231efa5-3ed9-4b92-96bc-f4c0872ca486/otSDKStub.js", charset: "UTF-8", "data-domain-script": "e231efa5-3ed9-4b92-96bc-f4c0872ca486", nonce: true %>
<% if onetrust_enabled? && ENV['ONETRUST_ID'].present? %>
<%= javascript_include_tag "https://cdn.cookielaw.org/consent/#{ENV['ONETRUST_ID']}/otSDKStub.js", charset: "UTF-8", "data-domain-script": "#{ENV['ONETRUST_ID']}", nonce: true %>
<% end %>
<% if gtag_enabled? %>
Expand Down
1 change: 1 addition & 0 deletions src/supermarket/habitat-web/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fqdn = ''
fqdn_sanitized = ''
from_email = ''
google_analytics_id = ''
onetrust_id = ''
segment_write_key = ''
log_level = 'info'
serve_static_files = true
Expand Down
1 change: 1 addition & 0 deletions src/supermarket/habitat-web/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ scaffolding_env[GITHUB_KEY]="{{ cfg.github.key }}"
scaffolding_env[GITHUB_SECRET]="{{ cfg.github.secret }}"
scaffolding_env[GITHUB_URL]="{{ cfg.github.url }}"
scaffolding_env[GOOGLE_ANALYTICS_ID]="{{ cfg.app.google_analytics_id }}"
scaffolding_env[ONETRUST_ID]="{{ cfg.app.onetrust_id }}"
scaffolding_env[LEARN_CHEF_URL]="{{ cfg.urls.learn_chef_url }}"
scaffolding_env[LOG_LEVEL]="{{ cfg.app.log_level }}"
scaffolding_env[NEWRELIC_AGENT_ENABLED]="{{ cfg.new_relic.enabled }}"
Expand Down

0 comments on commit f77fe99

Please sign in to comment.