Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GOVUK_ENVIRONMENT env var to set styling #314

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

theseanything
Copy link
Contributor

@theseanything theseanything commented Jun 6, 2024

There are a set number of apps that use this gem. They all configure the environment_style and environment_label with the exactly same configuration. This moves the repeated configuration into the this gem as standard.

e.g. https://github.com/alphagov/support/blob/main/config/initializers/govuk_admin_template.rb

GovukAdminTemplate.environment_label = ENV.fetch("GOVUK_ENVIRONMENT", "development").titleize
GovukAdminTemplate.environment_style = ENV["GOVUK_ENVIRONMENT"] == "production" ? "production" : "preview"

This will have no effect on the behaviour of the dependent apps, and allow us to remove repeated config.

The only apps that use this gem are:

  • Publisher
  • Maslow
  • Support
  • Specialist publisher
  • Short url manager
  • Transition
  • Service manual publisher
  • Contacts admin
  • Search admin
  • Content tagger

And all have the same configuration.

There are a set number of apps that use this gem. They all configure the
environment_style and environment_label with the exactly same
configuration. This moves the repeated configuration into the this gem
as standard.
@theseanything theseanything force-pushed the use-govuk-env-for-default-styling branch from f74f62a to 2867e52 Compare June 6, 2024 16:23
Copy link
Contributor

@ChrisBAshton ChrisBAshton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@theseanything theseanything merged commit 426a2cf into main Jun 7, 2024
23 checks passed
@theseanything theseanything deleted the use-govuk-env-for-default-styling branch June 7, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants