Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

srt new icon refs to #52746 #594

Merged
merged 4 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions packages/libs/wdk-client/src/Components/Icon/WdkStatusIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { useWdkService } from '../../Hooks/WdkServiceHook';
import NewFeatureImage from '../../Core/Style/images/new-feature.png';

type Props = {
buildIntroduced?: string;
marginOverride?: React.CSSProperties['margin'];
};

// Component name is generic enough to be expanded into rendering other status icons, like Beta
export function WdkStatusIcon({
buildIntroduced,
marginOverride = '0 5px',
}: Props) {
const currentBuild = useWdkService(
async (wdkService) =>
await wdkService.getConfig().then((config) => config.buildNumber)
);
const image =
currentBuild === buildIntroduced
? { src: NewFeatureImage, alt: 'New' }
: undefined;
return image ? (
<img alt={image.alt} src={image.src} style={{ margin: marginOverride }} />
) : null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ class RadioList extends React.Component<Props> {
return (
<ul className={className}>
{this.props.items.map((item) => (
<li key={item.value} className={item.disabled ? 'disabled' : ''}>
<li
key={item.value}
className={item.disabled ? 'disabled' : undefined}
>
<label>
<input
type="radio"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { Component } from 'react';
import { WdkStatusIcon } from '../../Components/Icon/WdkStatusIcon';
import RadioList from '../../Components/InputControls/RadioList';
import {
filterOutProps,
wrappable,
safeHtml,
} from '../../Utils/ComponentUtils';
import DownloadForm from '../../Views/ReporterForm/DownloadForm';
import PrimaryKeySpan from '../../Views/ReporterForm/PrimaryKeySpan';

let NO_REPORTER_SELECTED = '_none_';

Expand All @@ -16,8 +16,14 @@ let ReporterSelect = (props) => {
let nestedDivStyle = { display: 'inline-block', verticalAlign: 'top' };
let items = reporters.map((reporter) => ({
value: reporter.name,
display: reporter.displayName,
display: (
<>
{reporter.displayName}
<WdkStatusIcon buildIntroduced={reporter.newBuild} />
</>
),
description: reporter.description,
newBuild: reporter.newBuild,
}));
return (
<div style={{ margin: '20px 0' }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,26 +534,6 @@ const useHeaderMenuItems = (
include: [TriTrypDB],
},
},
{
key: 'plasmoap',
display: 'PlasmoAP',
type: 'reactRoute',
url: '/plasmoap',
target: '_blank',
metadata: {
include: [PlasmoDB],
},
},
/* {
key: 'pats',
display: 'PATS',
type: 'externalLink',
url: 'http://modlabcadd.ethz.ch/software/pats/',
target: '_blank',
metadata: {
include: [ PlasmoDB ]
}
},*/
{
key: 'mapveu',
display: 'MapVEu',
Expand Down Expand Up @@ -626,6 +606,33 @@ const useHeaderMenuItems = (
),
items: mapMenuItems,
},
{
key: 'ncbi-primer3',
display: 'NCBI Primer3',
type: 'externalLink',
url: 'https://www.ncbi.nlm.nih.gov/tools/primer-blast/',
target: '_blank',
},
{
key: 'plasmoap',
display: 'PlasmoAP',
type: 'reactRoute',
url: '/plasmoap',
target: '_blank',
metadata: {
include: [PlasmoDB],
},
},
/* {
key: 'pats',
display: 'PATS',
type: 'externalLink',
url: 'http://modlabcadd.ethz.ch/software/pats/',
target: '_blank',
metadata: {
include: [ PlasmoDB ]
}
},*/
{
key: 'pubcrawler',
display: 'PubMed and Entrez',
Expand Down Expand Up @@ -732,22 +739,9 @@ const useHeaderMenuItems = (
type: 'reactRoute',
url: makeStaticPageRoute('/dataInprogress.html'),
},
{
key: 'data-files-eupathdb',
display: 'Download data files',
type: 'externalLink',
url: '/common/downloads',
metadata: {
exclude: [EuPathDB],
},
},
{
key: 'data-files-eupathdb-beta',
display: (
<>
Download data files <img alt="BETA" src={betaImage} />
</>
),
display: <>Download data files</>,
type: 'reactRoute',
url: '/downloads',
metadata: {
Expand Down
Loading