diff --git a/home/export_content_pages.py b/home/export_content_pages.py index 7eb909fa..26a9b9f4 100644 --- a/home/export_content_pages.py +++ b/home/export_content_pages.py @@ -77,6 +77,7 @@ class ExportRow: doc_link: str = "" media_link: str = "" related_pages: str = "" + footer: str = "" @classmethod def headings(cls) -> list[str]: @@ -133,6 +134,8 @@ def add_message_fields(self, msg_blocks: MsgBlocks) -> None: self.buttons = self.serialise_buttons(whatsapp.value["buttons"]) if "example_values" in whatsapp.value: self.example_values = ", ".join(whatsapp.value["example_values"]) + if "footer" in whatsapp.value: + self.footer = whatsapp.value["footer"] if "list_items" in whatsapp.value: self.list_items = ", ".join(whatsapp.value["list_items"]) @@ -344,6 +347,7 @@ def _set_xlsx_styles(wb: Workbook, sheet: Worksheet) -> None: "doc_link": 118, "media_link": 118, "related": 118, + "footer": 118, } for index, column_width in enumerate(column_widths_in_pts.values(), 2): diff --git a/home/import_content_pages.py b/home/import_content_pages.py index c5a8f347..803606c5 100644 --- a/home/import_content_pages.py +++ b/home/import_content_pages.py @@ -326,6 +326,7 @@ def add_message_to_shadow_content_page_from_row( next_prompt=row.next_prompt, example_values=row.example_values, buttons=buttons, + footer=row.footer, list_items=row.list_items, ) ) @@ -530,6 +531,7 @@ class ShadowWhatsappBlock: example_values: list[str] = field(default_factory=list) variation_messages: list["ShadowVariationBlock"] = field(default_factory=list) list_items: list[str] = field(default_factory=list) + footer: str = "" @property def wagtail_format( @@ -542,6 +544,7 @@ def wagtail_format( "buttons": self.buttons, "variation_messages": [m.wagtail_format for m in self.variation_messages], "list_items": self.list_items, + "footer": self.footer, } @@ -631,6 +634,7 @@ class ContentRow: doc_link: str = "" media_link: str = "" related_pages: list[str] = field(default_factory=list) + footer: str = "" @classmethod def from_flat(cls, row: dict[str, str]) -> "ContentRow": @@ -651,6 +655,7 @@ def from_flat(cls, row: dict[str, str]) -> "ContentRow": example_values=deserialise_list(row.pop("example_values", "")), buttons=json.loads(row.pop("buttons", "")) if row.get("buttons") else [], list_items=deserialise_list(row.pop("list_items", "")), + footer=row.pop("footer") if row.get("footer") else "", **row, ) diff --git a/home/migrations/0048_alter_contentpage_whatsapp_body.py b/home/migrations/0048_alter_contentpage_whatsapp_body.py index db3da0b8..be7f127b 100644 --- a/home/migrations/0048_alter_contentpage_whatsapp_body.py +++ b/home/migrations/0048_alter_contentpage_whatsapp_body.py @@ -1,4 +1,4 @@ -# Generated by Django 4.1.13 on 2024-01-30 15:25 +# Generated by Django 4.1.10 on 2024-02-01 13:02 import django.core.validators import wagtail.blocks @@ -190,6 +190,18 @@ class Migration(migrations.Migration): ), ), ), + ( + "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", ), @@ -201,3 +213,4 @@ class Migration(migrations.Migration): ), ), ] + diff --git a/home/models.py b/home/models.py index 21482055..7c1b4a32 100644 --- a/home/models.py +++ b/home/models.py @@ -1,3 +1,4 @@ +import logging import re from django.conf import settings @@ -40,7 +41,6 @@ TabbedInterface, TitleFieldPanel, ) -import logging logger = logging.getLogger(__name__) @@ -265,6 +265,12 @@ class WhatsappBlock(blocks.StructBlock): validators=(MaxLengthValidator(24)), ) + footer = blocks.CharBlock( + help_text="Footer cannot exceed 60 characters.", + required=False, + validators=(MaxLengthValidator(60),), + ) + class Meta: icon = "user" form_classname = "whatsapp-message-block struct-block" diff --git a/home/tests/content2.csv b/home/tests/content2.csv index 3763a312..756c9291 100644 --- a/home/tests/content2.csv +++ b/home/tests/content2.csv @@ -1,5 +1,5 @@ -structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,variation_title,variation_body,list_items,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,,main-menu,,Main Menu,,,,,,,,,,,,,,,,a0b85075-d01b-46bf-8997-8591e87ba171,,,,English,,,,,,,[] +structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,variation_title,variation_body,list_items,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,,main-menu,,Main Menu,,,,,,,,,,,,,,,,a0b85075-d01b-46bf-8997-8591e87ba171,,,,English,,,,,,,[], Sub 1.1,1,,main-menu-first-time-user,Main Menu,main menu first time user,,,main menu first time user," *Welcome to HealthAlert* 🌍 This is a messaging service created by the _*World Health Organization*_ *(WHO)* that provides information on COVID-19 as well as emergency resources for disease outbreaks, natural, and man-made disasters. @@ -12,12 +12,12 @@ This is a messaging service created by the World Health Organization (WHO) that You can return to this main menu at any time by replying 🏠 -Choose what you'd like to know more about by tapping a button below ⬇️",,,5892bccd-8025-419d-9a8e-a6a37b755dbf,menu,"Self-help🌬️, Settings⚙️, Health Info🏥",Main menu🏠,English,,[],,,,,[] +Choose what you'd like to know more about by tapping a button below ⬇️",,,5892bccd-8025-419d-9a8e-a6a37b755dbf,menu,"Self-help🌬️, Settings⚙️, Health Info🏥",Main menu🏠,English,,[],,,,,[], Sub 1.1.1,1,,health-info,main menu first time user,health info,,,health info,"*Health information* 🏥 Get information and advice from WHO by tapping on a button below ⬇️",,,,Health Info SMS Title,*Health Info SMS Body*,Health Info USSD Title,*Health Info USSD Body*,health info,"*Health information* 🏥 -Get information and advice from WHO by tapping on a button below ⬇️",,,c9d6309e-173f-4c1d-bbaf-440b1fd4415f,health_info,,,English,,[],,,,,[] +Get information and advice from WHO by tapping on a button below ⬇️",,,c9d6309e-173f-4c1d-bbaf-440b1fd4415f,health_info,,,English,,[],,,,,[], Sub 1.1.2,1,,self-help,main menu first time user,self-help,,,self-help,"*Self-help programs* 🌬️ Reply with a number to take part in a *free* self-help program created by WHO. @@ -32,4 +32,4 @@ Reply with a number to take part in a *free* self-help program created by WHO. 1. Quit tobacco 🚭 _Stop smoking with the help of a guided, 42-day program._ 2. Manage your stress 🧘🏽‍♀️ -_Learn how to cope with stress and improve your wellbeing._",,,3e5d77f7-4d34-430d-aad7-d9ca01f79732,self_help,,,English,,[],,,,,[] \ No newline at end of file +_Learn how to cope with stress and improve your wellbeing._",,,3e5d77f7-4d34-430d-aad7-d9ca01f79732,self_help,,,English,,[],,,,,[], \ No newline at end of file diff --git a/home/tests/exported_content_20230911-variations-linked-page.csv b/home/tests/exported_content_20230911-variations-linked-page.csv index 4a9c436d..359fccf1 100644 --- a/home/tests/exported_content_20230911-variations-linked-page.csv +++ b/home/tests/exported_content_20230911-variations-linked-page.csv @@ -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,list_items,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,,,,,,, \ No newline at end of file +structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,variation_title,variation_body,list_items,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,,,,,,,, \ No newline at end of file diff --git a/home/tests/list_items.csv b/home/tests/list_items.csv index 861516a7..38717cfe 100644 --- a/home/tests/list_items.csv +++ b/home/tests/list_items.csv @@ -1,3 +1,3 @@ -structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,variation_title,variation_body,list_items,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 -Menu 1,0,600,main-menu,,Main Menu,,,,,,,,,,,,,,,,,,35a7f12c-7373-42a6-9ca6-a1caedea5822,,,,English,,,,,, -Sub 1.1,1,601,ha-menu,Main Menu,HealthAlert menu,,,HealthAlert menu,*Welcome to HealthAlert* WA,,UTILITY,,,"['Item 1', 'Item 2']",,,,,HealthAlert menu,Welcome to HealthAlert M,HealthAlert menu,Welcome to HealthAlert V,5ab08854-228b-4f83-ae54-ec2dc6ebaf69,,,,English,,[],,,, \ No newline at end of file +structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,variation_title,variation_body,list_items,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,footer +Menu 1,0,600,main-menu,,Main Menu,,,,,,,,,,,,,,,,,,35a7f12c-7373-42a6-9ca6-a1caedea5822,,,,English,,,,,,, +Sub 1.1,1,601,ha-menu,Main Menu,HealthAlert menu,,,HealthAlert menu,*Welcome to HealthAlert* WA,,UTILITY,,,"['Item 1', 'Item 2']",,,,,HealthAlert menu,Welcome to HealthAlert M,HealthAlert menu,Welcome to HealthAlert V,5ab08854-228b-4f83-ae54-ec2dc6ebaf69,,,,English,,[],,,,, \ No newline at end of file diff --git a/home/tests/multiple_messages.csv b/home/tests/multiple_messages.csv index a3362acf..db6654c1 100644 --- a/home/tests/multiple_messages.csv +++ b/home/tests/multiple_messages.csv @@ -1,8 +1,8 @@ -structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,variation_title,variation_body,list_items,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 -Menu 1,0,600,main-menu,,Main Menu,,,,,,,,,,,,,,,,,,35a7f12c-7373-42a6-9ca6-a1caedea5822,,,,English,,,,,, -Sub 1.1,1,601,ha-menu,Main Menu,HealthAlert menu,,,HealthAlert menu,*Welcome to HealthAlert* WA,,UTILITY,,,,,,,,HealthAlert menu,Welcome to HealthAlert M,HealthAlert menu,Welcome to HealthAlert V,5ab08854-228b-4f83-ae54-ec2dc6ebaf69,,,,English,,[],,,, -Sub 1.1.1,1,602,health-info,HealthAlert menu,health info,,,health info,wa1,,UTILITY,,,,,,,,health info,m1,health info,v1,117e862d-57dd-4be6-a802-cdc075a725b2,,,,English,,[],,,, -,2,602,health-info,,,,,,wa2,,,,,,,,,,,m2,,v2,,,,,,,[],,,, -,3,602,health-info,,,,,,wa3,,,,,,,,,,,m3,,v3,,,,,,,[],,,, -,4,602,health-info,,,,,,wa4,,,,,,,,,,,m4,,,,,,,,,[],,,, -,5,602,health-info,,,,,,wa5,,,,,,,,,,,,,,,,,,,,[],,,, \ No newline at end of file +structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,variation_title,variation_body,list_items,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,footer +Menu 1,0,600,main-menu,,Main Menu,,,,,,,,,,,,,,,,,,35a7f12c-7373-42a6-9ca6-a1caedea5822,,,,English,,,,,,, +Sub 1.1,1,601,ha-menu,Main Menu,HealthAlert menu,,,HealthAlert menu,*Welcome to HealthAlert* WA,,UTILITY,,,,,,,,HealthAlert menu,Welcome to HealthAlert M,HealthAlert menu,Welcome to HealthAlert V,5ab08854-228b-4f83-ae54-ec2dc6ebaf69,,,,English,,[],,,,, +Sub 1.1.1,1,602,health-info,HealthAlert menu,health info,,,health info,wa1,,UTILITY,,,,,,,,health info,m1,health info,v1,117e862d-57dd-4be6-a802-cdc075a725b2,,,,English,,[],,,,, +,2,602,health-info,,,,,,wa2,,,,,,,,,,,m2,,v2,,,,,,,[],,,,, +,3,602,health-info,,,,,,wa3,,,,,,,,,,,m3,,v3,,,,,,,[],,,,, +,4,602,health-info,,,,,,wa4,,,,,,,,,,,m4,,,,,,,,,[],,,,, +,5,602,health-info,,,,,,wa5,,,,,,,,,,,,,,,,,,,,[],,,,, \ No newline at end of file diff --git a/home/tests/no-translation-key-default.csv b/home/tests/no-translation-key-default.csv index 90696dc5..722ac44f 100644 --- a/home/tests/no-translation-key-default.csv +++ b/home/tests/no-translation-key-default.csv @@ -1,3 +1,3 @@ -structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,example_values,variation_title,variation_body,list_items,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 -Menu 1,0,659,ma_import-export,,MA_import export,,,,,,,,,,,,,,,,,,,,,,,English,,,,,, -Sub 1.1,1,660,locale-import,MA_import export,Locale import,,,import per locale,this is the english message..edit,,UTILITY,,,,,,,,,,,,,,,,,English,,[],,,, \ No newline at end of file +structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,example_values,variation_title,variation_body,list_items,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,footer +Menu 1,0,659,ma_import-export,,MA_import export,,,,,,,,,,,,,,,,,,,,,,,English,,,,,,, +Sub 1.1,1,660,locale-import,MA_import export,Locale import,,,import per locale,this is the english message..edit,,UTILITY,,,,,,,,,,,,,,,,,English,,[],,,,, \ No newline at end of file diff --git a/home/tests/page_builder.py b/home/tests/page_builder.py index 4632ac4a..1611d31b 100644 --- a/home/tests/page_builder.py +++ b/home/tests/page_builder.py @@ -113,6 +113,7 @@ class WABlk(ContentBlock): example_values: list[str] = field(default_factory=list) buttons: list[Btn] = field(default_factory=list) list_items: list[str] = field(default_factory=list) + footer: str = "" def to_dict(self) -> dict[str, Any]: varmsgs = [vm.to_dict() for vm in self.variation_messages] diff --git a/home/tests/test_content_import_export.py b/home/tests/test_content_import_export.py index e85f5892..1f1a4557 100644 --- a/home/tests/test_content_import_export.py +++ b/home/tests/test_content_import_export.py @@ -1520,6 +1520,40 @@ def test_translations_en(self, impexp: ImportExport) -> None: imported = impexp.get_page_json() assert imported == orig_en + def test_footer(self, impexp: ImportExport) -> None: + """ + ContentPages with footer in whatsapp messages are preserved + across export/import. + """ + home_page = HomePage.objects.first() + main_menu = PageBuilder.build_cpi(home_page, "main-menu", "Main Menu") + + ha_menu = PageBuilder.build_cp( + parent=main_menu, + slug="ha-menu", + title="HealthAlert menu", + bodies=[WABody("HealthAlert menu", [WABlk("*Welcome to HealthAlert* WA")])], + ) + + footer = "Test footer" + _health_info = PageBuilder.build_cp( + parent=ha_menu, + slug="health-info", + title="health info", + bodies=[ + WABody( + "health info", + [WABlk("*Health information* WA", footer=footer)], + ) + ], + whatsapp_template_name="template-health-info", + ) + + orig = impexp.get_page_json() + impexp.export_reimport() + imported = impexp.get_page_json() + assert imported == orig + def test_example_values(self, impexp: ImportExport) -> None: """ ContentPages with example values in whatsapp messages are preserved diff --git a/home/tests/test_models.py b/home/tests/test_models.py index 2fedbc89..13caad9b 100644 --- a/home/tests/test_models.py +++ b/home/tests/test_models.py @@ -346,6 +346,7 @@ def create_message_value( next_prompt="", buttons=None, list_items=None, + footer="", ): return { "image": image, @@ -357,6 +358,7 @@ def create_message_value( "next_prompt": next_prompt, "buttons": buttons or [], "list_items": list_items or [], + "footer": footer, } def create_image(self, width=0, height=0): diff --git a/home/tests/test_page_builder.py b/home/tests/test_page_builder.py index 0a4cd15f..46d8bb72 100644 --- a/home/tests/test_page_builder.py +++ b/home/tests/test_page_builder.py @@ -138,6 +138,7 @@ def test_build_simple_pages() -> None: "buttons": [], "example_values": [], "variation_messages": [], + "footer": "", }, ), ] @@ -261,6 +262,7 @@ def test_build_variations() -> None: {"message": "Single male", "variation_restrictions": v_single_male}, {"message": "Comp male", "variation_restrictions": v_complicated_male}, ], + "footer": "", }, { "message": "Message 2, variable placeholders as well {{0}}", @@ -272,6 +274,7 @@ def test_build_variations() -> None: "variation_messages": [ {"message": "Teen", "variation_restrictions": [("age", "15-18")]} ], + "footer": "", }, { "message": "Message 3 with no variation", @@ -279,6 +282,7 @@ def test_build_variations() -> None: "buttons": [("next_message", {"title": "end"})], "example_values": [], "variation_messages": [], + "footer": "", }, ] diff --git a/home/tests/translations-en.csv b/home/tests/translations-en.csv index 83d61e91..2d6f4727 100644 --- a/home/tests/translations-en.csv +++ b/home/tests/translations-en.csv @@ -1,3 +1,3 @@ -structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,example_values,variation_title,variation_body,list_items,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 -Menu 1,0,659,ma_import-export,,MA_import export,,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,English,,,,,, -Sub 1.1,1,660,locale-import,MA_import export,Locale import,,,import per locale,this is the english message..edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,English,,[],,,, \ No newline at end of file +structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,example_values,variation_title,variation_body,list_items,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,footer +Menu 1,0,659,ma_import-export,,MA_import export,,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,English,,,,,,, +Sub 1.1,1,660,locale-import,MA_import export,Locale import,,,import per locale,this is the english message..edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,English,,[],,,,, \ No newline at end of file diff --git a/home/tests/translations-pt.csv b/home/tests/translations-pt.csv index cbdbad5e..3efa78e9 100644 --- a/home/tests/translations-pt.csv +++ b/home/tests/translations-pt.csv @@ -1,3 +1,3 @@ -structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,example_values,variation_title,variation_body,list_items,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 -Menu 1,0,1297,ma_import-export,,MA_import export,,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,Portuguese,,,,,, -Sub 1.1,1,1298,locale-import,MA_import export,Locale import,,,import per locale,this is the Portuguese message....edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,Portuguese,,[],,,, \ No newline at end of file +structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,example_values,variation_title,variation_body,list_items,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,footer +Menu 1,0,1297,ma_import-export,,MA_import export,,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,Portuguese,,,,,,, +Sub 1.1,1,1298,locale-import,MA_import export,Locale import,,,import per locale,this is the Portuguese message....edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,Portuguese,,[],,,,, \ No newline at end of file diff --git a/home/tests/translations-sep-en.csv b/home/tests/translations-sep-en.csv index 83d61e91..2d6f4727 100644 --- a/home/tests/translations-sep-en.csv +++ b/home/tests/translations-sep-en.csv @@ -1,3 +1,3 @@ -structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,example_values,variation_title,variation_body,list_items,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 -Menu 1,0,659,ma_import-export,,MA_import export,,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,English,,,,,, -Sub 1.1,1,660,locale-import,MA_import export,Locale import,,,import per locale,this is the english message..edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,English,,[],,,, \ No newline at end of file +structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,example_values,variation_title,variation_body,list_items,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,footer +Menu 1,0,659,ma_import-export,,MA_import export,,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,English,,,,,,, +Sub 1.1,1,660,locale-import,MA_import export,Locale import,,,import per locale,this is the english message..edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,English,,[],,,,, \ No newline at end of file diff --git a/home/tests/translations-sep-pt.csv b/home/tests/translations-sep-pt.csv index dc425d48..a67c8617 100644 --- a/home/tests/translations-sep-pt.csv +++ b/home/tests/translations-sep-pt.csv @@ -1,3 +1,3 @@ -structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,example_values,variation_title,variation_body,list_items,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 -Menu 1,0,1297,ma_import-export-pt,,MA_import export (pt),,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,Portuguese,,,,,, -Sub 1.1,1,1298,locale-import-pt,MA_import export (pt),Locale import,,,import per locale,this is the Portuguese message....edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,Portuguese,,[],,,, \ No newline at end of file +structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,example_values,variation_title,variation_body,list_items,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,footer +Menu 1,0,1297,ma_import-export-pt,,MA_import export (pt),,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,Portuguese,,,,,,, +Sub 1.1,1,1298,locale-import-pt,MA_import export (pt),Locale import,,,import per locale,this is the Portuguese message....edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,Portuguese,,[],,,,, \ No newline at end of file diff --git a/home/tests/translations-sep.csv b/home/tests/translations-sep.csv index aafcbb61..4d8afe04 100644 --- a/home/tests/translations-sep.csv +++ b/home/tests/translations-sep.csv @@ -1,5 +1,5 @@ -structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,example_values,variation_title,variation_body,list_items,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 -Menu 1,0,659,ma_import-export,,MA_import export,,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,English,,,,,, -Sub 1.1,1,660,locale-import,MA_import export,Locale import,,,import per locale,this is the english message..edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,English,,[],,,, -Menu 1,0,1297,ma_import-export-pt,,MA_import export (pt),,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,Portuguese,,,,,, -Sub 1.1,1,1298,locale-import-pt,MA_import export (pt),Locale import,,,import per locale,this is the Portuguese message....edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,Portuguese,,[],,,, \ No newline at end of file +structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,example_values,variation_title,variation_body,list_items,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,footer +Menu 1,0,659,ma_import-export,,MA_import export,,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,English,,,,,,, +Sub 1.1,1,660,locale-import,MA_import export,Locale import,,,import per locale,this is the english message..edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,English,,[],,,,, +Menu 1,0,1297,ma_import-export-pt,,MA_import export (pt),,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,Portuguese,,,,,,, +Sub 1.1,1,1298,locale-import-pt,MA_import export (pt),Locale import,,,import per locale,this is the Portuguese message....edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,Portuguese,,[],,,,, \ No newline at end of file diff --git a/home/tests/translations.csv b/home/tests/translations.csv index a5495bb4..3609390c 100644 --- a/home/tests/translations.csv +++ b/home/tests/translations.csv @@ -1,5 +1,5 @@ -structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,example_values,variation_title,variation_body,list_items,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 -Menu 1,0,659,ma_import-export,,MA_import export,,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,English,,,,,, -Sub 1.1,1,660,locale-import,MA_import export,Locale import,,,import per locale,this is the english message..edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,English,,[],,,, -Menu 1,0,1297,ma_import-export,,MA_import export,,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,Portuguese,,,,,, -Sub 1.1,1,1298,locale-import,MA_import export,Locale import,,,import per locale,this is the Portuguese message....edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,Portuguese,,[],,,, \ No newline at end of file +structure,message,page_id,slug,parent,web_title,web_subtitle,web_body,whatsapp_title,whatsapp_body,whatsapp_template_name,whatsapp_template_category,example_values,variation_title,variation_body,list_items,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,footer +Menu 1,0,659,ma_import-export,,MA_import export,,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,English,,,,,,, +Sub 1.1,1,660,locale-import,MA_import export,Locale import,,,import per locale,this is the english message..edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,English,,[],,,,, +Menu 1,0,1297,ma_import-export,,MA_import export,,,,,,,,,,,,,,,,,,,38a22433-e474-4f5a-b06b-7367d1a7f664,,,,Portuguese,,,,,,, +Sub 1.1,1,1298,locale-import,MA_import export,Locale import,,,import per locale,this is the Portuguese message....edit,,UTILITY,,,,,,,,,,,,,9aab62ab-caf7-4606-b9bf-ac3148309319,,,,Portuguese,,[],,,,, \ No newline at end of file