Skip to content

Commit

Permalink
feat(openalex): add 2 buttons for improve filter
Browse files Browse the repository at this point in the history
  • Loading branch information
jerem1508 committed Nov 15, 2024
1 parent 7a2de47 commit 27ff010
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
14 changes: 12 additions & 2 deletions client/src/pages/openalex-ror/results/list-view.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Col, Link, Row, Tag, Text } from '@dataesr/dsfr-plus';
import { Button, Col, Link, Row, Tag, Text } from '@dataesr/dsfr-plus';
import { useState } from 'react';

import WorksList from '../components/works-list';
Expand All @@ -9,6 +9,7 @@ export default function ListView({
selectedOpenAlex,
allAffiliations,
highlightRor,
setFilteredAffiliationName,
}) {
const defineRorColor = [];
const dsColors = ['green-tilleul-verveine', 'green-bourgeon', 'green-emeraude', 'green-menthe',
Expand Down Expand Up @@ -42,7 +43,10 @@ export default function ListView({
<li key={affiliation.key}>
<Row>
<Col md={1}>
<input type="checkbox" id={`affiliation-${affiliation.key}`} />
<input
id={`affiliation-${affiliation.key}`}
type="checkbox"
/>
</Col>
<Col md={9}>
<Text as="label" htmlFor={`affiliation-${affiliation.key}`}>
Expand Down Expand Up @@ -72,6 +76,12 @@ export default function ListView({
<img src={`https://flagsapi.com/${ror.rorCountry}/flat/48.png`} alt={`${ror.rorCountry} flag`} />
<br />
{ror.rorName}
<br />
<Button
onClick={() => setFilteredAffiliationName(ror.rorId)}
>
Filter on this id
</Button>
</div>
</>
))}
Expand Down
9 changes: 9 additions & 0 deletions client/src/pages/openalex-ror/results/views-selector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ export default function OpenalexView({
}}
value={filteredAffiliationName}
/>
<Button
className=" fr-ml-1w "
icon="delete-line"
onClick={() => setFilteredAffiliationName('')}
size="sm"
variant="text"
/>

</Col>
<Col xs={2}>
<span className="fr-checkbox-group fr-mt-2w">
Expand Down Expand Up @@ -119,6 +127,7 @@ export default function OpenalexView({
onRowEditComplete={onRowEditComplete}
setSelectedOpenAlex={setSelectedOpenAlex}
selectedOpenAlex={selectedOpenAlex}
setFilteredAffiliationName={setFilteredAffiliationName}
allAffiliations={allAffiliations}
highlightRor={highlightRor}
/>
Expand Down

0 comments on commit 27ff010

Please sign in to comment.