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

Feedback survey #669

Merged
merged 7 commits into from
Aug 14, 2024
Merged

Feedback survey #669

merged 7 commits into from
Aug 14, 2024

Conversation

MatMoore
Copy link
Contributor

@MatMoore MatMoore commented Aug 12, 2024

This adds a GOV.UK style survey to the page that writes to the database.

To get the data out I've added a ./manage.py command that outputs CSV.

Screenshots

Screenshot 2024-08-13 at 15 49 42 Screenshot 2024-08-13 at 15 50 10

Details

I've created a new app for this rather than adding to the home one, as they are quite separate things. The only dependency on home is the base layout.

I had to put a weird workaround in the ModelForm in order for the form to not render an empty choice with label "-----". (ModelForm behaviour is described here: https://docs.djangoproject.com/en/5.0/topics/forms/modelforms/#field-types)

I'm sure I'm missing something simple here but I was banging my ahead against it so just wanted to get something working for now.

@MatMoore MatMoore force-pushed the fmj-557-feedback-page branch from 62e6dfd to ca82c7e Compare August 13, 2024 14:49
@MatMoore MatMoore changed the title Fmj 557 feedback page Feedback survey Aug 13, 2024
@MatMoore MatMoore force-pushed the fmj-557-feedback-page branch from 04ede5e to e085c4f Compare August 13, 2024 15:29
@MatMoore MatMoore marked this pull request as ready for review August 13, 2024 15:30
@MatMoore MatMoore requested a review from a team as a code owner August 13, 2024 15:30
This follows the pattern set by GOV.UK but stores
responses in the database. We are building our own because we're in
private beta this is an internal service (not on GOV.UK)

The form is linked from the MOJ internal header, rather than the
phase banner where we would put it on an external service.
@MatMoore MatMoore force-pushed the fmj-557-feedback-page branch from e085c4f to b1cb3fd Compare August 13, 2024 15:34
@MatMoore
Copy link
Contributor Author

To export data:

  1. Navigate to a container in k9s
  2. Open a shell
  3. Run DJANGO_LOG_LEVEL=INFO ./manage.py export_feedback

Copy link
Collaborator

@mitchdawson1982 mitchdawson1982 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM

@MatMoore MatMoore merged commit d98514f into main Aug 14, 2024
7 checks passed
@MatMoore MatMoore deleted the fmj-557-feedback-page branch August 14, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants