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

TP2000-1185 Add maintenance mode #1137

Merged
merged 10 commits into from
Jan 22, 2024
Merged

Conversation

mattjamc
Copy link
Collaborator

@mattjamc mattjamc commented Jan 22, 2024

TP2000-1185 Add maintenance mode

Why

Some types of application update require that TAP is out of action for a short period of time - or at least, no data should be changed during that time. A means of preventing active user interfaction with the service should provided, while also showing an informative message.

What

This PR:

  • adds ENV variable for MAINTENANCE_MODE to be set to True whenever we need to take TAP down temporarily
  • adds a url/template and view for a page letting users know TAP is down for maintenance (following GDS guidelines)
  • adds middleware to check the maintenance mode variable and redirect accordingly
  • conditionally removes middleware that might write to the database during maintenance mode as well as the admin app
  • adds tests for the maintenance mode redirect and page content
  • updates incorrect contact us links on the 403 and 500 error pages

image

@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2024

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (1acdd9c) 93.32% compared to head (db4a86b) 93.30%.

Files Patch % Lines
settings/common.py 16.66% 8 Missing and 2 partials ⚠️
common/middleware.py 72.72% 2 Missing and 1 partial ⚠️
urls.py 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1137      +/-   ##
==========================================
- Coverage   93.32%   93.30%   -0.03%     
==========================================
  Files         571      572       +1     
  Lines       42663    42701      +38     
  Branches     3070     3074       +4     
==========================================
+ Hits        39815    39841      +26     
- Misses       2252     2260       +8     
- Partials      596      600       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mattjamc mattjamc changed the title Tp2000 1185 maintenance mode TP2000-1185 Add maintenance mode Jan 22, 2024
@mattjamc mattjamc marked this pull request as ready for review January 22, 2024 11:03
common/urls.py Outdated Show resolved Hide resolved
common/views.py Outdated Show resolved Hide resolved
@mattjamc mattjamc merged commit 01a0d09 into master Jan 22, 2024
3 checks passed
@mattjamc mattjamc deleted the TP2000-1185--maintenance-mode branch January 22, 2024 12:04
dougmills-DIT pushed a commit that referenced this pull request Feb 20, 2024
* Add MAINTENANCE_MODE setting and middleware

* Fix middleware removal and recursive redirect

* Add template view and url

* Add tests

* Update contact us form link for other pages

* Update text wording

* Remove database route during maintenance

* Update maintenance page template/url name

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>
dougmills-DIT added a commit that referenced this pull request Feb 23, 2024
* TP2000-1168 Add sub-quota, blocking period & suspension period nested review tabs (#1133)

* Add sub-quotas nested review tab

* Add quota blocking periods nested review tab

* Add quota suspension periods nested review tab

* Use tab title instead of model verbose name

* Add blocking period and suspension period SID to table

* Feat: expand expiring quotas report to include tabs (#1131)

* feat: invoke UI changes to reports and create new URL path to handle reports with multiple tabs (#1134)

* feat: Add both CSV and excel types for charts exporting (#1136)

* TP2000-1185  Add maintenance mode (#1137)

* Add MAINTENANCE_MODE setting and middleware

* Fix middleware removal and recursive redirect

* Add template view and url

* Add tests

* Update contact us form link for other pages

* Update text wording

* Remove database route during maintenance

* Update maintenance page template/url name

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>

* Increment message id & record sequence number correctly (#1083)

* record seq number & message id fix

* fix taricXMLRenderer, pass in value of counter

* feat: implement URLs for quota reports to ease navigation (#1135)

* Update readme with maintenance mode instructions. (#1140)

* TP2000-1130 Move current workbasket from Session to custom User model (#1123)

* Update User model references

* Use custom User model

* TP2000-1152-handling-invalid-workbaskets (#1113)

* Update middleware to check for workbasket changing state

* Update to use decorator rather than middleware, add pytest fixtures

* Update tests that require a session workbasket to run

* Move views and urls to workbasket app and update template

* Add tests for when workbasket status changes

* Tidy up following Pauls comments

* Update models and templates to find workbasket in user model

* Update test fixtures for workbasket being in user model

* Tidy up and test updates

* Update referencing to User model

* Updating bdd tests for new user model

* Add and update view and model unit tests

* Update require_current_workbasket decorator docstring

* Add docstring, move template for NoActiveWorkBasket view

* Amend current workbasket id retrieval in template

* Amend custom User model migration

* Remake migration adding current_workbasket field to User model

* Remove unused ValidateSessionWorkBasketMiddleware

* Make current_workbasket optional

* Add User model to admin

* Use historical models to fix migration tests

* Move ContentType data migration so it may be applied

* Rename function to remove a users current workbasket

* Amend docstrings

* Remove reference to session middleware that is no longer used

* Update workbaskets models following Pauls review

* Bring back user workbasket middleware as extra security

* Move User model from workbaskets app to common app

* Add forgotten content type data migration

* Remove setup_content_type fixture following patch to migrator fixture

* Amend middleware util method name

* Remove uneeded DoesNotExist try except block

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>

* Bump aiohttp from 3.9.1 to 3.9.2 (#1142)

Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.1 to 3.9.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.9.1...v3.9.2)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* initial commit - ref doc data model

* update importer model matching to account for end dated objects. (#1146)

* update importer model matching to account for end dated objects.

* update importer model matching to account for end dated objects.

* Tp2000 1211 (#1148)

* update govuk dependency since its been deleted at source

* update govuk dependency since its been deleted at source

* initial commit - ref doc data model

* wip commit

* Bump django from 3.2.23 to 3.2.24 (#1150)

Bumps [django](https://github.com/django/django) from 3.2.23 to 3.2.24.
- [Commits](django/django@3.2.23...3.2.24)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Tp2000 652  force rule check after real edit (#1130)

* added a check that if tracked models have been updated since the last checks business rules need run again
* data migration to add timestamps to tracked models and transaction checks
* tests for real edits
* tests for data migrations

* TP2000-1219  Prevent maintenance mode errors (#1152)

* Remove authbroker middleware when in maintenance mode

* Skip applying migrations in init script

* Prevent maintenance mode template attempts to access user attribute on request object

* Update privacy policy link

* initial commit - ref doc data model

* wip commit

* initial commit - ref doc data model

* wip commit

* wip commit

* wip commit

* added alignment report, reference document and reference document version views, refactored the checks and ran the checks several times against reference document versions.

* TP2000-1168 Add sub-quota, blocking period & suspension period nested review tabs (#1133)

* Add sub-quotas nested review tab

* Add quota blocking periods nested review tab

* Add quota suspension periods nested review tab

* Use tab title instead of model verbose name

* Add blocking period and suspension period SID to table

* Feat: expand expiring quotas report to include tabs (#1131)

* feat: invoke UI changes to reports and create new URL path to handle reports with multiple tabs (#1134)

* feat: Add both CSV and excel types for charts exporting (#1136)

* TP2000-1185  Add maintenance mode (#1137)

* Add MAINTENANCE_MODE setting and middleware

* Fix middleware removal and recursive redirect

* Add template view and url

* Add tests

* Update contact us form link for other pages

* Update text wording

* Remove database route during maintenance

* Update maintenance page template/url name

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>

* Increment message id & record sequence number correctly (#1083)

* record seq number & message id fix

* fix taricXMLRenderer, pass in value of counter

* feat: implement URLs for quota reports to ease navigation (#1135)

* Update readme with maintenance mode instructions. (#1140)

* TP2000-1130 Move current workbasket from Session to custom User model (#1123)

* Update User model references

* Use custom User model

* TP2000-1152-handling-invalid-workbaskets (#1113)

* Update middleware to check for workbasket changing state

* Update to use decorator rather than middleware, add pytest fixtures

* Update tests that require a session workbasket to run

* Move views and urls to workbasket app and update template

* Add tests for when workbasket status changes

* Tidy up following Pauls comments

* Update models and templates to find workbasket in user model

* Update test fixtures for workbasket being in user model

* Tidy up and test updates

* Update referencing to User model

* Updating bdd tests for new user model

* Add and update view and model unit tests

* Update require_current_workbasket decorator docstring

* Add docstring, move template for NoActiveWorkBasket view

* Amend current workbasket id retrieval in template

* Amend custom User model migration

* Remake migration adding current_workbasket field to User model

* Remove unused ValidateSessionWorkBasketMiddleware

* Make current_workbasket optional

* Add User model to admin

* Use historical models to fix migration tests

* Move ContentType data migration so it may be applied

* Rename function to remove a users current workbasket

* Amend docstrings

* Remove reference to session middleware that is no longer used

* Update workbaskets models following Pauls review

* Bring back user workbasket middleware as extra security

* Move User model from workbaskets app to common app

* Add forgotten content type data migration

* Remove setup_content_type fixture following patch to migrator fixture

* Amend middleware util method name

* Remove uneeded DoesNotExist try except block

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>

* Bump aiohttp from 3.9.1 to 3.9.2 (#1142)

Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.1 to 3.9.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.9.1...v3.9.2)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* update importer model matching to account for end dated objects. (#1146)

* update importer model matching to account for end dated objects.

* update importer model matching to account for end dated objects.

* Tp2000 1211 (#1148)

* update govuk dependency since its been deleted at source

* update govuk dependency since its been deleted at source

* Bump django from 3.2.23 to 3.2.24 (#1150)

Bumps [django](https://github.com/django/django) from 3.2.23 to 3.2.24.
- [Commits](django/django@3.2.23...3.2.24)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Tp2000 652  force rule check after real edit (#1130)

* added a check that if tracked models have been updated since the last checks business rules need run again
* data migration to add timestamps to tracked models and transaction checks
* tests for real edits
* tests for data migrations

* TP2000-1219  Prevent maintenance mode errors (#1152)

* Remove authbroker middleware when in maintenance mode

* Skip applying migrations in init script

* Prevent maintenance mode template attempts to access user attribute on request object

* Update privacy policy link

* Formatting updates and adding end date field to footnote create (#1154)

* TP2000-1114: React enhanced forms proof of concept (#1091)

* Add react

* Start to build origins form in react

* Build quota origin form with initial data

* Enable adding/removing of origins

* Repopulate form initial in case of error on submit

* Pass errors from django to react

* Create origins

* Add aria attribute

* Reinstate geo area descriptions in form

* Organise JS, code comments

* Add key for react list

* Simplify if statement

* Add exclusions formset

* Add jest for react testing

* Amend gitignore

* Fix error re-rendering component after submit fail

* Move state management into top level component

* Pass origin index to exclusions formset

* Submit origin pk

* Update constants.py

* Test form cleaned_data

* Update quota origins to use with_latest_description

* Use description from annotated query

* Update origins and add test

* Update origin exclusions

* Don't remove empty data

* Fix exclusions not pre-populating

* Add jest snapshot tests

* Add react tests

* Add jest tests to github actions

* Fix query not returning origin exclusions

* Fix disabled widget error

* Fix origins no longer being linked to quota when order number updated

* Update tests for workbasket change

* Add tests for add_extra_error form method

* Fix incorrect exclusion being removed

* Clean up babel config

* Remove unused field

* Create exclusions for updated and new origins

* Make sure exclusions are updated/deleted

* Move current() queryset into init

* Fix geographical area invalid choice error in test

* Move babel packages out of dev deps (#1155)

* initial commit - ref doc data model

* wip commit

* initial commit - ref doc data model

* wip commit

* wip commit

* initial commit - ref doc data model

* wip commit

* initial commit - ref doc data model

* wip commit

* added alignment report, reference document and reference document version views, refactored the checks and ran the checks several times against reference document versions.

* added alignment report, reference document and reference document version views, refactored the checks and ran the checks several times against reference document versions.

* prep for merge to mega branch

* prep for merge to mega branch

* prep for merge to mega branch

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Dale Cannon <118175145+dalecannon@users.noreply.github.com>
Co-authored-by: Tash Boyse <57753415+nboyse@users.noreply.github.com>
Co-authored-by: Matthew McKenzie <97194636+mattjamc@users.noreply.github.com>
Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>
Co-authored-by: A Gleeson <anthoni.gleeson@digital.trade.gov.uk>
Co-authored-by: Paul Pepper <85895113+paulpepper-trade@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Edie Pearce <edie.pearce@digital.trade.gov.uk>
dougmills-DIT added a commit that referenced this pull request May 8, 2024
* Add reference_documents app

* WIP - Templates >:(

* Get a template of some sort working

* Add reference document detail path and templates

* add date filters to the get_context_data function

* WiP

* Rough commit - working tabs - need cleaning up

* Add button to home form

* Add comm code links to table

* initial commit - ref doc data model

* initial commit - ref doc data model

* wip commit

* initial commit - ref doc data model

* wip commit

* initial commit - ref doc data model

* wip commit

* wip commit

* wip commit

* added alignment report, reference document and reference document version views, refactored the checks and ran the checks several times against reference document versions.

* TP2000-1168 Add sub-quota, blocking period & suspension period nested review tabs (#1133)

* Add sub-quotas nested review tab

* Add quota blocking periods nested review tab

* Add quota suspension periods nested review tab

* Use tab title instead of model verbose name

* Add blocking period and suspension period SID to table

* Feat: expand expiring quotas report to include tabs (#1131)

* feat: invoke UI changes to reports and create new URL path to handle reports with multiple tabs (#1134)

* feat: Add both CSV and excel types for charts exporting (#1136)

* TP2000-1185  Add maintenance mode (#1137)

* Add MAINTENANCE_MODE setting and middleware

* Fix middleware removal and recursive redirect

* Add template view and url

* Add tests

* Update contact us form link for other pages

* Update text wording

* Remove database route during maintenance

* Update maintenance page template/url name

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>

* Increment message id & record sequence number correctly (#1083)

* record seq number & message id fix

* fix taricXMLRenderer, pass in value of counter

* feat: implement URLs for quota reports to ease navigation (#1135)

* Update readme with maintenance mode instructions. (#1140)

* TP2000-1130 Move current workbasket from Session to custom User model (#1123)

* Update User model references

* Use custom User model

* TP2000-1152-handling-invalid-workbaskets (#1113)

* Update middleware to check for workbasket changing state

* Update to use decorator rather than middleware, add pytest fixtures

* Update tests that require a session workbasket to run

* Move views and urls to workbasket app and update template

* Add tests for when workbasket status changes

* Tidy up following Pauls comments

* Update models and templates to find workbasket in user model

* Update test fixtures for workbasket being in user model

* Tidy up and test updates

* Update referencing to User model

* Updating bdd tests for new user model

* Add and update view and model unit tests

* Update require_current_workbasket decorator docstring

* Add docstring, move template for NoActiveWorkBasket view

* Amend current workbasket id retrieval in template

* Amend custom User model migration

* Remake migration adding current_workbasket field to User model

* Remove unused ValidateSessionWorkBasketMiddleware

* Make current_workbasket optional

* Add User model to admin

* Use historical models to fix migration tests

* Move ContentType data migration so it may be applied

* Rename function to remove a users current workbasket

* Amend docstrings

* Remove reference to session middleware that is no longer used

* Update workbaskets models following Pauls review

* Bring back user workbasket middleware as extra security

* Move User model from workbaskets app to common app

* Add forgotten content type data migration

* Remove setup_content_type fixture following patch to migrator fixture

* Amend middleware util method name

* Remove uneeded DoesNotExist try except block

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>

* Bump aiohttp from 3.9.1 to 3.9.2 (#1142)

Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.1 to 3.9.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.9.1...v3.9.2)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* update importer model matching to account for end dated objects. (#1146)

* update importer model matching to account for end dated objects.

* update importer model matching to account for end dated objects.

* Tp2000 1211 (#1148)

* update govuk dependency since its been deleted at source

* update govuk dependency since its been deleted at source

* Bump django from 3.2.23 to 3.2.24 (#1150)

Bumps [django](https://github.com/django/django) from 3.2.23 to 3.2.24.
- [Commits](django/django@3.2.23...3.2.24)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Tp2000 652  force rule check after real edit (#1130)

* added a check that if tracked models have been updated since the last checks business rules need run again
* data migration to add timestamps to tracked models and transaction checks
* tests for real edits
* tests for data migrations

* TP2000-1219  Prevent maintenance mode errors (#1152)

* Remove authbroker middleware when in maintenance mode

* Skip applying migrations in init script

* Prevent maintenance mode template attempts to access user attribute on request object

* Update privacy policy link

* Formatting updates and adding end date field to footnote create (#1154)

* TP2000-1114: React enhanced forms proof of concept (#1091)

* Add react

* Start to build origins form in react

* Build quota origin form with initial data

* Enable adding/removing of origins

* Repopulate form initial in case of error on submit

* Pass errors from django to react

* Create origins

* Add aria attribute

* Reinstate geo area descriptions in form

* Organise JS, code comments

* Add key for react list

* Simplify if statement

* Add exclusions formset

* Add jest for react testing

* Amend gitignore

* Fix error re-rendering component after submit fail

* Move state management into top level component

* Pass origin index to exclusions formset

* Submit origin pk

* Update constants.py

* Test form cleaned_data

* Update quota origins to use with_latest_description

* Use description from annotated query

* Update origins and add test

* Update origin exclusions

* Don't remove empty data

* Fix exclusions not pre-populating

* Add jest snapshot tests

* Add react tests

* Add jest tests to github actions

* Fix query not returning origin exclusions

* Fix disabled widget error

* Fix origins no longer being linked to quota when order number updated

* Update tests for workbasket change

* Add tests for add_extra_error form method

* Fix incorrect exclusion being removed

* Clean up babel config

* Remove unused field

* Create exclusions for updated and new origins

* Make sure exclusions are updated/deleted

* Move current() queryset into init

* Fix geographical area invalid choice error in test

* Move babel packages out of dev deps (#1155)

* initial commit - ref doc data model

* wip commit

* initial commit - ref doc data model

* wip commit

* wip commit

* initial commit - ref doc data model

* wip commit

* initial commit - ref doc data model

* wip commit

* added alignment report, reference document and reference document version views, refactored the checks and ran the checks several times against reference document versions.

* added alignment report, reference document and reference document version views, refactored the checks and ran the checks several times against reference document versions.

* prep for merge to mega branch

* prep for merge to mega branch

* prep for merge to mega branch

* Tp2000 1186 ref doc data model (#1164)

* TP2000-1168 Add sub-quota, blocking period & suspension period nested review tabs (#1133)

* Add sub-quotas nested review tab

* Add quota blocking periods nested review tab

* Add quota suspension periods nested review tab

* Use tab title instead of model verbose name

* Add blocking period and suspension period SID to table

* Feat: expand expiring quotas report to include tabs (#1131)

* feat: invoke UI changes to reports and create new URL path to handle reports with multiple tabs (#1134)

* feat: Add both CSV and excel types for charts exporting (#1136)

* TP2000-1185  Add maintenance mode (#1137)

* Add MAINTENANCE_MODE setting and middleware

* Fix middleware removal and recursive redirect

* Add template view and url

* Add tests

* Update contact us form link for other pages

* Update text wording

* Remove database route during maintenance

* Update maintenance page template/url name

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>

* Increment message id & record sequence number correctly (#1083)

* record seq number & message id fix

* fix taricXMLRenderer, pass in value of counter

* feat: implement URLs for quota reports to ease navigation (#1135)

* Update readme with maintenance mode instructions. (#1140)

* TP2000-1130 Move current workbasket from Session to custom User model (#1123)

* Update User model references

* Use custom User model

* TP2000-1152-handling-invalid-workbaskets (#1113)

* Update middleware to check for workbasket changing state

* Update to use decorator rather than middleware, add pytest fixtures

* Update tests that require a session workbasket to run

* Move views and urls to workbasket app and update template

* Add tests for when workbasket status changes

* Tidy up following Pauls comments

* Update models and templates to find workbasket in user model

* Update test fixtures for workbasket being in user model

* Tidy up and test updates

* Update referencing to User model

* Updating bdd tests for new user model

* Add and update view and model unit tests

* Update require_current_workbasket decorator docstring

* Add docstring, move template for NoActiveWorkBasket view

* Amend current workbasket id retrieval in template

* Amend custom User model migration

* Remake migration adding current_workbasket field to User model

* Remove unused ValidateSessionWorkBasketMiddleware

* Make current_workbasket optional

* Add User model to admin

* Use historical models to fix migration tests

* Move ContentType data migration so it may be applied

* Rename function to remove a users current workbasket

* Amend docstrings

* Remove reference to session middleware that is no longer used

* Update workbaskets models following Pauls review

* Bring back user workbasket middleware as extra security

* Move User model from workbaskets app to common app

* Add forgotten content type data migration

* Remove setup_content_type fixture following patch to migrator fixture

* Amend middleware util method name

* Remove uneeded DoesNotExist try except block

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>

* Bump aiohttp from 3.9.1 to 3.9.2 (#1142)

Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.1 to 3.9.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.9.1...v3.9.2)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* initial commit - ref doc data model

* update importer model matching to account for end dated objects. (#1146)

* update importer model matching to account for end dated objects.

* update importer model matching to account for end dated objects.

* Tp2000 1211 (#1148)

* update govuk dependency since its been deleted at source

* update govuk dependency since its been deleted at source

* initial commit - ref doc data model

* wip commit

* Bump django from 3.2.23 to 3.2.24 (#1150)

Bumps [django](https://github.com/django/django) from 3.2.23 to 3.2.24.
- [Commits](django/django@3.2.23...3.2.24)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Tp2000 652  force rule check after real edit (#1130)

* added a check that if tracked models have been updated since the last checks business rules need run again
* data migration to add timestamps to tracked models and transaction checks
* tests for real edits
* tests for data migrations

* TP2000-1219  Prevent maintenance mode errors (#1152)

* Remove authbroker middleware when in maintenance mode

* Skip applying migrations in init script

* Prevent maintenance mode template attempts to access user attribute on request object

* Update privacy policy link

* initial commit - ref doc data model

* wip commit

* initial commit - ref doc data model

* wip commit

* wip commit

* wip commit

* added alignment report, reference document and reference document version views, refactored the checks and ran the checks several times against reference document versions.

* TP2000-1168 Add sub-quota, blocking period & suspension period nested review tabs (#1133)

* Add sub-quotas nested review tab

* Add quota blocking periods nested review tab

* Add quota suspension periods nested review tab

* Use tab title instead of model verbose name

* Add blocking period and suspension period SID to table

* Feat: expand expiring quotas report to include tabs (#1131)

* feat: invoke UI changes to reports and create new URL path to handle reports with multiple tabs (#1134)

* feat: Add both CSV and excel types for charts exporting (#1136)

* TP2000-1185  Add maintenance mode (#1137)

* Add MAINTENANCE_MODE setting and middleware

* Fix middleware removal and recursive redirect

* Add template view and url

* Add tests

* Update contact us form link for other pages

* Update text wording

* Remove database route during maintenance

* Update maintenance page template/url name

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>

* Increment message id & record sequence number correctly (#1083)

* record seq number & message id fix

* fix taricXMLRenderer, pass in value of counter

* feat: implement URLs for quota reports to ease navigation (#1135)

* Update readme with maintenance mode instructions. (#1140)

* TP2000-1130 Move current workbasket from Session to custom User model (#1123)

* Update User model references

* Use custom User model

* TP2000-1152-handling-invalid-workbaskets (#1113)

* Update middleware to check for workbasket changing state

* Update to use decorator rather than middleware, add pytest fixtures

* Update tests that require a session workbasket to run

* Move views and urls to workbasket app and update template

* Add tests for when workbasket status changes

* Tidy up following Pauls comments

* Update models and templates to find workbasket in user model

* Update test fixtures for workbasket being in user model

* Tidy up and test updates

* Update referencing to User model

* Updating bdd tests for new user model

* Add and update view and model unit tests

* Update require_current_workbasket decorator docstring

* Add docstring, move template for NoActiveWorkBasket view

* Amend current workbasket id retrieval in template

* Amend custom User model migration

* Remake migration adding current_workbasket field to User model

* Remove unused ValidateSessionWorkBasketMiddleware

* Make current_workbasket optional

* Add User model to admin

* Use historical models to fix migration tests

* Move ContentType data migration so it may be applied

* Rename function to remove a users current workbasket

* Amend docstrings

* Remove reference to session middleware that is no longer used

* Update workbaskets models following Pauls review

* Bring back user workbasket middleware as extra security

* Move User model from workbaskets app to common app

* Add forgotten content type data migration

* Remove setup_content_type fixture following patch to migrator fixture

* Amend middleware util method name

* Remove uneeded DoesNotExist try except block

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>

* Bump aiohttp from 3.9.1 to 3.9.2 (#1142)

Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.1 to 3.9.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.9.1...v3.9.2)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* update importer model matching to account for end dated objects. (#1146)

* update importer model matching to account for end dated objects.

* update importer model matching to account for end dated objects.

* Tp2000 1211 (#1148)

* update govuk dependency since its been deleted at source

* update govuk dependency since its been deleted at source

* Bump django from 3.2.23 to 3.2.24 (#1150)

Bumps [django](https://github.com/django/django) from 3.2.23 to 3.2.24.
- [Commits](django/django@3.2.23...3.2.24)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Tp2000 652  force rule check after real edit (#1130)

* added a check that if tracked models have been updated since the last checks business rules need run again
* data migration to add timestamps to tracked models and transaction checks
* tests for real edits
* tests for data migrations

* TP2000-1219  Prevent maintenance mode errors (#1152)

* Remove authbroker middleware when in maintenance mode

* Skip applying migrations in init script

* Prevent maintenance mode template attempts to access user attribute on request object

* Update privacy policy link

* Formatting updates and adding end date field to footnote create (#1154)

* TP2000-1114: React enhanced forms proof of concept (#1091)

* Add react

* Start to build origins form in react

* Build quota origin form with initial data

* Enable adding/removing of origins

* Repopulate form initial in case of error on submit

* Pass errors from django to react

* Create origins

* Add aria attribute

* Reinstate geo area descriptions in form

* Organise JS, code comments

* Add key for react list

* Simplify if statement

* Add exclusions formset

* Add jest for react testing

* Amend gitignore

* Fix error re-rendering component after submit fail

* Move state management into top level component

* Pass origin index to exclusions formset

* Submit origin pk

* Update constants.py

* Test form cleaned_data

* Update quota origins to use with_latest_description

* Use description from annotated query

* Update origins and add test

* Update origin exclusions

* Don't remove empty data

* Fix exclusions not pre-populating

* Add jest snapshot tests

* Add react tests

* Add jest tests to github actions

* Fix query not returning origin exclusions

* Fix disabled widget error

* Fix origins no longer being linked to quota when order number updated

* Update tests for workbasket change

* Add tests for add_extra_error form method

* Fix incorrect exclusion being removed

* Clean up babel config

* Remove unused field

* Create exclusions for updated and new origins

* Make sure exclusions are updated/deleted

* Move current() queryset into init

* Fix geographical area invalid choice error in test

* Move babel packages out of dev deps (#1155)

* initial commit - ref doc data model

* wip commit

* initial commit - ref doc data model

* wip commit

* wip commit

* initial commit - ref doc data model

* wip commit

* initial commit - ref doc data model

* wip commit

* added alignment report, reference document and reference document version views, refactored the checks and ran the checks several times against reference document versions.

* added alignment report, reference document and reference document version views, refactored the checks and ran the checks several times against reference document versions.

* prep for merge to mega branch

* prep for merge to mega branch

* prep for merge to mega branch

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Dale Cannon <118175145+dalecannon@users.noreply.github.com>
Co-authored-by: Tash Boyse <57753415+nboyse@users.noreply.github.com>
Co-authored-by: Matthew McKenzie <97194636+mattjamc@users.noreply.github.com>
Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>
Co-authored-by: A Gleeson <anthoni.gleeson@digital.trade.gov.uk>
Co-authored-by: Paul Pepper <85895113+paulpepper-trade@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Edie Pearce <edie.pearce@digital.trade.gov.uk>

* prep for merge to mega branch

* Add command to import duties and quotas

* Add command to import duties and quotas

* Functionality to edit reference documents

* CRUD templates

* Reference Doc CRUD

* Add factories, add editing for rates - still WIP but working

* Add factories, add editing for rates - still WIP but working

* Add factories, add editing for rates - still WIP but working

* TP2000-1232 Reference doc UI management (#1165)

* Functionality to edit reference documents

* CRUD templates

* Reference Doc CRUD

* fixed time zone issue with factories.py

* Create update form tests

* fixed time zone issue with factories.py

* add basic tests for models

* add basic tests for models

* Add test init files

* View and form tests for ref doc crud

* Remove init files

* Add reference doc form and view tests

* Move get_area_name_by_id to model

* add basic tests for models

* add basic tests for models

* add basic tests for models

* update edit quota view

* fix views

* Ref doc versions create and edit urls/templates

* Ref doc formatting tidy up

* Ref doc versions create and edit views/form

* fix views

* fix views

* Update ref doc create breadcrumbs

* Ref doc version delete

* Delete ref doc version and confirmation pages

* Area ID and version form validation

* update data

* Ref doc versions form and view tests

* Add model test for get_area_name_by_id

* Update data model

* Preferential rate style and consistency tidy

* separate out the context from reference document version details

* separate out the context from reference document version details

* separate out the context from reference document version details

* separate out the context from reference document version details

* separate out the context from reference document version details

* Pref quota bulk create base

* add / edit order number

* Bulk add preferential quotas for a commodity code list

* add / edit order number

* Bulk create quotas for multiple validity period volume combos

* WIP commit - quota and order number updates

* WIP commit - quota and order number updates

* quota and order number views + test fixes

* quota and order number views + test fixes

* Bulk create quotas redo without validityperiodform

* test fixes

* Add js remove button to additional quota definition forms

* tested quota order number and quota forms

* Preferential quota bulk create tests

* Content standardisations

* Add preferential quota bulk create for specific order numbers

* models 100% tested, forms 100% tested

* models 100% tested, forms 100% tested

* Ref doc and versions view tests

* added more tests

* added more tests

* tidy up for PR

* tidy up for PR

* Stop add new button submitting form when js is disabled

* tidy up for PR

* tidy up for PR

* tidy up for PR

* tidy up for PR

* tidy up for PR

* tidy up for PR

* tidy up for PR

* tidy up for PR

* tidy up for PR

* content corrections

* content corrections

* fixes for breadcrumbs

* fixes for breadcrumbs

* minor fix

* minor text changes

* updates to ref doc data import management command

* Test fixes after content change

* Updates from Dale's review

* updated based on PR comments

* updated based on PR comments

* updated js based on linting issues

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Lauren Qurashi <lauren.qurashi@digital.trade.gov.uk>
Co-authored-by: Anthoni Gleeson <anthoni.gleeson@digital.trade.gov.uk>
Co-authored-by: Dale Cannon <118175145+dalecannon@users.noreply.github.com>
Co-authored-by: Tash Boyse <57753415+nboyse@users.noreply.github.com>
Co-authored-by: Matthew McKenzie <97194636+mattjamc@users.noreply.github.com>
Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>
Co-authored-by: Paul Pepper <85895113+paulpepper-trade@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Edie Pearce <edie.pearce@digital.trade.gov.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants