Skip to content

Commit

Permalink
Rename to "NonSubmittingSummaryPage". add Non-submitting summary page…
Browse files Browse the repository at this point in the history
… to designer
  • Loading branch information
jenbutongit committed Nov 13, 2024
1 parent 552b090 commit 28d2d31
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions designer/client/page-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ class PageCreate extends React.Component {
<option value="">Question Page</option>
<option value="./pages/start.js">Start Page</option>
<option value="./pages/summary.js">Summary Page</option>
<option value="NonSubmittingSummaryPage">
Non-submitting Summary Page
</option>
</select>
</div>

Expand Down
3 changes: 3 additions & 0 deletions designer/client/page-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ export class PageEdit extends React.Component {
<option value="./pages/summary.js">
{i18n("page.types.summary")}
</option>
<option value="NonSubmittingSummaryPage">
Non-submitting Summary Page
</option>
</select>
</div>
<Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ import { FormComponent } from "server/plugins/engine/components";
import { PageControllerBase } from "server/plugins/engine/pageControllers/PageControllerBase";
import { FormModel } from "server/plugins/engine/models";

export class SummaryPageWithNextPageController extends PageController {
export class NonSubmittingSummaryPage extends PageController {
returnUrlParameter: string;
constructor(model: FormModel, pageDef: any) {
super(model, pageDef);
/**
* TODO: set options to the instance if necessary.
*/

const returnPath = `/${this.model.basePath}${this.path}`;
this.returnUrlParameter = `?returnUrl=${encodeURIComponent(returnPath)}`;
Expand All @@ -24,7 +21,8 @@ export class SummaryPageWithNextPageController extends PageController {
this.langFromRequest(request);

const viewModel = await this.summaryViewModel(request);
return h.view("summary-with-next", viewModel);

return h.view("midpoint-summary", viewModel);
};
}

Expand Down
4 changes: 2 additions & 2 deletions runner/src/server/plugins/engine/pageControllers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { RepeatingFieldPageController } from "./RepeatingFieldPageController";
import { Page } from "@xgovformbuilder/model";
import { UploadPageController } from "server/plugins/engine/pageControllers/UploadPageController";
import { MultiStartPageController } from "server/plugins/engine/pageControllers/MultiStartPageController";
import { SummaryPageWithNextPageController } from "server/plugins/engine/pageControllers/SummaryPageWithNextPageController";
import { NonSubmittingSummaryPage } from "server/plugins/engine/pageControllers/NonSubmittingSummaryPage";

const PageControllers = {
DobPageController,
Expand All @@ -24,7 +24,7 @@ const PageControllers = {
RepeatingFieldPageController,
UploadPageController,
MultiStartPageController,
SummaryPageWithNextPageController,
NonSubmittingSummaryPage,
};

export const controllerNameFromPath = (filePath: string) => {
Expand Down
2 changes: 1 addition & 1 deletion runner/src/server/plugins/engine/pageControllers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export { StartDatePageController } from "./StartDatePageController";
export { StartPageController } from "./StartPageController";
export { SummaryPageController } from "./SummaryPageController";
export { PageControllerBase } from "./PageControllerBase";
export { SummaryPageWithNextPageController } from "./SummaryPageWithNextPageController";
export { NonSubmittingSummaryPage } from "./NonSubmittingSummaryPage";
export { getPageController, controllerNameFromPath } from "./helpers";
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ <h2 class="govuk-heading-m"> {{list.sectionTitle}} </h2>
{{ govukSummaryList(list) }}
{% endfor %}


{% if page.hasNext %}
<form method="post" enctype="multipart/form-data" autocomplete="off" novalidate>
<input type="hidden" name="crumb" value="{{crumb}}"/>
<button data-prevent-double-click="true" class="govuk-button" data-module="govuk-button">
Continue
</button>
<form>
{% endif %}
</div>
</div>
</div>
Expand Down

0 comments on commit 28d2d31

Please sign in to comment.