Skip to content

Commit

Permalink
Merge branch 'devel' into chore/cb-5333/update-npm-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-anton-t authored Aug 6, 2024
2 parents a3c8dc6 + ffee7a1 commit 2fcd658
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion webapp/packages/plugin-data-import/src/DataImportService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@ export class DataImportService {
async importData(connectionId: string, contextId: string, projectId: string, resultsId: string, processorId: string, file: File) {
const abortController = new AbortController();
let cancelImplementation: (() => void | Promise<void>) | null;
let isCancelled = false;

function cancel() {
cancelImplementation?.();
if (!cancelImplementation) {
return;
}

cancelImplementation();
isCancelled = true;
}

const { controller, notification } = this.notificationService.processNotification(
Expand All @@ -65,6 +71,10 @@ export class DataImportService {
processorId,
file,
event => {
if (isCancelled) {
return;
}

if (event.total !== undefined) {
const percentCompleted = getProgressPercent(event.loaded, event.total);

Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-data-import/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export default [
['plugin_data_import_title', 'Importation de données'],
['plugin_data_import_process_title', 'Importation des données...'],
['plugin_data_import_process_success', 'Données importées avec succès'],
['plugin_data_import_process_fail', 'Échec de l\'importation des données'],
['plugin_data_import_process_fail', "Échec de l'importation des données"],
['plugin_data_import_process_file_processing_step_message', 'Fichier téléchargé, en cours de traitement...'],
];

0 comments on commit 2fcd658

Please sign in to comment.