forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MM-10368: react-router subpath (mattermost#1348)
* use Link in Textbox Introduce react-router-enzyme-context to enable unit testing of same with `mount` vs. `shallow`. * leverage browserHistory in SystemUsersDropdown Note that the demotion modal isn't actually being shown at present: the transition of self from system admin to regular member is done without confirmation after a partial refactor last year. * leverage browserHistory in Authorize * leverage Link in SignupController * leverage browserHistory in UserSettingsSecurity * extract base path from config's SiteURL on logout * move __webpack_public_path__ into entry.js This ensures that the other imports aren't hoisted above the definition. Additionally re-export the public path back onto window.publicPath to cover development environments. * rely on window.basename in autolinkChannelMentions While globals should generally be avoided, this is one of only two places where `window.basename` is used. Moving it into the store and rewriting the text rendering to pass down (or wrap) the necessary state may be premature, given the pre-existing need for this variable to be global. * update getSiteURL to respect subpath Additionally leverage getSiteURL over accessing window.* directly. * strip any trailing slash before appending the ws pathname * lint fixes * use window.location.originw when SiteURL not defined
- Loading branch information
1 parent
983635d
commit e8e1219
Showing
21 changed files
with
211 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | ||
// See LICENSE.txt for license information. | ||
|
||
// Allow overriding the path used by webpack to dynamically resolve assets. This is driven by | ||
// an environment variable in development, or by a window variable defined in root.html in | ||
// production. The window variable is updated by the server after configuring SiteURL and | ||
// restarting or by running the `mattermost config subpath` command. | ||
window.publicPath = process.env.PUBLIC_PATH || window.publicPath || '/static/'; // eslint-disable-line no-process-env | ||
__webpack_public_path__ = window.publicPath; // eslint-disable-line camelcase, no-undef | ||
|
||
// Define the subpath at which Mattermost is running. Extract this from the publicPath above to | ||
// avoid depending on Redux state before it is even loaded. This actual global export is used | ||
// in a minimum of places, as it is preferred to leverage react-router, configured to use this | ||
// basename accordingly. | ||
window.basename = window.publicPath.substr(0, window.publicPath.length - '/static/'.length); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.