Skip to content

Conversation

@chrismytton
Copy link
Member

@chrismytton chrismytton commented Jan 14, 2026

As part of the application forms project this adds the foundations for the new licencing forms, and implements the first form, scaffolding, along with the shared fields etc for them. Also refactors some bits of the claims form around file uploads to be shared between the forms.

In order to test this locally you'll need to enable it in the config:

COBRAND_FEATURES:
  # Other fields…
  licencing_forms:
    tfl: 1

I think you might need to create the category as well, but I was able to create reports without the category existing, so not sure if I've done something wrong there?

I haven't done anything about the PDF generation (https://github.com/mysociety/societyworks/issues/5343) yet, this is just the form itself.

Fixes https://github.com/mysociety/societyworks/issues/5304

Add foundation for TfL's digital licence application system, replacing
their current process.

- Licence controller that discovers and routes to specific licence form
  types (scaffold, etc.)
- Base Licence form role providing shared functionality for all licence
  forms (file uploads, summary display, field formatting)
- Scaffold licence form as the first example
- Form submission creates non-public Problem records with licence data
  stored in extra metadata
This removes the duplication between these two forms, and makes it
easier for other forms to handle file uploads in the future.
@chrismytton chrismytton requested a review from dracos January 14, 2026 16:20
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 80.76923% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.96%. Comparing base (b654f02) to head (4544af1).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
perllib/FixMyStreet/App/Controller/Licence.pm 80.30% 4 Missing and 9 partials ⚠️
perllib/FixMyStreet/App/Form/Licence.pm 72.41% 4 Missing and 4 partials ⚠️
perllib/FixMyStreet/App/Form/Wizard.pm 82.85% 3 Missing and 3 partials ⚠️
...ib/FixMyStreet/App/Form/Licence/Fields/Location.pm 78.57% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5807      +/-   ##
==========================================
+ Coverage   82.66%   82.96%   +0.30%     
==========================================
  Files         458      467       +9     
  Lines       35802    37237    +1435     
  Branches     5844     6114     +270     
==========================================
+ Hits        29594    30892    +1298     
- Misses       4506     4620     +114     
- Partials     1702     1725      +23     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dracos
Copy link
Member

dracos commented Jan 15, 2026

I was able to create reports without the category existing, so not sure if I've done something wrong there?

Manually created reports can stick in any category they want, there's no database linking there.

Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

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

This is all looking good - a number of suggestions and things to change; messaged on Slack in terms of the bits (only little, I think) that we should do before letting them know

? $c->user->obj
: $c->model('DB::User')->find_or_new({ email => $data->{email} });
$user->name($data->{name}) if $data->{name};
$user->phone($data->{phone}) if $data->{phone};
Copy link
Member

Choose a reason for hiding this comment

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

I think this may be a problem in Claims as well; if the user already exists, its name/phone are not updated (which I think is right, because otherwise someone could override it only by specifying their email, if there's no confirmation). It looks like in Waste we're now setting a $report->set_extra_metadata(phone => $c->stash->{phone}); in these cases, maybe? Bit unclear, and hopefully won't matter, but thought worth noting to have a think.

# Fields: name, email, phone from AboutYou role
# ==========================================================================
has_page applicant => (
fields => [
Copy link
Member

Choose a reason for hiding this comment

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

The field order on the about applicant page is wrong. This came up in waste with bexley verifications, perhaps now is an opportunity to fix it so the order is always that specified in fields ; at present it’s done on order and then somehow on MRO import order - which makes including things in multiple places harder than need be (but for now, using manual order numbering could provide a fix if necessary here).

@@ -0,0 +1,67 @@
body.formflow {
Copy link
Member

Choose a reason for hiding this comment

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

Could we have a shared CSS, as this is the same as claims, and I don't think it's going to differ a lot

@chrismytton
Copy link
Member Author

Have done a first pass of changes. I added a 👍 reaction to comments I've addressed, and 👀 to ones I still need to address.

I think the two things I still need to address before sharing with them are:

  • Better formatting of the report detail in the licencing controller I'll look at this evening/first thing tomorrow as that would be good to fix.
  • Split up the "Details of Scaffold" page into multiple steps

The other bits I'd like to do as well, but not as critical before sharing.

Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

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

[I can't seem to see the single comment I just made, so adding again here.] Changes so far all look good, only thing left within those is the help text should be "If the response to question 1 is 'no', or any response from 2 through to 7 is 'yes', then..."

@chrismytton
Copy link
Member Author

@dracos Oops, thanks! Looks like your comment is on the fixup commit 23368e1. Have pushed another fixup to fix the fixup 😬 612addf

@chrismytton
Copy link
Member Author

@dracos I think I've addressed everything that needs to be done before showing them the scaffold form. Would you mind checking over my fixups?

@chrismytton chrismytton requested a review from dracos January 16, 2026 11:15
Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

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

Yep, all looks good to me, thanks :-)

So I think only non-internal thing left is the form ordering on that one page, which is fine (could tell them we know it's an issue, or not even mention it, give them something to spot ;) ).

@chrismytton
Copy link
Member Author

Have put this on staging and setup a "Scaffold licence" category.

For now I've used "Red claim " as the category type, but we should make this more generic, have opened https://github.com/mysociety/societyworks/issues/5348 to track that.

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