Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-nick17 committed May 12, 2023
2 parents 40fa81c + 08de895 commit 19adb81
Show file tree
Hide file tree
Showing 26 changed files with 973 additions and 572 deletions.
8 changes: 4 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ linters:
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- deadcode
- depguard
- dogsled
- gochecknoinits
Expand All @@ -64,7 +63,6 @@ linters:
- ineffassign
- nakedret
- unconvert
- varcheck
- whitespace
- gocognit
- prealloc
Expand All @@ -82,12 +80,14 @@ issues:
- gocritic
- ineffassign
- govet
- path: main.go
linters:
- typecheck
new: false

# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.43.x # use the fixed version to not introduce new linters unexpectedly
golangci-lint-version: 1.52.x # use the fixed version to not introduce new linters unexpectedly
prepare:
- echo "here I can run custom commands, but no preparation needed for this repo"
- echo "here I can run custom commands, but no preparation needed for this repo"
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BINPATH ?= build
BUILD_TIME=$(shell date +%s)
GIT_COMMIT=$(shell git rev-parse HEAD)
VERSION ?= $(shell git tag --points-at HEAD | grep ^v | head -n 1)
LOCAL_DP_RENDERER_IN_USE = $(shell grep -c "\"github.com/ONSdigital/dp-renderer\" =" go.mod)
LOCAL_DP_RENDERER_IN_USE = $(shell grep -c "\"github.com/ONSdigital/dp-renderer/v2\" =" go.mod)

LDFLAGS = -ldflags "-X main.BuildTime=$(BUILD_TIME) -X main.GitCommit=$(GIT_COMMIT) -X main.Version=$(VERSION)"

Expand All @@ -18,8 +18,9 @@ audit:
build: generate-prod
go build -tags 'production' $(LDFLAGS) -o $(BINPATH)/dp-frontend-feedback-controller

.PHONY: lint
lint:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2
golangci-lint run ./...

.PHONY: debug
Expand Down Expand Up @@ -58,8 +59,8 @@ generate-prod: fetch-renderer-lib
.PHONY: fetch-dp-renderer
fetch-renderer-lib:
ifeq ($(LOCAL_DP_RENDERER_IN_USE), 1)
$(eval CORE_ASSETS_PATH = $(shell grep -w "\"github.com/ONSdigital/dp-renderer\" =>" go.mod | awk -F '=> ' '{print $$2}' | tr -d '"'))
$(eval CORE_ASSETS_PATH = $(shell grep -w "\"github.com/ONSdigital/dp-renderer/v2\" =>" go.mod | awk -F '=> ' '{print $$2}' | tr -d '"'))
else
$(eval APP_RENDERER_VERSION=$(shell grep "github.com/ONSdigital/dp-renderer" go.mod | cut -d ' ' -f2 ))
$(eval CORE_ASSETS_PATH = $(shell go get github.com/ONSdigital/dp-renderer@$(APP_RENDERER_VERSION) && go list -f '{{.Dir}}' -m github.com/ONSdigital/dp-renderer))
$(eval APP_RENDERER_VERSION=$(shell grep "github.com/ONSdigital/dp-renderer/v2" go.mod | cut -d ' ' -f2 ))
$(eval CORE_ASSETS_PATH = $(shell go get github.com/ONSdigital/dp-renderer/v2@$(APP_RENDERER_VERSION) && go list -f '{{.Dir}}' -m github.com/ONSdigital/dp-renderer/v2))
endif
47 changes: 25 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,43 @@ To allow users to provide feedback about the ONS website

## Getting started

* Run `make debug`
- Run `make debug`

## Dependencies

* No further dependencies other than those defined in `go.mod`
- No further dependencies other than those defined in `go.mod`

## Configuration

| Environment variable | Default | Description
| ------------------------------ | --------- | -----------
| BIND_ADDR | localhost:25200 | The host and port to bind to
| GRACEFUL_SHUTDOWN_TIMEOUT | 5s | The graceful shutdown timeout in seconds (`time.Duration` format)
| HEALTHCHECK_INTERVAL | 30s | Time between self-healthchecks (`time.Duration` format)
| HEALTHCHECK_CRITICAL_TIMEOUT | 90s | Time to wait until an unhealthy dependent propagates its state to make this app unhealthy (`time.Duration` format)
| RENDERER_URL | http://localhost:20010 | The URL of [dp-frontend-renderer](https://www.github.com/ONSdigital/dp-frontend-renderer).
| MAIL_HOST | "" | The host for the mail server.
| MAIL_PORT | "" | The port for the mail server.
| MAIL_USER | "" | A user on the mail server.
| MAIL_PASSWORD | "" | The password for the mail server user.
| FEEDBACK_TO | "" | Receiver email address for feedback.
| FEEDBACK_FROM | "" | Sender email address for feedback.
| DEBUG | false | Enable debug mode
| API_ROUTER_URL | http://localhost:23200/v1 | The URL of the [dp-api-router](https://github.com/ONSdigital/dp-api-router)
| SITE_DOMAIN | localhost |
| PATTERN_LIBRARY_ASSETS_PATH | "" | Pattern library location
| SUPPORTED_LANGUAGES | [2]string{"en", "cy"} | Supported languages
| Environment variable | Default | Description |
| ------------------------------ | --------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| API_ROUTER_URL | <http://localhost:23200/v1> | The URL of the [dp-api-router](https://github.com/ONSdigital/dp-api-router) |
| BIND_ADDR | localhost:25200 | The host and port to bind to |
| CENSUS_TOPIC_ID | 4445 | The census topic id |
| DEBUG | false | Enable debug mode |
| ENABLE_CENSUS_TOPIC_SUBSECTION | false | Enable census topic subsection |
| ENABLE_NEW_NAVBAR | false | Enable new navigation bar |
| GRACEFUL_SHUTDOWN_TIMEOUT | 5s | The graceful shutdown timeout in seconds (`time.Duration` format) |
| HEALTHCHECK_INTERVAL | 30s | Time between self-healthchecks (`time.Duration` format) |
| HEALTHCHECK_CRITICAL_TIMEOUT | 90s | Time to wait until an unhealthy dependent propagates its state to make this app unhealthy (`time.Duration` format) |
| MAIL_HOST | "" | The host for the mail server. |
| MAIL_PORT | "" | The port for the mail server. |
| MAIL_USER | "" | A user on the mail server. |
| MAIL_PASSWORD | "" | The password for the mail server user. |
| FEEDBACK_TO | "" | Receiver email address for feedback. |
| FEEDBACK_FROM | "" | Sender email address for feedback. |
| IS_PUBLISHING_MODE | false |
| PATTERN_LIBRARY_ASSETS_PATH | "" | Pattern library location |
| SERVICE_AUTH_TOKEN | "" | Service authorisation token |
| SITE_DOMAIN | localhost |
| SUPPORTED_LANGUAGES | []string{"en", "cy"} | Supported languages |

## Contributing

See [CONTRIBUTING](CONTRIBUTING.md) for details.

## License

Copyright © 2021, Office for National Statistics (https://www.ons.gov.uk)
Copyright © 2023, Office for National Statistics (<https://www.ons.gov.uk>)

Released under MIT license, see [LICENSE](LICENSE.md) for details.

26 changes: 15 additions & 11 deletions assets/locales/service.cy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------

[FeedbackTitle]
description = "{{.Metadata.Title}}"
one = "{{.arg0}}"
description = "Feedback"
one = "Feedback"

[FeedbackDesc]
descriptions = "You can use the form below to ask a question, report a problem or suggest an improvement we can make to ONS.GOV.UK"
Expand All @@ -30,16 +30,20 @@ description = "This specific page"
one = "This specific page"

[FeedbackWhatEnterURL]
description = "Enter URL or name of the page"
one = "Enter URL or name of the page"
description = "Enter URL of the page"
one = "Enter URL of the page"

[FeedbackWhatOptHintSpecificPage]
description = "{{.ServiceDescription}}"
one = "({{.arg0}})"
[FeedbackValidURL]
description = "Enter a valid URL"
one = "Enter a valid URL"

[FeedbackChooseType]
description = "Choose a type"
one = "Choose a type"

[FeedbackWhatOptNewService]
description = "This new service"
one = "This new service"
description = "This {{.ServiceName}} service"
one = "The {{.arg0}} service"

[FeedbackWhatOptGeneral]
description = "The whole <abbr title=\"Office for National Statistics\">ONS</abbr> website or general feedback"
Expand Down Expand Up @@ -86,8 +90,8 @@ description = "Send feedback"
one = "Send feedback"

[FeedbackFinished]
description = "Your feedback will help us to improve the website. We are unable to respond to all enquiries. If your matter is urgent, please <a href=\"/aboutus/contactus\">contact us</a>.<br><br>Return to <a href=\"{{.Metadata.Description}}\">{{.Metadata.Description}}"
one = "Your feedback will help us to improve the website. We are unable to respond to all enquiries. If your matter is urgent, please <a href=\"/aboutus/contactus\">contact us</a>.<br><br>Return to <a href=\"{{.arg0}}\">{{.arg0}}"
description = "Your feedback will help us to improve the website. We are unable to respond to all enquiries. If your matter is urgent, please <a href=\"/aboutus/contactus\">contact us</a>."
one = "Your feedback will help us to improve the website. We are unable to respond to all enquiries. If your matter is urgent, please <a href=\"/aboutus/contactus\">contact us</a>."

[FeedbackWholeWebsite]
description = "The whole ONS website or general feedback"
Expand Down
26 changes: 15 additions & 11 deletions assets/locales/service.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------

[FeedbackTitle]
description = "{{.Metadata.Title}}"
one = "{{.arg0}}"
description = "Feedback"
one = "Feedback"

[FeedbackDesc]
descriptions = "You can use the form below to ask a question, report a problem or suggest an improvement we can make to ONS.GOV.UK"
Expand All @@ -30,16 +30,20 @@ description = "This specific page"
one = "This specific page"

[FeedbackWhatEnterURL]
description = "Enter URL or name of the page"
one = "Enter URL or name of the page"
description = "Enter URL of the page"
one = "Enter URL of the page"

[FeedbackWhatOptHintSpecificPage]
description = "{{.ServiceDescription}}"
one = "({{.arg0}})"
[FeedbackValidURL]
description = "Enter a valid URL"
one = "Enter a valid URL"

[FeedbackChooseType]
description = "Choose a type"
one = "Choose a type"

[FeedbackWhatOptNewService]
description = "This new service"
one = "This new service"
description = "This {{.ServiceName}} service"
one = "The {{.arg0}} service"

[FeedbackWhatOptGeneral]
description = "The whole <abbr title=\"Office for National Statistics\">ONS</abbr> website or general feedback"
Expand Down Expand Up @@ -86,8 +90,8 @@ description = "Send feedback"
one = "Send feedback"

[FeedbackFinished]
description = "Your feedback will help us to improve the website. We are unable to respond to all enquiries. If your matter is urgent, please <a href=\"/aboutus/contactus\">contact us</a>.<br><br>Return to <a href=\"{{.Metadata.Description}}\">{{.Metadata.Description}}"
one = "Your feedback will help us to improve the website. We are unable to respond to all enquiries. If your matter is urgent, please <a href=\"/aboutus/contactus\">contact us</a>.<br><br>Return to <a href=\"{{.arg0}}\">{{.arg0}}"
description = "Your feedback will help us to improve the website. We are unable to respond to all enquiries. If your matter is urgent, please <a href=\"/aboutus/contactus\">contact us</a>."
one = "Your feedback will help us to improve the website. We are unable to respond to all enquiries. If your matter is urgent, please <a href=\"/aboutus/contactus\">contact us</a>."

[FeedbackWholeWebsite]
description = "The whole ONS website or general feedback"
Expand Down
51 changes: 33 additions & 18 deletions assets/templates/feedback-thanks.tmpl
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
{{$Language := .Language}}
<div class="feedback-page-intro background--gallery">
<div class="wrapper">
<div class="col-wrap">
<div class="col margin-top--1">
{{ template "partials/breadcrumb" . }}
<h1 class="feedback-thanks feedback-page-intro__title margin-bottom--4" aria-live="polite">
<strong>{{ localise "FeedbackThanks" $Language 1 $.Metadata.Title }}</strong>
</h1>
</div>
</div>
</div>
</div>
<div id="feedback-form-page-container" class="wrapper">
<div class="col-wrap margin-bottom--4">
<div class="col col--lg-two-thirds col--md-two-thirds">
<div class="font-size--16 margin-top--4">
{{ localise "FeedbackFinished" $Language 1 .Metadata.Description .Metadata.Description | safeHTML }}
<div class="ons-page__container ons-container">
<div class="ons-grid ons-u-ml-no">
<div class="ons-grid__col ons-col-12@m ons-u-pl-no">
<div class="ons-page__main">
<div aria-labelledby="alert" role="alert" tabindex="-1" class="ons-panel ons-panel--success ons-panel--no-title">
<span id="alert" class="ons-panel__assistive-text ons-u-vh">Completed:
</span>
<span class="ons-panel__icon ons-u-fs-xl">
<svg
class="ons-svg-icon ons-svg-icon--xl"
viewBox="0 0 13 10"
xmlns="http://www.w3.org/2000/svg"
focusable="false"
fill="currentColor">
<path
d="M14.35,3.9l-.71-.71a.5.5,0,0,0-.71,0h0L5.79,10.34,3.07,7.61a.51.51,0,0,0-.71,0l-.71.71a.51.51,0,0,0,0,.71l3.78,3.78a.5.5,0,0,0,.71,0h0L14.35,4.6A.5.5,0,0,0,14.35,3.9Z"
transform="translate(-1.51 -3.04)"/>
</svg>
</span>
<div class="ons-panel__body ons-svg-icon-margin--xl">
<h1>{{- localise "FeedbackThanks" .Language 1 -}}</h1>
<div class="ons-panel__body">
{{- localise "FeedbackFinished" .Language 1 | safeHTML -}}
</div>
</div>
</div>
<a href="{{- .ReturnTo -}}" class="ons-btn ons-btn--link ons-js-submit-btn ons-u-mt-m">
<span class="ons-btn__inner">
<span class="ons-btn__text">
Done
</span>
</span>
</a>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 19adb81

Please sign in to comment.