From 6461d919ac3851e6f67477381083695da5d105ca Mon Sep 17 00:00:00 2001 From: Harum Helmy Date: Fri, 15 May 2020 11:56:25 -0400 Subject: [PATCH 1/4] renamed the COVID-19 disease subject tag --- src/constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants.js b/src/constants.js index 9243038..45858ca 100644 --- a/src/constants.js +++ b/src/constants.js @@ -203,7 +203,7 @@ export const DISEASES = [ { name: '2019 novel coronavirus', - alternateName: '2019-nCoV', + alternateName: 'COVID-19', priority: 'red' }, From 68faa5c3acd8dc0db56db021cc424943d208beff Mon Sep 17 00:00:00 2001 From: Harum Helmy Date: Fri, 15 May 2020 15:07:32 -0400 Subject: [PATCH 2/4] added a feature tag on to COVID-19, so that we can highlight it on the list of disease subject tags, also added styling pizzazz --- src/components/diseases.css | 6 ++++++ src/components/diseases.js | 9 +++++++++ src/constants.js | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/diseases.css b/src/components/diseases.css index 2ce8eb1..593c0bf 100644 --- a/src/components/diseases.css +++ b/src/components/diseases.css @@ -40,4 +40,10 @@ position: absolute; z-index: 10000000; } + + & .diseases__featured { + border: 1px solid var(--ruling-color); + + } } + diff --git a/src/components/diseases.js b/src/components/diseases.js index 155b36b..ffa9823 100644 --- a/src/components/diseases.js +++ b/src/components/diseases.js @@ -16,6 +16,12 @@ export default function Diseases({ onSubmit, blacklist = [] }) { const [term, setTerm] = useState(''); const [selected, setSelected] = useState(null); + const featured = useMemo(() => { + return DISEASES.filter( + subject => subject.featured + ) + }) + const options = useMemo(() => { return DISEASES.filter( subject => @@ -65,6 +71,9 @@ export default function Diseases({ onSubmit, blacklist = [] }) { className="diseases__combobox-popover" > + {featured.map(subject => ( + + ))} {sorted.map(subject => ( ))} diff --git a/src/constants.js b/src/constants.js index 45858ca..5e61050 100644 --- a/src/constants.js +++ b/src/constants.js @@ -204,7 +204,8 @@ export const DISEASES = [ { name: '2019 novel coronavirus', alternateName: 'COVID-19', - priority: 'red' + priority: 'red', + featured: true }, { From b2dcd132364a87365770b674316390afad31c49d Mon Sep 17 00:00:00 2001 From: Harum Helmy Date: Fri, 15 May 2020 15:38:01 -0400 Subject: [PATCH 3/4] Hard coded the DISEASE constants so that COVID-19 appears at the top, added some styling pizzazz to highlight it --- src/components/diseases.js | 11 +---------- src/components/facets.css | 5 +++++ src/components/facets.js | 2 +- src/constants.js | 13 ++++++------- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/components/diseases.js b/src/components/diseases.js index ffa9823..d779dcf 100644 --- a/src/components/diseases.js +++ b/src/components/diseases.js @@ -16,12 +16,6 @@ export default function Diseases({ onSubmit, blacklist = [] }) { const [term, setTerm] = useState(''); const [selected, setSelected] = useState(null); - const featured = useMemo(() => { - return DISEASES.filter( - subject => subject.featured - ) - }) - const options = useMemo(() => { return DISEASES.filter( subject => @@ -71,11 +65,8 @@ export default function Diseases({ onSubmit, blacklist = [] }) { className="diseases__combobox-popover" > - {featured.map(subject => ( - - ))} {sorted.map(subject => ( - + ))} diff --git a/src/components/facets.css b/src/components/facets.css index d073bb2..3b7835d 100644 --- a/src/components/facets.css +++ b/src/components/facets.css @@ -39,6 +39,11 @@ & input { width: 2em; } + + &-featured { + color: var(--prereview-red); + font-weight: bold; + } } } diff --git a/src/components/facets.js b/src/components/facets.js index 3801781..546bac4 100644 --- a/src/components/facets.js +++ b/src/components/facets.js @@ -176,7 +176,7 @@ export default function Facets({ counts = {}, ranges = {}, isFetching }) { isFetching || !(counts.subjectName || {})[subject.name] } label={ - + {subject.alternateName ? ( {subject.alternateName} ) : ( diff --git a/src/constants.js b/src/constants.js index 5e61050..46fd482 100644 --- a/src/constants.js +++ b/src/constants.js @@ -137,6 +137,12 @@ export const INDEXED_PREPRINT_PROPS = [ // See https://github.com/PREreview/rapid-prereview/issues/10 export const DISEASES = [ + { + name: '2019 novel coronavirus', + alternateName: 'COVID-19', + priority: 'red', + featured: true + }, { name: 'Chikungunya', priority: 'orange' @@ -201,13 +207,6 @@ export const DISEASES = [ priority: 'red' }, - { - name: '2019 novel coronavirus', - alternateName: 'COVID-19', - priority: 'red', - featured: true - }, - { name: 'Plague', priority: 'yellow' From 3040f4d7ff033f606e82df5db11a90df4292de88 Mon Sep 17 00:00:00 2001 From: Harum Helmy Date: Mon, 18 May 2020 17:55:36 -0400 Subject: [PATCH 4/4] Fixed the non-abbreviated name for COVID-19 --- src/constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants.js b/src/constants.js index 46fd482..36ba711 100644 --- a/src/constants.js +++ b/src/constants.js @@ -138,7 +138,7 @@ export const INDEXED_PREPRINT_PROPS = [ // See https://github.com/PREreview/rapid-prereview/issues/10 export const DISEASES = [ { - name: '2019 novel coronavirus', + name: 'Coronavirus disease 2019', alternateName: 'COVID-19', priority: 'red', featured: true