-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[MM-19193] Fix basename in paths to System Console #3885
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA will test this after it's merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense -- just a request to use getBasePath
throughout below.
} | ||
|
||
const siteURLMessage = formatMessage({id, defaultMessage}); | ||
let basename = window.basename; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid using window.basename
(i.e. the global) directly? And instead bind the result of getBasePath
into the component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!!
@mickmister I just inadvertently found a System Console link I hadn't seen before, but this one has a different problem. Should the following be a separate ticket, or should it be fixed along with these?
|
@jasonblais, Just looking at this, I would assume this is an issue related to the PR I merged last night. It seems that {siteURL} must not be necessary afterall, although I found other instances of the same usage. I'll check this first thing tomorrow. |
I added a fix for the bot account link @jfrerich @lindalumitchell
Since we need to take subpaths into account, we need to either explicitly include the basename (what this PR does), or include the siteURL. Both methods are essentially trying to form a URL the browser can process properly. It turns out that mattermost-webapp/utils/url.jsx Lines 45 to 47 in e7c9f00
|
After seeing the usage of |
@mickmister. This was also cherry-picked into the @lindalumitchell, @jasonblais I applied |
@@ -10,7 +10,7 @@ exports[`components/MarketplaceModal should match the snapshot, error banner is | |||
className="error-bar" | |||
dangerouslySetInnerHTML={ | |||
Object { | |||
"__html": "<p>Error connecting to the marketplace server. Please check your settings in the <a class=\\"theme markdown__link\\" href=\\"/admin_console/plugins/plugin_management\\" rel=\\"noreferrer\\" data-link=\\"/admin_console/plugins/plugin_management\\">System Console</a>.</p>", | |||
"__html": "<p>Error connecting to the marketplace server. Please check your settings in the <a class=\\"theme markdown__link\\" href=\\"http:https://example.com/admin_console/plugins/plugin_management\\" rel=\\"noreferrer\\" target=\\"_blank\\">System Console</a>.</p>", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment re: change to target
here, but otherwise looks good.
@mickmister
|
/cherry-pick release-1.25 |
Error trying doing the automated Cherry picking. Please do this manually
|
/cherry-pick release-5.17 |
Error trying doing the automated Cherry picking. Please do this manually
|
* Clarify bot account creation flow * fix basename in paths to System Console
* fix basename in paths to System Console * update to use getBasePath * fix bot account i18n site url * prefer siteURL over basename * update tests * use FormattedMarkdownMessage * remove unnecessary import
Summary
This PR fixes an issue where links to the System Console do not take into account the basename of the MM server. So servers serving only from subpaths would result in a 404.
Ticket Link
https://mattermost.atlassian.net/browse/MM-19193
This PR has changes to en.json