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.

custom-profile-fields: Add new default external accounts.

Niloth Pdc60033ccab9
diff --git a/tools/lib/capitalization.py b/tools/lib/capitalization.py
index d01813b8de0..f42d50031bb 100644
--- a/tools/lib/capitalization.py
+++ b/tools/lib/capitalization.py
@@ -21,6 +21,7 @@ IGNORED_PHRASES = [
r"Esc",
r"GCM",
r"GitHub",
+ r"GitLab",
r"Gravatar",
r"HTTP",
r"ID",
@@ -42,10 +43,12 @@ IGNORED_PHRASES = [
r"Slack",
r"Google",
r"Terms of Service",
+ r"TikTok",
r"Tuesday",
r"URL",
r"UUID",
r"WordPress",
+ r"YouTube",
r"Zoom",
r"Zulip",
r"Zulip Server",
diff --git a/web/templates/default_external_account_icon.hbs b/web/templates/default_external_account_icon.hbs
index d52848b6d73..6fac0fc0faa 100644
--- a/web/templates/default_external_account_icon.hbs
+++ b/web/templates/default_external_account_icon.hbs
@@ -1,3 +1,3 @@
-{{#unless (eq this.subtype "custom")}}
+{{#unless (or (eq this.subtype "custom") (eq this.subtype "bluesky") (eq this.subtype "codeberg") (eq this.subtype "discord") (eq this.subtype "mastodon") (eq this.subtype "threads") (eq this.subtype "tiktok"))}}
<i class="fa fa-{{this.subtype}}" aria-hidden="true"></i>
{{/unless}}
diff --git a/zerver/lib/external_accounts.py b/zerver/lib/external_accounts.py
index 271cd16c3bf..2ebf1711d58 100644
--- a/zerver/lib/external_accounts.py
+++ b/zerver/lib/external_accounts.py
@@ -33,10 +33,46 @@ class ExternalAccount:
# and the user should enter the full URL of their link.
# Set url_pattern as "" to make the field a text field.
DEFAULT_EXTERNAL_ACCOUNTS = {
- "twitter": ExternalAccount(
- text="Twitter",
- url_pattern="https://twitter.com/%(username)s",
- name=gettext_lazy("Twitter username"),
+ "behance": ExternalAccount(
+ text="Behance",
+ url_pattern="https://www.behance.net/%(username)s",
+ name=gettext_lazy("Behance username"),
+ hint="",
+ ),
+ "bitbucket": ExternalAccount(
+ text="Bitbucket",
+ url_pattern="https://bitbucket.org/%(username)s",
+ name=gettext_lazy("Bitbucket username"),
+ hint="",
+ ),
+ "bluesky": ExternalAccount(
+ text="Bluesky",
+ url_pattern="https://bsky.app/profile/%(username)s",
+ name=gettext_lazy("Bluesky handle"),
+ hint="",
+ ),
+ "codeberg": ExternalAccount(
+ text="Codeberg",
+ url_pattern="https://codeberg.org/%(username)s",
+ name=gettext_lazy("Codeberg username"),
+ hint="",
+ ),
+ "discord": ExternalAccount(
+ text="Discord",
+ url_pattern="",
+ name=gettext_lazy("Discord tag"),
+ hint="",
+ ),
+ "dribbble": ExternalAccount(
+ text="Dribbble",
+ url_pattern="https://dribbble.com/%(username)s",
+ name=gettext_lazy("Dribbble username"),
+ hint="",
+ ),
+ "facebook": ExternalAccount(
+ text="Facebook",
+ url_pattern="https://www.facebook.com/%(username)s",
+ name=gettext_lazy("Facebook username"),
hint="",
),
"github": ExternalAccount(
@@ -45,6 +81,84 @@ DEFAULT_EXTERNAL_ACCOUNTS = {
name=gettext_lazy("GitHub username"),
hint="",
),
+ "gitlab": ExternalAccount(
+ text="GitLab",
+ url_pattern="https://gitlab.com/%(username)s",
+ name=gettext_lazy("GitLab username"),
+ hint="",
+ ),
+ "instagram": ExternalAccount(
+ text="Instagram",
+ url_pattern="https://www.instagram.com/%(username)s",
+ name=gettext_lazy("Instagram username"),
+ hint="",
+ ),
+ "linkedin": ExternalAccount(
+ text="LinkedIn",
+ url_pattern="https://www.linkedin.com/in/%(username)s",
+ name=gettext_lazy("LinkedIn profile name"),
+ hint="",
+ ),
+ "mastodon": ExternalAccount(
+ text="Mastodon",
+ url_pattern="%(username)s",
+ name=gettext_lazy("Mastodon profile URL"),
+ hint="",
+ ),
+ "medium": ExternalAccount(
+ text="Medium",
+ url_pattern="https://%(username)s.medium.com",
+ name=gettext_lazy("Medium username"),
+ hint="",
+ ),
+ "pinterest": ExternalAccount(
+ text="Pinterest",
+ url_pattern="https://www.pinterest.com/%(username)s",
+ name=gettext_lazy("Pinterest username"),
+ hint="",
+ ),
+ "reddit": ExternalAccount(
+ text="Reddit",
+ url_pattern="https://www.reddit.com/user/%(username)s",
+ name=gettext_lazy("Reddit username"),
+ hint="",
+ ),
+ "snapchat": ExternalAccount(
+ text="Snapchat",
+ url_pattern="https://www.snapchat.com/@%(username)s",
+ name=gettext_lazy("Snapchat username"),
+ hint="",
+ ),
+ "threads": ExternalAccount(
+ text="Threads",
+ url_pattern="https://www.threads.com/@%(username)s",
+ name=gettext_lazy("Threads username"),
+ hint="",
+ ),
+ "tiktok": ExternalAccount(
+ text="TikTok",
+ url_pattern="https://www.tiktok.com/@%(username)s",
+ name=gettext_lazy("TikTok username"),
+ hint="",
+ ),
+ "twitch": ExternalAccount(
+ text="Twitch",
+ url_pattern="https://www.twitch.tv/%(username)s",
+ name=gettext_lazy("Twitch username"),
+ hint="",
+ ),
+ "twitter": ExternalAccount(
+ text="Twitter",
+ url_pattern="https://twitter.com/%(username)s",
+ name=gettext_lazy("Twitter username"),
+ hint="",
+ ),
+ "youtube": ExternalAccount(
+ text="YouTube",
+ url_pattern="https://www.youtube.com/%(username)s",
+ name=gettext_lazy("YouTube handle"),
+ hint="",
+ ),
}
diff --git a/zerver/tests/test_custom_profile_data.py b/zerver/tests/test_custom_profile_data.py
index d974958a3b6..2c3d0335479 100644
--- a/zerver/tests/test_custom_profile_data.py
+++ b/zerver/tests/test_custom_profile_data.py
@@ -270,7 +270,7 @@ class CreateCustomProfileFieldTest(CustomProfileFieldTestCase):
result = self.client_post("/json/realm/profile_fields", info=data)
self.assert_json_error(result, "Invalid external account type")
- non_default_external_account = "linkedin"
+ non_default_external_account = "gitthub"
data["field_data"] = orjson.dumps(
{
"subtype": non_default_external_account,