Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proto new uncompeted journey #125

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

albertkol
Copy link
Contributor

@albertkol albertkol commented Jan 30, 2025

Demo'd in the video on the LS channel.

New features we need for the Form Runner:

  1. If a user received feedback from an assessor they should be redirected directly to the Summary/Check your answers page
  2. Summary page should only show links to the questions that received feedback from the assessor
  3. The assessor feedback is to be displayed above the component
  4. Other components that did not receive feedback should not be editable
  5. Summary page should show different title and hide the mark section as complete until all feedback is addressed (this one is missing at the moment)

@albertkol albertkol force-pushed the proto-new-uncompeted-journey branch from 7d6bbd6 to b3dc86d Compare January 30, 2025 11:03
@albertkol albertkol force-pushed the proto-new-uncompeted-journey branch from b3dc86d to eacc7fa Compare January 30, 2025 11:05
Copy link
Collaborator

@nuwan-samarasinghe nuwan-samarasinghe left a comment

Choose a reason for hiding this comment

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

Woow nice change @albertkol I am happy to approve but added a comment may be when it resolved I am happy to merge

Can we have a unit test for this scenario possibly a e2e which covers this change ?

Comment on lines +662 to +706
if (!(state["metadata"] && state["metadata"]["change_requests"])) {
// No Change Requests - Quick return

return evaluatedComponent;
}

// If there are Change Requests
const changeRequests = state["metadata"]["change_requests"];
const componentName = evaluatedComponent.model.name || "";
if (componentName in changeRequests) {
// Component has Change Request - Add feedback to hint

if (evaluatedComponent.model.hint === undefined) {
evaluatedComponent.model.hint = {html: ""};
}

const messages = changeRequests[componentName];
if (messages) {
const hints = messages.map((msg) => `<p>${msg}</p>`).join("");
evaluatedComponent.model.hint.html += `<div class="govuk-inset-text change-request-block"><header>Assessor feedback</header>${hints}</div>`;
}

return evaluatedComponent;
}

// Component has no Change Request
const pageHasNoComponentWithChangeRequest = this.pageDef.components.find(component => component.name in changeRequests);
if (pageHasNoComponentWithChangeRequest === undefined) {
// if no Change Request on page - We got here through a condition

return evaluatedComponent;
}


// Change Request on page - Disable all other components on page
if (evaluatedComponent.model.classes === undefined) {
evaluatedComponent.model.classes = "";
}
evaluatedComponent.model.classes += " govuk-input--disabled";

if (evaluatedComponent.model.hint === undefined) {
evaluatedComponent.model.hint = {html: ""};
}
evaluatedComponent.model.hint.html += `<div class="govuk-inset-text change-request-disabled"><header>Cannot edit</header></div>`;

Copy link
Collaborator

Choose a reason for hiding this comment

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

@albertkol one quick question about this change

I hope this information box is coming on each page if there is a comment from the assessor ? or is there any specific page that comes if this only happens in summary shall we add this to summary page controller

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