Skip to content

Commit fc96306

Browse files
committed
Merge branch 'WT-962-set-as-default-page' of https://github.com/mozmeao/springfield into WT-962-set-as-default-page
2 parents 0bf0048 + d40f496 commit fc96306

36 files changed

Lines changed: 132 additions & 62 deletions

springfield/cms/blocks.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,19 +319,20 @@
319319
("other-os", "Other OS"),
320320
("unsupported", "Unsupported OS"),
321321
]
322-
323322
FIREFOX_CHOICES = [
324323
("", "No restriction"),
325324
("is-firefox", "Firefox only"),
326325
("not-firefox", "Non-Firefox only"),
327326
]
328-
329327
AUTH_CHOICES = [
330328
("", "No restriction"),
331329
("state-fxa-supported-signed-in", "Signed-in only"),
332330
("state-fxa-supported-signed-out", "Signed-out only"),
333331
]
334-
332+
DEFAULT_BROWSER_CHOICES = [
333+
("is-default", "Firefox is default browser"),
334+
("is-not-default", "Firefox is not default browser"),
335+
]
335336

336337
UITOUR_BUTTON_NEW_TAB = "open_new_tab"
337338
UITOUR_BUTTON_ABOUT_PREFERENCES = "open_about_preferences"
@@ -441,6 +442,13 @@ class ConditionalDisplayBlock(blocks.StructBlock):
441442
label="Login state",
442443
help_text="Filter by login state. Leave empty for no restriction.",
443444
)
445+
default_browser = blocks.ChoiceBlock(
446+
choices=DEFAULT_BROWSER_CHOICES,
447+
default="",
448+
required=False,
449+
label="Default Browser",
450+
help_text="Filter by default browser state. Leave empty for no restriction.",
451+
)
444452

445453
class Meta:
446454
label = "Conditional Display"

springfield/cms/fixtures/article_page_fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
1818
)
1919

20-
SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": ""}
20+
SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": "", "default_browser": ""}
2121

2222

2323
def create_article(

springfield/cms/fixtures/banner_fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from springfield.cms.fixtures.video_fixtures import get_video_variants
99
from springfield.cms.models import FreeFormPage, FreeFormPage2026
1010

11-
SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": ""}
11+
SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": "", "default_browser": ""}
1212

1313

1414
def get_banner_variants():

springfield/cms/fixtures/card_fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from springfield.cms.fixtures.tag_fixtures import get_tag_variants
1111
from springfield.cms.models import FreeFormPage
1212

13-
SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": ""}
13+
SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": "", "default_browser": ""}
1414

1515

1616
def get_sticker_card_variants() -> list[dict]:

springfield/cms/fixtures/cards_2026_fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from springfield.cms.fixtures.button_fixtures import get_button_variants
99
from springfield.cms.models import FreeFormPage2026
1010

11-
_SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": ""}
11+
_SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": "", "default_browser": ""}
1212

1313
_IMAGE_VARIANTS = {
1414
"image": settings.PLACEHOLDER_IMAGE_ID,

springfield/cms/fixtures/carousel_2026_fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from springfield.cms.fixtures.button_fixtures import get_button_variants
99
from springfield.cms.models import FreeFormPage2026
1010

11-
SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": ""}
11+
SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": "", "default_browser": ""}
1212

1313

1414
def _image(image_id, dark_mode_image_id=None):

springfield/cms/fixtures/download_page_fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from springfield.cms.fixtures.snippet_fixtures import get_pre_footer_cta_form_snippet
1010
from springfield.cms.models import DownloadIndexPage, DownloadPage
1111

12-
SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": ""}
12+
SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": "", "default_browser": ""}
1313

1414

1515
def get_illustration_cards():

springfield/cms/fixtures/freeformpage_2026.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from springfield.cms.fixtures.snippet_fixtures import get_qr_code_snippet, get_set_as_default_snippet
99
from springfield.cms.models import FreeFormPage2026
1010

11-
SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": ""}
11+
SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": "", "default_browser": ""}
1212

1313

1414
def get_mobile_store_qr_code():

springfield/cms/fixtures/homepage_fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from springfield.cms.fixtures.snippet_fixtures import get_pre_footer_cta_snippet
1010
from springfield.cms.models import HomePage
1111

12-
SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": ""}
12+
SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": "", "default_browser": ""}
1313

1414

1515
def get_home_intro():

springfield/cms/fixtures/icon_list_with_image_2026_fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from springfield.cms.fixtures.base_fixtures import get_2026_test_index_page, get_placeholder_images
88
from springfield.cms.models import FreeFormPage2026
99

10-
_SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": ""}
10+
_SHOW_TO_ALL = {"platforms": [], "firefox": "", "auth_state": "", "default_browser": ""}
1111

1212

1313
def _section(heading_text, content_blocks, section_id, subheading_text=""):

0 commit comments

Comments
 (0)