Skip to content

feat(timeout): redirect to form start page and support new config fields#384

Merged
emilyjevans merged 2 commits into
ukhsa-collaboration:v2from
SullyK:form-specific-start-page
May 28, 2025
Merged

feat(timeout): redirect to form start page and support new config fields#384
emilyjevans merged 2 commits into
ukhsa-collaboration:v2from
SullyK:form-specific-start-page

Conversation

@SullyK

@SullyK SullyK commented May 28, 2025

Copy link
Copy Markdown
  • Fix timeout.html redirecting incorrectly to the /config route by using the injected referer instead.
    (See:

    if (referer) {
    const match = referer.match(/https?:\/\/[^/]+\/([^/]+).*/);
    if (match && match.length > 1) {
    startPage = `/${match[1]}`;
    }
    }
    return h.view("timeout", {
    startPage,
    });
    ))

  • Timeout now correctly redirects to the form's start page.

  • Add support for new serviceName form field. This may overlap with existing name field... May be removed based on feedback.

  • Use new fullStartPage form field instead of the global serviceStartPage setting. (Overrides config at

    serviceStartPage: "/ReportAnOutbreak/start",
    )

Example usage:

"fullStartPage": "/kls-path-1/contact-the-knowledge-and-library-services-team",
 "serviceName": "klsform",

Type of change

Please delete options that are not relevant.

  • [ ✅] Bug fix (non-breaking change which fixes an issue)
  • [✅ ] New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Tested locally.

Checklist:

  • [✅] I have performed a self-review of my own code

SullyK and others added 2 commits May 28, 2025 09:47
- Fix timeout.html redirecting incorrectly to the /config route by using the injected referer instead.
(See:    https://github.com/ukhsa-collaboration/digital-form-builder/blob/801bc7de3d8f57d316bc46a67518ef07914f54c3/runner/src/server/plugins/router.ts#L263))

- Timeout now correctly redirects to the form's start page.

- Add support for new serviceName form field. This may overlap with existing name field... May be removed based on feedback.

Use new fullStartPage form field instead of the global serviceStartPage setting.
(Overrides config at https://github.com/ukhsa-collaboration/digital-form-builder/blob/801bc7de3d8f57d316bc46a67518ef07914f54c3/runner/config/default.js#L59
)
@SullyK SullyK marked this pull request as ready for review May 28, 2025 09:01
@SullyK SullyK requested a review from a team as a code owner May 28, 2025 09:01
Comment thread runner/src/server/views/timeout.html
@emilyjevans emilyjevans merged commit 5503618 into ukhsa-collaboration:v2 May 28, 2025
1 check failed
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.

2 participants