Add "export bibliography" button#145
Open
lpi-tn wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an “Export Bibliography” capability to the Sources list so users can download the bibliography for the currently displayed documents as a .ris file.
Changes:
- Added an export button with loading/disabled states to
SourcesListComponent.vue, plus client-side blob download handling. - Added
exportBibliographyAPI helper insrc/utils/fetch.tsto POST document IDs and request a blob response. - Added unit tests and updated EN/FR localisation strings for the new UI.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/fetch.ts | Adds exportBibliography POST helper returning a blob response. |
| src/utils/tests/fetch.spec.ts | Adds tests validating the export endpoint call and empty-input error. |
| src/components/SourcesListComponent.vue | Adds export button UI and browser download logic. |
| src/localisation/en.ts | Adds new translation keys for export button text/loading state. |
| src/localisation/fr.ts | Adds new translation keys for export button text/loading state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| try { | ||
| const response = await exportBibliography(documentIds.value); | ||
| const fileName = "welearn_bilbiography_export.ris"; |
Comment on lines
+194
to
+195
| export const exportBibliography = async (documentsIds: string[]) => { | ||
| if (!documentsIds.length) throw new Error('No document ids provided'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds a new "Export Bibliography" feature to the sources list, allowing users to download the bibliography for the displayed sources as a
.risfile. It introduces the necessary UI, logic, API utility, and tests to support this feature, as well as updates to English and French translations.Export Bibliography feature:
SourcesListComponent.vue, including loading state handling and disabling when no documents are available. [1] [2]exportBibliographyutility function infetch.tsto POST the selected document IDs and return the bibliography as a blob.SourcesListComponent.vue.exportBibliographyto ensure correct API usage and error handling for empty input.Localization:
en.ts) and French (fr.ts) translations with new strings for the export button and its loading state. [1] [2]