diff --git a/CHANGELOG.md b/CHANGELOG.md index 68ee8e77d..4120a2fdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Disable buttons and menu entries when user does not have permissions * Fix save error for user fields * Ensure custom fonts are loaded before rendering charts and diagrams +* Remove status emoji of notes ## v2023.145 - 2023-12-11 diff --git a/api/src/reportcreator_api/archive/import_export/serializers.py b/api/src/reportcreator_api/archive/import_export/serializers.py index e9b258831..07047038e 100644 --- a/api/src/reportcreator_api/archive/import_export/serializers.py +++ b/api/src/reportcreator_api/archive/import_export/serializers.py @@ -407,13 +407,12 @@ class Meta: model = ProjectNotebookPage fields = [ 'id', 'created', 'updated', - 'title', 'text', 'checked', 'icon_emoji', 'status_emoji', 'assignee', + 'title', 'text', 'checked', 'icon_emoji', 'assignee', 'order', 'parent', ] extra_kwargs = { 'created': {'read_only': False, 'required': False}, 'icon_emoji': {'required': False}, - 'status_emoji': {'required': False}, 'assignee': {'required': False} } diff --git a/api/src/reportcreator_api/pentests/migrations/0047_remove_historicalprojectnotebookpage_status_emoji_and_more.py b/api/src/reportcreator_api/pentests/migrations/0047_remove_historicalprojectnotebookpage_status_emoji_and_more.py new file mode 100644 index 000000000..82df7dd23 --- /dev/null +++ b/api/src/reportcreator_api/pentests/migrations/0047_remove_historicalprojectnotebookpage_status_emoji_and_more.py @@ -0,0 +1,25 @@ +# Generated by Django 4.2.7 on 2023-12-14 09:09 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('pentests', '0046_history_encryption'), + ] + + operations = [ + migrations.RemoveField( + model_name='historicalprojectnotebookpage', + name='status_emoji', + ), + migrations.RemoveField( + model_name='projectnotebookpage', + name='status_emoji', + ), + migrations.RemoveField( + model_name='usernotebookpage', + name='status_emoji', + ), + ] diff --git a/api/src/reportcreator_api/pentests/models/notes.py b/api/src/reportcreator_api/pentests/models/notes.py index ac929e9e7..5d3f2ed08 100644 --- a/api/src/reportcreator_api/pentests/models/notes.py +++ b/api/src/reportcreator_api/pentests/models/notes.py @@ -18,7 +18,6 @@ class Meta: text = EncryptedField(base_field=models.TextField(default='')) checked = models.BooleanField(null=True, blank=True) icon_emoji = models.CharField(max_length=32, null=True, blank=True) - status_emoji = models.CharField(max_length=32, null=True, blank=True) parent = models.ForeignKey(to='self', on_delete=models.CASCADE, null=True, blank=True) order = models.PositiveIntegerField() diff --git a/api/src/reportcreator_api/pentests/serializers/notes.py b/api/src/reportcreator_api/pentests/serializers/notes.py index 1166fecff..54f5163b5 100644 --- a/api/src/reportcreator_api/pentests/serializers/notes.py +++ b/api/src/reportcreator_api/pentests/serializers/notes.py @@ -17,7 +17,7 @@ class NotebookPageSerializerBase(serializers.ModelSerializer): class Meta: fields = [ 'id', 'created', 'updated', 'lock_info', - 'title', 'text', 'checked', 'icon_emoji', 'status_emoji', + 'title', 'text', 'checked', 'icon_emoji', 'order', 'parent', ] extra_kwargs = { diff --git a/api/src/reportcreator_api/tests/mock.py b/api/src/reportcreator_api/tests/mock.py index 8114af0c0..e9c581e1f 100644 --- a/api/src/reportcreator_api/tests/mock.py +++ b/api/src/reportcreator_api/tests/mock.py @@ -188,7 +188,6 @@ def create_usernotebookpage(**kwargs) -> UserNotebookPage: 'text': 'Note text', 'checked': random.choice([None, True, False]), 'icon_emoji': random.choice([None, '🦖']), - 'status_emoji': random.choice([None, '✔️', '🤡']), } | kwargs) @@ -198,7 +197,6 @@ def create_projectnotebookpage(**kwargs) -> ProjectNotebookPage: 'text': 'Note text', 'checked': random.choice([None, True, False]), 'icon_emoji': random.choice([None, '🦖']), - 'status_emoji': random.choice([None, '✔️', '🤡']), } | kwargs) diff --git a/api/src/reportcreator_api/tests/test_import_export.py b/api/src/reportcreator_api/tests/test_import_export.py index bf9c88c1b..67aeadae5 100644 --- a/api/src/reportcreator_api/tests/test_import_export.py +++ b/api/src/reportcreator_api/tests/test_import_export.py @@ -175,7 +175,7 @@ def test_export_import_project_all(self): assert p.notes.count() == self.project.notes.count() for i, s in zip(p.notes.order_by('note_id'), self.project.notes.order_by('note_id')): - assertKeysEqual(i, s, ['note_id', 'created', 'title', 'text', 'checked', 'icon_emoji', 'status_emoji', 'order']) + assertKeysEqual(i, s, ['note_id', 'created', 'title', 'text', 'checked', 'icon_emoji', 'order']) assert i.parent.note_id == s.parent.note_id if s.parent else i.parent is None assert {(f.name, f.file.read()) for f in p.files.all()} == {(f.name, f.file.read()) for f in self.project.files.all()} @@ -373,7 +373,7 @@ def test_copy_project(self): for p_n, cp_n in zip(p.notes.order_by('note_id'), cp.notes.order_by('note_id')): assert p_n != cp_n - assertKeysEqual(p_n, cp_n, ['note_id', 'title', 'text', 'checked', 'icon_emoji', 'status_emoji', 'order']) + assertKeysEqual(p_n, cp_n, ['note_id', 'title', 'text', 'checked', 'icon_emoji', 'order']) assert not cp_f.is_locked if p_n.parent: assert p_n.parent.note_id == cp_n.parent.note_id diff --git a/frontend/src/components/Design/CreateDesignDialog.vue b/frontend/src/components/Design/CreateDesignDialog.vue index 1933cab6f..a3903368a 100644 --- a/frontend/src/components/Design/CreateDesignDialog.vue +++ b/frontend/src/components/Design/CreateDesignDialog.vue @@ -18,12 +18,6 @@ :required="false" autofocus /> - @@ -52,23 +46,28 @@ diff --git a/frontend/src/pages/designs/private.vue b/frontend/src/pages/designs/private.vue index 5dbf4c40d..78bbd1810 100644 --- a/frontend/src/pages/designs/private.vue +++ b/frontend/src/pages/designs/private.vue @@ -3,10 +3,10 @@ - diff --git a/frontend/src/pages/projects/index.vue b/frontend/src/pages/projects/index.vue index 00f571a53..f4638b63c 100644 --- a/frontend/src/pages/projects/index.vue +++ b/frontend/src/pages/projects/index.vue @@ -3,8 +3,8 @@ @@ -69,7 +69,7 @@ const { toolbarAttrs, fetchLoaderAttrs, readonly } = useLockEdit({ fetchState, baseUrl, toolbarRef: computed(() => (vm?.refs?.templateEditor as any)?.toolbarRef), - hasEditPermissions: computed(() => auth.permissions.template_editor), + hasEditPermissions: computed(() => auth.permissions.value.template_editor), performSave: async (data) => { const res = await templateStore.update(data!); for (const tr of template.value!.translations) { diff --git a/frontend/src/pages/templates/index.vue b/frontend/src/pages/templates/index.vue index 61548db43..3148c9b79 100644 --- a/frontend/src/pages/templates/index.vue +++ b/frontend/src/pages/templates/index.vue @@ -29,12 +29,12 @@