link_utils: exposing whitelisted protocols to user settings#1467
link_utils: exposing whitelisted protocols to user settings#1467shubham-padia wants to merge 1 commit intozulip:mainfrom
Conversation
| @@ -0,0 +1,35 @@ | |||
| # Customizing Link Protocols | |||
There was a problem hiding this comment.
We should be using standard Zulip capitalization throughout (sentence case).
| } | ||
| ``` | ||
|
|
||
| Note: Each protocol should include the trailing colon (:), e.g., "mailto:" instead of "mailto". |
There was a problem hiding this comment.
| Note: Each protocol should include the trailing colon (:), e.g., "mailto:" instead of "mailto". | |
| Note: Each protocol should include the trailing `:`, e.g., "mailto:" instead of "mailto". |
|
@andersk Tagging for your review. |
app/common/link-util.ts
Outdated
| const whitelistedProtocols = ConfigUtil.getConfigItem("whitelistedProtocols", [ | ||
| "http:", | ||
| "https:", | ||
| "mailto:", | ||
| "tel:", | ||
| "sip:", | ||
| ]); |
There was a problem hiding this comment.
getConfigItem writes the default value into the config file if it’s missing, so if we ever add new default protocols they’ll never be visible to someone who’s ever launched an old version.
(Was this a bad design decision for getConfigItem? Yes.)
There was a problem hiding this comment.
I have added getConfigItemWithoutSettingDefault for now, will do a followup PR to make getConfigItem to do the same after checking every use of getConfigItem and making sure there are no behavioural changes introduced by doing so.
ac1247a to
e78394a
Compare
Fixes zulip#1284. Adding config option to set protocols in the config that are whitelisted to be opened directly. The behaviour is documented in docs\howto\customize-link-protocols.md.
e78394a to
646425a
Compare
|
Made changes requested! |
Fixes #1284.
Adding config option to set protocols in the config that are whitelisted to be opened directly.
The behaviour is documented in docs\howto\customize-link-protocols.md.
Supersedes #1401. Keeps the original author same.
Fixes:
Screenshots and screen captures:
Platforms this PR was tested on:
Self-review checklist
(variable names, code reuse, readability, etc.).
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: