Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

integrations: Rename url_option `MAPPING` to `CHANNEL_MAPPING`.

PieterCKc065186f3b05
diff --git a/api_docs/incoming-webhooks-walkthrough.md b/api_docs/incoming-webhooks-walkthrough.md
index cf0aeecb4d7..4c82e4f3b56 100644
--- a/api_docs/incoming-webhooks-walkthrough.md
+++ b/api_docs/incoming-webhooks-walkthrough.md
@@ -304,7 +304,7 @@ Currently configured preset URL options:
`ignore_private_repositories` boolean parameter will be added to the
[generated integration URL](/help/generate-integration-url).
-- **`MAPPING`**: This preset is intended to be used for [chat-app
+- **`CHANNEL_MAPPING`**: This preset is intended to be used for [chat-app
integrations](/integrations/category/communication) (like Slack), and adds a
special option, **Matching Zulip channel**, to the UI for where to send
Zulip notification messages. This special option maps the notification
diff --git a/web/src/integration_url_modal.ts b/web/src/integration_url_modal.ts
index 633b5013b49..2dc17e6bb80 100644
--- a/web/src/integration_url_modal.ts
+++ b/web/src/integration_url_modal.ts
@@ -35,7 +35,7 @@ const url_options_schema = z.array(url_option_schema);
const PresetUrlOption = {
BRANCHES: "branches",
- MAPPING: "mapping",
+ CHANNEL_MAPPING: "mapping",
};
export function show_generate_integration_url_modal(api_key: string): void {
@@ -129,7 +129,7 @@ export function show_generate_integration_url_modal(api_key: string): void {
$config_element.find("#integration-url-all-branches").on("change", () => {
show_branch_filtering_ui();
});
- } else if (option.key === PresetUrlOption.MAPPING) {
+ } else if (option.key === PresetUrlOption.CHANNEL_MAPPING) {
continue;
} else if (option.validator === "check_bool") {
const config_html = render_generate_integration_url_config_checkbox_modal({
@@ -247,11 +247,11 @@ export function show_generate_integration_url_modal(api_key: string): void {
if (url_options) {
for (const option of url_options) {
let $input_element;
- if (option.key === PresetUrlOption.MAPPING) {
+ if (option.key === PresetUrlOption.CHANNEL_MAPPING) {
const stream_input = stream_input_dropdown_widget.value();
if (stream_input === map_channels_option?.unique_id) {
params.delete("stream");
- params.set(PresetUrlOption.MAPPING, "channels");
+ params.set(PresetUrlOption.CHANNEL_MAPPING, "channels");
}
} else if (option.key === PresetUrlOption.BRANCHES) {
if ($("#integration-url-all-branches").prop("checked")) {
@@ -369,7 +369,7 @@ export function show_generate_integration_url_modal(api_key: string): void {
}
const mapping_option = url_options?.find(
- (option) => option.key === PresetUrlOption.MAPPING,
+ (option) => option.key === PresetUrlOption.CHANNEL_MAPPING,
);
if (mapping_option) {
diff --git a/web/templates/dropdown_list.hbs b/web/templates/dropdown_list.hbs
index c88ea4cbabf..e4dbeec9ef4 100644
--- a/web/templates/dropdown_list.hbs
+++ b/web/templates/dropdown_list.hbs
@@ -42,8 +42,8 @@
<span class="setting-disabled-option-text dropdown-list-text-neutral">{{t "Disable" }}</span>
{{/if}}
{{else if (eq unique_id -2)}}
- {{!-- This is the option for PresetUrlOption.MAPPING --}}
- <i class="zulip-icon zulip-icon-equal channel-privacy-type-icon" aria-hidden="true"></i> <span class="dropdown-list-text-neutral">{{name}}</span>
+ {{!-- This is the option for PresetUrlOption.CHANNEL_MAPPING --}}
+ <i class="zulip-icon zulip-icon-hashtag channel-privacy-type-icon" aria-hidden="true"></i> <span class="dropdown-list-text-neutral">{{name}}</span>
{{else}}
<span class="dropdown-list-item-name">
{{#if bold_current_selection}}
diff --git a/zerver/lib/webhooks/common.py b/zerver/lib/webhooks/common.py
index 5cc22d0b317..30c9a45b562 100644
--- a/zerver/lib/webhooks/common.py
+++ b/zerver/lib/webhooks/common.py
@@ -57,7 +57,7 @@ OptionalUserSpecifiedTopicStr: TypeAlias = Annotated[str | None, ApiParamConfig(
class PresetUrlOption(str, Enum):
BRANCHES = "branches"
IGNORE_PRIVATE_REPOSITORIES = "ignore_private_repositories"
- MAPPING = "mapping"
+ CHANNEL_MAPPING = "mapping"
@dataclass
@@ -95,7 +95,7 @@ class WebhookUrlOption:
label="Exclude notifications from private repositories",
validator=check_bool,
)
- case PresetUrlOption.MAPPING: # nocoverage # Not used yet
+ case PresetUrlOption.CHANNEL_MAPPING: # nocoverage # Not used yet
return cls(
name=config.value,
label="",