-
Notifications
You must be signed in to change notification settings - Fork 9
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 #18 from hmrc/PLATUI-443-remove-snapshotter-dep
Remove dependency on x-frontend-snapshotter, simplify build
- Loading branch information
Showing
239 changed files
with
1,049 additions
and
1,578 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,4 @@ npm-debug.log | |
yarn-debug.log | ||
yarn-error.log | ||
.DS_Store | ||
|
||
|
||
src/main/play-25/twirl/**/*.scala.html |
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,60 @@ | ||
import java.io.File | ||
|
||
import play.api.libs.json.{JsObject, Json} | ||
import sbt._ | ||
import scalaj.http.{Http, HttpOptions} | ||
import scala.util.{Failure, Success, Try} | ||
|
||
object GenerateFixtures { | ||
def getExamples(frontendVersion: String): Seq[JsObject] = { | ||
|
||
val rendererPort: String = "3000" | ||
val endpoint: String = s"http://localhost:$rendererPort/snapshot/hmrc/$frontendVersion" | ||
|
||
val attempt: Try[Seq[JsObject]] = Try { | ||
val response = Http(endpoint) | ||
.option(HttpOptions.connTimeout(2000)) | ||
.option(HttpOptions.readTimeout(5000)) | ||
.asString | ||
.body | ||
|
||
Json.parse(response).as[Seq[JsObject]] | ||
} | ||
|
||
attempt match { | ||
case Success(snapshot) => snapshot | ||
case Failure(e) => | ||
println(s"Failed to fetch snapshot from Template Service at $endpoint. Details: [${e.getLocalizedMessage}].") | ||
Seq() | ||
} | ||
} | ||
|
||
def generateFixtures(javaResourcesDir: File, govukFrontendVersion: String): Unit = { | ||
val resourcesDir = javaResourcesDir | ||
val fixturesDir = resourcesDir / "fixtures" | ||
val testFixturesDir = | ||
(fixturesDir / s"test-fixtures") | ||
|
||
IO.delete(testFixturesDir) | ||
IO.createDirectory(testFixturesDir) | ||
|
||
IO.write((testFixturesDir / "VERSION.txt"), govukFrontendVersion) | ||
|
||
for (example <- getExamples(govukFrontendVersion)) { | ||
val componentName = (example \ "componentName").as[String] | ||
val componentJson = Json.obj( | ||
"name" -> componentName | ||
) | ||
val inputJson = (example \ "input").as[JsObject] | ||
val exampleDir = testFixturesDir / (example \ "exampleId").as[String] | ||
|
||
IO.createDirectory(exampleDir) | ||
IO.write((exampleDir / "input.json"), Json.prettyPrint(inputJson)) | ||
IO.write( | ||
(exampleDir / "component.json"), | ||
Json.prettyPrint(componentJson) | ||
) | ||
IO.write((exampleDir / "output.txt"), (example \ "output").as[String]) | ||
} | ||
} | ||
} |
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 @@ | ||
libraryDependencies ++= Seq( | ||
"org.scalaj" %% "scalaj-http" % "2.4.2" | ||
) |
126 changes: 0 additions & 126 deletions
126
src/main/play-25/twirl/uk/gov/hmrc/hmrcfrontend/views/components/hmrcAccountMenu.scala.html
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
src/main/play-25/twirl/uk/gov/hmrc/hmrcfrontend/views/components/hmrcBanner.scala.html
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.