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
6b0bd025
Commit
6b0bd025
authored
3 years ago
by
esikkala
Browse files
Options
Downloads
Patches
Plain Diff
Info header info icon: add tooltip
parent
d5816a02
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/client/components/main_layout/InfoHeader.js
+12
-4
12 additions, 4 deletions
src/client/components/main_layout/InfoHeader.js
src/client/translations/sampo/localeEN.json
+3
-0
3 additions, 0 deletions
src/client/translations/sampo/localeEN.json
with
15 additions
and
4 deletions
src/client/components/main_layout/InfoHeader.js
+
12
−
4
View file @
6b0bd025
...
...
@@ -9,6 +9,7 @@ import Typography from '@material-ui/core/Typography'
// import Divider from '@material-ui/core/Divider';
import
IconButton
from
'
@material-ui/core/IconButton
'
import
InfoIcon
from
'
@material-ui/icons/InfoOutlined
'
import
Tooltip
from
'
@material-ui/core/Tooltip
'
import
intl
from
'
react-intl-universal
'
const
useStyles
=
makeStyles
(
theme
=>
({
...
...
@@ -90,7 +91,12 @@ const InfoHeader = props => {
let
label
=
''
const
data
=
props
.
instanceData
const
hasData
=
data
!==
null
&&
Object
.
values
(
data
).
length
>=
1
if
(
hasData
&&
data
.
prefLabel
)
{
label
=
data
.
prefLabel
.
prefLabel
||
data
.
prefLabel
}
if
(
hasData
&&
data
.
prefLabel
)
{
if
(
Array
.
isArray
(
data
.
prefLabel
))
{
data
.
prefLabel
=
data
.
prefLabel
[
0
]
}
label
=
data
.
prefLabel
.
prefLabel
||
data
.
prefLabel
}
return
label
}
...
...
@@ -126,9 +132,11 @@ const InfoHeader = props => {
{
props
.
pageType
===
'
facetResults
'
&&
intl
.
get
(
`perspectives.
${
props
.
resultClass
}
.label`
)}
{
props
.
pageType
===
'
instancePage
'
&&
intl
.
get
(
`perspectives.
${
props
.
resultClass
}
.instancePage.label`
)}
<
/Typography
>
<
IconButton
aria
-
label
=
'
open instructions
'
className
=
{
classes
.
infoIconButton
}
onClick
=
{
handleExpandButtonOnClick
}
>
<
InfoIcon
className
=
{
classes
.
infoIcon
}
/
>
<
/IconButton
>
<
Tooltip
title
=
{
intl
.
get
(
'
infoHeader.toggleInstructions
'
)}
>
<
IconButton
aria
-
label
=
'
toggle instructions
'
className
=
{
classes
.
infoIconButton
}
onClick
=
{
handleExpandButtonOnClick
}
>
<
InfoIcon
className
=
{
classes
.
infoIcon
}
/
>
<
/IconButton
>
<
/Tooltip
>
<
/div
>
{
props
.
pageType
===
'
instancePage
'
&&
<
Typography
className
=
{
classes
.
label
}
component
=
'
h1
'
variant
=
'
h6
'
>
{
generateLabel
()}
<
/Typography>
}
...
...
This diff is collapsed.
Click to expand it.
src/client/translations/sampo/localeEN.json
+
3
−
0
View file @
6b0bd025
...
...
@@ -15,6 +15,9 @@
"selectPerspective"
:
"Select a perspective to search and browse the knowledge graph:"
,
"mainPageImageLicence"
:
"Images used under license from Shutterstock.com"
,
"backendErrorText"
:
"One of the backend services is not available at the moment. Please try again later."
,
"infoHeader"
:
{
"toggleInstructions"
:
"Click to show or hide instructions"
},
"topBar"
:
{
"feedback"
:
"feedback"
,
"info"
:
{
...
...
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