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

Export references #392

Merged
merged 2 commits into from
Aug 22, 2023
Merged

Export references #392

merged 2 commits into from
Aug 22, 2023

Conversation

sehyod
Copy link
Collaborator

@sehyod sehyod commented Aug 22, 2023

This adds the function to exports the entire list of references as a .bib file. Clicking on the button opens a dialog to choose where the file should be saved (defaulting to the exports folder of the project)
When no reference has been ingested, the button is disabled

Closes #345

@sehyod sehyod requested a review from cguedes August 22, 2023 14:20
@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Merging #392 (235e8ad) into main (a1c7f9e) will decrease coverage by 0.45%.
Report is 1 commits behind head on main.
The diff coverage is 57.89%.

@@            Coverage Diff             @@
##             main     #392      +/-   ##
==========================================
- Coverage   84.16%   83.72%   -0.45%     
==========================================
  Files         175      159      -16     
  Lines       10016     9149     -867     
  Branches     1101     1103       +2     
==========================================
- Hits         8430     7660     -770     
+ Misses       1575     1478      -97     
  Partials       11       11              
Files Changed Coverage Δ
src/io/filesystem.ts 75.17% <11.11%> (-4.37%) ⬇️
src/components/PanelSection.tsx 100.00% <100.00%> (ø)
...rc/features/references/sidebar/ReferencesPanel.tsx 98.36% <100.00%> (ø)
src/wrappers/EventsListener.tsx 100.00% <100.00%> (ø)

... and 16 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -335,6 +337,31 @@ export async function renameFile(relativePath: string, newName: string): RenameF
}
type RenameFileResult = Promise<{ success: false } | { success: true; newPath: string }>;

export async function exportReferences(references: ReferenceItem[]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you need to add this to the __mocks__/filesystem.ts

@cguedes cguedes merged commit 9056422 into main Aug 22, 2023
8 of 11 checks passed
@cguedes cguedes deleted the 345-export-references branch August 22, 2023 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export references as .bib
2 participants