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

CB-5414 Import table - wrong description for canceled import #2821

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no need to do something here cause it is handled here. message about cancelation and other statuses provided by server added automatically by controller.reject and ProcessNotificationController
Снимок экрана 2024-08-05 в 11 38 46

}

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...'],
];
Loading