diff --git a/frontend/orca_data_converter/src/app/views/dashboard/dashboard.component.html b/frontend/orca_data_converter/src/app/views/dashboard/dashboard.component.html index 9134b8bf..c0186631 100644 --- a/frontend/orca_data_converter/src/app/views/dashboard/dashboard.component.html +++ b/frontend/orca_data_converter/src/app/views/dashboard/dashboard.component.html @@ -5,12 +5,12 @@

Upload your ORCA data file

-
Selected File: {{fileName}}
+

Search terms

@@ -57,7 +57,7 @@

Cycles

Data to be extracted

@@ -87,4 +83,4 @@

Lines

(click)="onSubmit()" >Download Output
- \ No newline at end of file + diff --git a/frontend/orca_data_converter/src/app/views/dashboard/dashboard.component.ts b/frontend/orca_data_converter/src/app/views/dashboard/dashboard.component.ts index 0412bc22..50cb887a 100644 --- a/frontend/orca_data_converter/src/app/views/dashboard/dashboard.component.ts +++ b/frontend/orca_data_converter/src/app/views/dashboard/dashboard.component.ts @@ -21,7 +21,7 @@ export class DashboardComponent{ fileType = 'ORCA'; fileExtension = '.txt'; - public fileName: string; + public fileName: string | undefined; selectedFile: File | null = null; //searchTerms: { term: string, cycles?: string[], data?: string[], lines?: string[] }[] = []; specify_lines: string = ''; @@ -42,12 +42,12 @@ export class DashboardComponent{ constructor(private readonly http: HttpClient) { } onFileSelected(event: any) { - this.selectedFile = event.target.files[0]; + //this.selectedFile = event.target.files[0]; // console.log("file name full:", event.target.value); // if(this.selectedFile){ // this.fileName = this.selectedFile.name; // } // Store filename for display - this.fileName = this.selectedFile ? this.selectedFile.name : ''; + //this.fileName = this.selectedFile?.name; } @@ -134,7 +134,7 @@ export class DashboardComponent{ // } onSubmit() { - if (!this.selectedFile) { + if (!this.selectedFile || !this.fileName) { alert('Please select a file.'); return; } @@ -173,5 +173,6 @@ export class DashboardComponent{ } // readonly separatorKeysCodes: number[] = [ENTER, COMMA]; + } \ No newline at end of file