From 583eb3f62c4be832c1d5c12127ebaba002dec118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20H=C3=BCster?= Date: Fri, 23 May 2025 19:36:53 +0200 Subject: [PATCH] =?UTF-8?q?fixed=20the=20url=20styling=20for=20webhooks=20?= =?UTF-8?q?to=20now=20use=20pure=20html=20instead=20of=20ma=E2=80=A6=20(#3?= =?UTF-8?q?0845)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fixed the url styling for webhooks to now use pure html instead of markdown * remove code styling from outgoing webhook token * updated test snapshots * added code styling to more integrations tokens * update snapshots * fixed translation strings for english and german --- .../installed_command.test.tsx.snap | 16 ++++++--- .../installed_incoming_webhook.test.tsx.snap | 4 ++- .../installed_outgoing_webhook.test.tsx.snap | 4 ++- .../confirm_integration.test.tsx.snap | 36 +++++++++++++------ .../confirm_integration.tsx | 22 ++++++------ .../integrations/installed_command.tsx | 2 +- .../installed_incoming_webhook.tsx | 2 +- .../installed_outgoing_webhook.tsx | 2 +- ...ed_outgoing_oauth_connection.test.tsx.snap | 12 +++++-- .../installed_outgoing_oauth_connection.tsx | 6 ++-- webapp/channels/src/i18n/en.json | 4 +-- 11 files changed, 72 insertions(+), 38 deletions(-) diff --git a/webapp/channels/src/components/integrations/__snapshots__/installed_command.test.tsx.snap b/webapp/channels/src/components/integrations/__snapshots__/installed_command.test.tsx.snap index 3ebc4b2167..fbb8035d42 100644 --- a/webapp/channels/src/components/integrations/__snapshots__/installed_command.test.tsx.snap +++ b/webapp/channels/src/components/integrations/__snapshots__/installed_command.test.tsx.snap @@ -75,7 +75,9 @@ exports[`components/integrations/InstalledCommand should call onDelete function id="installed_integrations.token" values={ Object { - "token": "testToken", + "token": + testToken + , } } /> @@ -187,7 +189,9 @@ exports[`components/integrations/InstalledCommand should call onRegenToken funct id="installed_integrations.token" values={ Object { - "token": "testToken", + "token": + testToken + , } } /> @@ -269,7 +273,9 @@ exports[`components/integrations/InstalledCommand should match snapshot 1`] = ` id="installed_integrations.token" values={ Object { - "token": "testToken", + "token": + testToken + , } } /> @@ -349,7 +355,9 @@ exports[`components/integrations/InstalledCommand should match snapshot, not aut id="installed_integrations.token" values={ Object { - "token": "testToken", + "token": + testToken + , } } /> diff --git a/webapp/channels/src/components/integrations/__snapshots__/installed_incoming_webhook.test.tsx.snap b/webapp/channels/src/components/integrations/__snapshots__/installed_incoming_webhook.test.tsx.snap index 7454016f89..8b96af04cd 100644 --- a/webapp/channels/src/components/integrations/__snapshots__/installed_incoming_webhook.test.tsx.snap +++ b/webapp/channels/src/components/integrations/__snapshots__/installed_incoming_webhook.test.tsx.snap @@ -58,7 +58,9 @@ exports[`components/integrations/InstalledIncomingWebhook should match snapshot id="installed_integrations.url" values={ Object { - "url": "http://localhost:8065/hooks/9w96t4nhbfdiij64wfqors4i1r", + "url": + http://localhost:8065/hooks/9w96t4nhbfdiij64wfqors4i1r + , } } /> diff --git a/webapp/channels/src/components/integrations/__snapshots__/installed_outgoing_webhook.test.tsx.snap b/webapp/channels/src/components/integrations/__snapshots__/installed_outgoing_webhook.test.tsx.snap index 9f30271384..c21c3a3ac0 100644 --- a/webapp/channels/src/components/integrations/__snapshots__/installed_outgoing_webhook.test.tsx.snap +++ b/webapp/channels/src/components/integrations/__snapshots__/installed_outgoing_webhook.test.tsx.snap @@ -128,7 +128,9 @@ exports[`components/integrations/InstalledOutgoingWebhook should match snapshot id="installed_integrations.token" values={ Object { - "token": "xoxz1z7c3tgi9xhrfudn638q9r", + "token": + xoxz1z7c3tgi9xhrfudn638q9r + , } } /> diff --git a/webapp/channels/src/components/integrations/confirm_integration/__snapshots__/confirm_integration.test.tsx.snap b/webapp/channels/src/components/integrations/confirm_integration/__snapshots__/confirm_integration.test.tsx.snap index 5af03bb990..19f9e95565 100644 --- a/webapp/channels/src/components/integrations/confirm_integration/__snapshots__/confirm_integration.test.tsx.snap +++ b/webapp/channels/src/components/integrations/confirm_integration/__snapshots__/confirm_integration.test.tsx.snap @@ -52,7 +52,9 @@ exports[`components/integrations/ConfirmIntegration should match snapshot, comma values={ Object { "b": [Function], - "token": "jb6oyqh95irpbx8fo9zmndkp1r", + "token": + jb6oyqh95irpbx8fo9zmndkp1r + , } } /> @@ -135,7 +137,9 @@ exports[`components/integrations/ConfirmIntegration should match snapshot, incom values={ Object { "b": [Function], - "url": "\`http://localhost:8065/hooks/r5tpgt4iepf45jt768jz84djic\`", + "url": + http://localhost:8065/hooks/r5tpgt4iepf45jt768jz84djic + , } } /> @@ -220,7 +224,9 @@ exports[`components/integrations/ConfirmIntegration should match snapshot, oauth values={ Object { "b": [Function], - "id": "r5tpgt4iepf45jt768jz84djic", + "id": + r5tpgt4iepf45jt768jz84djic + , } } /> @@ -240,7 +246,9 @@ exports[`components/integrations/ConfirmIntegration should match snapshot, oauth values={ Object { "b": [Function], - "secret": "<==secret==>", + "secret": + <==secret==> + , } } /> @@ -347,7 +355,9 @@ exports[`components/integrations/ConfirmIntegration should match snapshot, outgo values={ Object { "b": [Function], - "token": "jb6oyqh95irpbx8fo9zmndkp1r", + "token": + jb6oyqh95irpbx8fo9zmndkp1r + , } } /> @@ -432,7 +442,9 @@ exports[`components/integrations/ConfirmIntegration should match snapshot, outgo values={ Object { "b": [Function], - "id": "someid", + "id": + someid + , } } /> @@ -452,12 +464,14 @@ exports[`components/integrations/ConfirmIntegration should match snapshot, outgo className="word-break--all" > + https://tokenurl.com + , } } /> @@ -466,12 +480,14 @@ exports[`components/integrations/ConfirmIntegration should match snapshot, outgo className="word-break--all" > + https://myaudience.com + , } } /> diff --git a/webapp/channels/src/components/integrations/confirm_integration/confirm_integration.tsx b/webapp/channels/src/components/integrations/confirm_integration/confirm_integration.tsx index 3b602a6a18..11c46fd05c 100644 --- a/webapp/channels/src/components/integrations/confirm_integration/confirm_integration.tsx +++ b/webapp/channels/src/components/integrations/confirm_integration/confirm_integration.tsx @@ -92,7 +92,7 @@ const ConfirmIntegration = ({team, location, commands, oauthApps, incomingHooks, id='add_command.token' defaultMessage='Token: {token}' values={{ - token: commandToken, + token: {commandToken}, b: (chunks: string) => {chunks}, }} /> @@ -135,7 +135,7 @@ const ConfirmIntegration = ({team, location, commands, oauthApps, incomingHooks, id='add_incoming_webhook.url' defaultMessage='URL: {url}' values={{ - url: '`' + incomingHookToken + '`', + url: {incomingHookToken}, b: (chunks: string) => {chunks}, }} /> @@ -178,7 +178,7 @@ const ConfirmIntegration = ({team, location, commands, oauthApps, incomingHooks, id='add_outgoing_webhook.token' defaultMessage='Token: {token}' values={{ - token: outgoingHookToken, + token: {outgoingHookToken}, b: (chunks: string) => {chunks}, }} /> @@ -224,7 +224,7 @@ const ConfirmIntegration = ({team, location, commands, oauthApps, incomingHooks, id='add_oauth_app.clientId' defaultMessage='Client ID: {id}' values={{ - id: oauthAppToken, + id: {oauthAppToken}, b: (chunks: string) => {chunks}, }} /> @@ -237,7 +237,7 @@ const ConfirmIntegration = ({team, location, commands, oauthApps, incomingHooks, id='add_oauth_app.clientSecret' defaultMessage='Client Secret: {secret}' values={{ - secret: oauthAppSecret, + secret: {oauthAppSecret}, b: (chunks: string) => {chunks}, }} /> @@ -307,7 +307,7 @@ const ConfirmIntegration = ({team, location, commands, oauthApps, incomingHooks, id='add_outgoing_oauth_connection.clientId' defaultMessage='Client ID: {id}' values={{ - id: clientId, + id: {clientId}, b: (chunks: string) => {chunks}, }} /> @@ -356,9 +356,9 @@ const ConfirmIntegration = ({team, location, commands, oauthApps, incomingHooks,

{outgoingOAuthConnection.oauth_token_url}, b: (chunks: string) => {chunks}, }} /> @@ -366,9 +366,9 @@ const ConfirmIntegration = ({team, location, commands, oauthApps, incomingHooks,

{outgoingOAuthConnection.audiences.join(', ')}, b: (chunks: string) => {chunks}, }} /> @@ -410,7 +410,7 @@ const ConfirmIntegration = ({team, location, commands, oauthApps, incomingHooks, id='add_outgoing_webhook.token' defaultMessage='Token: {token}' values={{ - token: botToken, + token: {botToken}, b: (chunks: string) => {chunks}, }} /> diff --git a/webapp/channels/src/components/integrations/installed_command.tsx b/webapp/channels/src/components/integrations/installed_command.tsx index 6f35f9c15d..201cf92159 100644 --- a/webapp/channels/src/components/integrations/installed_command.tsx +++ b/webapp/channels/src/components/integrations/installed_command.tsx @@ -166,7 +166,7 @@ export default class InstalledCommand extends React.PureComponent { id='installed_integrations.token' defaultMessage='Token: {token}' values={{ - token: commandToken, + token: {commandToken}, }} /> id='installed_integrations.url' defaultMessage='URL: {url}' values={{ - url: incomingWebhookId, + url: {incomingWebhookId}, }} /> diff --git a/webapp/channels/src/components/integrations/installed_outgoing_webhook.tsx b/webapp/channels/src/components/integrations/installed_outgoing_webhook.tsx index 021ccb65a7..c6ca3cf003 100644 --- a/webapp/channels/src/components/integrations/installed_outgoing_webhook.tsx +++ b/webapp/channels/src/components/integrations/installed_outgoing_webhook.tsx @@ -230,7 +230,7 @@ export default class InstalledOutgoingWebhook extends React.PureComponent id='installed_integrations.token' defaultMessage='Token: {token}' values={{ - token: outgoingWebhook.token, + token: {outgoingWebhook.token}, }} /> - someid + + someid + @@ -89,7 +91,9 @@ exports[`components/integrations/InstalledOutgoingOAuthConnection should match s id="installed_integrations.audience_urls" values={ Object { - "urls": "https://myaudience.com", + "urls": + https://myaudience.com + , } } /> @@ -106,7 +110,9 @@ exports[`components/integrations/InstalledOutgoingOAuthConnection should match s id="installed_integrations.token_url" values={ Object { - "url": "https://tokenurl.com", + "url": + https://tokenurl.com + , } } /> diff --git a/webapp/channels/src/components/integrations/outgoing_oauth_connections/installed_outgoing_oauth_connection.tsx b/webapp/channels/src/components/integrations/outgoing_oauth_connections/installed_outgoing_oauth_connection.tsx index 74db3049ff..153888dfc2 100644 --- a/webapp/channels/src/components/integrations/outgoing_oauth_connections/installed_outgoing_oauth_connection.tsx +++ b/webapp/channels/src/components/integrations/outgoing_oauth_connections/installed_outgoing_oauth_connection.tsx @@ -63,7 +63,7 @@ const InstalledOutgoingOAuthConnection = (props: InstalledOutgoingOAuthConnectio id='installed_integrations.audience_urls' defaultMessage='Audience URLs: {urls}' values={{ - urls: outgoingOAuthConnection.audiences.join(', '), + urls: {outgoingOAuthConnection.audiences.join(', ')}, }} /> @@ -74,7 +74,7 @@ const InstalledOutgoingOAuthConnection = (props: InstalledOutgoingOAuthConnectio id='installed_integrations.token_url' defaultMessage='Token URL: {url}' values={{ - url: outgoingOAuthConnection.oauth_token_url, + url: {outgoingOAuthConnection.oauth_token_url}, }} /> @@ -124,7 +124,7 @@ const InstalledOutgoingOAuthConnection = (props: InstalledOutgoingOAuthConnectio id='installed_integrations.client_id' defaultMessage='Client ID: ' /> - {outgoingOAuthConnection.client_id} + {outgoingOAuthConnection.client_id}

diff --git a/webapp/channels/src/i18n/en.json b/webapp/channels/src/i18n/en.json index 5c2f956d39..df51d4125f 100644 --- a/webapp/channels/src/i18n/en.json +++ b/webapp/channels/src/i18n/en.json @@ -165,7 +165,7 @@ "add_oauth_app.trusted.help": "If true, the OAuth 2.0 application is considered trusted by the Mattermost server and does not require the user to accept authorization. If false, a window opens to ask the user to accept or deny the authorization.", "add_oauth_app.url": "URL(s): {url}", "add_outgoing_oauth_connection.add": "Add", - "add_outgoing_oauth_connection.audience_urls": "Audience URL(s): `{url}`", + "add_outgoing_oauth_connection.audience_urls": "Audience URL(s): {url}", "add_outgoing_oauth_connection.audienceUrls.help": "The URLs which will receive requests with the OAuth token, e.g. your custom slash command handler endpoint. Must be a valid URL and start with http:// or https://.", "add_outgoing_oauth_connection.audienceUrls.label": "Audience URLs (One Per Line)", "add_outgoing_oauth_connection.audienceUrls.required": "One or more audience URLs are required.", @@ -196,7 +196,7 @@ "add_outgoing_oauth_connection.save_anyway": "Save anyway", "add_outgoing_oauth_connection.save_without_validation_warning": "This connection has not been validated, Do you want to save anyway?", "add_outgoing_oauth_connection.saving": "Saving...", - "add_outgoing_oauth_connection.token_url": "Token URL: `{url}`", + "add_outgoing_oauth_connection.token_url": "Token URL: {url}", "add_outgoing_oauth_connection.username": "Username: {username}", "add_outgoing_oauth_connection.validate": "Validate Connection", "add_outgoing_oauth_connection.validated_connection": "Validated connection",