Skip to content

Commit 29c1268

Browse files
feat!: enable authoring MFE markdown editor waffle for everyone by default (#36872)
This adds a migration to turn on the new React-based Markdown editing option for newly-created ProblemBlocks for all authors. The option is nested under "Advanced settings", just like the Advanced (OLX) problem editor. The migration is written such that it will *not* overwrite an existing global "No" waffle flag. Furthermore, our waffle utilities are designed such that org-level and course-level overrides will still take preference over the flag that the migration creates. Therefore, this should only take effect in cases where no existing waffle flag applies. BREAKING CHANGE: Operators who do not want the new React-based Markdown editor to be shown should create a flag contentstore.use_react_markdown_editor with the value "No". We plan to backport this to Teak. Prior art for flipping waffles like this: 9b00243 Part of: openedx/platform-roadmap#384 Co-authored-by: Muhammad Anas <[email protected]>
1 parent b6cec3c commit 29c1268

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from django.db import migrations
2+
3+
from cms.djangoapps.contentstore.toggles import (
4+
ENABLE_REACT_MARKDOWN_EDITOR
5+
)
6+
7+
8+
def create_flag(apps, schema_editor):
9+
Flag = apps.get_model('waffle', 'Flag')
10+
Flag.objects.get_or_create(
11+
name=ENABLE_REACT_MARKDOWN_EDITOR.name, defaults={'everyone': True}
12+
)
13+
14+
15+
class Migration(migrations.Migration):
16+
dependencies = [
17+
('contentstore', '0010_container_link_models'),
18+
('waffle', '0001_initial'),
19+
]
20+
21+
operations = [
22+
# Do not remove the flags for rollback. We don't want to lose originals if
23+
# they already existed, and it won't hurt if they are created.
24+
migrations.RunPython(create_flag, reverse_code=migrations.RunPython.noop),
25+
]

0 commit comments

Comments
 (0)