Skip to content

Commit

Permalink
fix(publications): Restore previous work
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Feb 7, 2025
1 parent ab1297d commit 370d4e5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/src/pages/actions/actionsAffiliations.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function ActionsAffiliations({
<File
accept=".json"
label="Restore affiliations from saved file"
onChange={(e) => { onImport(e); }}
onChange={(e) => onImport(e)}
/>
</Col>
</Row>
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/datasets/datasetsTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default function DatasetsTab({
className={`selected-item ${selectedDatasets.length && 'selected'}`}
>
<span className="number">{selectedDatasets.length}</span>
{`selected dataset${selectedDatasets.length === 1 ? '' : 's'}`}
{` selected dataset${selectedDatasets.length === 1 ? '' : 's'}`}
</div>
{renderButtons(selectedDatasets, tagDatasets)}
<div className="text-right">
Expand Down
5 changes: 1 addition & 4 deletions client/src/pages/publications/results.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ export default function Affiliations() {
affiliations
.map((affiliation) => {
if (affiliationIds.includes(affiliation.id)) {
return ({
...affiliation,
status: action,
});
affiliation.status = action;
}
return affiliation;
}),
Expand Down
2 changes: 1 addition & 1 deletion server/src/utils/works.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const mergePublications = (publication1, publication2) => {
: publication1;
return ({
...priorityPublication,
affiliations: [...new Set([...publication1.affiliations || [], ...publication2.affiliations])].filter((aff) => aff.length > 0),
affiliations: [...new Set([...publication1?.affiliations ?? [], ...publication2?.affiliations ?? []])].filter((aff) => aff.length > 0),
// Filter allIds by unique values
allIds: Object.values([...publication1.allIds, ...publication2.allIds].reduce((acc, obj) => ({ ...acc, [obj.id_value]: obj }), {})),
// Filter authors by unique
Expand Down

0 comments on commit 370d4e5

Please sign in to comment.