Skip to content

Add ability to set a default brand for organisation#2935

Open
theseanything wants to merge 6 commits into
mainfrom
add-organisation-default-brand
Open

Add ability to set a default brand for organisation#2935
theseanything wants to merge 6 commits into
mainfrom
add-organisation-default-brand

Conversation

@theseanything

@theseanything theseanything commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What

Lets super admins set a default brand for an organisation, from the available brands section on the organisation page.

New forms created in the organisation's groups start with that brand, as long as the group has custom branding enabled.

People editing a form can still change/override the brand using the existing branding task list item.

The interface prevents people removing a brand from available brand if its set at the default.

Screenshots

image image

@theseanything
theseanything marked this pull request as ready for review July 15, 2026 12:03
@theseanything theseanything changed the title Add organisation default brand Add ability to set a default brand for organisation Jul 15, 2026
Organisations can have several available brands, but there is no way
to say which brand new forms in the organisation should start with, so
every form starts with GOV.UK branding until someone changes it.

Add a nullable default_brand_id foreign key to organisations, with a
validation that the default brand must be one of the organisation's
available brands. The validation only runs when the default brand is
changing, so the nightly organisation sync cannot fail on unrelated
updates. A nil default means GOV.UK branding.
The organisation's default brand will be applied to new forms created
in the organisation's groups. There is no way to set it yet.

Add a default-brand route nested under organisations, handled by an
update_default action on the organisation brands controller and
restricted to super admins by the existing policy. Setting the default
with no brand ID clears it, which means new forms use GOV.UK branding.
A brand that is not one of the organisation's available brands returns
a 404, matching how removing an unknown brand behaves.
Removing the default brand from an organisation's available brands
would leave the default pointing at a brand the organisation can no
longer use.

Refuse to destroy the organisation brand when it is the current
default and redirect back to the organisation page. The remove button
will be disabled in the interface for the default brand, so this guard
only protects against crafted requests.
Super admins need a way to choose which of an organisation's available
brands new forms should start with.

Add a permanent GOV.UK row to the available brands table and tag the
current default brand, or GOV.UK when no default is set. Each other
row has a make default button, and the remove button is disabled for
the current default. Making GOV.UK the default clears the setting, so
there is no separate action to unset it. The table now always renders
because the GOV.UK row is always present.
Setting a default brand on an organisation has no effect until new
forms pick it up.

Set the form's brand to the organisation's default brand slug when
creating a form, but only in groups with custom branding enabled, so
that forms never get a brand their editors cannot see or change. The
branding task list item still lets editors change or remove the brand
on each form.
The make default and remove buttons each rendered in their own
block-level form with the standard button bottom margin, so they
stacked vertically and made the available brands table rows very
tall.

Place the pair of buttons in a button group so they sit side by side,
and remove the bottom margin from all of the action buttons so the
rows stay compact.
@theseanything
theseanything force-pushed the add-organisation-default-brand branch from 9fc6641 to a7c238d Compare July 15, 2026 12:23
@github-actions

Copy link
Copy Markdown

🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-2935.admin.review.forms.service.gov.uk/

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

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.

1 participant