Skip to content

Commit

Permalink
Merge pull request #1018 from hmrc/SDT-1047_fix-error-pages-assets-path
Browse files Browse the repository at this point in the history
SDT-1047 fix error pages assets path
  • Loading branch information
Mat Carey authored Apr 4, 2019
2 parents dba354d + 004ad87 commit 074f9dd
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [3.10.0] and [4.10.0] - 2019-04-03
### Fixed
- The assets path in the static error pages was pointing to a SNAPSHOT version of the assests since new build changes
- The javascript link in the static error pages was pointing to an unminified filename which isn't present in the release

## [3.9.0] and [4.9.0] - 2019-01-24
### Updated
- Updated VAT registration number documentation [#1012](https://github.com/hmrc/assets-frontend/pull/1012)
Expand Down Expand Up @@ -372,6 +377,7 @@ This entire version is covered by a single pull request. [#867](https://github.c
- Changes to nginx error pages not being build and deployed [#734]

[Unreleased]: https://github.com/hmrc/assets-frontend/compare/release/4.2.0...master
[4.10.0]: https://github.com/hmrc/assets-frontend/compare/v4.9.0...v4.10.0
[4.9.0]: https://github.com/hmrc/assets-frontend/compare/v4.8.0...v4.9.0
[4.8.0]: https://github.com/hmrc/assets-frontend/compare/v4.7.0...v4.8.0
[4.7.0]: https://github.com/hmrc/assets-frontend/compare/release/4.6.0...v4.7.0
Expand All @@ -386,6 +392,7 @@ This entire version is covered by a single pull request. [#867](https://github.c
[4.2.1]: https://github.com/hmrc/assets-frontend/compare/release/4.2.0...release/4.2.1
[4.2.0]: https://github.com/hmrc/assets-frontend/compare/release/4.1.0...release/4.2.0
[4.1.0]: https://github.com/hmrc/assets-frontend/compare/release/3.0.2...release/4.1.0
[3.10.0]: https://github.com/hmrc/assets-frontend/compare/v3.9.0...v3.10.0
[3.9.0]: https://github.com/hmrc/assets-frontend/compare/v3.8.0...v3.9.0
[3.8.0]: https://github.com/hmrc/assets-frontend/compare/v3.7.0...v3.8.0
[3.7.0]: https://github.com/hmrc/assets-frontend/compare/release/3.6.0...v3.7.0
Expand Down
2 changes: 1 addition & 1 deletion assets/error_pages/400.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,6 @@ <h2><a href="http://www.nationalarchives.gov.uk/doc/open-government-licence/vers
<!--end footer-->

<script src="/template/assets/javascripts/govuk-template.js" type="text/javascript"></script>
<script src="{{ assetsPath }}javascripts/application.js" type="text/javascript"></script>
<script src="{{ assetsPath }}javascripts/application.min.js" type="text/javascript"></script>
</body>
</html>
3 changes: 2 additions & 1 deletion assets/error_pages/401.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ <h2>
<!--end footer-->

<script src="/template/assets/javascripts/govuk-template.js" type="text/javascript"></script>
<script src="{{ assetsPath }}javascripts/application.js" type="text/javascript"></script>
<script src="{{ assetsPath }}javascripts/application.min.js" type="text/javascript"></script>
</body>
</html>
s
2 changes: 1 addition & 1 deletion assets/error_pages/403.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,6 @@ <h2>
<!--end footer-->

<script src="/template/assets/javascripts/govuk-template.js" type="text/javascript"></script>
<script src="{{ assetsPath }}javascripts/application.js" type="text/javascript"></script>
<script src="{{ assetsPath }}javascripts/application.min.js" type="text/javascript"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion assets/error_pages/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@ <h2>
<!--end footer-->

<script src="/template/assets/javascripts/govuk-template.js" type="text/javascript"></script>
<script src="{{ assetsPath }}javascripts/application.js" type="text/javascript"></script>
<script src="{{ assetsPath }}javascripts/application.min.js" type="text/javascript"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion assets/error_pages/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ <h2><a href="http://www.nationalarchives.gov.uk/doc/open-government-licence/vers
<!--end footer-->

<script src="/template/assets/javascripts/govuk-template.js" type="text/javascript"></script>
<script src="{{ assetsPath }}javascripts/application.js" type="text/javascript"></script>
<script src="{{ assetsPath }}javascripts/application.min.js" type="text/javascript"></script>
</body>
</html>
9 changes: 8 additions & 1 deletion gulpfile.js/tasks/error-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ const path = require('path')
const gulp = require('gulp')
const replace = require('gulp-replace')
const config = require('../config')
const NodeGitVersion = require('@hmrc/node-git-versioning')
let version = ''

const errorPages = (v) => {
const version = process.env.TAG ? process.env.TAG : path.parse(config.snapshotDir[v]).name
const nextMinorVersion = parseInt(NodeGitVersion().split('.')[1]) + 1

if (/https?:\/\/.*\.tax\.service\.gov\.uk\//.test(process.env.JENKINS_URL)) {
version = [v.slice(1), nextMinorVersion, '0'].join('.')
} else {
version = path.parse(config.snapshotDir[v]).name
}
return gulp.src(config.errorPages.src)
.pipe(replace('{{ assetsPath }}', `${config.errorPages.assetsBaseUri}${version}/`))
.pipe(gulp.dest(config.snapshotDir[v]))
Expand Down

0 comments on commit 074f9dd

Please sign in to comment.