Add typeahed for single choice surveys

Add typeahed for single choice surveys, also fix a couple of missing
translations for Select component.

See: https://github.com/ansible/awx/issues/8097
This commit is contained in:
nixocio 2022-06-06 13:11:18 -04:00
parent d9f26a411e
commit e62c77e783
4 changed files with 4 additions and 2 deletions

View File

@ -122,7 +122,7 @@ function MultipleChoiceField({ question }) {
setIsOpen(false);
}}
selections={field.value}
variant={SelectVariant.single}
variant={SelectVariant.typeahead}
id={id}
ouiaId={`single-survey-question-${question.variable}`}
isOpen={isOpen}

View File

@ -59,6 +59,7 @@ function TagMultiSelect({ onChange, value }) {
typeAheadAriaLabel={t`Select tags`}
noResultsFoundText={t`No results found`}
ouiaId="tag-multiselect"
createText={t`Create`}
>
{renderOptions(options)}
</Select>

View File

@ -63,6 +63,7 @@ function BecomeMethodField({ fieldOptions, isRequired }) {
setOptions([...options, { value: option }]);
}}
noResultsFoundText={t`No results found`}
createText={t`Create`}
>
{options.map((option) => (
<SelectOption key={option.value} value={option.value} />

View File

@ -44,7 +44,7 @@ function SurveyListItem({ canEdit, question, isChecked, onSelect, rowIndex }) {
question.variable
)}`}
>
{question.question_name}
<b>{question.question_name}</b>
</Link>
{question.required && (
<Required