Skip to content

Commit

Permalink
API-6782 - Moving feedback banner to top of page template (#444)
Browse files Browse the repository at this point in the history
* API-6782 - Moving feedback banner to top of page template

* API-6782 - Removing feedback banner view as no longer used

* API-6782 - Adding feedback banner to home page
  • Loading branch information
peteslater-ee authored Apr 5, 2023
1 parent 65edcc4 commit 59b1754
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 61 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
@import uk.gov.hmrc.apidocumentation.models.{Breadcrumbs, GenericFeedbackBanner, _}
@import play.twirl.api.HtmlFormat
@import uk.gov.hmrc.apidocumentation.views.templates.FooterLinks
@import uk.gov.hmrc.apidocumentation.views.html.include.FeedbackBannerView
@import uk.gov.hmrc.apidocumentation.views.html.include
@import uk.gov.hmrc.apidocumentation.views.html.partials
@import uk.gov.hmrc.apidocumentation.views.html.templates._
Expand All @@ -32,8 +31,7 @@
siteFooter: SiteFooter,
siteHeader: SiteHeader,
siteHelper: SiteHelper,
hmrcTrackingConsentSnippet: HmrcTrackingConsentSnippet,
feedbackBannerView: FeedbackBannerView
hmrcTrackingConsentSnippet: HmrcTrackingConsentSnippet
)
@(
pageTitle: Option[String] = None,
Expand All @@ -43,12 +41,11 @@
bodyEndBlock: Option[Html] = None,
breadcrumbs: Option[Breadcrumbs] = None,
navLinks: Seq[NavLink] = Seq.empty,
leftNav: Option[Html] = None,
feedbackBanner: Option[FeedbackBanner] = Some(GenericFeedbackBanner)
leftNav: Option[Html] = None
)(contentBlock: Html)(implicit applicationConfig: ApplicationConfig, messages: Messages, request: play.api.mvc.Request[Any], requestHeader: RequestHeader)

@head = {
@hmrcTrackingConsentSnippet()
@hmrcTrackingConsentSnippet()
<link href='@controllers.routes.Assets.versioned("css/main.css")' media="screen" rel="stylesheet" type="text/css" />
}

Expand All @@ -60,6 +57,13 @@


@beforeContentBlock = {
<div id="feedback-banner" class="govuk-phase-banner">
<p id="feedback-title" class="govuk-phase-banner__content">
<span class="govuk-phase-banner__text">
Your <a class="govuk-link" href="@{applicationConfig.feedbackSurveyUrl}" target="_blank">feedback (opens in new tab)</a> will help us to improve this service.
</span>
</p>
</div>
<div class="govuk-grid-row">
<div class="govuk-grid-column-full subnav">
@breadcrumbs.map { crumbs =>
Expand All @@ -71,20 +75,12 @@
}

@footerBlock = {
<div class="govuk-!-margin-top-8">
@feedbackBanner match {
case Some(fb) => {
@feedbackBannerView(fb)
}
case _ => {}
}
</div>
@siteFooter(new Footer(meta = Some(Meta(items = Some(footerLinks.items)))))
}

@bodyEndDefault = {
@bodyEndBlock
@scripts
@scripts
}

@mainContentDefault = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,26 @@
* limitations under the License.
*@

@import uk.gov.hmrc.apidocumentation.config.ApplicationConfig
@import uk.gov.hmrc.apidocumentation.views.html.templates.SiteHeader
@import uk.gov.hmrc.apidocumentation.views.html.partials
@import uk.gov.hmrc.apidocumentation.views.html.include
@import uk.gov.hmrc.apidocumentation.models._

@this(siteHeader: SiteHeader)

@(headerNavLinks: Option[Html] = None, navLinks: Seq[NavLink] = Seq.empty)(implicit messages: Messages)
@(headerNavLinks: Option[Html] = None, navLinks: Seq[NavLink] = Seq.empty)(implicit messages: Messages, applicationConfig: ApplicationConfig)

@siteHeader(navLinks)
<!-- Notification Banner -->
<div class="govuk-width-container">
<div id="feedback-banner" class="govuk-phase-banner">
<p id="feedback-title" class="govuk-phase-banner__content">
<span class="govuk-phase-banner__text">
Your <a class="govuk-link" href="@{applicationConfig.feedbackSurveyUrl}" target="_blank">feedback (opens in new tab)</a> will help us to improve this service.
</span>
</p>
</div>
<div class="govuk-grid-row">
<div class="govuk-grid-column-full subnav subnav-margins">
@include.api_header_nav(navLinks = headerNavLinks)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class apiMainSpec extends CommonViewSpec {
}

"htmlView" must {

"render the page with feedback banner" in new Setup {
val document = Jsoup.parse(
usingTheHubView.render(
Expand All @@ -46,9 +45,8 @@ class apiMainSpec extends CommonViewSpec {
).body
)

elementExistsById(document, "feedback") shouldBe true
elementExistsById(document, "show-survey") shouldBe true
document.getElementById("feedback-title").text() shouldBe "Your feedback helps us improve our service"
elementExistsById(document, "feedback-banner") shouldBe true
document.getElementById("feedback-title").text() shouldBe "Your feedback (opens in new tab) will help us to improve this service."
}
}
}

0 comments on commit 59b1754

Please sign in to comment.