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

Specialist document presenter refactor #3571

Merged
merged 2 commits into from
Feb 25, 2025

Conversation

minhngocd
Copy link
Contributor

As follow on discussion on PR: #3565
Refactored the specialist document presenter.

Closed the previous PR as we may no longer need to manipulate the finder schema to fetch sub-facets anymore. Refactorings are stand alone.

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

Routes in this application are being migrated to another application, please check with #govuk-patterns-and-pages when making changes.

There are many facet value variables which make it confusing. Naming it what it is, which is metadata from the content item
Removed some of the nested maps and loops. Hopefully be more explicit with sequential steps of generating metadata.
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3571 February 24, 2025 17:53 Inactive
Copy link
Contributor

@ryanb-gds ryanb-gds left a comment

Choose a reason for hiding this comment

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

I think this will make it easier to introduce the nested facet behaviour we need, if that's still required. If it isn't (sounds like it isn't) then I'm not sure of the value of merging this

@minhngocd
Copy link
Contributor Author

minhngocd commented Feb 25, 2025

I think this will make it easier to introduce the nested facet behaviour we need, if that's still required. If it isn't (sounds like it isn't) then I'm not sure of the value of merging this

I think it's more like - refactoring was done by that point anyways, and for the sake of better readability and leaving things in a better state we'll just pop this PR out there. It's no longer urgent. We also stopped and rolled back the refactoring of pullings things out into its own models.

Copy link
Contributor

@hannako hannako left a comment

Choose a reason for hiding this comment

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

Thanks Minno for taking the time to refactor this 🏅

@@ -113,7 +113,7 @@ def facets
finder.dig("details", "facets")
end

def facet_values
def content_item_metadata
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a much better name 👍

@minhngocd minhngocd merged commit 0b36b90 into main Feb 25, 2025
12 checks passed
@minhngocd minhngocd deleted the specialist-document-presenter-refactor-2 branch February 25, 2025 15:23
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.

4 participants