Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ public async Task<IActionResult> GetDevIdDetails(int resourceVersionId)
public async Task<IActionResult> UpdateDevIdDetails(ResourceVersionDevIdViewModel model)
{
var message = string.Empty;
if (await this.resourceService.DoesDevIdExistsAsync(model.DevId))
if (string.IsNullOrEmpty(model.DevId))
{
message = "Enter a Dev id for the resource";
}
else if (await this.resourceService.DoesDevIdExistsAsync(model.DevId))
{
message = "Duplicate";
}
Expand Down
10 changes: 8 additions & 2 deletions AdminUI/LearningHub.Nhs.AdminUI/Views/Resource/Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -651,13 +651,19 @@
{
<!-- Alert Text -->
<div class="d-flex ml-5 my-2">
<div id="alertInfo" class="alert alert-success">Successfully updated the details</div>
<div id="alertInfo" class="alert alert-success">Successfully added the Dev ID.</div>
</div>
}
@if (this.ViewBag.Status == "Duplicate")
{
<div class="d-flex ml-5 my-2">
<div id="alertInfo" class="alert alert-danger">Dev Id already exists.</div>
<div id="alertInfo" class="alert alert-danger">Dev ID already exists.</div>
</div>
}
else if (this.ViewBag.Status == "Enter a Dev id for the resource")
{
<div class="d-flex ml-5 my-2">
<div id="alertInfo" class="alert alert-danger">You must enter a Dev ID.</div>
</div>
}
<div id="devIdDetails" class="pl-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,23 @@
<form asp-controller="Resource" asp-action="UpdateDevIdDetails" method="post">
<div class="row m-0">
<div class="form-group col-4">
<label asp-for="DevId" class="control-label">Development Id</label>
<input asp-for="DevId" class="form-control" />
<div class="col-12" style="padding-left:0px;" >
<dl>
<dt>Dev ID: </dt>
<dd>
@Html.DisplayFor(model => model.DevId)
</dd>
</dl>
</div>
<label asp-for="DevId" class="control-label">Add Dev ID</label>
<input asp-for="DevId" class="form-control" maxlength="30" />
<input type="hidden" asp-for="ResourceVersionId" />
</div>
</div>
<div class="form-group col-lg-2 d-flex flex-row justify-content-between">
<div>
<button type="submit" class="btn btn-common btn-success">Save</button>
</div>
<button type="submit" class="btn btn-common btn-success nhsuk-button">Save</button>
</div>
</div>
</form>
</div>
Loading