Skip to content

Commit

Permalink
fix(openalex): Change the logic behind "Remove all affiliations" button
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Dec 3, 2024
1 parent cdb6394 commit b2f840d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/components/tag-input/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const { VITE_APP_TAG_LIMIT } = import.meta.env;
const SEE_MORE_AFTER = 3;

export default function TagInput({
deletedAffiliations,
deletedTags,
getRorChildren,
hint,
Expand Down Expand Up @@ -106,7 +107,7 @@ export default function TagInput({
className="fr-ml-1w"
color="yellow-tournesol"
icon="delete-line"
onClick={() => onTagsChange([], tags)}
onClick={() => onTagsChange([], deletedAffiliations)}
size="sm"
title="Remove all affiliations"
variant="text"
Expand Down Expand Up @@ -196,6 +197,7 @@ export default function TagInput({
}

TagInput.propTypes = {
deletedAffiliations: PropTypes.arrayOf(PropTypes.string).isRequired,
deletedTags: PropTypes.arrayOf(PropTypes.object),
getRorChildren: PropTypes.bool,
hint: PropTypes.string,
Expand Down
2 changes: 2 additions & 0 deletions client/src/pages/datasets/search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ export default function DatasetsSearch() {
</Col>
<Col xs="12">
<TagInput
deletedAffiliations={deletedAffiliations}
getRorChildren={getRorChildren}
hint="Press ENTER to search for several terms / expressions. If several, an OR operator is used."
isLoading={isFetching}
Expand Down Expand Up @@ -319,6 +320,7 @@ export default function DatasetsSearch() {
<Row className="fr-pt-2w fr-pr-2w fr-pb-0 fr-pl-2w">
<Col xs="8">
<TagInput
deletedAffiliations={deletedAffiliations}
getRorChildren={getRorChildren}
hint="Press ENTER to search for several terms / expressions. If several, an OR operator is used."
isLoading={isFetching}
Expand Down
2 changes: 2 additions & 0 deletions client/src/pages/openalex-affiliations/search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ export default function OpenalexAffiliationsSearch() {
</Col>
<Col xs="12">
<TagInput
deletedAffiliations={deletedAffiliations}
getRorChildren={currentSearchParams.getRorChildren === '1'}
hint="Press ENTER to search for several terms / expressions. If several, an OR operator is used."
isLoading={isLoading}
Expand Down Expand Up @@ -299,6 +300,7 @@ export default function OpenalexAffiliationsSearch() {
<Row className="fr-pt-2w fr-pr-2w fr-pb-0 fr-pl-2w">
<Col xs="8">
<TagInput
deletedAffiliations={deletedAffiliations}
getRorChildren={currentSearchParams.getRorChildren === '1'}
hint="Press ENTER to search for several terms / expressions. If several, an OR operator is used."
isLoading={isLoading}
Expand Down
2 changes: 2 additions & 0 deletions client/src/pages/publications/search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export default function PublicationsSearch() {
</Col>
<Col xs="12">
<TagInput
deletedAffiliations={deletedAffiliations}
getRorChildren={getRorChildren}
hint="Press ENTER to search for several terms / expressions. If several, an OR operator is used."
isLoading={isFetching}
Expand Down Expand Up @@ -320,6 +321,7 @@ export default function PublicationsSearch() {
<Row className="fr-pt-2w fr-pr-2w fr-pb-0 fr-pl-2w">
<Col xs="8">
<TagInput
deletedAffiliations={deletedAffiliations}
getRorChildren={getRorChildren}
hint="Press ENTER to search for several terms / expressions. If several, an OR operator is used."
isLoading={isFetching}
Expand Down

0 comments on commit b2f840d

Please sign in to comment.