Skip to content

Commit

Permalink
fix: Validate chat button url only when chatUrl is set (#12655) (#12749)
Browse files Browse the repository at this point in the history
* Validate chat button url only when chatUrl is set

Signed-off-by: Rouke Broersma <rouke.broersma@infosupport.com>

* Add Info Support to argocd USERS.md

Signed-off-by: Rouke Broersma <rouke.broersma@infosupport.com>

* Fix linter error

Signed-off-by: Rouke Broersma <rouke.broersma@infosupport.com>

* Fix linter error

Signed-off-by: Rouke Broersma <rouke.broersma@infosupport.com>

---------

Signed-off-by: Rouke Broersma <rouke.broersma@infosupport.com>
  • Loading branch information
rouke-broersma committed Mar 7, 2023
1 parent 0f500a5 commit 6953b43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [imaware](https://imaware.health)
1. [Indeed](https://indeed.com)
1. [Index Exchange](https://www.indexexchange.com/)
1. [Info Support](https://www.infosupport.com/)
1. [InsideBoard](https://www.insideboard.com)
1. [Intuit](https://www.intuit.com/)
1. [Joblift](https://joblift.com/)
Expand Down
12 changes: 7 additions & 5 deletions ui/src/app/ui-banner/ui-banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ export const Banner = (props: React.Props<any>) => {
chatBottomPosition = 85;
}
}
try {
const externalLink = new ExternalLink(chatUrl);
chatUrl = externalLink.ref;
} catch (InvalidExternalLinkError) {
chatUrl = 'invalid-url';
if (chatUrl) {
try {
const externalLink = new ExternalLink(chatUrl);
chatUrl = externalLink.ref;
} catch (InvalidExternalLinkError) {
chatUrl = 'invalid-url';
}
}
return (
<React.Fragment>
Expand Down

0 comments on commit 6953b43

Please sign in to comment.