Skip to content

Commit

Permalink
Merge branch 'main' into wdk-record-page-perisistence
Browse files Browse the repository at this point in the history
  • Loading branch information
dmfalke authored Nov 18, 2024
2 parents 8976af1 + fc9beda commit dd3000c
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 28 deletions.
20 changes: 16 additions & 4 deletions packages/libs/web-common/src/App/UserMenu/UserMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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',
Expand All @@ -36,16 +39,25 @@ class UserMenu extends React.Component {
{
icon: 'power-off',
text: 'Log Out',
route: '/user/logout',
onClick: () => actions.showLogoutWarning(),
},
];

return (
<div className="UserMenu-Pane">
{items.map((item, key) => {
const { route, target } = item;
const { route, target, onClick } = item;
const className = 'UserMenu-Pane-Item';

if (onClick) {
return (
<button type="button" className={className} onClick={onClick}>
<Icon fa={item.icon + ' UserMenu-Pane-Item-Icon'} />
{item.text}
</button>
);
}

return (
<Link key={key} className={className} to={route} target={target}>
<Icon fa={item.icon + ' UserMenu-Pane-Item-Icon'} />
Expand Down
6 changes: 5 additions & 1 deletion packages/libs/web-common/src/App/UserMenu/UserMenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $white: #e0e0e0;
}

.UserMenu-Pane {
transition: opacity 500ms 500ms;
transition: opacity 1s 500ms;
opacity: 0;
pointer-events: none;

Expand Down Expand Up @@ -65,6 +65,10 @@ $white: #e0e0e0;
transform: rotateZ(45deg);
background-color: #e0e0e0;
}
button.UserMenu-Pane-Item {
background: transparent;
border: none;
}
.UserMenu-Pane-Item {
&,
&:link,
Expand Down
92 changes: 69 additions & 23 deletions packages/libs/web-common/src/components/Announcements.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div key="live-beta">
Welcome to {props.displayName} <i>beta</i> where you will find the newest versions of our interface, features, tools and data.
While we transition to making this beta site permanent, <a target="_blank" href={`https://legacy.${props.projectId.toLowerCase()}.${props.projectId === 'SchistoDB' ? 'net' : 'org'}`}>
legacy.{props.projectId.toLowerCase()}.org</a> is still available.
Here is a <a target="_blank" href="https://upenn.co1.qualtrics.com/jfe/form/SV_9N2RTXq7ljpZnDv">form for sending your feedback</a> on the beta sites.

{
id: 'ortho-live',
renderDisplay: (props) => {
if (props.projectId == 'OrthoMCL' && props.buildNumber == '6.21')
return (
<div key="ortho621">
Visit the new{' '}
<a target="_blank" href="https://beta.orthomcl.org">
<b>OrthoMCL 7 beta</b>
</a>{' '}
with OrthoFinder clustering, Similar Groups, and Phylogenetic Trees!
<a
target="_blank"
href="https://qa.static-content.veupathdb.org/documents/Read_more_Ortho7_new.pdf"
>
{' '}
Read more about the new features
</a>
, and see a{' '}
<a
target="_blank"
href="https://qa.static-content.veupathdb.org/documents/Ortho7_basic_functionality_tutorial.pdf"
>
{' '}
full tutorial here
</a>
.
</div>
)
else return (
<div key="live-beta">
Welcome to {props.displayName} <i>beta</i> where you will find the newest versions of our interface, features, tools and data.
While we transition to making this beta site permanent, <a target="_blank" href={`https://legacy.${props.projectId.toLowerCase()}.${props.projectId === 'SchistoDB' ? 'net' : 'org'}`}>
legacy.{props.projectId.toLowerCase()}.org</a> is still available (to be retired March 2nd).
Here is a <a target="_blank" href="https://upenn.co1.qualtrics.com/jfe/form/SV_9N2RTXq7ljpZnDv">form for sending your feedback</a> on the beta sites.
</div>
)
}
}
);
},
},

{
id: 'ortho-beta',
renderDisplay: (props) => {
if (props.projectId == 'OrthoMCL' && props.buildNumber == '7.0')
return (
<div key="ortho7">
Welcome to <b>OrthoMCL 7 beta</b> with OrthoFinder clustering,
Similar Groups, and Phylogenetic Trees!
<a
target="_blank"
href="https://qa.static-content.veupathdb.org/documents/Read_more_Ortho7_new.pdf"
>
{' '}
Read more about the new features
</a>
, and see a{' '}
<a
target="_blank"
href="https://qa.static-content.veupathdb.org/documents/Ortho7_basic_functionality_tutorial.pdf"
>
{' '}
full tutorial here
</a>
. While we transition to making this beta site permanent,{' '}
<a target="_blank" rel="noreferrer" href="https://orthomcl.org">
OrthoMCL 6_21
</a>{' '}
is still available.
</div>
);
},
},
*/

/*
{
Expand Down Expand Up @@ -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' ||
Expand Down

0 comments on commit dd3000c

Please sign in to comment.