-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add user research recruitment banner
Trello: https://trello.com/c/yGMU3sR2 We're only showing the banner on the dashboard so that we don't overwhelm people by showing it everywhere. We're using larger, bold text and a "start" button [1] to make the "Find out more" CTA stand out over the "Hide this" button. Ideally we'd have used the GOV.UK Components button [2] for the two buttons. However, the `govuk-button--inverse` CSS class [3] is not supported by the component and there's no easy way to override it. Instead of using that component, we're explicitly writing out the HTML that it would have generated. It would be worth opening a PR to add an `inverse` property to the GOV.UK Components button so we can avoid this duplication. [1]: https://design-system.service.gov.uk/components/button/#start-buttons [2]: https://components.publishing.service.gov.uk/component-guide/button [3]: https://design-system.service.gov.uk/components/button/#buttons-on-dark-backgrounds
- Loading branch information
1 parent
33911bd
commit 27cac47
Showing
5 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
app/assets/stylesheets/_user_research_recruitment_banner.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,22 @@ | ||
.user-research-recruitment-banner { | ||
background-color: $govuk-brand-colour; | ||
@include govuk-responsive-padding(8, "top"); | ||
} | ||
|
||
.user-research-recruitment-banner__divider { | ||
border-bottom: 1px solid govuk-colour("white"); | ||
} | ||
|
||
.user-research-recruitment-banner__title { | ||
color: govuk-colour("white"); | ||
@include govuk-responsive-margin(5, "bottom"); | ||
} | ||
|
||
.user-research-recruitment-banner__intro { | ||
color: govuk-colour("white"); | ||
} | ||
|
||
.user-research-recruitment-banner__buttons { | ||
@include govuk-responsive-padding(6, "bottom"); | ||
align-items: center; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require "test_helper" | ||
|
||
class UserResearchRecruitmentBannerTest < ActionDispatch::IntegrationTest | ||
should "not display the banner on the login page" do | ||
visit new_user_session_path | ||
|
||
assert_not has_content?(user_research_recruitment_banner_title) | ||
end | ||
|
||
should "display the banner on the dashboard" do | ||
user = create(:user, name: "user-name", email: "user@example.com") | ||
visit new_user_session_path | ||
signin_with(user) | ||
|
||
assert has_content?(user_research_recruitment_banner_title) | ||
assert has_css?("form", text: "Find out more") | ||
end | ||
|
||
should "not display the banner on any page other than the dashboard" do | ||
user = create(:user, name: "user-name", email: "user@example.com") | ||
visit new_user_session_path | ||
signin_with(user) | ||
|
||
click_on "Change your email or password" | ||
|
||
assert_not has_content?(user_research_recruitment_banner_title) | ||
end | ||
|
||
private | ||
|
||
def user_research_recruitment_banner_title | ||
"Help us improve GOV.UK Publishing" | ||
end | ||
end |