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
c3b8a249
Commit
c3b8a249
authored
3 years ago
by
esikkala
Browse files
Options
Downloads
Patches
Plain Diff
Combine reducers based on configs
parent
41c0fb2f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/client/configs/sampo/PerspectiveConfig.js
+5
-0
5 additions, 0 deletions
src/client/configs/sampo/PerspectiveConfig.js
src/client/reducers/index.js
+40
-47
40 additions, 47 deletions
src/client/reducers/index.js
with
45 additions
and
47 deletions
src/client/configs/sampo/PerspectiveConfig.js
+
5
−
0
View file @
c3b8a249
...
...
@@ -192,6 +192,11 @@ export const perspectiveConfig = [
}
]
},
{
id
:
'
fullTextSearch
'
,
isHidden
:
true
,
searchMode
:
'
full-text-search
'
},
{
id
:
'
clientFSPlaces
'
,
frontPageImage
:
placesImage
,
...
...
This diff is collapsed.
Click to expand it.
src/client/reducers/index.js
+
40
−
47
View file @
c3b8a249
import
portalConfig
from
'
../configs/PortalConfig
'
import
{
combineReducers
}
from
'
redux
'
import
{
reducer
as
toastrReducer
}
from
'
react-redux-toastr
'
// general reducers:
// Import and add general reducers:
import
error
from
'
./general/error
'
import
options
from
'
./general/options
'
import
animation
from
'
./general/animation
'
import
leafletMap
from
'
./general/leafletMap
'
// portal spefic reducers:
import
fullTextSearch
from
'
./sampo/fullTextSearch
'
import
clientSideFacetedSearch
from
'
./sampo/clientSideFacetedSearch
'
import
perspective1
from
'
./sampo/perspective1
'
// copy of manuscripts
import
perspective2
from
'
./sampo/perspective2
'
// copy of works
import
perspective3
from
'
./sampo/perspective3
'
// copy of events
import
manuscripts
from
'
./sampo/manuscripts
'
import
works
from
'
./sampo/works
'
import
events
from
'
./sampo/events
'
import
actors
from
'
./sampo/actors
'
import
places
from
'
./sampo/places
'
import
expressions
from
'
./sampo/expressions
'
import
collections
from
'
./sampo/collections
'
import
finds
from
'
./sampo/finds
'
import
findsFacets
from
'
./sampo/findsFacets
'
import
findsFacetsConstrainSelf
from
'
./sampo/findsFacetsConstrainSelf
'
import
perspective1Facets
from
'
./sampo/perspective1Facets
'
import
perspective1FacetsConstrainSelf
from
'
./sampo/perspective1FacetsConstrainSelf
'
import
perspective2Facets
from
'
./sampo/perspective2Facets
'
import
perspective2FacetsConstrainSelf
from
'
./sampo/perspective2FacetsConstrainSelf
'
import
perspective3Facets
from
'
./sampo/perspective3Facets
'
// import perspective3FacetsConstrainSelf from './sampo/perspective3FacetsConstrainSelf'
const
reducer
=
combineReducers
({
perspective1
,
perspective2
,
perspective3
,
perspective1Facets
,
perspective1FacetsConstrainSelf
,
perspective2Facets
,
perspective2FacetsConstrainSelf
,
perspective3Facets
,
// perspective3FacetsConstrainSelf,
manuscripts
,
works
,
events
,
actors
,
expressions
,
collections
,
places
,
finds
,
findsFacets
,
findsFacetsConstrainSelf
,
const
reducers
=
{
leafletMap
,
animation
,
options
,
error
,
clientSideFacetedSearch
,
fullTextSearch
,
toastr
:
toastrReducer
})
}
// Import and add portal spefic reducers:
const
{
portalID
}
=
portalConfig
const
{
perspectiveConfig
}
=
await
import
(
`../configs/
${
portalID
}
/PerspectiveConfig`
)
const
{
perspectiveConfigOnlyInfoPages
}
=
await
import
(
`../configs/
${
portalID
}
/PerspectiveConfigOnlyInfoPages`
)
for
(
const
perspective
of
perspectiveConfig
)
{
if
(
perspective
.
searchMode
&&
perspective
.
searchMode
===
'
federated-search
'
)
{
const
{
default
:
reducer
}
=
await
import
(
`./
${
portalID
}
/clientSideFacetedSearch`
)
reducers
.
clientSideFacetedSearch
=
reducer
}
else
if
(
perspective
.
searchMode
&&
perspective
.
searchMode
===
'
full-text-search
'
)
{
const
{
default
:
reducer
}
=
await
import
(
`./
${
portalID
}
/fullTextSearch`
)
reducers
.
fullTextSearch
=
reducer
}
else
{
const
perspectiveID
=
perspective
.
id
const
{
default
:
reducer
}
=
await
import
(
`./
${
portalID
}
/
${
perspectiveID
}
`
)
const
{
default
:
facetReducer
}
=
await
import
(
`./
${
portalID
}
/
${
perspectiveID
}
Facets`
)
let
facetConstrainselfReducer
=
null
try
{
const
{
default
:
importedFacetConstrainselfReducer
}
=
await
import
(
`./
${
portalID
}
/
${
perspectiveID
}
FacetsConstrainSelf`
)
facetConstrainselfReducer
=
importedFacetConstrainselfReducer
}
catch
(
error
)
{
}
reducers
[
perspectiveID
]
=
reducer
reducers
[
`
${
perspectiveID
}
Facets`
]
=
facetReducer
if
(
facetConstrainselfReducer
)
{
reducers
[
`
${
perspectiveID
}
FacetsConstrainSelf`
]
=
facetConstrainselfReducer
}
}
}
for
(
const
perspective
of
perspectiveConfigOnlyInfoPages
)
{
const
perspectiveID
=
perspective
.
id
const
{
default
:
reducer
}
=
await
import
(
`./
${
portalID
}
/
${
perspectiveID
}
`
)
reducers
[
perspectiveID
]
=
reducer
}
const
reducer
=
combineReducers
(
reducers
)
export
default
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