Skip to content

Commit

Permalink
Change logic for when the form Continue button is displayed for V2
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjamesstone committed Jan 21, 2025
1 parent 7f96277 commit bf40f10
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ export class QuestionPageController extends PageController {
})
}

get allowContinue(): boolean {
if (this.model.engine === Engine.V2) {
return this.pageDef.controller !== ControllerType.Terminal
}

return this.next.length > 0
}

getItemId(request?: FormContextRequest) {
const { itemId } = this.getFormParams(request)
return itemId ?? request?.params.itemId
Expand Down
2 changes: 1 addition & 1 deletion src/server/plugins/engine/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{% include "partials/heading.html" %}

{% block form %}
{% if page.next | length %}
{% if page.allowContinue %}
{% include "partials/form.html" %}
{% else %}
{{ componentList(components) }}
Expand Down

0 comments on commit bf40f10

Please sign in to comment.