diff --git a/apps/web/src/app/tools/import-export/import.component.html b/apps/web/src/app/tools/import-export/import.component.html index ba2eb69925..15c1109654 100644 --- a/apps/web/src/app/tools/import-export/import.component.html +++ b/apps/web/src/app/tools/import-export/import.component.html @@ -291,12 +291,25 @@
+
+
+ + {{ this.fileSelected ? this.fileSelected.name : ("noFileChosen" | i18n) }} +
diff --git a/apps/web/src/app/tools/import-export/import.component.ts b/apps/web/src/app/tools/import-export/import.component.ts index 3f36223285..5c062b09fb 100644 --- a/apps/web/src/app/tools/import-export/import.component.ts +++ b/apps/web/src/app/tools/import-export/import.component.ts @@ -25,6 +25,7 @@ export class ImportComponent implements OnInit, OnDestroy { importOptions: ImportOption[]; format: ImportType = null; fileContents: string; + fileSelected: File; formPromise: Promise; loading = false; importBlockedByPolicy$ = this.policyService.policyAppliesToActiveUser$( @@ -184,6 +185,11 @@ export class ImportComponent implements OnInit, OnDestroy { }); } + setSelectedFile(event: Event) { + const fileInputEl = event.target; + this.fileSelected = fileInputEl.files.length > 0 ? fileInputEl.files[0] : null; + } + private async error(error: Error) { await Swal.fire({ heightAuto: false, diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index ce8ea7e707..2a5646424f 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -1192,6 +1192,12 @@ "selectImportFile": { "message": "Select the import file" }, + "chooseFile": { + "message": "Choose File" + }, + "noFileChosen": { + "message": "No file chosen" + }, "orCopyPasteFileContents": { "message": "or copy/paste the import file contents" },