Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
integrations: Remove Desk.com integration.
Niloth P7261898d8916
diff --git a/static/images/integrations/bot_avatars/deskcom.png b/static/images/integrations/bot_avatars/deskcom.pngdeleted file mode 100644index 6e4a703cb98..00000000000Binary files a/static/images/integrations/bot_avatars/deskcom.png and /dev/null differdiff --git a/static/images/integrations/desk/001.png b/static/images/integrations/desk/001.pngdeleted file mode 100644index 11579dab049..00000000000Binary files a/static/images/integrations/desk/001.png and /dev/null differdiff --git a/static/images/integrations/desk/002.png b/static/images/integrations/desk/002.pngdeleted file mode 100644index 6fe46566c3a..00000000000Binary files a/static/images/integrations/desk/002.png and /dev/null differdiff --git a/static/images/integrations/desk/003.png b/static/images/integrations/desk/003.pngdeleted file mode 100644index a51fcbff1f1..00000000000Binary files a/static/images/integrations/desk/003.png and /dev/null differdiff --git a/static/images/integrations/desk/004.png b/static/images/integrations/desk/004.pngdeleted file mode 100644index 8e39eb73ea5..00000000000Binary files a/static/images/integrations/desk/004.png and /dev/null differdiff --git a/static/images/integrations/desk/005.png b/static/images/integrations/desk/005.pngdeleted file mode 100644index fd524a1b49d..00000000000Binary files a/static/images/integrations/desk/005.png and /dev/null differdiff --git a/static/images/integrations/desk/006.png b/static/images/integrations/desk/006.pngdeleted file mode 100644index fcbcf234224..00000000000Binary files a/static/images/integrations/desk/006.png and /dev/null differdiff --git a/static/images/integrations/desk/007.png b/static/images/integrations/desk/007.pngdeleted file mode 100644index 6063874fbdf..00000000000Binary files a/static/images/integrations/desk/007.png and /dev/null differdiff --git a/static/images/integrations/desk/008.png b/static/images/integrations/desk/008.pngdeleted file mode 100644index b28b48b1a8d..00000000000Binary files a/static/images/integrations/desk/008.png and /dev/null differdiff --git a/static/images/integrations/desk/009.png b/static/images/integrations/desk/009.pngdeleted file mode 100644index 1ad2d656ba5..00000000000Binary files a/static/images/integrations/desk/009.png and /dev/null differdiff --git a/static/images/integrations/logos/deskcom.png b/static/images/integrations/logos/deskcom.pngdeleted file mode 100644index e7454c59148..00000000000Binary files a/static/images/integrations/logos/deskcom.png and /dev/null differdiff --git a/zerver/lib/integrations.py b/zerver/lib/integrations.pyindex 93a1d3eea7c..ef6bf4524fd 100644--- a/zerver/lib/integrations.py+++ b/zerver/lib/integrations.py@@ -389,13 +389,6 @@ WEBHOOK_INTEGRATIONS: list[WebhookIntegration] = [WebhookIntegration("crashlytics", ["monitoring"]),WebhookIntegration("dialogflow", ["customer-support"]),WebhookIntegration("delighted", ["customer-support", "marketing"]),- WebhookIntegration(- "deskdotcom",- ["customer-support"],- logo="images/integrations/logos/deskcom.png",- display_name="Desk.com",- stream_name="desk",- ),WebhookIntegration("dropbox", ["productivity"]),WebhookIntegration("errbit", ["monitoring"]),WebhookIntegration("flock", ["customer-support"]),@@ -720,7 +713,6 @@ DOC_SCREENSHOT_CONFIG: dict[str, list[BaseScreenshotConfig]] = {"codeship": [ScreenshotConfig("error_build.json")],"crashlytics": [ScreenshotConfig("issue_message.json")],"delighted": [ScreenshotConfig("survey_response_updated_promoter.json")],- "deskdotcom": [ScreenshotConfig("static_text.txt", "009.png", "desk", use_basic_auth=True)],"dialogflow": [ScreenshotConfig("weather_app.json", extra_params={"email": "[email protected]"})],"dropbox": [ScreenshotConfig("file_updated.json")],"errbit": [ScreenshotConfig("error_message.json")],diff --git a/zerver/webhooks/deskdotcom/__init__.py b/zerver/webhooks/deskdotcom/__init__.pydeleted file mode 100644index e69de29bb2d..00000000000diff --git a/zerver/webhooks/deskdotcom/doc.md b/zerver/webhooks/deskdotcom/doc.mddeleted file mode 100644index 2f7bdbd26cc..00000000000--- a/zerver/webhooks/deskdotcom/doc.md+++ /dev/null@@ -1,105 +0,0 @@-1. {!create-channel.md!}-- Keep in mind you still need to create the channel first even- if you are using this recommendation.--1. {!create-an-incoming-webhook.md!}--1. Next, in Desk.com, open your **Admin** view via the top-left- dropdown. In the **Admin** view, click on **Apps**, then- click **Install** under **Custom Action**:-- --1. From there, click **Install Custom Action** and accept the terms.- Fill in the form like this:-- * **Name**: Zulip- * **Authentication Method**: Basic Auth- * **URL**: `{{ api_url }}/v1/external/deskdotcom`- * **User name**: your bot's user name, e.g., `[email protected]`- * **Password**: your bot's API key-- --1. Click **Create** to save your settings. From the next screen, click- **Add Action** to add a new action. You'll do this for every action- you want a notification on Zulip for. (To add another action later,- look for your custom action on the **Apps** page under- **Installed Apps**.)-- --1. Let's say you want a notification each time a case is updated. Put- in a descriptive name like **Announce case update**, select- **POST a string to a URL** for **Action Type**, and copy-paste this- to the **Appended URL path**:-- {% raw %}-- `?stream=desk&topic={{ case.id }}:+{{ case.subject }}`-- {% endraw %}-- The "appended URL path" will be the same for every notification —- it makes sure the notification goes to the appropriate channel and topic- within Zulip.--1. Next, copy this template Zulip message into **Message to POST**:-- {% raw %}-- Case [{{ case.id }}, {{ case.subject }}]({{ case.direct_url }}), was updated.-- * Status: {{ case.status.name }}- * Priority: {{ case.priority }}- * Customer: {{ customer.name }}- * Company: {{ customer.company }}- * Description: {{ case.description }}-- {% endraw %}-- You don't need to edit that, although you may if you wish. All the- funny-looking stuff inside `{{ "{{" }}` and `{{ "}}" }}` will be filled in by- Desk.com for each event. The dialog should look like this:-- --1. Click **Add Action** to save, and then on the next screen, click the- slider next to the action to enable it. This is important — actions are- turned off by default!-- --1. Now you need to create a rule that triggers this action. Desk.com's- support center has a [lengthy article on rules][1], but in short,- click on **Cases** up at the top, **Rules** on the left side, and- then the specific event you want to notify on — in our example,- **Inbound Interaction**.-- [1]: https://support.desk.com/customer/portal/articles/1376-- --1. Select the types of interaction you want your rule to apply to,- such as **Chat**. Specify the name and click on **Add Rule**.-- --1. In the next screen, provide the details. First, click **Add Actions**- to display the rule actions. Select **Trigger an App Action** in the- dropdown, and then the name of the custom action you created earlier- when the second dropdown appears. You can add additional **All** or- **Any** conditions if desired. Also select when the rule should run- (if not **Anytime**) and enable it.-- --1. Finally, click **Update**.--{!congrats.md!}----When a case is updated, you'll see a notification like the one above,-to the channel `desk`, with a topic that matches the case's subject name.diff --git a/zerver/webhooks/deskdotcom/fixtures/case_updated.txt b/zerver/webhooks/deskdotcom/fixtures/case_updated.txtdeleted file mode 100644index c7330cf1015..00000000000--- a/zerver/webhooks/deskdotcom/fixtures/case_updated.txt+++ /dev/null@@ -1 +0,0 @@-stream=deskdotcom&topic=case%20updated%20notification&data=Case+2+updated.+Link%3A+%3Ca+href%3D%27https%3A%2F%2Fdeskdotcomtest.desk.com%2Fweb%2Fagent%2Fcase%2F2%27%3EI+have+a+question%3C%2Fa%3Ediff --git a/zerver/webhooks/deskdotcom/fixtures/static_text.txt b/zerver/webhooks/deskdotcom/fixtures/static_text.txtdeleted file mode 100644index e870b96a9f0..00000000000--- a/zerver/webhooks/deskdotcom/fixtures/static_text.txt+++ /dev/null@@ -1 +0,0 @@-stream=deskdotcom&topic=static%20text%20notification&data=This%20is%20a%20custom%20action.diff --git a/zerver/webhooks/deskdotcom/fixtures/unicode_text_italian.txt b/zerver/webhooks/deskdotcom/fixtures/unicode_text_italian.txtdeleted file mode 100644index 0ffdec70432..00000000000--- a/zerver/webhooks/deskdotcom/fixtures/unicode_text_italian.txt+++ /dev/null@@ -1 +0,0 @@-stream=deskdotcom&topic=case%20updated%20notification&data=Case+2+updated.+Link%3A+%3Ca+href%3D%27https%3A%2F%2Fdeskdotcomtest.desk.com%2Fweb%2Fagent%2Fcase%2F2%27%3EIl+mio+hovercraft+è+pieno+di+anguille.%3C%2Fa%3Ediff --git a/zerver/webhooks/deskdotcom/fixtures/unicode_text_japanese.txt b/zerver/webhooks/deskdotcom/fixtures/unicode_text_japanese.txtdeleted file mode 100644index 35a004bab63..00000000000--- a/zerver/webhooks/deskdotcom/fixtures/unicode_text_japanese.txt+++ /dev/null@@ -1 +0,0 @@-stream=deskdotcom&topic=case%20updated%20notification&data=Case+2+updated.+Link%3A+%3Ca+href%3D%27https%3A%2F%2Fdeskdotcomtest.desk.com%2Fweb%2Fagent%2Fcase%2F2%27%3E私のホバークラフトは鰻でいっぱいです%3C%2Fa%3Ediff --git a/zerver/webhooks/deskdotcom/tests.py b/zerver/webhooks/deskdotcom/tests.pydeleted file mode 100644index eb1e143b3be..00000000000--- a/zerver/webhooks/deskdotcom/tests.py+++ /dev/null@@ -1,83 +0,0 @@-from typing_extensions import override--from zerver.lib.test_classes import WebhookTestCase--# Tests for the Desk.com webhook integration.-#-# The channel name must be provided in the URL-encoded test fixture data,-# and must match CHANNEL_NAME set here.-#-# Example:-#-# stream=deskdotcom&topic=static%20text%20notification&data=This%20is%20a%20custom%20action.-#---class DeskDotComHookTests(WebhookTestCase):- CHANNEL_NAME = "deskdotcom"- URL_TEMPLATE = "/api/v1/external/deskdotcom?stream={stream}"- WEBHOOK_DIR_NAME = "deskdotcom"-- def test_static_text_message(self) -> None:- expected_topic_name = "static text notification"- expected_message = "This is a custom action."-- self.api_channel_message(- self.test_user,- "static_text",- expected_topic_name,- expected_message,- content_type="application/x-www-form-urlencoded",- )-- def test_case_updated_message(self) -> None:- expected_topic_name = "case updated notification"- expected_message = (- "Case 2 updated. "- "Link: <a href='https://deskdotcomtest.desk.com/web/agent/case/2'>"- "I have a question</a>"- )-- self.api_channel_message(- self.test_user,- "case_updated",- expected_topic_name,- expected_message,- content_type="application/x-www-form-urlencoded",- )-- def test_unicode_text_italian(self) -> None:- expected_topic_name = "case updated notification"- expected_message = (- "Case 2 updated. "- "Link: <a href='https://deskdotcomtest.desk.com/web/agent/case/2'>"- "Il mio hovercraft è pieno di anguille.</a>"- )-- self.api_channel_message(- self.test_user,- "unicode_text_italian",- expected_topic_name,- expected_message,- content_type="application/x-www-form-urlencoded",- )-- def test_unicode_text_japanese(self) -> None:- expected_topic_name = "case updated notification"- expected_message = (- "Case 2 updated. "- "Link: <a href='https://deskdotcomtest.desk.com/web/agent/case/2'>"- "私のホバークラフトは鰻でいっぱいです</a>"- )-- self.api_channel_message(- self.test_user,- "unicode_text_japanese",- expected_topic_name,- expected_message,- content_type="application/x-www-form-urlencoded",- )-- @override- def get_body(self, fixture_name: str) -> str:- return self.webhook_fixture_data("deskdotcom", fixture_name, file_type="txt")diff --git a/zerver/webhooks/deskdotcom/view.py b/zerver/webhooks/deskdotcom/view.pydeleted file mode 100644index e53b482472b..00000000000--- a/zerver/webhooks/deskdotcom/view.py+++ /dev/null@@ -1,26 +0,0 @@-# Webhooks for external integrations.-from django.http import HttpRequest, HttpResponse--from zerver.decorator import authenticated_rest_api_view-from zerver.lib.response import json_success-from zerver.lib.typed_endpoint import typed_endpoint-from zerver.lib.webhooks.common import check_send_webhook_message-from zerver.models import UserProfile---# Desk.com's integrations all make the user supply a template, where it fills-# in stuff like {{customer.name}} and posts the result as a "data" parameter.-# There's no raw JSON for us to work from. Thus, it makes sense to just write-# a template Zulip message within Desk.com and have the webhook extract that-# from the "data" param and post it, which this does.-@authenticated_rest_api_view(webhook_client_name="Desk")-@typed_endpoint-def api_deskdotcom_webhook(- request: HttpRequest,- user_profile: UserProfile,- *,- data: str,-) -> HttpResponse:- topic_name = "Desk.com notification"- check_send_webhook_message(request, user_profile, topic_name, data)- return json_success(request)