Skip to content

Commit e8a60eb

Browse files
authored
Merge pull request #25 from TechnologyEnhancedLearning/Develop/Fixes/TD-2217
TD-2217 Update radio list view component
2 parents fd54a81 + 143b3e6 commit e8a60eb

File tree

2 files changed

+33
-29
lines changed

2 files changed

+33
-29
lines changed

.github/workflows/continuous-integration-workflow.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ jobs:
77
SOLUTION: 'NHSUKViewComponents.sln'
88
name: Build and publish package
99
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
1012
strategy:
1113
matrix:
1214
dotnet-version: ['3.1.x']
@@ -39,7 +41,9 @@ jobs:
3941
- name: Add Azure artifact
4042
run: dotnet nuget add source 'https://pkgs.dev.azure.com/e-LfH/_packaging/LearningHubFeed/nuget/v3/index.json' --name 'LearningHubFeed' --username 'kevin.whittaker' --password ${{ secrets.AZUREDEVOPSKEY }} --store-password-in-clear-text
4143

42-
44+
- name: Add github registry
45+
run: dotnet nuget add source --username 'kevin.whittaker' --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name githubPackages "https://nuget.pkg.github.com/TechnologyEnhancedLearning/index.json"
46+
4347
- name: Dotnet build
4448
run: dotnet build NHSUKViewComponents.sln --configuration release
4549

@@ -48,7 +52,7 @@ jobs:
4852

4953
- name: Push generated package to GitHub registry
5054
if: startsWith(github.ref, 'refs/tags/v')
51-
run: dotnet nuget push ./package/*.nupkg --source https://nuget.pkg.github.com/TechnologyEnhancedLearning/index.json --api-key ${{ secrets.NUGETAPIKEY }} --skip-duplicate
55+
run: dotnet nuget push ./package/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "githubPackages" --skip-duplicate
5256

5357
- name: Push generated package to Azure Feed
5458
if: startsWith(github.ref, 'refs/tags/v')

NHSUKViewComponents.Web/Views/Shared/Components/RadioList/Default.cshtml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@model RadiosViewModel
55
@{
66
int counter = 0;
7-
7+
88
}
99

1010
<div class="nhsuk-form-group @(Model.HasError ? "nhsuk-form-group--error" : "")">
@@ -60,14 +60,14 @@
6060
<div class="@Model.Class">
6161
<div class="nhsuk-radios__item">
6262
<input class="nhsuk-radios__input"
63-
id="@radioId"
64-
name="@Model.AspFor"
65-
type="radio"
66-
value="@radio.Value"
67-
aria-describedby="@radio.Value-item-hint"
68-
data-val-required="@(Model.Required ? Model.RequiredClientSideErrorMessage : "" )"
69-
data-val="@(Model.Required ? "true" : "false" )"
70-
@(radio.Selected ? "checked" : string.Empty) />
63+
id="@radioId"
64+
name="@Model.AspFor"
65+
type="radio"
66+
value="@radio.Value"
67+
aria-describedby="@(!string.IsNullOrEmpty(radio.HintText) ? $"{radio.Value}-item-hint" : string.Empty)"
68+
data-val-required="@(Model.Required ? Model.RequiredClientSideErrorMessage : "")"
69+
data-val="@(Model.Required ? "true" : "false")"
70+
@(radio.Selected ? "checked" : string.Empty) />
7171
<label class="nhsuk-label nhsuk-radios__label" for="@radioId">
7272
@radio.Label
7373
</label>
@@ -84,14 +84,14 @@
8484
{
8585
<div class="nhsuk-radios__item">
8686
<input class="nhsuk-radios__input"
87-
id="@radioId"
88-
name="@Model.AspFor"
89-
type="radio"
90-
value="@radio.Value"
91-
aria-describedby="@radio.Value-item-hint"
92-
data-val-required="@(Model.Required ? Model.RequiredClientSideErrorMessage : "" )"
93-
data-val="@(Model.Required ? "true" : "false" )"
94-
@(radio.Selected ? "checked" : string.Empty) />
87+
id="@radioId"
88+
name="@Model.AspFor"
89+
type="radio"
90+
value="@radio.Value"
91+
aria-describedby="@(!string.IsNullOrEmpty(radio.HintText) ? $"{radio.Value}-item-hint" : string.Empty)"
92+
data-val-required="@(Model.Required ? Model.RequiredClientSideErrorMessage : "")"
93+
data-val="@(Model.Required ? "true" : "false")"
94+
@(radio.Selected ? "checked" : string.Empty) />
9595
<label class="nhsuk-label nhsuk-radios__label" for="@radioId">
9696
@radio.Label
9797
</label>
@@ -105,20 +105,20 @@
105105
}
106106

107107
}
108-
@if(Model.OptionalRadio != null)
108+
@if (Model.OptionalRadio != null)
109109
{
110110
<div class="nhsuk-radios__divider nhsuk-u-padding-left-2">or</div>
111111
var radioId = $"{Model.OptionalRadio.Value}-{++counter}";
112112
<div class="nhsuk-radios__item">
113113
<input class="nhsuk-radios__input"
114-
id="@radioId"
115-
name="@Model.AspFor"
116-
type="radio"
117-
value="@Model.OptionalRadio.Value"
118-
aria-describedby="@Model.OptionalRadio.Value-item-hint"
119-
data-val-required="@(Model.Required ? Model.RequiredClientSideErrorMessage : "" )"
120-
data-val="@(Model.Required ? "true" : "false" )"
121-
@(Model.OptionalRadio.Selected ? "checked" : string.Empty) />
114+
id="@radioId"
115+
name="@Model.AspFor"
116+
type="radio"
117+
value="@Model.OptionalRadio.Value"
118+
aria-describedby="@(!string.IsNullOrEmpty(Model.OptionalRadio.HintText) ? $"{Model.OptionalRadio.Value}-item-hint" : string.Empty)"
119+
data-val-required="@(Model.Required ? Model.RequiredClientSideErrorMessage : "")"
120+
data-val="@(Model.Required ? "true" : "false")"
121+
@(Model.OptionalRadio.Selected ? "checked" : string.Empty) />
122122
<label class="nhsuk-label nhsuk-radios__label" for="@radioId">
123123
@Model.OptionalRadio.Label
124124
</label>
@@ -134,4 +134,4 @@
134134
</div>
135135
</fieldset>
136136

137-
</div>
137+
</div>

0 commit comments

Comments
 (0)