Skip to content

Commit

Permalink
Merge pull request #9 from hmrc/PLATUI-352
Browse files Browse the repository at this point in the history
PlatUI-352 rename to prevent name clash in Twirl compilation
  • Loading branch information
LUATEC committed Jan 6, 2020
2 parents 4836d62 + 842b758 commit 76dcf88
Show file tree
Hide file tree
Showing 16 changed files with 148 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@



@*
* 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: AccountMenu)
@import params._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@



@*
* 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: Banner)
@import params._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@



@*
* 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: Header)
@import params._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@



@*
* 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: InternalHeader)
@import params._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@



@*
* 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: LanguageSelect)
@import params._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@



@*
* 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: NewTabLink)
@import params._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@



@*
* 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: NotificationBadge = NotificationBadge())
@import params._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@



@*
* 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: PageHeading)
@import params._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@



@*
* 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: TimeoutDialog)
@import params._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 HM Revenue & Customs
* 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 HM Revenue & Customs
* 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.
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/uk/gov/hmrc/hmrcfrontend/views/Aliases.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ trait Aliases {
type LanguageToggle = viewmodels.language.LanguageToggle
val LanguageToggle = viewmodels.language.LanguageToggle

type Messages = viewmodels.accountmenu.Messages
val Messages = viewmodels.accountmenu.Messages
type AccountMessages = viewmodels.accountmenu.AccountMessages
val AccountMessages = viewmodels.accountmenu.AccountMessages

type NavigationItem = viewmodels.header.NavigationItem
val NavigationItem = viewmodels.header.NavigationItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import uk.gov.hmrc.hmrcfrontend.views.viewmodels.language.Language

case class AccountMenu(
accountHome: AccountHome = AccountHome(),
messages: Messages = Messages(),
messages: AccountMessages = AccountMessages(),
checkProgress: CheckProgress = CheckProgress(),
paperlessSettings: PaperlessSettings = PaperlessSettings(),
personalDetails: PersonalDetails = PersonalDetails(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ package uk.gov.hmrc.hmrcfrontend.views.viewmodels.accountmenu
import play.api.libs.json._
import uk.gov.hmrc.hmrcfrontend.views.viewmodels.JsonDefaultValueFormatter

case class Messages(
case class AccountMessages(
href: String = "#",
active: Boolean = false,
messageCount: Option[Int] = None
)

object Messages extends JsonDefaultValueFormatter[Messages] {
object AccountMessages extends JsonDefaultValueFormatter[AccountMessages] {

override def defaultObject: Messages = Messages()
override def defaultObject: AccountMessages = AccountMessages()

override def defaultReads: Reads[Messages] = Json.reads[Messages]
override def defaultReads: Reads[AccountMessages] = Json.reads[AccountMessages]

override implicit def jsonWrites: OWrites[Messages] = Json.writes[Messages]
override implicit def jsonWrites: OWrites[AccountMessages] = Json.writes[AccountMessages]
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ package uk.gov.hmrc.hmrcfrontend.views.viewmodels.accountmenu
import uk.gov.hmrc.hmrcfrontend.views.viewmodels.JsonRoundtripSpec
import uk.gov.hmrc.hmrcfrontend.views.viewmodels.accountmenu.Generators._

class MessagesSpec extends JsonRoundtripSpec[Messages]
class AccountMessagesSpec extends JsonRoundtripSpec[AccountMessages]
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ object Generators {
CheckProgress(href = href, active = active)
}

implicit val arbMessages: Arbitrary[Messages] = Arbitrary {
implicit val arbMessages: Arbitrary[AccountMessages] = Arbitrary {
for {
href <- genAlphaStr()
active <- arbBool.arbitrary
messageCount <- Gen.option(Gen.chooseNum(0, 5))
} yield
Messages(href = href, active = active, messageCount = messageCount)
AccountMessages(href = href, active = active, messageCount = messageCount)
}

implicit val arbPaperlessSettings: Arbitrary[PaperlessSettings] = Arbitrary {
Expand Down

0 comments on commit 76dcf88

Please sign in to comment.