diff options
4 files changed, 34 insertions, 32 deletions
diff --git a/backend/api/api/Controllers/FileController.cs b/backend/api/api/Controllers/FileController.cs index 0e9f9b97..9baf6294 100644 --- a/backend/api/api/Controllers/FileController.cs +++ b/backend/api/api/Controllers/FileController.cs @@ -94,30 +94,9 @@ namespace api.Controllers return Ok(fileModel._id); } - [HttpGet("csvread/{hasHeader}/{fileId}")] - [Authorize(Roles = "User,Guest")] - public ActionResult<string> CsvRead(bool hasHeader, string fileId) - { - - string uploaderId = getUserId(); - - if (uploaderId == null) - return BadRequest(); - - //String csvContent = System.IO.File.ReadAllText(fileModel.path); - string filePath = _fileservice.GetFilePath(fileId, uploaderId); - - - - if (hasHeader) - return String.Join("\n", System.IO.File.ReadLines(filePath).Take(11)); - else - return String.Join("\n", System.IO.File.ReadLines(filePath).Take(10)); - } - [HttpGet("csvread/{hasHeader}/{fileId}/{skipRows}/{takeRows}")] [Authorize(Roles = "User,Guest")] - public ActionResult<string> CsvRead(bool hasHeader, string fileId, int skipRows, int takeRows) + public ActionResult<string> CsvRead(bool hasHeader, string fileId, int skipRows = 0, int takeRows = 10) { string uploaderId = getUserId(); diff --git a/frontend/src/app/_elements/folder/folder.component.css b/frontend/src/app/_elements/folder/folder.component.css index ce9b9fad..c90278d2 100644 --- a/frontend/src/app/_elements/folder/folder.component.css +++ b/frontend/src/app/_elements/folder/folder.component.css @@ -158,7 +158,7 @@ .file-content { width: 100%; - height: 100%; + height: 93%; position: relative; } diff --git a/frontend/src/app/_elements/form-dataset/form-dataset.component.css b/frontend/src/app/_elements/form-dataset/form-dataset.component.css index 6b3e2bed..66be7f7d 100644 --- a/frontend/src/app/_elements/form-dataset/form-dataset.component.css +++ b/frontend/src/app/_elements/form-dataset/form-dataset.component.css @@ -1,19 +1,36 @@ .folderBox { width: 100%; - height: 100%; + height: 90%; position: relative; } + +.file-container{ + margin-left: 3%; + margin-top: 3%; + margin-bottom: -50%; + width: 94%; + height: 500px; + border: 4px dotted white; + border-radius: 25px; +} +.file-container .file { + opacity: 0; + padding: 5rem; + width: 100%; + height: 100%; +} + .icon-display { position: absolute; - top: 50%; + top: 45%; left: 50%; transform: translate(-50%, -50%) scale(4); } .bottomBar { position: absolute; - bottom: 0%; + bottom: -6%; left: 5%; } diff --git a/frontend/src/app/_elements/form-dataset/form-dataset.component.html b/frontend/src/app/_elements/form-dataset/form-dataset.component.html index 50a33583..afe1aeed 100644 --- a/frontend/src/app/_elements/form-dataset/form-dataset.component.html +++ b/frontend/src/app/_elements/form-dataset/form-dataset.component.html @@ -1,12 +1,18 @@ <div class="folderBox"> - <mat-icon class="icon-display">upload</mat-icon> - <!-- - - <div class="px-5 mt-5"> - <app-datatable [tableData]="tableData"></app-datatable> + <div class="file-container"> + <div class="px-5 mt-5 "> + <!--<app-datatable [tableData]="tableData"></app-datatable>--> + </div> + <i class="material-icons-outlined icon-display">file_upload</i> + <input type="file" class="file" (change)="changeListener($event)" accept=".csv"> + + </div> - --> + + + + <div class="bottomBar"> <div class="row"> |