Skip to content

Add "export bibliography" button#145

Open
lpi-tn wants to merge 1 commit into
mainfrom
add-bilbio-button
Open

Add "export bibliography" button#145
lpi-tn wants to merge 1 commit into
mainfrom
add-bilbio-button

Conversation

@lpi-tn

@lpi-tn lpi-tn commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

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 .ris file. 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:

  • Added an "Export Bibliography" button to the sources list UI in SourcesListComponent.vue, including loading state handling and disabling when no documents are available. [1] [2]
  • Implemented the exportBibliography utility function in fetch.ts to POST the selected document IDs and return the bibliography as a blob.
  • Added logic to handle file download in the browser and error handling for the export process in SourcesListComponent.vue.
  • Created unit tests for exportBibliography to ensure correct API usage and error handling for empty input.

Localization:

  • Updated English (en.ts) and French (fr.ts) translations with new strings for the export button and its loading state. [1] [2]

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 exportBibliography API helper in src/utils/fetch.ts to 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 thread src/utils/fetch.ts
Comment on lines +194 to +195
export const exportBibliography = async (documentsIds: string[]) => {
if (!documentsIds.length) throw new Error('No document ids provided');
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.

2 participants