Skip to content

Commit 3f021d0

Browse files
authored
Merge pull request #725 from TechnologyEnhancedLearning/Develop/Fixes/TD-4080-DIG302_Placeholder-text-cannot-be-used-to-label-forms
TD-4080: DIG302: Placeholder text cannot be used to label forms
2 parents 405baeb + f89d568 commit 3f021d0

14 files changed

+62
-29
lines changed

LearningHub.Nhs.WebUI/Scripts/vuesrc/catalogue/managecatalogue.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
<div class="row">
7777
<div class="col" style="min-width:400px; width:400px;">
7878
<div class="input-group pt-4" id="input-group-searchbar-md">
79+
<label class="nhsuk-label nhsuk-u-visually-hidden" for="input-search-md">Find a user by their email address</label>
7980
<input class="form-control small pl-4" v-model="emailAddressFilter" type="search" placeholder="Find a user by their email address" aria-label="Search your learning activity" id="input-search-md" @change="loadUsers();" v-on:keyup="searchUsersKeyUp($event.keyCode)">
8081
<span class="input-group-append">
8182
<button class="btn btn-outline-secondary btn-search" type="button" name="button-search" aria-label="search" v-on:click="loadUsers()" style="margin-top: 0;">

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/Contribute.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@
4949

5050
<div class="contribute-title-wrapper lh-padding-fluid">
5151
<div class="lh-container-xl pt-20 pb-2">
52+
5253
<EditSaveFieldWithCharacterCount v-model="resourceDetails.title"
5354
addEditLabel="title"
5455
:characterLimit="255"
5556
:isH1="true"
56-
size="large"></EditSaveFieldWithCharacterCount>
57+
size="large"
58+
:inputId="title"></EditSaveFieldWithCharacterCount>
5759
</div>
5860
<h3 v-if="resourceDetails.resourceType === ResourceType.ASSESSMENT"
5961
class="pb-15 lh-container-xl">
@@ -290,6 +292,7 @@
290292
export default Vue.extend({
291293
props: {
292294
resourceVersionId: String,
295+
title: { type: String, default: 'title' },
293296
},
294297
components: {
295298
ContributeActionsBar,

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeAssessmentSettings.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353

5454
<div class="d-flex" v-if="assessmentDetails.assessmentType === AssessmentTypeEnum.Formal">
5555
<div class="selection pr-50">
56-
<div class="mb-4">Define how many attempts the learner can have.</div>
57-
<input class="text-input" type="text" v-model="assessmentDetails.maximumAttempts" />
56+
<div class="mb-4"><label for="maximumAttempts">Define how many attempts the learner can have.</label></div>
57+
<input class="text-input" type="text" id="maximumAttempts" name="maximumAttempts" v-model="assessmentDetails.maximumAttempts" />
5858
</div>
5959
<div class="tip">
6060
<h3>Tip</h3>
@@ -65,11 +65,12 @@
6565

6666
<div class="d-flex">
6767
<div class="selection pr-50">
68-
<div>Provide guidance for the learner at the end of this assessment. <i v-if="!IsVisible" class="warningTriangle fas fa-exclamation-triangle warm-yellow"></i></div>
68+
<div>Provide guidance for the learner at the end of this assessment.<i v-if="!IsVisible" class="warningTriangle fas fa-exclamation-triangle warm-yellow"></i></div>
6969
<EditSaveFieldWithCharacterCount v-model="assessmentDetails.endGuidance.blocks[0].title"
7070
addEditLabel="title"
7171
v-bind:characterLimit="60"
72-
v-bind:isH3="true" />
72+
v-bind:isH3="true"
73+
v-bind:inputId="message"/>
7374
<ckeditorwithhint v-on:blur="setEndGuidance"
7475
v-on:inputValidity="setGuidanceValidity"
7576
:maxLength="1000"
@@ -107,6 +108,7 @@
107108
props: {
108109
blockCollection: { type: Object } as PropOptions<BlockCollectionModel>,
109110
firstTimeOpen: Boolean,
111+
message: { type: String, default: 'message' },
110112
},
111113
components: {
112114
ExpansionPanel,

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeAuthorsTab.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</label>
2929
</div>
3030
<CharacterCount v-model="authorName"
31-
v-bind:inputId="authorName"
31+
v-bind:inputId="txtauthorName"
3232
v-bind:characterLimit="100"
3333
v-bind:disabled="authorIsContributor"
3434
:showTitle="false"
@@ -38,7 +38,7 @@
3838
</template>
3939
</CharacterCount>
4040
<CharacterCount v-model="authorOrganisation"
41-
v-bind:inputId="authorOrganisation"
41+
v-bind:inputId="txtauthorOrganisation"
4242
v-bind:characterLimit="100"
4343
:showTitle="false"
4444
class="mt-15">
@@ -47,7 +47,7 @@
4747
</template>
4848
</CharacterCount>
4949
<CharacterCount v-model="authorRole"
50-
v-bind:inputId="authorRole"
50+
v-bind:inputId="txtauthorRole"
5151
v-bind:characterLimit="100"
5252
:showTitle="false"
5353
class="mt-15">
@@ -86,12 +86,16 @@
8686
props: {
8787
resourceDetails: { type: Object } as PropOptions<ContributeResourceDetailModel>,
8888
configuration: { type: Object } as PropOptions<ContributeConfiguration>,
89+
txtauthorName: { type: String, default: 'authorName' },
90+
txtauthorOrganisation: { type: String, default: 'authorOrganisation' },
91+
txtauthorRole: { type: String, default: 'authorRole' },
8992
},
9093
components: {
9194
AuthorsList,
9295
Button,
9396
CharacterCount,
9497
LinkTextAndIcon,
98+
9599
},
96100
data() {
97101
return {

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeBlock.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
v-model="block.title"
2929
addEditLabel="title"
3030
:characterLimit="60"
31-
:isH3="true"></EditSaveFieldWithCharacterCount>
31+
:isH3="true"
32+
:inputId="title"></EditSaveFieldWithCharacterCount>
3233
<h3 class="my-0"
3334
v-else>
3435
{{ block.title }}
@@ -158,7 +159,8 @@
158159
enableDown: Boolean,
159160
resourceType: { type: Number } as PropOptions<ResourceType>,
160161
canBeDuplicated: Boolean,
161-
selectedToDuplicate: Boolean
162+
selectedToDuplicate: Boolean,
163+
title: { type: String, default: 'title' },
162164
},
163165
data() {
164166
return {

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeImageCarouselBlock.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="contribute-image-carousel-block">
33
<div class="contribute-image-carousel-block-description">
44
<div>
5-
<b>Description text</b>
5+
<label for="description"> <b>Description text</b></label>
66
<Tick v-bind:complete="!!imageCarouselBlock.description"></Tick>
77
<p>
88
Provide a short description for the Carousel. This will be displayed to the user in the header bar beneath the title.
@@ -13,7 +13,8 @@
1313
<EditSaveFieldWithCharacterCount v-model="imageCarouselBlock.description"
1414
addEditLabel="Description"
1515
v-bind:characterLimit="250"
16-
v-bind:isH3="true"></EditSaveFieldWithCharacterCount>
16+
v-bind:isH3="true"
17+
v-bind:inputId="description"></EditSaveFieldWithCharacterCount>
1718
</div>
1819
</div>
1920
</div>
@@ -97,6 +98,7 @@
9798
props: {
9899
imageCarouselBlock: { type: Object } as PropOptions<ImageCarouselBlockModel>,
99100
resourceType: { type: Number } as PropOptions<ResourceType>,
101+
description: { type: String, default: 'description' },
100102
},
101103
data() {
102104
return {

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeImageCarouselBlockItem.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
<EditSaveFieldWithCharacterCount v-model="block.title"
1313
addEditLabel="title"
1414
v-bind:characterLimit="60"
15-
v-bind:isH3="true"></EditSaveFieldWithCharacterCount>
15+
v-bind:isH3="true"
16+
v-bind:inputId="title"></EditSaveFieldWithCharacterCount>
1617
<Tick v-bind:complete="block.isReadyToPublish()" class="p-10"></Tick>
1718
</div>
1819
<div class="d-flex justify-content-center icon-button">
@@ -107,6 +108,7 @@ export default Vue.extend({
107108
enableUp: Boolean,
108109
enableDown: Boolean,
109110
resourceType: {type: Number} as PropOptions<ResourceType>,
111+
title: { type: String, default: 'title' },
110112
},
111113
data() {
112114
return {

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeWholeSlideImage.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
<div class="d-flex flex-grow-1">
55
<Tick :complete="wholeSlideImageItem.isReadyToPublish()"
66
class="pt-20 pl-15 pr-10"></Tick>
7-
<div class="flex-grow-1 mr-10">
7+
<div class="flex-grow-1 mr-10">
88
<EditSaveFieldWithCharacterCount v-model="wholeSlideImage.title"
99
addEditLabel="title"
1010
:characterLimit="60"
11-
:isH4="true"></EditSaveFieldWithCharacterCount>
11+
:isH4="true"
12+
:inputId="title"></EditSaveFieldWithCharacterCount>
1213
</div>
1314
</div>
1415
<div class="contribute-whole-slide-image-buttons d-flex align-items-start justify-content-end">
@@ -53,13 +54,14 @@
5354

5455
<div v-if="!wholeSlideImage.getFileModel() && !imageZone">
5556
<h3 class="flex pl-2 pt-10"
56-
v-if="showPlaceholderText">Placeholder text:</h3>
57+
v-if="showPlaceholderText"><label for="placeholder">Placeholder text:</label></h3>
5758
<div class="d-flex align-items-center">
5859
<EditSaveFieldWithCharacterCount
5960
class="flex"
6061
addEditLabel="placeholder text"
6162
v-model="wholeSlideImageItem.placeholderText"
6263
:characterLimit="500"
64+
:inputId="placeholder"
6365
@updateIsEditing="value => isEditingPlaceholder(value)"/>
6466
</div>
6567
<div>
@@ -225,7 +227,9 @@
225227
enableUp: Boolean,
226228
enableDown: Boolean,
227229
resourceType: { type: Number } as PropOptions<ResourceType>,
228-
imageZone: { type: Boolean, default: false }
230+
imageZone: { type: Boolean, default: false },
231+
title: { type: String, default: 'title' },
232+
placeholder: { type: String, default: 'placeholder' },
229233
},
230234
data() {
231235
return {

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/components/content-tab/MediaBlockCarouselImage.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
</picture>
2121
</div>
2222
<div class="carousel-text-editor">
23-
<b>Description text</b> (Optional)
23+
<label for="description"> <b>Description text</b> (Optional)</label>
2424
<p>
2525
Provide a short description of the image, which will be displayed to the user under the image in the carousel.
2626
</p>
2727
<EditSaveFieldWithCharacterCount v-model="image.description"
2828
addEditLabel="Description"
2929
v-bind:characterLimit="150"
30+
v-bind:inputId="description"
3031
block-view/>
3132
</div>
3233
<div class="carousel-text-editor">
@@ -39,7 +40,7 @@
3940
<EditSaveFieldWithCharacterCount v-model="image.altText"
4041
addEditLabel="alt text"
4142
v-bind:characterLimit="125"
42-
block-view/>
43+
block-view />
4344
</div>
4445
</div>
4546
</div>
@@ -71,6 +72,7 @@
7172
},
7273
props: {
7374
image: { type: Object } as PropOptions<ImageModel>,
75+
description: { type: String, default: 'description' },
7476
},
7577
data() {
7678
return {

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/components/content-tab/MediaBlockImage.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
<div v-if="withLabel">
1515
<EditSaveFieldWithCharacterCount v-model="image.description"
1616
addEditLabel="label"
17-
v-bind:characterLimit="descriptionCharacterLimit"/>
17+
v-bind:characterLimit="descriptionCharacterLimit"
18+
v-bind:inputId="imageAltText"/>
1819
</div>
1920
</div>
2021
<div v-else class="d-flex flex-column align-items-center justify-content-center">
@@ -36,6 +37,7 @@
3637
<EditSaveFieldWithCharacterCount v-model="image.altText"
3738
addEditLabel="alt text"
3839
v-bind:characterLimit="125"
40+
v-bind:inputId="alttext"
3941
block-view/>
4042
</div>
4143
</div>
@@ -71,7 +73,8 @@ export default Vue.extend({
7173
restrictAdvancedImageTypes: { type: Boolean, default: false },
7274
imageClass: String,
7375
withLabel: { type: Boolean, default: false },
74-
descriptionCharacterLimit: { type: Number, default: 125 }
76+
descriptionCharacterLimit: { type: Number, default: 125 },
77+
alttext: { type: String, default: 'alttext' },
7578
},
7679
data() {
7780
return {

0 commit comments

Comments
 (0)