(CM-618) Develop smart answers spike #7378
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This develops the spike outlined in #7347 to allow us to use Content Blocks within Smart Answers. A lot of the integration with the content blocks has been outsourced to the Content Block Tools Gem, specifically the functionality added in alphagov/govuk_content_block_tools#112.
Most of the actual work in this PR is adding a
ContentBlockDetectorclass which, when a Smart Answer is published to Publishing API, looks to see what content blocks are used in a Smart Answer and publishes the relevant links so they can be shown as related content in Content Block Manager, eg:We currently aren't using any blocks in the code at the moment, but this sets us up so using content blocks is easy and seamless.