Skip to content

Commit 95a24a5

Browse files
committed
TD-2396: SIT fixes for the DevId implementaion.
1 parent 3772822 commit 95a24a5

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

AdminUI/LearningHub.Nhs.AdminUI/Controllers/ResourceController.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ public async Task<IActionResult> GetDevIdDetails(int resourceVersionId)
164164
public async Task<IActionResult> UpdateDevIdDetails(ResourceVersionDevIdViewModel model)
165165
{
166166
var message = string.Empty;
167-
if (await this.resourceService.DoesDevIdExistsAsync(model.DevId))
167+
if (string.IsNullOrEmpty(model.DevId))
168+
{
169+
message = "Enter a Dev id for the resource";
170+
}
171+
else if (await this.resourceService.DoesDevIdExistsAsync(model.DevId))
168172
{
169173
message = "Duplicate";
170174
}

AdminUI/LearningHub.Nhs.AdminUI/Views/Resource/Details.cshtml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,13 +651,19 @@
651651
{
652652
<!-- Alert Text -->
653653
<div class="d-flex ml-5 my-2">
654-
<div id="alertInfo" class="alert alert-success">Successfully updated the details</div>
654+
<div id="alertInfo" class="alert alert-success">Successfully added the Dev ID.</div>
655655
</div>
656656
}
657657
@if (this.ViewBag.Status == "Duplicate")
658658
{
659659
<div class="d-flex ml-5 my-2">
660-
<div id="alertInfo" class="alert alert-danger">Dev Id already exists.</div>
660+
<div id="alertInfo" class="alert alert-danger">Dev ID already exists.</div>
661+
</div>
662+
}
663+
else if (this.ViewBag.Status == "Enter a Dev id for the resource")
664+
{
665+
<div class="d-flex ml-5 my-2">
666+
<div id="alertInfo" class="alert alert-danger">You must enter a Dev ID.</div>
661667
</div>
662668
}
663669
<div id="devIdDetails" class="pl-2">

AdminUI/LearningHub.Nhs.AdminUI/Views/Resource/_DevIdDetails.cshtml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,23 @@
88
<form asp-controller="Resource" asp-action="UpdateDevIdDetails" method="post">
99
<div class="row m-0">
1010
<div class="form-group col-4">
11-
<label asp-for="DevId" class="control-label">Development Id</label>
12-
<input asp-for="DevId" class="form-control" />
11+
<div class="col-12" style="padding-left:0px;" >
12+
<dl>
13+
<dt>Dev ID: </dt>
14+
<dd>
15+
@Html.DisplayFor(model => model.DevId)
16+
</dd>
17+
</dl>
18+
</div>
19+
<label asp-for="DevId" class="control-label">Add Dev ID</label>
20+
<input asp-for="DevId" class="form-control" maxlength="30" />
1321
<input type="hidden" asp-for="ResourceVersionId" />
1422
</div>
1523
</div>
1624
<div class="form-group col-lg-2 d-flex flex-row justify-content-between">
1725
<div>
18-
<button type="submit" class="btn btn-common btn-success">Save</button>
19-
</div>
26+
<button type="submit" class="btn btn-common btn-success nhsuk-button">Save</button>
27+
</div>
2028
</div>
2129
</form>
2230
</div>

0 commit comments

Comments
 (0)