-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #483 from DEFRA/feature/290089-form-overview-page
Add environment identification tag in the header (409424)
- Loading branch information
Showing
11 changed files
with
134 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@forward "@defra/forms-designer/server/src/common/components/tag-env/tag-env"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
designer/server/src/common/components/tag-env/_tag-env.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@use "govuk-frontend" as *; | ||
|
||
.app-tag--env { | ||
margin: -6px 0 0; | ||
vertical-align: top; | ||
|
||
// Override product name font size | ||
@include govuk-font-size($size: 16); | ||
|
||
// Align with product name | ||
@include govuk-media-query($from: tablet) { | ||
margin: -3px 0 0; | ||
} | ||
|
||
// Override service header alignment | ||
.cross-service-header & { | ||
margin: -2px 0 0 govuk-spacing(1); | ||
|
||
// Align with product name | ||
@include govuk-media-query($from: tablet) { | ||
margin: 0 0 0 govuk-spacing(2); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% macro appTagEnv(params) %} | ||
{%- include "./template.njk" -%} | ||
{% endmacro %} |
30 changes: 30 additions & 0 deletions
30
designer/server/src/common/components/tag-env/template.njk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{%- from "govuk/components/tag/macro.njk" import govukTag -%} | ||
|
||
{%- switch params.env %} | ||
{% case "local" %} | ||
{% set text = "Local" %} | ||
{% set classes = "govuk-tag--green" %} | ||
{% case "dev" %} | ||
{% set text = "Development" %} | ||
{% set classes = "govuk-tag--grey" %} | ||
{% case "test" %} | ||
{% set text = "Test" %} | ||
{% set classes = "govuk-tag--yellow" %} | ||
{% case "ext-test" %} | ||
{% set text = "External test" %} | ||
{% set classes = "govuk-tag--yellow" %} | ||
{% case "perf-test" %} | ||
{% set text = "Performance test" %} | ||
{% set classes = "govuk-tag--yellow" %} | ||
{% case "prod" %} | ||
{% set text = "Production" %} | ||
{% set classes = "govuk-tag--red" %} | ||
{% default %} | ||
{% set text = env | replace("-", " ") | capitalize %} | ||
{% set classes = "govuk-tag--grey" %} | ||
{% endswitch -%} | ||
|
||
{{ govukTag({ | ||
text: text, | ||
classes: classes + " app-tag--env" | ||
}) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters