diff --git a/packages/libs/web-common/src/App/UserMenu/UserMenu.jsx b/packages/libs/web-common/src/App/UserMenu/UserMenu.jsx index d04e25e929..5b68912c72 100644 --- a/packages/libs/web-common/src/App/UserMenu/UserMenu.jsx +++ b/packages/libs/web-common/src/App/UserMenu/UserMenu.jsx @@ -4,6 +4,7 @@ import { Link } from 'react-router-dom'; import './UserMenu.scss'; import { IconAlt as Icon } from '@veupathdb/wdk-client/lib/Components'; +import { showLogoutWarning } from '@veupathdb/wdk-client/lib/Actions/UserSessionActions'; class UserMenu extends React.Component { constructor(props) { @@ -12,13 +13,15 @@ class UserMenu extends React.Component { } renderMenu() { - const { user } = this.props; + const { user, actions } = this.props; const items = user.isGuest ? [ { icon: 'sign-in', text: 'Login', - route: '/user/login', + route: `/user/login?destination=${encodeURIComponent( + window.location + )}`, }, { icon: 'user-plus', @@ -36,16 +39,25 @@ class UserMenu extends React.Component { { icon: 'power-off', text: 'Log Out', - route: '/user/logout', + onClick: () => actions.showLogoutWarning(), }, ]; return (
{items.map((item, key) => { - const { route, target } = item; + const { route, target, onClick } = item; const className = 'UserMenu-Pane-Item'; + if (onClick) { + return ( + + ); + } + return ( diff --git a/packages/libs/web-common/src/App/UserMenu/UserMenu.scss b/packages/libs/web-common/src/App/UserMenu/UserMenu.scss index 15d5ef1ab8..9c89554bbc 100644 --- a/packages/libs/web-common/src/App/UserMenu/UserMenu.scss +++ b/packages/libs/web-common/src/App/UserMenu/UserMenu.scss @@ -33,7 +33,7 @@ $white: #e0e0e0; } .UserMenu-Pane { - transition: opacity 500ms 500ms; + transition: opacity 1s 500ms; opacity: 0; pointer-events: none; @@ -65,6 +65,10 @@ $white: #e0e0e0; transform: rotateZ(45deg); background-color: #e0e0e0; } + button.UserMenu-Pane-Item { + background: transparent; + border: none; + } .UserMenu-Pane-Item { &, &:link, diff --git a/packages/libs/web-common/src/components/Announcements.jsx b/packages/libs/web-common/src/components/Announcements.jsx index f85f18de55..dbe46ca981 100644 --- a/packages/libs/web-common/src/components/Announcements.jsx +++ b/packages/libs/web-common/src/components/Announcements.jsx @@ -64,31 +64,71 @@ const siteAnnouncements = [ } }, }, - /* - { - id: 'live-beta', - renderDisplay: props => { - if ( isGenomicHomePage(props.projectId, props.location) ) { - if (props.projectId == 'VectorBase' || props.projectId == 'OrthoMCL') return ( -
- Welcome to {props.displayName} beta where you will find the newest versions of our interface, features, tools and data. - While we transition to making this beta site permanent, - legacy.{props.projectId.toLowerCase()}.org is still available. - Here is a form for sending your feedback on the beta sites. + + { + id: 'ortho-live', + renderDisplay: (props) => { + if (props.projectId == 'OrthoMCL' && props.buildNumber == '6.21') + return ( +
+ Visit the new{' '} + + OrthoMCL 7 beta + {' '} + with OrthoFinder clustering, Similar Groups, and Phylogenetic Trees! + + {' '} + Read more about the new features + + , and see a{' '} + + {' '} + full tutorial here + + .
- ) - else return ( -
- Welcome to {props.displayName} beta where you will find the newest versions of our interface, features, tools and data. - While we transition to making this beta site permanent, - legacy.{props.projectId.toLowerCase()}.org is still available (to be retired March 2nd). - Here is a form for sending your feedback on the beta sites. -
- ) - } - } + ); + }, + }, + + { + id: 'ortho-beta', + renderDisplay: (props) => { + if (props.projectId == 'OrthoMCL' && props.buildNumber == '7.0') + return ( +
+ Welcome to OrthoMCL 7 beta with OrthoFinder clustering, + Similar Groups, and Phylogenetic Trees! + + {' '} + Read more about the new features + + , and see a{' '} + + {' '} + full tutorial here + + . While we transition to making this beta site permanent,{' '} + + OrthoMCL 6_21 + {' '} + is still available. +
+ ); + }, }, -*/ /* { @@ -1269,6 +1309,12 @@ function param(name, { search = '' }) { function isGenomicSite(projectId) { return !/ClinEpiDB|MicrobiomeDB/i.test(projectId); } +function isQASite() { + return ( + param('qa', window.location) === 'true' || + /^(qa|q1|q2)/.test(window.location.hostname) + ); +} function isBetaSite() { return ( param('beta', window.location) === 'true' ||