Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.4.0 #66

Merged
merged 6 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions dp-frontend-feedback-controller.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ job "dp-frontend-feedback-controller" {
group "web" {
count = "{{WEB_TASK_COUNT}}"

spread {
attribute = "${node.unique.id}"
weight = 100
# with `target` omitted, Nomad will spread allocations evenly across all values of the attribute.
}
spread {
attribute = "${attr.platform.aws.placement.availability-zone}"
weight = 100
# with `target` omitted, Nomad will spread allocations evenly across all values of the attribute.
}

constraint {
attribute = "${node.class}"
value = "web"
Expand Down Expand Up @@ -78,6 +89,17 @@ job "dp-frontend-feedback-controller" {
group "publishing" {
count = "{{PUBLISHING_TASK_COUNT}}"

spread {
attribute = "${node.unique.id}"
weight = 100
# with `target` omitted, Nomad will spread allocations evenly across all values of the attribute.
}
spread {
attribute = "${attr.platform.aws.placement.availability-zone}"
weight = 100
# with `target` omitted, Nomad will spread allocations evenly across all values of the attribute.
}

constraint {
attribute = "${node.class}"
value = "publishing"
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ require (
github.com/ONSdigital/dp-topic-api v0.22.0
github.com/ONSdigital/go-ns v0.0.0-20210916104633-ac1c1c52327e
github.com/ONSdigital/log.go/v2 v2.4.3
github.com/elazarl/go-bindata-assetfs v1.0.1
github.com/gorilla/mux v1.8.1
github.com/gorilla/schema v1.3.0
github.com/gorilla/schema v1.4.1
github.com/justinas/alice v1.2.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/kevinburke/go-bindata v3.24.0+incompatible
Expand Down
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM=
github.com/elazarl/go-bindata-assetfs v1.0.1 h1:m0kkaHRKEu7tUIUFVwhGGGYClXvyl4RE03qmvRTNfbw=
github.com/elazarl/go-bindata-assetfs v1.0.1/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
github.com/facebookgo/freeport v0.0.0-20150612182905-d4adf43b75b9 h1:wWke/RUCl7VRjQhwPlR/v0glZXNYzBHdNUzf/Am2Nmg=
github.com/facebookgo/freeport v0.0.0-20150612182905-d4adf43b75b9/go.mod h1:uPmAp6Sws4L7+Q/OokbWDAK1ibXYhB3PXFP1kol5hPg=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
Expand Down Expand Up @@ -70,8 +68,8 @@ github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
github.com/gorilla/schema v1.1.0/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU=
github.com/gorilla/schema v1.3.0 h1:rbciOzXAx3IB8stEFnfTwO3sYa6EWlQk79XdyustPDA=
github.com/gorilla/schema v1.3.0/go.mod h1:Dg5SSm5PV60mhF2NFaTV1xuYYj8tV8NOPRo4FggUMnM=
github.com/gorilla/schema v1.4.1 h1:jUg5hUjCSDZpNGLuXQOgIWGdlgrIdYvgQ0wZtdK1M3E=
github.com/gorilla/schema v1.4.1/go.mod h1:Dg5SSm5PV60mhF2NFaTV1xuYYj8tV8NOPRo4FggUMnM=
github.com/gosimple/slug v1.14.0 h1:RtTL/71mJNDfpUbCOmnf/XFkzKRtD6wL6Uy+3akm4Es=
github.com/gosimple/slug v1.14.0/go.mod h1:UiRaFH+GEilHstLUmcBgWcI42viBN7mAb818JrYOeFQ=
github.com/gosimple/unidecode v1.0.1 h1:hZzFTMMqSswvf0LBJZCZgThIZrpDHFXux9KeGmn6T/o=
Expand All @@ -88,8 +86,6 @@ github.com/justinas/alice v1.2.0 h1:+MHSA/vccVCF4Uq37S42jwlkvI2Xzl7zTPCN5BnZNVo=
github.com/justinas/alice v1.2.0/go.mod h1:fN5HRH/reO/zrUflLfTN43t3vXvKzvZIENsNEe7i7qA=
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg=
github.com/kevinburke/go-bindata v1.1.0 h1:JZ8XIdxtkAszuYkgf17qwQzcU/RgsGSVLSULJdN+5bU=
github.com/kevinburke/go-bindata v1.1.0/go.mod h1:UJ72WTOoRKzbz+vwtKgARJwsy+1ZGUukVBUCc197TJo=
github.com/kevinburke/go-bindata v3.24.0+incompatible h1:qajFA3D0pH94OTLU4zcCCKCDgR+Zr2cZK/RPJHDdFoY=
github.com/kevinburke/go-bindata v3.24.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
Expand Down
12 changes: 9 additions & 3 deletions mapper/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func CreateGetFeedback(req *http.Request, basePage core.Page, validationErrors [
var services = make(map[string]string)
services["cmd"] = "customising data by applying filters"
services["dev"] = "ONS developer"
services["search"] = "search"
serviceDescription := services[req.URL.Query().Get("service")]

p.Language = lang
Expand Down Expand Up @@ -69,7 +70,7 @@ func CreateGetFeedback(req *http.Request, basePage core.Page, validationErrors [
{
Input: core.Input{
ID: "specific-page",
IsChecked: ff.Type == "A specific page" || ff.URL != "",
IsChecked: ff.Type == "A specific page" || (ff.URL != "" && serviceDescription == ""),
Label: core.Localisation{
LocaleKey: "FeedbackASpecificPage",
Plural: 1,
Expand All @@ -81,7 +82,12 @@ func CreateGetFeedback(req *http.Request, basePage core.Page, validationErrors [
Autocomplete: "url",
ID: "page-url-field",
Name: "url",
Value: ff.URL,
Value: func() string {
if serviceDescription != "" {
return ""
}
return ff.URL
}(),
Label: core.Localisation{
LocaleKey: "FeedbackWhatEnterURL",
Plural: 1,
Expand All @@ -107,7 +113,7 @@ func CreateGetFeedback(req *http.Request, basePage core.Page, validationErrors [
core.Radio{
Input: core.Input{
ID: "new-service",
IsChecked: ff.Type == "new-service",
IsChecked: true,
Label: core.Localisation{
Text: helper.Localise("FeedbackWhatOptNewService", lang, 1, serviceDescription),
},
Expand Down