mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
integrations: Move configs in config_options to url_options.
Currently we have 2 implementations of `config_options`: - It's used for generating optional webhook URL parameters. These settings also come with custom UI in the "Generate integration URL" modal. - In `/bots` API, it's used as schema for the bots `BotConfigData`. Each type of bots have different ways of defining their `BotConfigData` fields. Currently, only embedded bots use `BotConfigData`, and only the incoming webhooks use `config_options` to configure a bot's `BotConfigData`; thus, the `config_options` remain unused. To avoid confusion as to which implementation of `config_options` is used by an integration, this separates the first use case -- to generate optional webhook URL -- to a new field called `url_options`. Thus, the `config_options` field is reserved only for the second use case.
This commit is contained in:
@@ -61,6 +61,13 @@ class WebhookConfigOption:
|
||||
validator: Callable[[str, str], str | bool | None]
|
||||
|
||||
|
||||
@dataclass
|
||||
class WebhookUrlOption:
|
||||
name: str
|
||||
label: str
|
||||
validator: Callable[[str, str], str | bool | None]
|
||||
|
||||
|
||||
def get_setup_webhook_message(integration: str, user_name: str | None = None) -> str:
|
||||
content = SETUP_MESSAGE_TEMPLATE.format(integration=integration)
|
||||
if user_name:
|
||||
|
||||
Reference in New Issue
Block a user