From 6389ce4303b13f0f8386cd9b65a7bd32b6d3dc25 Mon Sep 17 00:00:00 2001 From: Jumana Bahrainwala Date: Wed, 8 May 2024 19:36:06 +0000 Subject: [PATCH 1/6] Added fix for freshdesk ticket for name and logos --- app/clients/freshdesk.py | 6 ++++++ app/user/contact_request.py | 1 + app/user/rest.py | 1 + 3 files changed, 8 insertions(+) diff --git a/app/clients/freshdesk.py b/app/clients/freshdesk.py index 66c97546fa..fd0ecc978b 100644 --- a/app/clients/freshdesk.py +++ b/app/clients/freshdesk.py @@ -62,6 +62,9 @@ def _generate_description(self): f"- Organisation id: {self.contact.organisation_id}", f"- Organisation name: {self.contact.department_org_name}", f"- Logo filename: {self.contact.branding_url}", + f"- Logo name: {self.contact.branding_logo_name}", + f"- Alt text english: {self.contact.alt_text_en}", + f"- Alt text french: {self.contact.alt_text_fr}", "
", f"Un nouveau logo a été téléchargé par {self.contact.name} ({self.contact.email_address}) pour le service suivant :", f"- Identifiant du service : {self.contact.service_id}", @@ -69,6 +72,9 @@ def _generate_description(self): f"- Identifiant de l'organisation: {self.contact.organisation_id}", f"- Nom de l'organisation: {self.contact.department_org_name}", f"- Nom du fichier du logo : {self.contact.branding_url}", + f"- Nom du logo : {self.contact.branding_logo_name}", + f"- Texte alternatif anglais : {self.contact.alt_text_en}", + f"- Texte alternatif français : {self.contact.alt_text_fr}", ] ) diff --git a/app/user/contact_request.py b/app/user/contact_request.py index 74c5a96a35..cfca30cafb 100644 --- a/app/user/contact_request.py +++ b/app/user/contact_request.py @@ -31,6 +31,7 @@ class ContactRequest: notification_types: str = field(default="") expected_volume: str = field(default="") branding_url: str = field(default="") + branding_logo_name: str = field(default="") alt_text_en: str = field(default="") alt_text_fr: str = field(default="") diff --git a/app/user/rest.py b/app/user/rest.py index a80e280548..ea28646d41 100644 --- a/app/user/rest.py +++ b/app/user/rest.py @@ -500,6 +500,7 @@ def send_branding_request(user_id): organisation_id=data["organisation_id"], department_org_name=data["organisation_name"], branding_url=get_logo_url(data["filename"]), + branding_logo_name=data["branding_logo_name"] if "branding_logo_name" in data else "", alt_text_en=data["alt_text_en"], alt_text_fr=data["alt_text_fr"], ) From 39235484f0874f5ed4e3500f0534dfef7d65ea08 Mon Sep 17 00:00:00 2001 From: Jumana Bahrainwala Date: Wed, 8 May 2024 19:55:55 +0000 Subject: [PATCH 2/6] fix test --- tests/app/clients/test_freshdesk.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/app/clients/test_freshdesk.py b/tests/app/clients/test_freshdesk.py index a3e0713d5f..8df9015689 100644 --- a/tests/app/clients/test_freshdesk.py +++ b/tests/app/clients/test_freshdesk.py @@ -130,13 +130,19 @@ def match_json(request): "- Organisation id: 6b72e84f-8591-42e1-93b8-7d24a45e1d79
" "- Organisation name: best org name ever
" "- Logo filename: branding_url
" + "- Alt text english: en alt text
" + "- Logo name: branding_logo_name
" + "- Alt text french: fr alt text
" "

" "Un nouveau logo a été téléchargé par name (test@email.com) pour le service suivant :
" "- Identifiant du service : 8624bd36-b70b-4d4b-a459-13e1f4770b92
" "- Nom du service : t6
" "- Identifiant de l'organisation: 6b72e84f-8591-42e1-93b8-7d24a45e1d79
" "- Nom de l'organisation: best org name ever
" - "- Nom du fichier du logo : branding_url", + "- Nom du fichier du logo : branding_url" + "- Nom du logo : branding_logo_name
" + "- Texte alternatif anglais : en alt text
" + "- Texte alternatif français : fr alt text", "email": "test@email.com", "priority": 1, "status": 2, From 1aba884664aba07d03ee9aea1f2d399068f1db4c Mon Sep 17 00:00:00 2001 From: Jumana Bahrainwala Date: Wed, 8 May 2024 20:24:15 +0000 Subject: [PATCH 3/6] fix --- tests/app/clients/test_freshdesk.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/app/clients/test_freshdesk.py b/tests/app/clients/test_freshdesk.py index 8df9015689..025f4a046c 100644 --- a/tests/app/clients/test_freshdesk.py +++ b/tests/app/clients/test_freshdesk.py @@ -172,6 +172,8 @@ def match_json(request): "department_org_name": "best org name ever", "service_id": "8624bd36-b70b-4d4b-a459-13e1f4770b92", "branding_url": "branding_url", + "alt_text_en": "hello world", + "alt_text_fr": "bonjour le monde", } with notify_api.app_context(): response = freshdesk.Freshdesk(ContactRequest(**data)).send_ticket() From 6e3e94f931b0337d7465610f8ad2cc8ea2cb677a Mon Sep 17 00:00:00 2001 From: Jumana Bahrainwala Date: Wed, 8 May 2024 20:27:28 +0000 Subject: [PATCH 4/6] fix --- tests/app/clients/test_freshdesk.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/app/clients/test_freshdesk.py b/tests/app/clients/test_freshdesk.py index 025f4a046c..080693f3f7 100644 --- a/tests/app/clients/test_freshdesk.py +++ b/tests/app/clients/test_freshdesk.py @@ -172,6 +172,7 @@ def match_json(request): "department_org_name": "best org name ever", "service_id": "8624bd36-b70b-4d4b-a459-13e1f4770b92", "branding_url": "branding_url", + "branding_logo_name": "branding_log_name", "alt_text_en": "hello world", "alt_text_fr": "bonjour le monde", } From 61f073ae75be9dcef6a622d67b0849c5fbd4fe50 Mon Sep 17 00:00:00 2001 From: Jumana Bahrainwala Date: Thu, 9 May 2024 14:41:45 +0000 Subject: [PATCH 5/6] fix changes --- tests/app/clients/test_freshdesk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/app/clients/test_freshdesk.py b/tests/app/clients/test_freshdesk.py index 080693f3f7..f31c49056a 100644 --- a/tests/app/clients/test_freshdesk.py +++ b/tests/app/clients/test_freshdesk.py @@ -130,8 +130,8 @@ def match_json(request): "- Organisation id: 6b72e84f-8591-42e1-93b8-7d24a45e1d79
" "- Organisation name: best org name ever
" "- Logo filename: branding_url
" - "- Alt text english: en alt text
" "- Logo name: branding_logo_name
" + "- Alt text english: en alt text
" "- Alt text french: fr alt text
" "

" "Un nouveau logo a été téléchargé par name (test@email.com) pour le service suivant :
" @@ -172,7 +172,7 @@ def match_json(request): "department_org_name": "best org name ever", "service_id": "8624bd36-b70b-4d4b-a459-13e1f4770b92", "branding_url": "branding_url", - "branding_logo_name": "branding_log_name", + "branding_logo_name": "branding_logo_name", "alt_text_en": "hello world", "alt_text_fr": "bonjour le monde", } From d0288bc217e74e37e01a92ba8018e66dffb487aa Mon Sep 17 00:00:00 2001 From: wbanks Date: Thu, 9 May 2024 11:41:40 -0400 Subject: [PATCH 6/6] Fix test_send_ticket_branding_request --- tests/app/clients/test_freshdesk.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/app/clients/test_freshdesk.py b/tests/app/clients/test_freshdesk.py index f31c49056a..3e8b56227d 100644 --- a/tests/app/clients/test_freshdesk.py +++ b/tests/app/clients/test_freshdesk.py @@ -139,7 +139,7 @@ def match_json(request): "- Nom du service : t6
" "- Identifiant de l'organisation: 6b72e84f-8591-42e1-93b8-7d24a45e1d79
" "- Nom de l'organisation: best org name ever
" - "- Nom du fichier du logo : branding_url" + "- Nom du fichier du logo : branding_url
" "- Nom du logo : branding_logo_name
" "- Texte alternatif anglais : en alt text
" "- Texte alternatif français : fr alt text", @@ -173,8 +173,8 @@ def match_json(request): "service_id": "8624bd36-b70b-4d4b-a459-13e1f4770b92", "branding_url": "branding_url", "branding_logo_name": "branding_logo_name", - "alt_text_en": "hello world", - "alt_text_fr": "bonjour le monde", + "alt_text_en": "en alt text", + "alt_text_fr": "fr alt text", } with notify_api.app_context(): response = freshdesk.Freshdesk(ContactRequest(**data)).send_ticket()