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

PSR-1510 list page #930

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

PSR-1510 list page #930

wants to merge 1 commit into from

Conversation

westwater
Copy link
Contributor

No description provided.

)
}

case class ListViewModel(
inset: DisplayMessage,
rows: List[ListRow],
sections: List[Section],
Copy link
Contributor Author

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 =>
Copy link
Contributor Author

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
Copy link
Contributor

@kberec kberec Oct 22, 2024

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 =>
Copy link
Contributor

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) {
Copy link
Contributor

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.

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