Skip to content

Commit

Permalink
Update BlogIndexPages callout_box to use LinkBlock (#12572)
Browse files Browse the repository at this point in the history
* added new link_button LinkBlock field and migration

* added operation to migratin file to carry over old data

* updated template

* removal of old fields

* squashed migrations

* updated streamfield factory

* update to template

* merge with main + updated migrations

* updated migration dependencies

* updated migration operation
  • Loading branch information
danielfmiranda authored Jul 2, 2024
1 parent c3c4209 commit 8666d4a
Show file tree
Hide file tree
Showing 4 changed files with 356 additions and 18 deletions.
14 changes: 9 additions & 5 deletions network-api/networkapi/utility/faker/streamfield_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,15 @@ def generate_blog_index_callout_box_field():
title = fake.sentence(nb_words=10, variable_nb_words=True)
related_topics = [choice(BlogPageTopic.objects.all()).id]
body = fake.paragraph(nb_sentences=6, variable_nb_sentences=False)

show_icon = True
link_button_text = "Learn More"
link_button_url = fake.url(schemes=["https"])
link_button = [
{
"label": "Learn More",
"link_to": "external_url",
"external_url": fake.url(schemes=["https"]),
"new_window": True,
}
]

return generate_field(
"callout_box",
Expand All @@ -489,8 +494,7 @@ def generate_blog_index_callout_box_field():
"related_topics": related_topics,
"show_icon": show_icon,
"body": body,
"link_button_text": link_button_text,
"link_button_url": link_button_url,
"link_button": link_button,
},
)

Expand Down
Loading

0 comments on commit 8666d4a

Please sign in to comment.