Skip to content
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

Added fix for freshdesk ticket for name and logos #2174

Merged
merged 7 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/clients/freshdesk.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,19 @@ 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}",
"<hr>",
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}",
f"- Nom du service : {self.contact.service_name}",
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}",
]
)

Expand Down
1 change: 1 addition & 0 deletions app/user/contact_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="")

Expand Down
1 change: 1 addition & 0 deletions app/user/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)
Expand Down
11 changes: 10 additions & 1 deletion tests/app/clients/test_freshdesk.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,19 @@ def match_json(request):
"- Organisation id: 6b72e84f-8591-42e1-93b8-7d24a45e1d79<br>"
"- Organisation name: best org name ever<br>"
"- Logo filename: branding_url<br>"
"- Logo name: branding_logo_name<br>"
"- Alt text english: en alt text<br>"
"- Alt text french: fr alt text<br>"
"<hr><br>"
"Un nouveau logo a été téléchargé par name ([email protected]) pour le service suivant :<br>"
"- Identifiant du service : 8624bd36-b70b-4d4b-a459-13e1f4770b92<br>"
"- Nom du service : t6<br>"
"- Identifiant de l'organisation: 6b72e84f-8591-42e1-93b8-7d24a45e1d79<br>"
"- Nom de l'organisation: best org name ever<br>"
"- Nom du fichier du logo : branding_url",
"- Nom du fichier du logo : branding_url<br>"
"- Nom du logo : branding_logo_name<br>"
"- Texte alternatif anglais : en alt text<br>"
"- Texte alternatif français : fr alt text",
"email": "[email protected]",
"priority": 1,
"status": 2,
Expand Down Expand Up @@ -166,6 +172,9 @@ 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_logo_name",
"alt_text_en": "en alt text",
"alt_text_fr": "fr alt text",
}
with notify_api.app_context():
response = freshdesk.Freshdesk(ContactRequest(**data)).send_ticket()
Expand Down
Loading