Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions backend/api/cms/types.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import strawberry
import strawberry_django

from api.pages.types import Page
from cms import models

from ..helpers.i18n import make_localized_resolver
Expand All @@ -23,7 +22,6 @@ class MenuLink:
resolver=make_localized_resolver("title"), only=["title"]
)
is_primary: strawberry.auto
page: Page | None


@strawberry_django.type(models.Menu)
Expand Down
Empty file removed backend/api/pages/__init__.py
Empty file.
24 changes: 0 additions & 24 deletions backend/api/pages/schema.py

This file was deleted.

25 changes: 0 additions & 25 deletions backend/api/pages/types.py

This file was deleted.

2 changes: 0 additions & 2 deletions backend/api/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from .newsletters.schema import NewsletterMutations
from .orders.mutations import OrdersMutations
from .orders.query import OrdersQuery
from .pages.schema import PagesQuery
from .pretix.mutations import AttendeeTicketMutation
from .schedule.schema import ScheduleQuery, ScheduleMutations
from .submissions.mutations import SubmissionsMutations
Expand All @@ -34,7 +33,6 @@
class Query(
ConferenceQuery,
SubmissionsQuery,
PagesQuery,
CountryQuery,
OrdersQuery,
JobBoardQuery,
Expand Down
18 changes: 1 addition & 17 deletions backend/api/tests/schema/conference/test_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from cms.tests.factories import MenuFactory, MenuLinkFactory
from conferences.tests.factories import ConferenceFactory
from pages.tests.factories import PageFactory


@mark.django_db
Expand Down Expand Up @@ -68,10 +67,7 @@ def test_frontend_header_menus_query_is_constant(
for identifier in ["conference-nav", "program-nav"]:
menu = MenuFactory(identifier=identifier, conference=conference)
for _ in range(link_count):
MenuLinkFactory(
menu=menu,
page=PageFactory(conference=conference),
)
MenuLinkFactory(menu=menu)

with django_assert_num_queries(9):
resp = graphql_client.query(
Expand All @@ -83,36 +79,24 @@ def test_frontend_header_menus_query_is_constant(
links {
text: title(language: "en")
link: href(language: "en")
page {
slug(language: "en")
}
}
}
programMenuEn: menu(identifier: "program-nav") {
links {
text: title(language: "en")
link: href(language: "en")
page {
slug(language: "en")
}
}
}
conferenceMenuIt: menu(identifier: "conference-nav") {
links {
text: title(language: "it")
link: href(language: "it")
page {
slug(language: "it")
}
}
}
programMenuIt: menu(identifier: "program-nav") {
links {
text: title(language: "it")
link: href(language: "it")
page {
slug(language: "it")
}
}
}
}
Expand Down
158 changes: 0 additions & 158 deletions backend/api/tests/schema/test_pages.py

This file was deleted.

2 changes: 0 additions & 2 deletions backend/cms/migrations/0006_menu_menulink.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Migration(migrations.Migration):

dependencies = [
('conferences', '0011_auto_20190921_2340'),
('pages', '0002_auto_20190914_1504'),
('cms', '0005_faq'),
]

Expand Down Expand Up @@ -39,7 +38,6 @@ class Migration(migrations.Migration):
('title', i18n.fields.I18nTextField(verbose_name='title')),
('href', i18n.fields.I18nTextField(blank=True, verbose_name='Link url')),
('menu', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='links', to='cms.Menu', verbose_name='menu')),
('page', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='links', to='pages.Page', verbose_name='page')),
],
options={
'ordering': ('order',),
Expand Down
25 changes: 25 additions & 0 deletions backend/cms/migrations/0009_remove_menulink_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
('cms', '0008_menu_title'),
]

# The old pages app has been removed: 0006_menu_menulink no longer creates
# the menulink.page column, so there is no state to change here, only the
# leftover database objects of already migrated databases to clean up.
operations = [
migrations.RunSQL(
'ALTER TABLE cms_menulink DROP COLUMN IF EXISTS page_id;',
migrations.RunSQL.noop,
),
migrations.RunSQL(
'DROP TABLE IF EXISTS pages_page;',
migrations.RunSQL.noop,
),
migrations.RunSQL(
"DELETE FROM django_migrations WHERE app = 'pages';",
migrations.RunSQL.noop,
),
]
8 changes: 0 additions & 8 deletions backend/cms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@ class MenuLink(OrderedModel, TimeStampedModel):
title = I18nTextField(_("title"), blank=False)
href = I18nTextField(_("Link url"), blank=True)
is_primary = models.BooleanField(_("Is primary"), default=False)
page = models.ForeignKey(
"pages.Page",
on_delete=models.CASCADE,
verbose_name=_("page"),
related_name="links",
null=True,
blank=True,
)

def __str__(self):
return f"{self.title} ({self.menu})"
12 changes: 4 additions & 8 deletions backend/demodata/cms.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@
"en": "/en/schedule",
"it": "/en/programma"
},
"is_primary": false,
"page": null
"is_primary": false
}
},
{
Expand All @@ -211,8 +210,7 @@
"en": "/en/register",
"it": "/it/registrati"
},
"is_primary": true,
"page": null
"is_primary": true
}
},
{
Expand All @@ -231,8 +229,7 @@
"en": "/en/schedule",
"it": "/it/programma"
},
"is_primary": false,
"page": null
"is_primary": false
}
},
{
Expand All @@ -251,8 +248,7 @@
"en": "/en/where",
"it": "/it/dove"
},
"is_primary": false,
"page": null
"is_primary": false
}
}
]
Loading
Loading