Skip to content

Commit

Permalink
Merge branch 'release/1.46.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-nick17 committed Dec 1, 2022
2 parents 3e5ade3 + 7854cf7 commit e4c2ccc
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 6 deletions.
4 changes: 4 additions & 0 deletions assets/locales/service.cy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ one = "Select your download format"
description = "Get the data component lead text"
one = "Download the data in the following formats"

[GetDataXLSXInfo]
description = "xlsx delay information with {{.URI}}"
one = "If you are not seeing an <strong>xlsx</strong> download file, please <a href=\"{{.arg0}}\">refresh the page</a>. If the number of rows within the data set exceeds 1 million, the <strong>xlsx</strong> download file will not be available."

[IncludesSupportingInfo]
description = "Dataset and supporting information"
one = "Dataset and supporting information"
Expand Down
4 changes: 4 additions & 0 deletions assets/locales/service.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ one = "Select your download format"
description = "Get the data component lead text"
one = "Download the data in the following formats"

[GetDataXLSXInfo]
description = "xlsx delay information with {{.URI}}"
one = "If you are not seeing an <strong>xlsx</strong> download file, please <a href=\"{{.arg0}}\">refresh the page</a>. If the number of rows within the data set exceeds 1 million, the <strong>xlsx</strong> download file will not be available."

[IncludesSupportingInfo]
description = "Dataset and supporting information"
one = "Dataset and supporting information"
Expand Down
19 changes: 13 additions & 6 deletions assets/templates/partials/census/get-data.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
<h2 class="ons-u-mt-xl ons-u-pb-no ons-u-pt-no">{{ localise "GetData" .Language 1 }}</h2>
{{ if .DatasetLandingPage.HasDownloads }}
<div data-get-data-form-downloads="ready">
{{ if .DatasetLandingPage.ShowXLSXInfo }}
<div class="ons-text-indent">
<p class="default-line-height">
{{- localise "GetDataXLSXInfo" .Language 1 .URI | safeHTML -}}
</p>
</div>
{{ end }}
{{ if .Error.Title }}
<div class="ons-panel ons-panel--error ons-panel--no-title" id="select-format-error">
<span class="ons-u-vh">Error: </span>
<div class="ons-panel__body">
<p class="ons-panel__error">
<strong>{{ localise "GetDataValidationError" .Language 1 }}</strong>
</p>
<div class="ons-panel ons-panel--error ons-panel--no-title" id="select-format-error">
<span class="ons-u-vh">Error: </span>
<div class="ons-panel__body">
<p class="ons-panel__error">
<strong>{{ localise "GetDataValidationError" .Language 1 }}</strong>
</p>
{{ end }}
<form method="get" name="get-data-form">
<input type="hidden" name="f" value="get-data">
Expand Down
1 change: 1 addition & 0 deletions mapper/census.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ func CreateCensusDatasetLandingPage(isEnableMultivariate bool, ctx context.Conte

if isFilterOutput && len(filterOutput) >= 3 {
p.DatasetLandingPage.HasDownloads = true
p.DatasetLandingPage.ShowXLSXInfo = true
}

if p.HasContactDetails {
Expand Down
8 changes: 8 additions & 0 deletions mapper/census_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,10 @@ func TestCreateCensusDatasetLandingPage(t *testing.T) {
So(page.DatasetLandingPage.HasDownloads, ShouldBeTrue)
})

Convey("GetDataXLSXInfo set to false", func() {
So(page.DatasetLandingPage.ShowXLSXInfo, ShouldBeFalse)
})

Convey("Downloads are sorted by fixed extension order", func() {
So(page.Version.Downloads[0].Extension, ShouldEqual, "xls")
So(page.Version.Downloads[1].Extension, ShouldEqual, "csv")
Expand Down Expand Up @@ -687,6 +691,10 @@ func TestCreateCensusDatasetLandingPage(t *testing.T) {
So(page.DatasetLandingPage.HasDownloads, ShouldBeTrue)
})

Convey("GetDataXLSXInfo set to true for custom datasets", func() {
So(page.DatasetLandingPage.ShowXLSXInfo, ShouldBeTrue)
})

Convey("Downloads are sorted by fixed extension order", func() {
So(page.Version.Downloads[0].Extension, ShouldEqual, "csv")
So(page.Version.Downloads[1].Extension, ShouldEqual, "txt")
Expand Down
1 change: 1 addition & 0 deletions model/datasetLandingPageCensus/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type DatasetLandingPage struct {
QualityStatements []Panel `json:"quality_statements"`
RelatedContentItems []RelatedContentItem `json:"related_content_items"`
IsMultivariate bool `json:"is_multivariate"`
ShowXLSXInfo bool `json:"show_xlsx_info"`
}

// Panel contains the data required to populate a panel UI component
Expand Down

0 comments on commit e4c2ccc

Please sign in to comment.