From ad66002e7310effc57fb090e813777679106367c Mon Sep 17 00:00:00 2001 From: Cristina Aurrecoechea Date: Fri, 15 Nov 2024 15:19:36 -0500 Subject: [PATCH 1/3] ortho 7 banners for prod and beta --- .../src/components/Announcements.jsx | 92 ++++++++++++++----- 1 file changed, 69 insertions(+), 23 deletions(-) diff --git a/packages/libs/web-common/src/components/Announcements.jsx b/packages/libs/web-common/src/components/Announcements.jsx index f85f18de55..0d50518a1c 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' || From e4cdeaf6f60cdc8708823de5b05071bf11a78f62 Mon Sep 17 00:00:00 2001 From: Dave Falke Date: Fri, 15 Nov 2024 16:55:51 -0500 Subject: [PATCH 2/3] Fix login links in user menu --- .../web-common/src/App/UserMenu/UserMenu.jsx | 20 +++++++++++++++---- .../web-common/src/App/UserMenu/UserMenu.scss | 6 +++++- 2 files changed, 21 insertions(+), 5 deletions(-) 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, From fc9bedad8908638ea074fb04ad54593335cc4a3b Mon Sep 17 00:00:00 2001 From: Dave Falke Date: Mon, 18 Nov 2024 09:59:46 -0500 Subject: [PATCH 3/3] Add rel=noreferrer to circumvent redirect logic --- packages/libs/web-common/src/components/Announcements.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/libs/web-common/src/components/Announcements.jsx b/packages/libs/web-common/src/components/Announcements.jsx index 0d50518a1c..dbe46ca981 100644 --- a/packages/libs/web-common/src/components/Announcements.jsx +++ b/packages/libs/web-common/src/components/Announcements.jsx @@ -121,7 +121,7 @@ const siteAnnouncements = [ full tutorial here . While we transition to making this beta site permanent,{' '} - + OrthoMCL 6_21 {' '} is still available.