-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task/FOUR-19875: aria-label property is the same in all options in the select list component generating unexpected behaviors for screen readers #1769
Open
agustinbusso
wants to merge
3
commits into
release-2024-fall
Choose a base branch
from
task/FOUR-19875
base: release-2024-fall
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,9 @@ | |
</div> | ||
<label class="mt-3" for="option-content">{{ $t('Content') }}</label> | ||
<b-form-input id="option-content" v-model="optionContent" data-cy="inspector-option-content" /> | ||
|
||
<label v-if="renderAs === 'checkbox'" class="mt-3" for="option-aria-label">{{ $t('Aria Label') }}</label> | ||
<b-form-input v-if="renderAs === 'checkbox'" id="option-aria-label" v-model="optionAriaLabel" data-cy="inspector-option-aria-label" /> | ||
</div> | ||
|
||
<div class="card-footer text-right p-2"> | ||
|
@@ -74,6 +77,9 @@ | |
</div> | ||
<label class="mt-3" for="option-content">{{ $t('Content') }}</label> | ||
<b-form-input id="option-content" v-model="optionContent" data-cy="inspector-option-content" /> | ||
|
||
<label v-if="renderAs === 'checkbox'" class="mt-3" for="option-aria-label">{{ $t('Aria Label') }}</label> | ||
<b-form-input v-if="renderAs === 'checkbox'" id="option-aria-label" v-model="optionAriaLabel" data-cy="inspector-option-aria-label" /> | ||
</div> | ||
|
||
<div class="card-footer text-right p-2"> | ||
|
@@ -131,7 +137,7 @@ | |
</div> | ||
|
||
<div v-if="dataSource === dataSourceValues.collection"> | ||
<collection-select-list v-model="collectionOptions"></collection-select-list> | ||
<collection-select-list v-model="collectionOptions" :renderAs="renderAs"></collection-select-list> | ||
</div> | ||
|
||
<div v-if="showRenderAs"> | ||
|
@@ -203,12 +209,21 @@ | |
<mustache-helper/> | ||
<b-form-input id="value" v-model="value" @change="valueChanged" data-cy="inspector-datasource-content"/> | ||
<small class="form-text text-muted mb-3">{{ $t('Content to display to the user in the select list.') }}</small> | ||
|
||
<label v-if="renderAs === 'checkbox'" for="aria-label">{{ $t('Aria Label') }}</label> | ||
<mustache-helper v-if="renderAs === 'checkbox'" /> | ||
<b-form-input v-if="renderAs === 'checkbox'" id="aria-label" v-model="optionAriaLabel" data-cy="inspector-datasource-aria-label"/> | ||
<small v-if="renderAs === 'checkbox'" class="form-text text-muted mb-3">{{ $t('Aria label for accessibility support.') }}</small> | ||
</div> | ||
|
||
<div v-if="valueTypeReturned === 'single' && dataSource === dataSourceValues.dataObject"> | ||
<label for="key">{{ $t('Variable Data Property') }}</label> | ||
<b-form-input id="key" v-model="key" @change="keyChanged" placeholder="Request Variable Property" data-cy="inspector-options-value" /> | ||
<small class="form-text text-muted mb-3">{{ $t('Enter the property name from the Request data variable that will be passed as the value when selected.') }}</small> | ||
|
||
<label v-if="renderAs === 'checkbox'" for="aria-label">{{ $t('Aria Label') }}</label> | ||
<b-form-input v-if="renderAs === 'checkbox'" id="aria-label" v-model="optionAriaLabel" placeholder="Aria Label Property" data-cy="inspector-options-aria-label" /> | ||
<small v-if="renderAs === 'checkbox'" class="form-text text-muted mb-3">{{ $t('Enter the property name for the aria label from the Request data variable.') }}</small> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this translation label need to be registered in the core project, thanks |
||
</div> | ||
|
||
<div v-if="dataSource === dataSourceValues.dataConnector"> | ||
|
@@ -287,6 +302,7 @@ export default { | |
removeIndex: null, | ||
optionValue: '', | ||
optionContent: '', | ||
optionAriaLabel: '', | ||
showRenderAs: false, | ||
renderAs: 'dropdown', | ||
allowMultiSelect: false, | ||
|
@@ -413,6 +429,9 @@ export default { | |
valueField() { | ||
return this.value || 'content'; | ||
}, | ||
ariaLabelField() { | ||
return this.optionAriaLabel || 'ariaLabel'; | ||
}, | ||
currentItemToDelete() { | ||
if (this.removeIndex !== null | ||
&& this.optionsList.length > 0 | ||
|
@@ -450,6 +469,7 @@ export default { | |
editIndex: this.editIndex, | ||
removeIndex: this.removeIndex, | ||
valueTypeReturned: this.valueTypeReturned, | ||
optionAriaLabel: this.optionAriaLabel, | ||
}; | ||
}, | ||
}, | ||
|
@@ -467,6 +487,7 @@ export default { | |
this.selectedEndPoint = this.options.selectedEndPoint, | ||
this.key = this.options.key; | ||
this.value = this.options.value; | ||
this.optionAriaLabel = this.options.optionAriaLabel; | ||
this.pmqlQuery = this.options.pmqlQuery; | ||
this.defaultOptionKey= this.options.defaultOptionKey; | ||
this.selectedOptions = this.options.selectedOptions; | ||
|
@@ -530,8 +551,9 @@ export default { | |
const that = this; | ||
jsonList.forEach (item => { | ||
that.optionsList.push({ | ||
[that.keyField] : item[that.keyField], | ||
[that.valueField] : item[that.valueField], | ||
[that.keyField]: item[that.keyField], | ||
[that.valueField]: item[that.valueField], | ||
[that.ariaLabelField]: item[that.ariaLabelField] | ||
}); | ||
}); | ||
this.jsonError = ''; | ||
|
@@ -560,12 +582,14 @@ export default { | |
this.editIndex = index; | ||
this.optionContent = this.optionsList[index][this.valueField]; | ||
this.optionValue = this.optionsList[index][this.keyField]; | ||
this.optionAriaLabel = this.optionsList[index][this.ariaLabelField]; | ||
this.optionError = ''; | ||
}, | ||
showAddOption() { | ||
this.optionCardType = 'insert'; | ||
this.optionContent = ''; | ||
this.optionValue = ''; | ||
this.optionAriaLabel = ''; | ||
this.showOptionCard = true; | ||
this.optionError = ''; | ||
this.editIndex = null; | ||
|
@@ -582,6 +606,7 @@ export default { | |
{ | ||
[this.valueField]: this.optionContent, | ||
[this.keyField]: this.optionValue, | ||
[this.ariaLabelField]: this.optionAriaLabel, | ||
} | ||
); | ||
} | ||
|
@@ -592,6 +617,7 @@ export default { | |
} | ||
this.optionsList[this.editIndex][this.keyField] = this.optionValue; | ||
this.optionsList[this.editIndex][this.valueField] = this.optionContent; | ||
this.optionsList[this.editIndex][this.ariaLabelField] = this.optionAriaLabel; | ||
} | ||
|
||
this.jsonData = JSON.stringify(this.optionsList); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this label need to be registered in the core project, thanks