Skip to content

Feat/df 1068: Add 'offline' as status filter option#803

Merged
jbarnsley10 merged 10 commits into
mainfrom
feat/df-1068-offline
Jun 19, 2026
Merged

Feat/df 1068: Add 'offline' as status filter option#803
jbarnsley10 merged 10 commits into
mainfrom
feat/df-1068-offline

Conversation

@jbarnsley10

@jbarnsley10 jbarnsley10 commented May 15, 2026

Copy link
Copy Markdown
Contributor

Ticket DF-1068

Needs a model bump from DEFRA/forms-designer#1445

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds support for 'offline' as a status filter option when listing forms. The filter enum is migrated from FormStatus to the new FormFilterStatus (from @defra/forms-model), which includes Offline alongside Draft and Live. The aggregation pipeline and filter conditions are extended to recognise documents with offline: true as the new "offline" status.

Changes:

  • Replace FormStatus with FormFilterStatus in form-listing/filter code paths and corresponding tests.
  • Extend buildFilterConditions to map FormFilterStatus.Offline to { offline: true }.
  • Extend buildFiltersFacet to use a $switch so documents with offline === true are reported as 'offline' (taking precedence over 'live'/'draft').

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/api/forms/repositories/aggregation/form-metadata-aggregation.js Use FormFilterStatus; add Offline branch in buildFilterConditions and $switch in buildFiltersFacet.
src/api/forms/repositories/aggregation/form-metadata-aggregation.test.js Update tests to use FormFilterStatus and assert new $switch aggregation.
src/api/forms/repositories/aggregation/types.js Update JSDoc typedefs for the new $or shape and FormFilterStatus.
src/api/forms/repositories/form-metadata-repository.test.js Switch test imports/usages to FormFilterStatus.
src/api/forms/service/definition.test.js Switch test imports/usages to FormFilterStatus.
src/routes/forms.test.js Update expected validation error messages to include offline.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud

Copy link
Copy Markdown

@jbarnsley10
jbarnsley10 merged commit 32c247f into main Jun 19, 2026
9 checks passed
@jbarnsley10
jbarnsley10 deleted the feat/df-1068-offline branch June 19, 2026 08:44
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.

4 participants