Skip to content

Commit

Permalink
Change radio behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintRhys committed Jul 2, 2024
1 parent 5b25ab9 commit 6b66773
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions mapper/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,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 @@ -82,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 @@ -108,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

0 comments on commit 6b66773

Please sign in to comment.