-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c89258
commit 1fc4623
Showing
13 changed files
with
256 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
201 changes: 201 additions & 0 deletions
201
home/migrations/0048_alter_contentpage_whatsapp_body.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
# Generated by Django 4.1.10 on 2024-02-01 13:02 | ||
|
||
import django.core.validators | ||
from django.db import migrations | ||
import home.models | ||
import wagtail.blocks | ||
import wagtail.documents.blocks | ||
import wagtail.fields | ||
import wagtail.images.blocks | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("home", "0047_alter_contentpage_messenger_title_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="contentpage", | ||
name="whatsapp_body", | ||
field=wagtail.fields.StreamField( | ||
[ | ||
( | ||
"Whatsapp_Message", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"image", | ||
wagtail.images.blocks.ImageChooserBlock( | ||
required=False | ||
), | ||
), | ||
( | ||
"document", | ||
wagtail.documents.blocks.DocumentChooserBlock( | ||
icon="document", required=False | ||
), | ||
), | ||
( | ||
"media", | ||
home.models.MediaBlock( | ||
icon="media", required=False | ||
), | ||
), | ||
( | ||
"message", | ||
wagtail.blocks.TextBlock( | ||
help_text="each text message cannot exceed 4096 characters, messages with media cannot exceed 1024 characters.", | ||
validators=( | ||
django.core.validators.MaxLengthValidator( | ||
4096 | ||
), | ||
), | ||
), | ||
), | ||
( | ||
"example_values", | ||
wagtail.blocks.ListBlock( | ||
wagtail.blocks.CharBlock(label="Example Value"), | ||
default=[], | ||
help_text="Please add example values for all variables used in a WhatsApp template", | ||
label="Variable Example Values", | ||
), | ||
), | ||
( | ||
"variation_messages", | ||
wagtail.blocks.ListBlock( | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"variation_restrictions", | ||
wagtail.blocks.StreamBlock( | ||
[ | ||
( | ||
"gender", | ||
wagtail.blocks.ChoiceBlock( | ||
choices=home.models.get_gender_choices | ||
), | ||
), | ||
( | ||
"age", | ||
wagtail.blocks.ChoiceBlock( | ||
choices=home.models.get_age_choices | ||
), | ||
), | ||
( | ||
"relationship", | ||
wagtail.blocks.ChoiceBlock( | ||
choices=home.models.get_relationship_choices | ||
), | ||
), | ||
], | ||
help_text="Restrict this variation to users with this profile value. Valid values must be added to the Site Settings", | ||
max_num=1, | ||
min_num=1, | ||
required=False, | ||
use_json_field=True, | ||
), | ||
), | ||
( | ||
"message", | ||
wagtail.blocks.TextBlock( | ||
help_text="each message cannot exceed 4096 characters.", | ||
validators=( | ||
django.core.validators.MaxLengthValidator( | ||
4096 | ||
), | ||
), | ||
), | ||
), | ||
] | ||
), | ||
default=[], | ||
), | ||
), | ||
( | ||
"next_prompt", | ||
wagtail.blocks.CharBlock( | ||
help_text="prompt text for next message", | ||
required=False, | ||
validators=( | ||
django.core.validators.MaxLengthValidator( | ||
20 | ||
), | ||
), | ||
), | ||
), | ||
( | ||
"buttons", | ||
wagtail.blocks.StreamBlock( | ||
[ | ||
( | ||
"next_message", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"title", | ||
wagtail.blocks.CharBlock( | ||
help_text="text for the button, up to 20 characters.", | ||
validators=( | ||
django.core.validators.MaxLengthValidator( | ||
20 | ||
), | ||
), | ||
), | ||
) | ||
] | ||
), | ||
), | ||
( | ||
"go_to_page", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"title", | ||
wagtail.blocks.CharBlock( | ||
help_text="text for the button, up to 20 characters.", | ||
validators=( | ||
django.core.validators.MaxLengthValidator( | ||
20 | ||
), | ||
), | ||
), | ||
), | ||
( | ||
"page", | ||
wagtail.blocks.PageChooserBlock( | ||
help_text="page the button should go to" | ||
), | ||
), | ||
] | ||
), | ||
), | ||
], | ||
max_num=3, | ||
required=False, | ||
), | ||
), | ||
( | ||
"footer", | ||
wagtail.blocks.CharBlock( | ||
help_text="Footer cannot exceed 60 characters.", | ||
required=False, | ||
validators=( | ||
django.core.validators.MaxLengthValidator( | ||
60 | ||
), | ||
), | ||
), | ||
), | ||
], | ||
help_text="Each message will be sent with the text and media", | ||
), | ||
) | ||
], | ||
blank=True, | ||
null=True, | ||
use_json_field=True, | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 12 additions & 12 deletions
24
home/tests/exported_content_20230911-variations-linked-page.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,variation_title,variation_body,sms_title,sms_body,ussd_title,ussd_body,messenger_title,messenger_body,viber_title,viber_body,translation_tag,tags,quick_replies,triggers,locale,next_prompt,buttons,image_link,doc_link,media_link,related_pages,example_values | ||
Menu 1,0,5,appointment-reminders,,Appointment reminders,,,,,,,,,,,,,,,,8cff04aa-cf08-4120-88b4-e2269b7d5d80,,,,English,,,,,,, | ||
Menu 2,0,6,stage-based-messages,,Stage-based messages,,,,,,,,,,,,,,,,5f2d9e63-f047-41ab-921a-c5ca7c04d643,,,,English,,,,,,, | ||
Menu 3,0,7,health-info-messages,,Health info messages,,,,,,,,,,,,,,,,3db069a4-7112-4e66-a9a2-f35c6c18055a,,,,English,,,,,,, | ||
Menu 4,0,17,whatsapp-template-testing,,whatsapp template testing,,,,,,,,,,,,,,,,5f7221f4-146a-48c2-b2e3-c8491aaead9d,,,,English,,,,,,, | ||
Menu 5,0,164,import-export,,Import Export,,,,,,,,,,,,,,,,497bdc1f-43fc-4925-80a1-e68cb942faa4,,,,English,,,,,,, | ||
Sub 5.1,1,165,cp-import-export,Import Export,CP-Import/export,,,WA import export data,Message 1 contains an image,,,,,,,,,,,,8ac50daf-de21-4d05-b697-6d983b7ed3d5,"Tag2, Tag1",Quick reply1,"Trigger2, Trigger1",English,,[],/admin/images/usage/4/,,,ma_qa_temp, | ||
,1,165,cp-import-export,,,,,,,,gender: male,Variation message one for Gender Male,,,,,,,,,,,,,,,,,,,, | ||
,2,165,cp-import-export,,,,,,"Message2 has a document attached, lets add some variable placeholders as well {{0}}",,,,,,,,,,,,,,,,,,[],,/admin/documents/usage/1/,,, | ||
,2,165,cp-import-export,,,,,,,,gender: empty,Variation message one for Gender Rather not say,,,,,,,,,,,,,,,,,,,, | ||
,3,165,cp-import-export,,,,,,Message 3 with no variation but has an audio clip,,,,,,,,,,,,,,,,,,[],,,/admin/media/usage/1/,, | ||
Sub 5.2,1,166,ma_qa_temp,Import Export,MA QA Temp,,,,,,,,,,,,,,,,e9793b5f-f8c7-46c5-8a5e-bd9b8f00fee9,,,,English,,,,,,, | ||
structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,variation_title,variation_body,sms_title,sms_body,ussd_title,ussd_body,messenger_title,messenger_body,viber_title,viber_body,translation_tag,tags,quick_replies,triggers,locale,next_prompt,buttons,image_link,doc_link,media_link,related_pages,example_values,footer | ||
Menu 1,0,5,appointment-reminders,,Appointment reminders,,,,,,,,,,,,,,,,8cff04aa-cf08-4120-88b4-e2269b7d5d80,,,,English,,,,,,,, | ||
Menu 2,0,6,stage-based-messages,,Stage-based messages,,,,,,,,,,,,,,,,5f2d9e63-f047-41ab-921a-c5ca7c04d643,,,,English,,,,,,,, | ||
Menu 3,0,7,health-info-messages,,Health info messages,,,,,,,,,,,,,,,,3db069a4-7112-4e66-a9a2-f35c6c18055a,,,,English,,,,,,,, | ||
Menu 4,0,17,whatsapp-template-testing,,whatsapp template testing,,,,,,,,,,,,,,,,5f7221f4-146a-48c2-b2e3-c8491aaead9d,,,,English,,,,,,,, | ||
Menu 5,0,164,import-export,,Import Export,,,,,,,,,,,,,,,,497bdc1f-43fc-4925-80a1-e68cb942faa4,,,,English,,,,,,,, | ||
Sub 5.1,1,165,cp-import-export,Import Export,CP-Import/export,,,WA import export data,Message 1 contains an image,,,,,,,,,,,,8ac50daf-de21-4d05-b697-6d983b7ed3d5,"Tag2, Tag1",Quick reply1,"Trigger2, Trigger1",English,,[],/admin/images/usage/4/,,,ma_qa_temp,, | ||
,1,165,cp-import-export,,,,,,,,gender: male,Variation message one for Gender Male,,,,,,,,,,,,,,,,,,,,, | ||
,2,165,cp-import-export,,,,,,"Message2 has a document attached, lets add some variable placeholders as well {{0}}",,,,,,,,,,,,,,,,,,[],,/admin/documents/usage/1/,,,, | ||
,2,165,cp-import-export,,,,,,,,gender: empty,Variation message one for Gender Rather not say,,,,,,,,,,,,,,,,,,,,, | ||
,3,165,cp-import-export,,,,,,Message 3 with no variation but has an audio clip,,,,,,,,,,,,,,,,,,[],,,/admin/media/usage/1/,,, | ||
Sub 5.2,1,166,ma_qa_temp,Import Export,MA QA Temp,,,,,,,,,,,,,,,,e9793b5f-f8c7-46c5-8a5e-bd9b8f00fee9,,,,English,,,,,,,, |
Oops, something went wrong.