Skip to content

Commit bfe8edd

Browse files
authored
Merge branch 'main' into feature/CDD-3162-popular-topics-grid-component
2 parents 7a9b157 + c4d58ce commit bfe8edd

File tree

8 files changed

+7067
-6
lines changed

8 files changed

+7067
-6
lines changed

.github/workflows/actions.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,44 @@ jobs:
195195
- name: Build ingestion Docker image
196196
run: docker build -t be-ingestion-test -f Dockerfile-ingestion .
197197

198+
- name: Run main API container
199+
run: docker run -d --name be-main-test-container be-main-test
200+
201+
- name: Health check main API container
202+
run: |
203+
echo "Waiting for main API container to start..."
204+
sleep 10
205+
206+
if [ "$(docker inspect -f '{{.State.Running}}' be-main-test-container)" != "true" ]; then
207+
echo "Main API container failed to start"
208+
docker logs be-main-test-container
209+
exit 1
210+
fi
211+
212+
echo "Main API container is running successfully"
213+
214+
- name: Run ingestion container
215+
run: docker run -d --name be-ingestion-test-container be-ingestion-test
216+
217+
- name: Health check ingestion container
218+
run: |
219+
echo "Waiting for ingestion container to start..."
220+
sleep 10
221+
222+
if [ "$(docker inspect -f '{{.State.Running}}' be-ingestion-test-container)" != "true" ]; then
223+
echo "Ingestion container failed to start"
224+
docker logs be-ingestion-test-container
225+
exit 1
226+
fi
227+
228+
echo "Ingestion container is running successfully"
229+
230+
- name: Cleanup
231+
if: always()
232+
run: |
233+
docker rm -f be-main-test-container || true
234+
docker rm -f be-ingestion-test-container || true
235+
198236
###############################################################################
199237
# Build image
200238
###############################################################################

cms/dynamic_content/cards.py

Lines changed: 90 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ class ChartCard(blocks.StructBlock):
298298
required=False,
299299
)
300300
date_prefix = blocks.CharBlock(
301-
required=True,
301+
requried=True,
302302
default=CHART_CARD_DATE_PREFIX_DEFAULT_TEXT,
303-
help_text=help_texts.CHART_DATE_PREFIX,
303+
help_texts=help_texts.CHART_DATE_PREFIX,
304304
)
305305
show_timeseries_filter = blocks.BooleanBlock(
306306
help_text=help_texts.CHART_TIMESERIES_FILTER,
@@ -314,7 +314,16 @@ class Meta:
314314
icon = "standalone_chart"
315315

316316

317-
class ChartWithDescriptionCard(ChartCard):
317+
class ChartWithDescriptionCard(blocks.StructBlock):
318+
title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD)
319+
sub_title = blocks.TextBlock(
320+
required=False, help_text=help_texts.OPTIONAL_BODY_FIELD, label="Subtitle"
321+
)
322+
topic_page = PageLinkChooserBlock(
323+
page_type="topic.TopicPage",
324+
required=True,
325+
help_text=help_texts.TOPIC_PAGE_FIELD,
326+
)
318327
description = blocks.TextBlock(
319328
required=True,
320329
help_text=help_texts.CHART_DESCRIPTION,
@@ -323,6 +332,47 @@ class ChartWithDescriptionCard(ChartCard):
323332
required=False,
324333
help_text=help_texts.SOURCE_LINK_INTERNAL_OR_EXTERNAL,
325334
)
335+
tag_manager_event_id = blocks.CharBlock(
336+
required=False,
337+
help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD,
338+
label="Tag manager event ID",
339+
)
340+
x_axis = blocks.ChoiceBlock(
341+
required=False,
342+
choices=get_possible_axis_choices,
343+
help_text=help_texts.CHART_X_AXIS,
344+
)
345+
x_axis_title = blocks.CharBlock(
346+
required=False,
347+
default="",
348+
help_text=help_texts.CHART_X_AXIS_TITLE,
349+
)
350+
y_axis = blocks.ChoiceBlock(
351+
required=False,
352+
choices=get_possible_axis_choices,
353+
help_text=help_texts.CHART_Y_AXIS,
354+
)
355+
y_axis_title = blocks.CharBlock(
356+
required=False,
357+
default="",
358+
help_text=help_texts.CHART_Y_AXIS_TITLE,
359+
)
360+
y_axis_minimum_value = blocks.DecimalBlock(
361+
required=False,
362+
default=0,
363+
help_text=help_texts.CHART_Y_AXIS_MINIMUM_VALUE,
364+
)
365+
y_axis_maximum_value = blocks.DecimalBlock(
366+
required=False,
367+
help_text=help_texts.CHART_Y_AXIS_MAXIMUM_VALUE,
368+
)
369+
show_tooltips = blocks.BooleanBlock(
370+
help_text=help_texts.SHOW_TOOLTIPS_ON_CHARTS_FIELD,
371+
default=False,
372+
required=False,
373+
)
374+
375+
chart = ChartComponent(help_text=help_texts.CHART_BLOCK_FIELD)
326376

327377
class Meta:
328378
icon = "standalone_chart"
@@ -371,16 +421,52 @@ class Meta:
371421
icon = "standalone_chart"
372422

373423

374-
class HeadlineChartWithDescriptionCard(HeadlineChartCard):
424+
class HeadlineChartWithDescriptionCard(blocks.StructBlock):
425+
title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD)
426+
sub_title = blocks.TextBlock(
427+
required=False, help_text=help_texts.OPTIONAL_BODY_FIELD, label="Subtitle"
428+
)
429+
topic_page = PageLinkChooserBlock(
430+
page_type="topic.TopicPage",
431+
required=True,
432+
help_text=help_texts.TOPIC_PAGE_FIELD,
433+
)
375434
description = blocks.TextBlock(
376435
required=True,
377436
help_text=help_texts.HEADLINE_CHART_DESCRIPTION,
378437
)
438+
tag_manager_event_id = blocks.CharBlock(
439+
required=False,
440+
help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD,
441+
label="Tag manager event ID",
442+
)
443+
x_axis = blocks.ChoiceBlock(
444+
required=True,
445+
choices=get_possible_axis_choices,
446+
help_text=help_texts.REQUIRED_CHART_X_AXIS,
447+
)
448+
x_axis_title = blocks.CharBlock(
449+
required=False,
450+
default="",
451+
help_text=help_texts.CHART_X_AXIS_TITLE,
452+
)
453+
y_axis_title = blocks.CharBlock(
454+
required=False,
455+
default="",
456+
help_text=help_texts.CHART_Y_AXIS_TITLE,
457+
)
458+
show_tooltips = blocks.BooleanBlock(
459+
help_text=help_texts.SHOW_TOOLTIPS_ON_CHARTS_FIELD,
460+
default=False,
461+
required=False,
462+
)
379463
source = SourceLinkBlock(
380464
required=False,
381465
help_text=help_texts.SOURCE_LINK_INTERNAL_OR_EXTERNAL,
382466
)
383467

468+
chart = HeadlineChartComponent(help_texts=help_texts.CHART_BLOCK_FIELD)
469+
384470
class Meta:
385471
icon = "standalone_chart"
386472

@@ -494,7 +580,6 @@ class ChartRowBlockTypes(blocks.StreamBlock):
494580
chart_card = ChartCard()
495581
chart_with_description_card = ChartWithDescriptionCard()
496582
headline_chart_card = HeadlineChartCard()
497-
headline_chart_with_description_card = HeadlineChartWithDescriptionCard()
498583
chart_with_headline_and_trend_card = ChartWithHeadlineAndTrendCard()
499584
simplified_chart_with_link = SimplifiedChartWithLink()
500585
dual_category_chart_card = DualCategoryChartCard()
@@ -555,7 +640,6 @@ class Meta:
555640

556641

557642
class ChartCardSection(blocks.StructBlock):
558-
559643
cards = ChartRowBlockTypes(
560644
min_num=MINIMUM_COLUMNS_CHART_COLUMNS_COUNT,
561645
help_text=help_texts.CHART_ROW_CARD_COLUMN_WIDTH_THREE,

0 commit comments

Comments
 (0)