From 39e78fcc2ec35659f2a54cf0674185de5b3f0bf8 Mon Sep 17 00:00:00 2001 From: Arild Matsson Date: Wed, 6 Mar 2024 12:45:52 +0100 Subject: [PATCH] Defer loading large source text, fix #29 --- CHANGELOG.md | 1 + src/api/backend.composable.ts | 2 +- src/corpus/sources/SourceText.vue | 29 ++++++++++++++++++++++++----- src/corpus/sources/SourceView.vue | 6 +++++- src/fontawesome.ts | 2 ++ src/i18n/locales/en.yaml | 1 + src/i18n/locales/sv.yaml | 1 + 7 files changed, 35 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 231f3db..11eb76b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ As this project is a user-facing application, the places in the semantic version ### Changed - Extracted the concept of a Resource as a supertype of Corpus, in preparation for adding the Metadata resource type [#145](https://github.com/spraakbanken/mink-frontend/issues/145) +- Defer loading source text if file is large [#29](https://github.com/spraakbanken/mink-frontend/issues/29) - Source text file content now look the same as log output ### Fixed diff --git a/src/api/backend.composable.ts b/src/api/backend.composable.ts index 4011f0f..8ac9de5 100644 --- a/src/api/backend.composable.ts +++ b/src/api/backend.composable.ts @@ -52,7 +52,7 @@ export default function useMinkBackend() { spin( api.downloadSourceText(corpusId, filename), t("source.downloading_plain"), - `corpus/${corpusId}/sources/${filename}`, + `corpus/${corpusId}/sources/${filename}/plain`, ); const uploadSources = ( diff --git a/src/corpus/sources/SourceText.vue b/src/corpus/sources/SourceText.vue index 778a210..91b7f62 100644 --- a/src/corpus/sources/SourceText.vue +++ b/src/corpus/sources/SourceText.vue @@ -1,24 +1,38 @@ @@ -26,7 +40,12 @@ async function download() {