From b3dc86d86a4ed6bad65a9027aaa9b622f4e19720 Mon Sep 17 00:00:00 2001 From: Albert Artur Kolozsvari Date: Thu, 30 Jan 2025 10:57:54 +0000 Subject: [PATCH] Add tags and hide change links --- .../page-controllers/SummaryPageController.ts | 12 ++++++++++++ .../src/server/views/partials/summary-detail.html | 4 ++-- runner/src/server/views/partials/summary-row.html | 13 ++++++++----- runner/src/server/views/summary.html | 2 +- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/runner/src/server/plugins/engine/page-controllers/SummaryPageController.ts b/runner/src/server/plugins/engine/page-controllers/SummaryPageController.ts index 35e2d61d..d1a370b4 100644 --- a/runner/src/server/plugins/engine/page-controllers/SummaryPageController.ts +++ b/runner/src/server/plugins/engine/page-controllers/SummaryPageController.ts @@ -76,6 +76,18 @@ export class SummaryPageController extends PageController { viewModel.backLink = state.callback?.returnUrl; } + viewModel.isResubmission = false + if (state["metadata"] && state["metadata"]["is_resubmission"]) { + viewModel.isResubmission = state["metadata"]["is_resubmission"]; + } + + viewModel.changeRequestsQuestionIDs = []; + if (state["metadata"] && state["metadata"]["change_requests"]) { + for (let componentName in state["metadata"]["change_requests"]) { + viewModel.changeRequestsQuestionIDs.push(componentName); + } + } + /** * iterates through the errors. If there are errors, a user will be redirected to the page * with the error with returnUrl=`/${model.basePath}/` in the URL query parameter. diff --git a/runner/src/server/views/partials/summary-detail.html b/runner/src/server/views/partials/summary-detail.html index af765169..29f5fa1e 100644 --- a/runner/src/server/views/partials/summary-detail.html +++ b/runner/src/server/views/partials/summary-detail.html @@ -1,6 +1,6 @@ {% from "./summary-row.html" import summaryRow %} -{% macro summaryDetail(data, isReadOnlySummary=false) %} +{% macro summaryDetail(data, isReadOnlySummary=false, isResubmission=false, changeRequestsQuestionIDs=[]) %} {% set isRepeatableSection = (data.items[0] | isArray) %} {% if not isRepeatableSection %}

{{data.title}}

@@ -17,7 +17,7 @@

{{data. {{ summaryRow(repeated) }} {% endfor %} {% else %} - {{ summaryRow(item, data.notSuppliedText, data.changeText, isReadOnlySummary) }} + {{ summaryRow(item, data.notSuppliedText, data.changeText, isReadOnlySummary, isResubmission, changeRequestsQuestionIDs) }} {% endif %} {% endif %} {% endfor %} diff --git a/runner/src/server/views/partials/summary-row.html b/runner/src/server/views/partials/summary-row.html index afc31fb1..79d5b348 100644 --- a/runner/src/server/views/partials/summary-row.html +++ b/runner/src/server/views/partials/summary-row.html @@ -1,4 +1,4 @@ -{% macro summaryRow(item, notSuppliedText, changeText, isReadOnlySummary=false) %} +{% macro summaryRow(item, notSuppliedText, changeText, isReadOnlySummary=false, isResubmission=false, changeRequestsQuestionIDs=[]) %}
{{item.label}} @@ -39,10 +39,13 @@ {% endif %}
- {% if not isReadOnlySummary %} - - {{changeText}} {{item.label}} - + {% if not isReadOnlySummary and (not isResubmission or (isResubmission and item.name in changeRequestsQuestionIDs)) %} + {% if (isResubmission and item.name in changeRequestsQuestionIDs) %} + TO REVIEW + {% endif %} + + {{changeText}} {{item.label}} + {% endif %}
diff --git a/runner/src/server/views/summary.html b/runner/src/server/views/summary.html index 54c7dc6f..65f362f6 100644 --- a/runner/src/server/views/summary.html +++ b/runner/src/server/views/summary.html @@ -55,7 +55,7 @@

{% endif %} {% for detail in details %} - {{ summaryDetail(detail, isReadOnlySummary) }} + {{ summaryDetail(detail, isReadOnlySummary, isResubmission, changeRequestsQuestionIDs) }} {% endfor %} {% if fees and fees.details|length %}