From 0e16e862a5b61b0a7517dfe10da7dc9ca315fed0 Mon Sep 17 00:00:00 2001 From: Luis Felipe Risch <lfr20@inf.ufpr.br> Date: Fri, 21 May 2021 09:07:22 -0300 Subject: [PATCH] Hot fix --- package-lock.json | 24 ++++++++++++++++++++++++ package.json | 1 + public/index.html | 2 +- src/App.js | 12 +++++++++--- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 53fbe6a2..dff89962 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13664,6 +13664,25 @@ "pinkie": "^2.0.0" } }, + "piwik-react-router": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/piwik-react-router/-/piwik-react-router-0.12.1.tgz", + "integrity": "sha512-Ebi7rBKV/S+YJ3UF/6t6n/wRx1/4yilR1caG/JhdefkYHh8gopqy2kxjaaD++LS9tTmtPNfokEHWbXTbw2W7OA==", + "requires": { + "url-join": "^1.1.0", + "warning": "^3.0.0" + }, + "dependencies": { + "warning": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz", + "integrity": "sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w=", + "requires": { + "loose-envify": "^1.0.0" + } + } + } + }, "pkg-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", @@ -20190,6 +20209,11 @@ } } }, + "url-join": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz", + "integrity": "sha1-dBxsL0WWxIMNZxhGCSDQySIC3Hg=" + }, "url-loader": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-1.1.2.tgz", diff --git a/package.json b/package.json index 81033640..6c44b794 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "material-ui-popup-state": "^1.8.0", "moment": "^2.29.1", "npm": "^7.6.2", + "piwik-react-router": "^0.12.1", "react": "^16.14.0", "react-cookie": "^4.0.3", "react-dom": "^16.14.0", diff --git a/public/index.html b/public/index.html index a3e4855e..0cf2c82d 100755 --- a/public/index.html +++ b/public/index.html @@ -1,3 +1,3 @@ -<!-- Copyright (C) 2019 Centro de Computacao Cientifica e Software Livre Departamento de Informatica - Universidade Federal do Parana This file is part of Plataforma Integrada MEC. Plataforma Integrada MEC is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Plataforma Integrada MEC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see http://www.gnu.org/licenses/. --> <!DOCTYPE html> <html lang="pt-br"> <head> <meta charset="utf-8" /> <meta http-equiv='cache-control' content='no-cache'/> <meta http-equiv='expires' content='0'/> <meta http-equiv='pragma' content='no-cache'/> <!-- google sign-in --> <meta name="google-signin-client_id" content="288460085642-k4veg4fo8kddvjer8b055n9da5qtgha7.apps.googleusercontent.com"> <script src="https://apis.google.com/js/platform.js" async defer></script> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Portal MEC</title> </head> <body > <noscript>You need to enable JavaScript to run this app.</noscript> <div id="root"/> </body> </html> \ No newline at end of file +<!-- Copyright (C) 2019 Centro de Computacao Cientifica e Software Livre Departamento de Informatica - Universidade Federal do Parana This file is part of Plataforma Integrada MEC. Plataforma Integrada MEC is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Plataforma Integrada MEC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Plataforma Integrada MEC. If not, see http://www.gnu.org/licenses/. --> <!DOCTYPE html> <html lang="pt-br"> <head> <meta charset="utf-8" /> <meta http-equiv='cache-control' content='no-cache'/> <meta http-equiv='expires' content='0'/> <meta http-equiv='pragma' content='no-cache'/> <!-- google sign-in --> <meta name="google-signin-client_id" content="288460085642-k4veg4fo8kddvjer8b055n9da5qtgha7.apps.googleusercontent.com"> <script src="https://apis.google.com/js/platform.js" async defer></script> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Plataforma integrada MEC RED</title> </head> <body > <noscript>You need to enable JavaScript to run this app.</noscript> <div id="root"/> </body> </html> \ No newline at end of file diff --git a/src/App.js b/src/App.js index c9742324..83b75613 100644 --- a/src/App.js +++ b/src/App.js @@ -52,7 +52,6 @@ import CollectionPage from "./Pages/CollectionPage.js"; import FormationMaterialPage from "./Pages/FormationMaterialPage.js"; import FormationMaterialIframe from "./Pages/FormationMaterialIframe.js"; import MaterialPage from "./Pages/MaterialPage"; -import Maintence from './Components/maintenance' import NoteVariables from "./Admin/Pages/Pages/SubPages/NoteVariables"; import Institution from "./Admin/Pages/Pages/SubPages/Institutions"; @@ -94,13 +93,20 @@ import CreateRole from "./Admin/Components/Components/Inputs/CreateRole"; import BlockedUser from "./Admin/Pages/Pages/SubPages/BlockedUsers"; import AppBarAdmin from './Admin/Components/Components/AppBar' import Maintenance from "./Components/maintenance"; +import createBrowserHistory from 'history/createBrowserHistory' export default function App() { // eslint-disable-next-line - const { state, dispatch } = useContext(Store); const [hideFooter, setHideFooter] = useState(false); + const PiwikReactRouter = require('piwik-react-router'); + const piwik = PiwikReactRouter({ + url: '//piwik.c3sl.ufpr.br/', + siteId: 5 + }); + const customHistory = createBrowserHistory() + const CheckUserPermission = () => { let canUserEdit = false; @@ -148,7 +154,7 @@ export default function App() { }, [window.innerWidth, window.innerHeight]); return ( - <BrowserRouter basename="/react"> + <BrowserRouter history={piwik.connectToHistory(customHistory)}> <Maintenance /> <Header /> <div -- GitLab