mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
integrations: Add new file for fixtureless screenshot configs registry.
This does not include any screenshot configs, just defining the format, and loading FIXTURELESS_SCREENSHOT_CONFIG from the file. Co-authored-by: Lauryn Menard <lauryn@zulip.com>
This commit is contained in:
@@ -14,6 +14,7 @@ from django_stubs_ext import StrPromise
|
||||
from zerver.lib.storage import static_path
|
||||
from zerver.lib.validator import check_bool
|
||||
from zerver.lib.webhooks.common import PresetUrlOption, WebhookConfigOption, WebhookUrlOption
|
||||
from zerver.webhooks import fixtureless_integrations
|
||||
|
||||
"""This module declares all of the (documented) integrations available
|
||||
in the Zulip server. The Integration class is used as part of
|
||||
@@ -60,6 +61,15 @@ CATEGORIES: dict[str, StrPromise] = {
|
||||
"version-control": gettext_lazy("Version control"),
|
||||
}
|
||||
|
||||
# Can also be computed from INTEGRATIONS by removing entries from
|
||||
# WEBHOOK_INTEGRATIONS and NO_SCREENSHOT_CONFIG, but defined explicitly to
|
||||
# avoid circular dependency
|
||||
FIXTURELESS_INTEGRATIONS_WITH_SCREENSHOTS: list[str] = []
|
||||
FIXTURELESS_SCREENSHOT_CONTENT: dict[str, list[fixtureless_integrations.ScreenshotContent]] = {
|
||||
key: [getattr(fixtureless_integrations, key.upper().replace("-", "_"))]
|
||||
for key in FIXTURELESS_INTEGRATIONS_WITH_SCREENSHOTS
|
||||
}
|
||||
|
||||
|
||||
class Integration:
|
||||
DEFAULT_LOGO_STATIC_PATH_PNG = "images/integrations/logos/{name}.png"
|
||||
@@ -846,6 +856,11 @@ WEBHOOK_SCREENSHOT_CONFIG: dict[str, list[WebhookScreenshotConfig]] = {
|
||||
}
|
||||
|
||||
FIXTURELESS_SCREENSHOT_CONFIG: dict[str, list[FixturelessScreenshotConfig]] = {}
|
||||
for integration, screenshots_contents in FIXTURELESS_SCREENSHOT_CONTENT.items():
|
||||
FIXTURELESS_SCREENSHOT_CONFIG[integration] = [
|
||||
FixturelessScreenshotConfig(screenshot_content["content"], screenshot_content["topic"])
|
||||
for screenshot_content in screenshots_contents
|
||||
]
|
||||
|
||||
DOC_SCREENSHOT_CONFIG: dict[
|
||||
str, list[WebhookScreenshotConfig] | list[FixturelessScreenshotConfig]
|
||||
|
||||
Reference in New Issue
Block a user