-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
7d6bbd6
to
b3dc86d
Compare
b3dc86d
to
eacc7fa
Compare
|
There was a problem hiding this 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 ?
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>`; | ||
|
There was a problem hiding this comment.
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
Demo'd in the video on the LS channel.
New features we need for the Form Runner: