Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nos Hs2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Språksamlingane
stadnamn
Nos Hs2023
Commits
0c5ebe52
Commit
0c5ebe52
authored
6 years ago
by
esikkala
Browse files
Options
Downloads
Patches
Plain Diff
Add separate history object
parent
dc8bcb45
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/client/components/History.js
+3
-0
3 additions, 0 deletions
src/client/components/History.js
src/client/components/ResultTable.js
+7
-8
7 additions, 8 deletions
src/client/components/ResultTable.js
src/client/index.js
+2
-2
2 additions, 2 deletions
src/client/index.js
with
12 additions
and
10 deletions
src/client/components/History.js
0 → 100644
+
3
−
0
View file @
0c5ebe52
import
{
createBrowserHistory
}
from
'
history
'
;
export
default
createBrowserHistory
();
This diff is collapsed.
Click to expand it.
src/client/components/ResultTable.js
+
7
−
8
View file @
0c5ebe52
...
...
@@ -10,6 +10,7 @@ import CircularProgress from '@material-ui/core/CircularProgress';
import
purple
from
'
@material-ui/core/colors/purple
'
;
import
ResultTableHead
from
'
./ResultTableHead
'
;
import
{
parse
}
from
'
query-string
'
;
import
history
from
'
./History
'
;
const
styles
=
()
=>
({
tableContainer
:
{
...
...
@@ -44,13 +45,8 @@ class ResultTable extends React.Component {
let
page
;
if
(
this
.
props
.
routeProps
.
location
.
search
===
''
)
{
page
=
this
.
props
.
data
.
page
===
-
1
?
0
:
this
.
props
.
data
.
page
;
this
.
props
.
routeProps
.
history
.
push
({
pathname
:
`/
${
this
.
props
.
resultClass
}
/table`
,
data
:
`?page=
${
this
.
props
.
data
.
page
}
`
,
});
//console.log(`result table mounted WITHOUT page parameter, set page to ${page}`);
// console.log(`result table mounted WITHOUT page parameter, set page to ${page}`);
}
else
{
//console.log(this.props.routeProps.location.data)
page
=
parseInt
(
parse
(
this
.
props
.
routeProps
.
location
.
search
).
page
);
// console.log(`result table mounted with page parameter, set page to ${page}`);
}
...
...
@@ -60,13 +56,16 @@ class ResultTable extends React.Component {
componentDidUpdate
=
prevProps
=>
{
if
(
prevProps
.
data
.
page
!=
this
.
props
.
data
.
page
)
{
this
.
props
.
fetchPaginatedResults
(
this
.
props
.
resultClass
,
this
.
props
.
facetClass
,
this
.
props
.
variant
);
this
.
props
.
routeProps
.
history
.
push
({
// console.log('push to history')
// console.log(this.props.data.page)
history
.
push
({
pathname
:
`/
${
this
.
props
.
resultClass
}
/table`
,
data
:
`?page=
${
this
.
props
.
data
.
page
}
`
,
search
:
`?page=
${
this
.
props
.
data
.
page
}
`
,
});
}
if
(
prevProps
.
filters
!=
this
.
props
.
filters
)
{
this
.
props
.
updatePage
(
this
.
props
.
resultClass
,
0
);
// if already on page 0, fetch results
if
(
this
.
props
.
data
.
page
==
0
)
{
this
.
props
.
fetchPaginatedResults
(
this
.
props
.
resultClass
,
this
.
props
.
facetClass
,
this
.
props
.
variant
);
}
...
...
This diff is collapsed.
Click to expand it.
src/client/index.js
+
2
−
2
View file @
0c5ebe52
...
...
@@ -6,7 +6,7 @@ import {responsiveStoreEnhancer} from 'redux-responsive';
import
{
Provider
}
from
'
react-redux
'
;
import
ReduxToastr
,
{
actions
as
toastrActions
}
from
'
react-redux-toastr
'
;
import
{
Router
}
from
'
react-router-dom
'
;
import
{
createBrowserH
istory
}
from
'
h
istory
'
;
import
h
istory
from
'
./components/H
istory
'
;
import
'
react-redux-toastr/lib/css/react-redux-toastr.min.css
'
;
import
'
react-virtualized/styles.css
'
;
...
...
@@ -15,7 +15,7 @@ import rootEpic from './epics';
import
App
from
'
./components/App
'
;
const
epicMiddleware
=
createEpicMiddleware
();
const
history
=
createBrowserHistory
();
const
store
=
createStore
(
reducer
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment