Skip to content

Get list of page routes in routes controller show action#1744

Merged
lfdebrux merged 3 commits intomainfrom
ldeb-add-page-conditions-service
Jan 31, 2025
Merged

Get list of page routes in routes controller show action#1744
lfdebrux merged 3 commits intomainfrom
ldeb-add-page-conditions-service

Conversation

@lfdebrux
Copy link
Copy Markdown
Contributor

What problem does this pull request solve?

Trello card: https://trello.com/c/6qRDmaOg/2095-changes-to-question-xs-routes-page-to-make-it-clearer

Change the routes/show action, view and RouteSummaryCardDataPresenter to get page routes up front and pass down the chain to other objects. This lets us use the list of routes in places other than the presenter.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Has all relevant documentation been updated?

Refactor code dealing with conditions and routes to abstract out getting
conditions and routes for a page.
- Rename `all_routes` to `routes`
- Move routes and conditional_routes to private methods
- Add private method secondary_skip
- Remove unnecessary class method `call`, use `new` instead
Change the routes/show action, view and RouteSummaryCardDataPresenter to
get page routes up front and pass down the chain to other objects. This
lets us use the list of routes in places other than the presenter.
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@thomasiles thomasiles left a comment

Choose a reason for hiding this comment

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

Looks much neater, works locally and has some really nice ideas 👏

@lfdebrux lfdebrux merged commit f222951 into main Jan 31, 2025
5 checks passed
@lfdebrux lfdebrux deleted the ldeb-add-page-conditions-service branch January 31, 2025 11:06
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