Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • portalmec/portalmec-react
  • rfhferreira/cleaning-portal-mec-react
2 results
Select Git revision
Show changes
Commits on Source (2)
...@@ -31,6 +31,7 @@ const AdminTemplate = (props) => { ...@@ -31,6 +31,7 @@ const AdminTemplate = (props) => {
let canUserEdit = false; let canUserEdit = false;
if (state.userIsLoggedIn) { if (state.userIsLoggedIn) {
canUserEdit = true;
const roles = [...state.currentUser.roles]; const roles = [...state.currentUser.roles];
for (let i = 0; i < roles.length; i++) for (let i = 0; i < roles.length; i++)
if (roles[i].name === 'admin' || roles[i].name === 'editor') if (roles[i].name === 'admin' || roles[i].name === 'editor')
......
...@@ -182,7 +182,8 @@ const Institutions = () => { ...@@ -182,7 +182,8 @@ const Institutions = () => {
} }
const buildUrl = () => { const buildUrl = () => {
return Url("institutions", `"name" : "${search}", "description" : "${description}", "city" : "${city}", "country" : "${country}"`, currPage, invertList ? "ASC" : "DESC") /*Replace in the end intends to avoid error with JS search engine when using '#' */
return Url("institutions", `"name" : "${search}", "description" : "${description}", "city" : "${city}", "country" : "${country}"`, currPage, invertList ? "ASC" : "DESC").replace('#','/')
} }
useEffect(() => { useEffect(() => {
......
...@@ -183,7 +183,7 @@ export default function App() { ...@@ -183,7 +183,7 @@ export default function App() {
{!awaitTest && {!awaitTest &&
<React.Suspense fallback={<LoadingScreen />}> <React.Suspense fallback={<LoadingScreen />}>
{/*<BrowserRouter history={piwik.connectToHistory(customHistory)}>*/} {/*<BrowserRouter history={piwik.connectToHistory(customHistory)}>*/}
<BrowserRouter> <BrowserRouter history={piwik.connectToHistory(customHistory)}>
<ContrastBar /> <ContrastBar />
<Header /> <Header />
<div <div
......
...@@ -365,7 +365,8 @@ export default function Search() { ...@@ -365,7 +365,8 @@ export default function Search() {
useEffect(() => { useEffect(() => {
setIsLoading(true) setIsLoading(true)
const urlParams = new URLSearchParams(window.location.search); var hashtagProblem=window.location.href.replace('#','/'); /*If there is a '#' on the search,replaces it with a '/' to avoid problems*/
const urlParams = new URLSearchParams(hashtagProblem);
const query = urlParams.get("query"); const query = urlParams.get("query");
const searchClass = urlParams.get("search_class"); const searchClass = urlParams.get("search_class");
const page = parseInt(urlParams.get("page")); const page = parseInt(urlParams.get("page"));
......