-
Notifications
You must be signed in to change notification settings - Fork 3
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
PSR-1510 list page #930
base: main
Are you sure you want to change the base?
PSR-1510 list page #930
Conversation
) | ||
} | ||
|
||
case class ListViewModel( | ||
inset: DisplayMessage, | ||
rows: List[ListRow], | ||
sections: List[Section], |
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.
main change - list pages now have a list of sections instead of rows, each section is just a heading and a list of rows. This can be expanded to house section specific elements like pagination if needed later on
.withVisuallyHiddenText(hiddenText.toMessage) | ||
case ListRowNoLink(text) => ListWithActionsActionViewModel.noLink(renderMessage(text)) | ||
}.toList | ||
@viewmodel.page.sections.map { section => |
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.
iterate through each section and renders the rows. also optionally render a heading is it exists
|
||
// Dependant on Christo's work | ||
|
||
// Get all indexes for a section that have atleast completed the first page |
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.
Is there a need to have a Mode.PrePopulation and task list, list page and CYA pages to load with this mode?
In that case prePopAddresses would have data only if this case of pre-population mode.
Check
link would call CYA page in pre-population mode.
To reduce the risk of affecting existing functionality.
If mode is an overkill, we could consider another way of distinguishing pre-population mode, e.g. store a boolean flag `isPrePopulation' in the request.
section.rows.paginate(paginatedViewModel.pagination.currentPage, paginatedViewModel.pagination.pageSize)) | ||
) { rows => | ||
|
||
@section.label.map { label => |
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.
Label would need to be skipped if there are no items.
@@ -26,7 +26,7 @@ | |||
) | |||
@(form: Form[Boolean], viewmodel: FormPageViewModel[ListViewModel])(implicit request: Request[_], messages: Messages) | |||
|
|||
@layout(pageTitle = title(form, if(viewmodel.optViewOnlyDetails.nonEmpty) viewmodel.optViewOnlyDetails.get.title.toMessage else viewmodel.title.toMessage),showBackLink = viewmodel.showBackLink) { | |||
@layout(pageTitle = title(form, if(viewmodel.optViewOnlyDetails.nonEmpty) viewmodel.optViewOnlyDetails.get.title.toMessage else viewmodel.title.toMessage), showBackLink = viewmodel.showBackLink) { |
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.
Title (and heading) should be different in pre-population mode. Can be set up by the controller and just passed in as viewmodel.title
value though.
No description provided.