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
9f8f2316
Commit
9f8f2316
authored
5 years ago
by
esikkala
Browse files
Options
Downloads
Patches
Plain Diff
Don't create routes for perspectives that have an external url
parent
8775479d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/client/containers/SemanticPortal.js
+47
-41
47 additions, 41 deletions
src/client/containers/SemanticPortal.js
with
47 additions
and
41 deletions
src/client/containers/SemanticPortal.js
+
47
−
41
View file @
9f8f2316
...
@@ -20,6 +20,7 @@ import Actors from '../components//perspectives/Actors';
...
@@ -20,6 +20,7 @@ import Actors from '../components//perspectives/Actors';
import
All
from
'
../components/perspectives/All
'
;
import
All
from
'
../components/perspectives/All
'
;
import
InstanceHomePage
from
'
../components/main_layout/InstanceHomePage
'
;
import
InstanceHomePage
from
'
../components/main_layout/InstanceHomePage
'
;
import
{
perspectiveArr
}
from
'
../components/perspectives/PerspectiveArray
'
;
import
{
perspectiveArr
}
from
'
../components/perspectives/PerspectiveArray
'
;
import
{
has
}
from
'
lodash
'
;
import
{
import
{
fetchResultCount
,
fetchResultCount
,
fetchPaginatedResults
,
fetchPaginatedResults
,
...
@@ -203,6 +204,7 @@ let SemanticPortal = (props) => {
...
@@ -203,6 +204,7 @@ let SemanticPortal = (props) => {
<
/React.Fragment
>
<
/React.Fragment
>
}
}
/
>
/
>
{
/* route for full text search results */
}
<
Route
<
Route
path
=
"
/all
"
path
=
"
/all
"
render
=
{
routeProps
=>
render
=
{
routeProps
=>
...
@@ -219,49 +221,53 @@ let SemanticPortal = (props) => {
...
@@ -219,49 +221,53 @@ let SemanticPortal = (props) => {
<
/React.Fragment
>
<
/React.Fragment
>
}
}
/
>
/
>
{
/* create routes for perspectives defined in perspectiveArr */
}
{
/* routes for perspectives that don't have an external url */
}
{
perspectiveArr
.
map
(
perspective
=>
{
perspectiveArr
.
map
(
perspective
=>
{
<
React
.
Fragment
key
=
{
perspective
.
id
}
>
if
(
!
has
(
perspective
,
'
externalUrl
'
))
{
<
Route
return
(
path
=
{
`/
${
perspective
.
id
}
/faceted-search`
}
<
React
.
Fragment
key
=
{
perspective
.
id
}
>
render
=
{
routeProps
=>
{
<
Route
return
(
path
=
{
`/
${
perspective
.
id
}
/faceted-search`
}
<
React
.
Fragment
>
render
=
{
routeProps
=>
{
<
Grid
item
xs
=
{
12
}
md
=
{
3
}
className
=
{
classes
.
facetBarContainer
}
>
return
(
<
FacetBar
<
React
.
Fragment
>
facetData
=
{
props
[
`
${
perspective
.
id
}
Facets`
]}
<
Grid
item
xs
=
{
12
}
md
=
{
3
}
className
=
{
classes
.
facetBarContainer
}
>
facetClass
=
{
perspective
.
id
}
<
FacetBar
facetData
=
{
props
[
`
${
perspective
.
id
}
Facets`
]}
facetClass
=
{
perspective
.
id
}
resultClass
=
{
perspective
.
id
}
fetchingResultCount
=
{
props
[
perspective
.
id
].
fetchingResultCount
}
resultCount
=
{
props
[
perspective
.
id
].
resultCount
}
fetchFacet
=
{
props
.
fetchFacet
}
fetchResultCount
=
{
props
.
fetchResultCount
}
updateFacetOption
=
{
props
.
updateFacetOption
}
/
>
<
/Grid
>
<
Grid
item
xs
=
{
12
}
md
=
{
9
}
className
=
{
classes
.
resultsContainer
}
>
{
renderPerspective
(
perspective
,
routeProps
)}
<
/Grid
>
<
/React.Fragment
>
);
}}
/
>
<
Route
path
=
{
`/
${
perspective
.
id
}
/page/:id`
}
render
=
{
routeProps
=>
{
return
(
<
InstanceHomePage
fetchByURI
=
{
props
.
fetchByURI
}
resultClass
=
{
perspective
.
id
}
resultClass
=
{
perspective
.
id
}
fetchingResultCount
=
{
props
[
perspective
.
id
].
fetchingResultCount
}
data
=
{
props
[
perspective
.
id
].
instance
}
resultCount
=
{
props
[
perspective
.
id
].
resultCount
}
isLoading
=
{
props
[
perspective
.
id
].
fetching
}
fetchFacet
=
{
props
.
fetchFacet
}
routeProps
=
{
routeProps
}
fetchResultCount
=
{
props
.
fetchResultCount
}
updateFacetOption
=
{
props
.
updateFacetOption
}
/
>
/
>
<
/Grid
>
);
<
Grid
item
xs
=
{
12
}
md
=
{
9
}
className
=
{
classes
.
resultsContainer
}
>
}}
{
renderPerspective
(
perspective
,
routeProps
)}
/
>
<
/Grid
>
<
/React.Fragment
>
<
/React.Fragment
>
);
);
}
}}
})}
/
>
<
Route
path
=
{
`/
${
perspective
.
id
}
/page/:id`
}
render
=
{
routeProps
=>
{
return
(
<
InstanceHomePage
fetchByURI
=
{
props
.
fetchByURI
}
resultClass
=
{
perspective
.
id
}
data
=
{
props
[
perspective
.
id
].
instance
}
isLoading
=
{
props
[
perspective
.
id
].
fetching
}
routeProps
=
{
routeProps
}
/
>
);
}}
/
>
<
/React.Fragment
>
)}
{
/* create routes for classes that have only info pages and no perspective */
}
{
/* create routes for classes that have only info pages and no perspective */
}
<
Route
<
Route
path
=
{
`/collections/page/:id`
}
path
=
{
`/collections/page/:id`
}
...
...
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