}
/>
diff --git a/src/components/users/UserStatistics.jsx b/src/components/users/UserStatistics.jsx
index e4cbc5f48..5ca23b57a 100644
--- a/src/components/users/UserStatistics.jsx
+++ b/src/components/users/UserStatistics.jsx
@@ -32,7 +32,7 @@ const UserStatistics = ({ user }) => {
-
+
diff --git a/src/components/users/UserSummary.jsx b/src/components/users/UserSummary.jsx
index c1a244326..66067ea98 100644
--- a/src/components/users/UserSummary.jsx
+++ b/src/components/users/UserSummary.jsx
@@ -16,7 +16,7 @@ const UserSummary = ({ user }) => {
- } />
+ } />
>
)
diff --git a/src/index.jsx b/src/index.jsx
index 527b01cab..638135a91 100644
--- a/src/index.jsx
+++ b/src/index.jsx
@@ -3,13 +3,14 @@ import { createRoot } from 'react-dom/client';
import Fade from '@mui/material/Fade';
import { LocalizationProvider } from '@mui/x-date-pickers';
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
-import { HashRouter } from 'react-router-dom';
+import { BrowserRouter, useHistory } from 'react-router-dom';
import { ThemeProvider, StyledEngineProvider, createTheme } from '@mui/material/styles';
import App from './components/app/App';
import LayoutContext from './components/app/LayoutContext';
import './index.scss';
import { COLORS } from './common/colors';
import './i18n/config';
+import { setAppHistory, handleLinkClick, keepLinkClickBubbling, legacyHashRoute, redirectLegacyHashRoute } from './common/history';
const theme = createTheme();
const v5Theme = createTheme(theme, {
@@ -121,10 +122,24 @@ const v5Theme = createTheme(theme, {
})
+const HistoryBridge = () => {
+ setAppHistory(useHistory())
+ return null
+}
+
+const legacyRoute = legacyHashRoute()
+if(legacyRoute)
+ window.history.replaceState(null, '', legacyRoute)
+
+window.addEventListener('click', keepLinkClickBubbling, true)
+document.addEventListener('click', handleLinkClick)
+window.addEventListener('hashchange', redirectLegacyHashRoute)
+
const container = document.getElementById('root');
const root = createRoot(container);
root.render(
-
+
+
@@ -132,5 +147,5 @@ root.render(
-
+
);
diff --git a/src/services/GAService.js b/src/services/GAService.js
index 044521bf6..0d6969635 100644
--- a/src/services/GAService.js
+++ b/src/services/GAService.js
@@ -26,7 +26,7 @@ const GAService = {
if(!enabled())
return;
- ReactGA.send({ hitType: 'pageview', page: window.location.pathname + window.location.hash.split('?')[0] });
+ ReactGA.send({ hitType: 'pageview', page: window.location.pathname });
},
recordUpsertEvent(category, edit, resource) {
diff --git a/webpack.config.js b/webpack.config.js
index 81857a362..418f6b332 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -18,9 +18,12 @@ module.exports = (env) => {
// year (nginx/default.conf.template). HtmlWebpackPlugin writes the hashed
// names into index.html. Dev keeps webpack's default [name].js / [id].js.
output: isProduction ? {
+ publicPath: '/',
filename: '[name].[contenthash:8].js',
chunkFilename: '[name].[contenthash:8].js',
- } : {},
+ } : {
+ publicPath: '/',
+ },
module: {
rules: [
{
@@ -105,7 +108,8 @@ module.exports = (env) => {
},
allowedHosts: 'all',
historyApiFallback: {
- index: 'index.html',
+ index: '/index.html',
+ disableDotRule: true,
},
proxy: [
{