-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Donation Modal body text to aRichTextField
#11183
Comments
Current data should also be considered. How will the data be migrated? Can we cleanly migrate a text field to a rich text field? |
@jhonatan-lopes Added this as a P1 as we might want to go back to the stakeholder and let them know if we're either doing this or not. I would say that if the process of migrating is going to be difficult and might cause unintended issues, we might be better off leaving this as it is for the time being. The original deadline for this request was Q1 2024. |
We can do the data migrations, it just needs to be well thought before proceeding: https://docs.wagtail.org/en/stable/advanced_topics/streamfield_migrations.html#streamfield-migrations |
Let's discuss this in our next sprint planning. Thank you! |
@jhonatan-lopes The field name |
@mmmavis yep, I'm aware that it is a snippet 😬 We should definitely start by doing what you said: converting operations = [
migrations.AlterField(
model_name="donationmodal",
name="body",
field=wagtail.fields.RichTextField(
default="...",
help_text="Donation text",
),
),
] What I'm not sure is what comes next. I'm not 100% certain if the If not, we will need to figure out how to handle that data so that it is "rich text valid". Does that make sense? |
@jhonatan-lopes Yup! I'll get a copy of prod data to test it locally. |
@jhonatan-lopes Not sure if this is the right way of comparing the before and after values (certainly not the most efficient way I think 😅 ) ... What I did is to export data in the DonationModal table into json (both before and after the migration), and compare the Is this the kind of check you had in mind? If not, please let me know how I should proceed. Thanks! |
If the rendering still works, then that's good enough for me :thumbs-up: Thanks for checking that |
@mmmavis I'd recommend you ask Christian since he has a better sense of what the copy would be, I'm not sure what he has in mind. |
Sounds good. Will do! |
➤ Mavis Ou commented: Current update: I reached out to Christian on Slack yesterday. I will update the ticket and file PR once I hear back from him. |
➤ Mavis Ou commented: Update: Christian and team would like to have every feature in the RichTextField ( https://docs.wagtail.org/en/stable/advanced_topics/customisation/page_editing_interface.html#limiting-features-in-a-rich-text-field ) enabled. !image (7).png|width=1624,height=824,alt="image (7).png"! |
➤ Mavis Ou commented: Simon Acosta Torres I just tested this on staging, however, on staging the HTML formatted string doesn’t get rendered as HTML. This is different than what we tested it on the PR stage. I’m gonna dive into it more. If this can’t be fixed before the next deploy then we’ll have to pull out the code changes from main !image-20240510-214746.png|width=695,height=383,alt="image-20240510-214746.png"! |
➤ Mavis Ou commented: Fix is pretty straightforward. Will file a PR now. |
➤ Simon Acosta Torres commented: Mavis Ou Thanks for taking a look and even more, for finding a fix for this. This is one of the last few things remaining from stakeholders, so it will be amazing to be able to say its done 🙂 |
➤ Mavis Ou commented: Fix is under review at the moment: #12322 ( https://github.com/MozillaFoundation/foundation.mozilla.org/pull/12322|smart-link ) |
➤ Mavis Ou commented: PR merged and tested on staging. This is ready for prod push! |
Stakeholder: Michael Whitney
Original request: https://mozilla-hub.atlassian.net/browse/MOFOTP-23
Needs groomed, but seems like we should change
body
fromTextField
toRichTextField
. We should also put a reasonable character limit here. We should also find out ifheader
should remain aCharField
or convert that as well.Open questions:
Current data should also be considered. How will the data be migrated? Can we cleanly migrate a text field to a rich text field?
┆Issue is synchronized with this Jira Task
┆Attachments: image (7).png | image-20240510-214746.png
The text was updated successfully, but these errors were encountered: