diff --git a/LeedsExperiment/Dashboard/Controllers/BrowseController.cs b/LeedsExperiment/Dashboard/Controllers/BrowseController.cs index 0507b71..3f1f16c 100644 --- a/LeedsExperiment/Dashboard/Controllers/BrowseController.cs +++ b/LeedsExperiment/Dashboard/Controllers/BrowseController.cs @@ -102,7 +102,7 @@ public async Task IndexAsync( ViewBag.Parent = "/browse/" + parentPath; - ViewBag.Result = $"Container created at path {path}"; + ViewBag.CreateResult = $"Container created at path {path}"; return View("Container", newContainer); } } \ No newline at end of file diff --git a/LeedsExperiment/Dashboard/Controllers/ImportExportController.cs b/LeedsExperiment/Dashboard/Controllers/ImportExportController.cs index 3f01970..2b7c8e5 100644 --- a/LeedsExperiment/Dashboard/Controllers/ImportExportController.cs +++ b/LeedsExperiment/Dashboard/Controllers/ImportExportController.cs @@ -78,15 +78,12 @@ public async Task ImportStartAsync( var existingAg = await preservation.GetArchivalGroup(path, null); model.ArchivalGroup = existingAg; } - else if(resourceInfo.StatusCode == 404) - { - model.NewName = name; - } - else + else if (resourceInfo.StatusCode != 404) { ViewBag.Problem = "Invalid Status code: " + resourceInfo.StatusCode; return View("ImportStart", model); } + model.Name = name; if (!string.IsNullOrWhiteSpace(source)) { // we already know where the update file are @@ -94,7 +91,7 @@ public async Task ImportStartAsync( // for ad hoc construction of an ImportJob (e.g., it's just one deletion). var importJob = await preservation.GetUpdateJob(path, source); model.ImportJob = importJob; - importJob.ArchivalGroupName = name; + importJob.ArchivalGroupName = model.ArchivalGroup?.Name ?? model.Name; return View("ImportJob", model); } // else render a view that asks for the S3 source then resubmits diff --git a/LeedsExperiment/Dashboard/Models/ImportModel.cs b/LeedsExperiment/Dashboard/Models/ImportModel.cs index ffeaac9..6277567 100644 --- a/LeedsExperiment/Dashboard/Models/ImportModel.cs +++ b/LeedsExperiment/Dashboard/Models/ImportModel.cs @@ -6,24 +6,15 @@ namespace Dashboard.Models; public class ImportModel { - public string DisplayName - { - get - { - if(ArchivalGroup == null) - { - return "[New Archival Group]"; - } - return ArchivalGroup.GetDisplayName(); - } - } + public string DisplayName => ArchivalGroup?.GetDisplayName() ?? Name!; public required string Path { get; set; } public ArchivalGroup? ArchivalGroup { get; set; } public ResourceInfo? ResourceInfo { get; set; } public ImportJob? ImportJob { get; set; } /// - /// The name to give a new ArchivalGroup on creation + /// The name to give a new Archival Group on creation, or the name of the current + /// Archival Group. /// - public string? NewName { get; internal set; } + public string? Name { get; internal set; } } diff --git a/LeedsExperiment/Dashboard/Views/Browse/Container.cshtml b/LeedsExperiment/Dashboard/Views/Browse/Container.cshtml index 6669251..7ae79c5 100644 --- a/LeedsExperiment/Dashboard/Views/Browse/Container.cshtml +++ b/LeedsExperiment/Dashboard/Views/Browse/Container.cshtml @@ -3,69 +3,99 @@ @model Fedora.Abstractions.Container
- @if(ViewBag.Result != null) + @if(ViewBag.CreateResult != null) { - } - @if (ViewBag.Problem != null) - { - + } + else + { + @if (ViewBag.Problem != null) + { + + } - + - @if (Model.Type == "RepositoryRoot") - { -

🏠 @Model.GetDisplayName()

- } - else - { - + @if (Model.Type == "RepositoryRoot") + { +

🏠 @Model.GetDisplayName()

+ } + else + { + -

📁 @Model.GetDisplayName()

- - } +

📁 @Model.GetDisplayName()

+ + } - + - @if (ViewBag.ArchivalGroupPath == null) - { -
-
- - -
- -
- } + @if (ViewBag.ArchivalGroupPath == null) + { +
+
+ + +
+ +
- @if (ViewBag.ArchivalGroupPath == null && Model.Type != "RepositoryRoot") - { -
-
- - + + + } + + @if (ViewBag.ArchivalGroupPath == null && Model.Type != "RepositoryRoot") + { + + - - - + + } } -
diff --git a/LeedsExperiment/Dashboard/Views/ImportExport/ImportJob.cshtml b/LeedsExperiment/Dashboard/Views/ImportExport/ImportJob.cshtml index fa06258..d72c3a0 100644 --- a/LeedsExperiment/Dashboard/Views/ImportExport/ImportJob.cshtml +++ b/LeedsExperiment/Dashboard/Views/ImportExport/ImportJob.cshtml @@ -20,7 +20,7 @@ @if(Model.ArchivalGroup == null) { -

This import will create a new Archival Group at @Model.Path with name @Model.NewName

+

This import will create a new Archival Group at @Model.Path with name @Model.Name

} else { @@ -40,7 +40,7 @@ Name - @(Model.ArchivalGroup?.Name ?? Model.NewName) + @(Model.ArchivalGroup?.Name ?? Model.Name) Diff duration diff --git a/LeedsExperiment/Dashboard/Views/ImportExport/ImportStart.cshtml b/LeedsExperiment/Dashboard/Views/ImportExport/ImportStart.cshtml index 4100220..3b127e8 100644 --- a/LeedsExperiment/Dashboard/Views/ImportExport/ImportStart.cshtml +++ b/LeedsExperiment/Dashboard/Views/ImportExport/ImportStart.cshtml @@ -6,7 +6,6 @@

Import 📦 - @Model.DisplayName

Path: @Model.Path

-

View storage (OCFL)

@if(Model.ArchivalGroup == null) { @@ -14,6 +13,7 @@ } else { +

View storage (OCFL)

Specify a source for updating the existing Archival Group at @Model.Path

The existing Archival Group @Model.ArchivalGroup.Name is at version @Model.ArchivalGroup.Version

} @@ -29,7 +29,7 @@ {
- +
The name of the new Archival Group
}