Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-web
ensembl-client
Commits
70b6a440
Unverified
Commit
70b6a440
authored
Feb 09, 2021
by
Andrey Azov
Committed by
GitHub
Feb 09, 2021
Browse files
Enable Entity Viewer in production (#449)
parent
20f5c8fa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
79 deletions
+17
-79
src/ensembl/src/content/app/browser/browser-app-bar/BrowserAppBar.tsx
...src/content/app/browser/browser-app-bar/BrowserAppBar.tsx
+1
-1
src/ensembl/src/content/app/browser/zmenu/ZmenuAppLinks.tsx
src/ensembl/src/content/app/browser/zmenu/ZmenuAppLinks.tsx
+0
-4
src/ensembl/src/content/app/species/components/species-main-view/SpeciesMainViewStats.tsx
...ies/components/species-main-view/SpeciesMainViewStats.tsx
+0
-14
src/ensembl/src/content/home/components/homepage-app-links/HomepageAppLinks.tsx
...t/home/components/homepage-app-links/HomepageAppLinks.tsx
+15
-54
src/ensembl/src/header/launchbar/Launchbar.tsx
src/ensembl/src/header/launchbar/Launchbar.tsx
+1
-6
No files found.
src/ensembl/src/content/app/browser/browser-app-bar/BrowserAppBar.tsx
View file @
70b6a440
...
...
@@ -66,7 +66,7 @@ const BrowserAppBar = (props: BrowserAppBarProps) => {
<
AppBar
appName
=
{
AppName
.
GENOME_BROWSER
}
mainContent
=
{
wrappedSpecies
}
aside
=
{
<
HelpPopupButton
slug
=
"
using-the-
genome-browser"
/>
}
aside
=
{
<
HelpPopupButton
slug
=
"genome-browser"
/>
}
/>
);
};
...
...
src/ensembl/src/content/app/browser/zmenu/ZmenuAppLinks.tsx
View file @
70b6a440
...
...
@@ -18,7 +18,6 @@ import React from 'react';
import
{
connect
}
from
'
react-redux
'
;
import
{
push
}
from
'
connected-react-router
'
;
import
{
isEnvironment
,
Environment
}
from
'
src/shared/helpers/environment
'
;
import
*
as
urlFor
from
'
src/shared/helpers/urlHelper
'
;
import
{
parseFeatureId
}
from
'
src/content/app/browser/browserHelper
'
;
import
{
buildFocusIdForUrl
}
from
'
src/shared/state/ens-object/ensObjectHelpers
'
;
...
...
@@ -45,9 +44,6 @@ type Props = {
};
const
ZmenuAppLinks
=
(
props
:
Props
)
=>
{
if
(
!
isEnvironment
([
Environment
.
DEVELOPMENT
,
Environment
.
INTERNAL
]))
{
return
null
;
}
const
parsedFeatureId
=
parseFeatureId
(
props
.
featureId
);
if
(
parsedFeatureId
.
type
!==
'
gene
'
)
{
...
...
src/ensembl/src/content/app/species/components/species-main-view/SpeciesMainViewStats.tsx
View file @
70b6a440
...
...
@@ -17,12 +17,10 @@
import
React
,
{
useEffect
,
ReactNode
}
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
classNames
from
'
classnames
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
ViewInAppPopup
from
'
src/shared/components/view-in-app-popup/ViewInAppPopup
'
;
import
SpeciesStats
from
'
src/content/app/species/components/species-stats/SpeciesStats
'
;
import
ExpandableSection
from
'
src/shared/components/expandable-section/ExpandableSection
'
;
import
{
isEnvironment
,
Environment
}
from
'
src/shared/helpers/environment
'
;
import
{
getActiveGenomeId
,
...
...
@@ -66,18 +64,6 @@ type ExampleLinkPopupProps = {
};
const
ExampleLinkWithPopup
=
(
props
:
ExampleLinkPopupProps
)
=>
{
const
isProduction
=
isEnvironment
([
Environment
.
PRODUCTION
]);
if
(
isProduction
)
{
const
linkToGenomeBrowser
=
props
.
links
?.
genomeBrowser
;
return
linkToGenomeBrowser
?
(
<
div
className
=
{
styles
.
exampleLink
}
>
<
Link
to
=
{
linkToGenomeBrowser
}
>
{
props
.
children
}
</
Link
>
</
div
>
)
:
null
;
}
return
(
<
div
className
=
{
styles
.
exampleLink
}
>
<
ViewInAppPopup
links
=
{
props
.
links
}
>
...
...
src/ensembl/src/content/home/components/homepage-app-links/HomepageAppLinks.tsx
View file @
70b6a440
...
...
@@ -14,13 +14,11 @@
* limitations under the License.
*/
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'
react
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
React
,
{
useState
,
useRef
}
from
'
react
'
;
import
{
connect
,
useDispatch
}
from
'
react-redux
'
;
import
{
push
}
from
'
connected-react-router
'
;
import
classNames
from
'
classnames
'
;
import
{
isEnvironment
,
Environment
}
from
'
src/shared/helpers/environment
'
;
import
*
as
urlFor
from
'
src/shared/helpers/urlHelper
'
;
import
useOutsideClick
from
'
src/shared/hooks/useOutsideClick
'
;
...
...
@@ -66,24 +64,20 @@ const HomepageAppLinks = (props: Props) => {
}
};
if
(
isEnvironment
([
Environment
.
DEVELOPMENT
,
Environment
.
INTERNAL
]))
{
const
links
=
props
.
species
.
map
((
species
,
index
)
=>
(
<
HomepageAppLinksRow
key
=
{
species
.
genome_id
}
species
=
{
species
}
isExpanded
=
{
expandedRowIndex
===
index
}
toggleExpand
=
{
()
=>
onToggleRow
(
index
)
}
/>
));
return
(
<
section
className
=
{
styles
.
homepageAppLinks
}
>
<
h2
>
Previously viewed
</
h2
>
{
links
}
</
section
>
);
}
else
{
return
<
PreviouslyViewedLinks
{
...
props
}
/>;
}
const
links
=
props
.
species
.
map
((
species
,
index
)
=>
(
<
HomepageAppLinksRow
key
=
{
species
.
genome_id
}
species
=
{
species
}
isExpanded
=
{
expandedRowIndex
===
index
}
toggleExpand
=
{
()
=>
onToggleRow
(
index
)
}
/>
));
return
(
<
section
className
=
{
styles
.
homepageAppLinks
}
>
<
h2
>
Previously viewed
</
h2
>
{
links
}
</
section
>
);
};
const
HomepageAppLinksRow
=
(
props
:
HomepageAppLinksRowProps
)
=>
{
...
...
@@ -140,39 +134,6 @@ const HomepageAppLinksRow = (props: HomepageAppLinksRowProps) => {
);
};
// Legacy component that stays there until we have a presentable EntityViewer
const
PreviouslyViewedLinks
=
(
props
:
Props
)
=>
{
useEffect
(()
=>
{
props
.
fetchDataForLastVisitedObjects
();
},
[]);
if
(
!
props
.
species
.
length
||
props
.
previouslyViewedGenomeBrowserObjects
.
areLoading
)
{
return
null
;
}
const
previouslyViewedLinks
=
props
.
previouslyViewedGenomeBrowserObjects
.
objects
.
map
(
(
object
,
index
)
=>
(
<
div
key
=
{
index
}
className
=
{
styles
.
previouslyViewedItem
}
>
<
Link
to
=
{
object
.
link
}
>
{
object
.
speciesName
}
</
Link
>
<
span
className
=
{
styles
.
previouslyViewedItemAssemblyName
}
>
{
'
'
}
{
object
.
assemblyName
}
</
span
>
</
div
>
)
);
return
(
<
section
className
=
{
styles
.
previouslyViewed
}
>
<
h2
>
Previously viewed
</
h2
>
{
previouslyViewedLinks
}
</
section
>
);
};
const
mapStateToProps
=
(
state
:
RootState
)
=>
({
species
:
getEnabledCommittedSpecies
(
state
),
previouslyViewedGenomeBrowserObjects
:
getPreviouslyViewedGenomeBrowserObjects
(
...
...
src/ensembl/src/header/launchbar/Launchbar.tsx
View file @
70b6a440
...
...
@@ -71,12 +71,7 @@ const Launchbar = (props: LaunchbarProps) => {
app
=
"entity-viewer"
description
=
"Entity Viewer"
icon
=
{
EntityViewerIcon
}
enabled
=
{
isEnvironment
([
Environment
.
DEVELOPMENT
,
Environment
.
INTERNAL
])
&&
props
.
committedSpecies
.
length
>
0
}
enabled
=
{
props
.
committedSpecies
.
length
>
0
}
/>
</
div
>
<
div
className
=
{
styles
.
category
}
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment