CBL Import (#1834)

* Wrote my own step tracker and added a prev button. Works up to first conflict flow.

* Everything but final import is hooked up in the UI. Polish still needed, but getting there.

* Making more progress in the CBL import flow.

* Ready for the last step

* Cleaned up some logic to prepare for the last step and reset

* Users like order to be starting at 1

* Fixed a few bugs around cbl import

* CBL import is ready for some basic testing

* Added a reading list hook on side nav

* Fixed up unit tests

* Added icons and color to the import flow

* Tweaked some phrasing

* Hooked up a loading variable but disabled the component as it didn't look good.

* Styling it up

* changed an icon to better fit

---------

Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
This commit is contained in:
Joe Milazzo 2023-03-03 16:51:11 -06:00 committed by GitHub
parent 57de661d71
commit d88a4d5d0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 1125 additions and 466 deletions

View file

@ -484,22 +484,4 @@ public class ReadingListController : BaseApiController
if (string.IsNullOrEmpty(name)) return true;
return Ok(await _unitOfWork.ReadingListRepository.ReadingListExists(name));
}
// [HttpPost("import-cbl")]
// public async Task<ActionResult<CblImportSummaryDto>> ImportCbl([FromForm(Name = "cbl")] IFormFile file, [FromForm(Name = "dryRun")] bool dryRun = false)
// {
// var userId = User.GetUserId();
// var filename = Path.GetRandomFileName();
// var outputFile = Path.Join(_directoryService.TempDirectory, filename);
//
// await using var stream = System.IO.File.Create(outputFile);
// await file.CopyToAsync(stream);
// stream.Close();
// var cbl = ReadingListService.LoadCblFromPath(outputFile);
//
// // We need to pass the temp file back
//
// var importSummary = await _readingListService.ValidateCblFile(userId, cbl);
// return importSummary.Results.Any() ? Ok(importSummary) : Ok(await _readingListService.CreateReadingListFromCbl(userId, cbl, dryRun));
// }
}