diff --git a/src/backend/core/api/serializers.py b/src/backend/core/api/serializers.py index b7450dc9..de255790 100644 --- a/src/backend/core/api/serializers.py +++ b/src/backend/core/api/serializers.py @@ -148,7 +148,6 @@ class TemplateSerializer(BaseResourceSerializer): fields = [ "id", "title", - "code_editor", "accesses", "abilities", "css", diff --git a/src/backend/core/migrations/0001_initial.py b/src/backend/core/migrations/0001_initial.py index 4044bf77..d393e77a 100644 --- a/src/backend/core/migrations/0001_initial.py +++ b/src/backend/core/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 5.0.2 on 2024-03-31 18:49 +# Generated by Django 5.0.3 on 2024-05-02 12:12 import django.contrib.auth.models import django.core.validators @@ -42,7 +42,6 @@ class Migration(migrations.Migration): ('updated_at', models.DateTimeField(auto_now=True, help_text='date and time at which a record was last updated', verbose_name='updated on')), ('title', models.CharField(max_length=255, verbose_name='title')), ('description', models.TextField(blank=True, verbose_name='description')), - ('code_editor', models.JSONField(blank=True, default=dict, help_text='A JSON object with all the editor information', verbose_name='code editor')), ('code', models.TextField(blank=True, verbose_name='code')), ('css', models.TextField(blank=True, verbose_name='css')), ('is_public', models.BooleanField(default=False, help_text='Whether this template is public for anyone to use.', verbose_name='public')), diff --git a/src/backend/core/models.py b/src/backend/core/models.py index 6711668c..671fc2c7 100644 --- a/src/backend/core/models.py +++ b/src/backend/core/models.py @@ -327,12 +327,6 @@ class Template(BaseModel): title = models.CharField(_("title"), max_length=255) description = models.TextField(_("description"), blank=True) - code_editor = models.JSONField( - _("code editor"), - help_text=_("A JSON object with all the editor information"), - blank=True, - default=dict, - ) code = models.TextField(_("code"), blank=True) css = models.TextField(_("css"), blank=True) is_public = models.BooleanField( diff --git a/src/backend/core/tests/templates/test_api_templates_retrieve.py b/src/backend/core/tests/templates/test_api_templates_retrieve.py index bbffcae1..0993f414 100644 --- a/src/backend/core/tests/templates/test_api_templates_retrieve.py +++ b/src/backend/core/tests/templates/test_api_templates_retrieve.py @@ -28,7 +28,6 @@ def test_api_templates_retrieve_anonymous_public(): }, "accesses": [], "title": template.title, - "code_editor": {}, "is_public": True, "code": template.code, "css": template.css, @@ -73,7 +72,6 @@ def test_api_templates_retrieve_authenticated_unrelated_public(): }, "accesses": [], "title": template.title, - "code_editor": {}, "is_public": True, "code": template.code, "css": template.css, @@ -141,7 +139,6 @@ def test_api_templates_retrieve_authenticated_related_direct(): "id": str(template.id), "title": template.title, "abilities": template.get_abilities(user), - "code_editor": {}, "is_public": template.is_public, "code": template.code, "css": template.css, @@ -258,7 +255,6 @@ def test_api_templates_retrieve_authenticated_related_team_members( "id": str(template.id), "title": template.title, "abilities": template.get_abilities(user), - "code_editor": {}, "is_public": False, "code": template.code, "css": template.css, @@ -357,7 +353,6 @@ def test_api_templates_retrieve_authenticated_related_team_administrators( "id": str(template.id), "title": template.title, "abilities": template.get_abilities(user), - "code_editor": {}, "is_public": False, "code": template.code, "css": template.css, @@ -460,7 +455,6 @@ def test_api_templates_retrieve_authenticated_related_team_owners( "id": str(template.id), "title": template.title, "abilities": template.get_abilities(user), - "code_editor": {}, "is_public": False, "code": template.code, "css": template.css, diff --git a/src/backend/core/tests/test_models_templates.py b/src/backend/core/tests/test_models_templates.py index 87d9f8d2..79304e0f 100644 --- a/src/backend/core/tests/test_models_templates.py +++ b/src/backend/core/tests/test_models_templates.py @@ -167,9 +167,3 @@ def test_models_templates_get_abilities_preset_role(django_assert_num_queries): "partial_update": False, "generate_document": True, } - - -def test_models_templates_get_code_editor(): - """Check code_editor in the template model""" - template = factories.TemplateFactory(code_editor={"test": "ok"}) - assert template.code_editor == {"test": "ok"} diff --git a/src/frontend/apps/impress/src/features/pads/pad-tools/types.ts b/src/frontend/apps/impress/src/features/pads/pad-tools/types.ts index 41d7dad5..8f395b9d 100644 --- a/src/frontend/apps/impress/src/features/pads/pad-tools/types.ts +++ b/src/frontend/apps/impress/src/features/pads/pad-tools/types.ts @@ -1,5 +1,3 @@ -import { ProjectData } from 'grapesjs'; - export enum Role { MEMBER = 'member', ADMIN = 'administrator', @@ -30,7 +28,6 @@ export interface Template { partial_update: boolean; }; accesses: Access[]; - code_editor: ProjectData; title: string; is_public: boolean; css: string;