Skip to content

Commit

Permalink
Merge pull request #16 from hmrc/PLATUI-347_contact-link
Browse files Browse the repository at this point in the history
Add report technical issue component
  • Loading branch information
matthewmascord committed Apr 22, 2020
2 parents f55ba11 + 08c1be9 commit f6c3144
Show file tree
Hide file tree
Showing 172 changed files with 1,228 additions and 240 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ lazy val libDependencies: Seq[ModuleID] = dependencies(
"com.typesafe.play" %% "play" % playRevision,
"com.typesafe.play" %% "filters-helpers" % playRevision,
"org.joda" % "joda-convert" % "2.0.2",
"org.webjars.npm" % "hmrc-frontend" % "1.5.0"
"org.webjars.npm" % "hmrc-frontend" % "1.11.0"
)

val test = Seq(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
<ul class="hmrc-account-menu__main js-hidden">
<li class="hmrc-account-menu__link--back hidden" aria-hidden="true">
<a href="#" tabindex="-1" class="hmrc-account-menu__link">
Back
@language match {
case Cy => {Yn ôl}
case _ => {Back}
}
</a>
</li>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,35 @@
@(params: LanguageSelect)
@import params._

<div class="hrmc-lang-select">
<p class="hrmc-lang-select__content">
@languageToggle.linkMap.map {
case (lang, link) => {@if(lang == language){
@lang.name
} else {
<a class="govuk-link" id="@lang match {
case En => {switchToEnglish}
case Cy => {switchToWelsh}
}" lang="@lang.code" href="@link"
data-journey-click="link - click:lang-select:@lang.name">@lang.name</a>
}
}
}.toList match {
case x::Nil => {@x}
case x::y => {
@{(x::y).reduce((l, r) => Html(s"""$l\n <span aria-hidden="true">|</span>$r"""))}
<nav class="hmrc-language-select"
aria-label="@if(language.code == "cy"){Switcher iaith} else {Language switcher}"
>
<ul class="hmrc-language-select__list">
@languageToggle.linkMap.map {
case (lang, link) => {
@if(lang == language){
<li class="hmrc-language-select__list-item">
<span aria-current="true">@lang.name</span>
</li>
} else {
<li class="hmrc-language-select__list-item">
<a href="@link"
hreflang="@lang.code"
lang="@lang.code"
rel="alternate"
class="govuk-link"
data-journey-click="link - click:lang-select:@lang.name"
>
<span class="govuk-visually-hidden">@if(lang.code == "cy"){
Newid yr iaith ir Gymraeg
} else {
Change the language to English
}</span>
<span aria-hidden="true">@lang.name</span>
</a>
</li>
}
}
}
case _ => {}
}
</p>
</div>
</ul>
</nav>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@*
* Copyright 2020 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*@

@(params: ReportTechnicalIssue)
@import params._

<a lang="@params.language.get"
hreflang="@params.language.get"
class="@toClasses("govuk-link ", classList.getOrElse(""))"
target="_blank"
href="/contact/problem_reports_nonjs?newTab=true&amp;service=@serviceCode"
>@if(params.language.get == "cy"){
Help gyda'r dudalen hon (yn agor ffenestr neu dab newydd)
} else {
Get help with this page (opens in a new window or tab)
}</a>
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ package object components extends Utils with Aliases {

lazy val HmrcTimeoutDialog = hmrcTimeoutDialog

lazy val HmrcReportTechnicalIssue = hmrcReportTechnicalIssue
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
<ul class="hmrc-account-menu__main js-hidden">
<li class="hmrc-account-menu__link--back hidden" aria-hidden="true">
<a href="#" tabindex="-1" class="hmrc-account-menu__link">
Back
@language match {
case Cy => {Yn ôl}
case _ => {Back}
}
</a>
</li>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,35 @@
@(params: LanguageSelect)
@import params._

<div class="hrmc-lang-select">
<p class="hrmc-lang-select__content">
@languageToggle.linkMap.map {
case (lang, link) => {@if(lang == language){
@lang.name
} else {
<a class="govuk-link" id="@lang match {
case En => {switchToEnglish}
case Cy => {switchToWelsh}
}" lang="@lang.code" href="@link"
data-journey-click="link - click:lang-select:@lang.name">@lang.name</a>
}
}
}.toList match {
case x::Nil => {@x}
case x::y => {
@{(x::y).reduce((l, r) => Html(s"""$l\n <span aria-hidden="true">|</span>$r"""))}
<nav class="hmrc-language-select"
aria-label="@if(language.code == "cy"){Switcher iaith} else {Language switcher}"
>
<ul class="hmrc-language-select__list">
@languageToggle.linkMap.map {
case (lang, link) => {
@if(lang == language){
<li class="hmrc-language-select__list-item">
<span aria-current="true">@lang.name</span>
</li>
} else {
<li class="hmrc-language-select__list-item">
<a href="@link"
hreflang="@lang.code"
lang="@lang.code"
rel="alternate"
class="govuk-link"
data-journey-click="link - click:lang-select:@lang.name"
>
<span class="govuk-visually-hidden">@if(lang.code == "cy"){
Newid yr iaith ir Gymraeg
} else {
Change the language to English
}</span>
<span aria-hidden="true">@lang.name</span>
</a>
</li>
}
}
}
case _ => {}
}
</p>
</div>
</ul>
</nav>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@*
* Copyright 2020 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*@

@this()

@(params: ReportTechnicalIssue)
@import params._

<a lang="@params.language.get"
hreflang="@params.language.get"
class="@toClasses("govuk-link ", classList.getOrElse(""))"
target="_blank"
href="/contact/problem_reports_nonjs?newTab=true&amp;service=@serviceCode"
>@if(params.language.get == "cy"){
Help gyda'r dudalen hon (yn agor ffenestr neu dab newydd)
} else {
Get help with this page (opens in a new window or tab)
}</a>
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,8 @@ package object components extends Utils with Aliases {
type HmrcTimeoutDialog = hmrcTimeoutDialog
@deprecated(message="Use DI", since="Play 2.6")
lazy val HmrcTimeoutDialog = new hmrcTimeoutDialog()

type HmrcReportTechnicalIssue = hmrcReportTechnicalIssue
@deprecated(message="Use DI", since="Play 2.6")
lazy val HmrcReportTechnicalIssue = new hmrcReportTechnicalIssue()
}
3 changes: 3 additions & 0 deletions src/main/scala/uk/gov/hmrc/hmrcfrontend/views/Aliases.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ trait Aliases {

type TimeoutDialog = viewmodels.timeoutdialog.TimeoutDialog
val TimeoutDialog = viewmodels.timeoutdialog.TimeoutDialog

type ReportTechnicalIssue = viewmodels.reporttechnicalissue.ReportTechnicalIssue
val ReportTechnicalIssue = viewmodels.reporttechnicalissue.ReportTechnicalIssue
}

object Aliases extends Aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright 2020 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package uk.gov.hmrc.hmrcfrontend.views.viewmodels.reporttechnicalissue

import play.api.libs.json.{Json, OWrites, Reads}
import uk.gov.hmrc.hmrcfrontend.views.viewmodels.JsonDefaultValueFormatter

case class ReportTechnicalIssue (
serviceCode: String = "",
language: Option[String] = None,
classList: Option[String] = None
)

object ReportTechnicalIssue extends JsonDefaultValueFormatter[ReportTechnicalIssue] {

override def defaultObject: ReportTechnicalIssue = ReportTechnicalIssue()

override def defaultReads: Reads[ReportTechnicalIssue] = Json.reads[ReportTechnicalIssue]

override implicit def jsonWrites: OWrites[ReportTechnicalIssue] = Json.writes[ReportTechnicalIssue]
}
Binary file removed src/test/.DS_Store
Binary file not shown.
Binary file removed src/test/resources/.DS_Store
Binary file not shown.
Binary file removed src/test/resources/fixtures/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.11.0
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"name": "hmrcAccountMenu"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@



<!-- ACCOUNT MENU -->
<nav id="secondary-nav" class="hmrc-account-menu" aria-label="Account" data-module="hmrc-account-menu">
<a href="#" class="hmrc-account-menu__link hmrc-account-menu__link--home">
Expand All @@ -20,8 +23,7 @@
<li>
<a href="#" class="hmrc-account-menu__link">
Messages

</a>
</a>
</li>

<li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"name": "hmrcAccountMenu"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"signOut": {
"href": "#sign-out"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@



<!-- ACCOUNT MENU -->
<nav id="secondary-nav" class="hmrc-account-menu" aria-label="Account" data-module="hmrc-account-menu">
<a href="#account-home" class="hmrc-account-menu__link hmrc-account-menu__link--home hmrc-account-menu__link--active">
Expand All @@ -20,8 +23,7 @@
<li>
<a href="#messages" class="hmrc-account-menu__link">
Messages

</a>
</a>
</li>

<li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"name": "hmrcAccountMenu"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"messages": {
"messageCount": 2
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@



<!-- ACCOUNT MENU -->
<nav id="secondary-nav" class="hmrc-account-menu" aria-label="Account" data-module="hmrc-account-menu">
<a href="#" class="hmrc-account-menu__link hmrc-account-menu__link--home">
Expand All @@ -20,8 +23,10 @@
<li>
<a href="#" class="hmrc-account-menu__link">
Messages
<span class="hmrc-notification-badge">2</span>
</a>

<span class="hmrc-notification-badge">2</span>

</a>
</li>

<li>
Expand Down

0 comments on commit f6c3144

Please sign in to comment.