-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Adds getAriaName function and applies it to advanced settings #13448
Adds getAriaName function and applies it to advanced settings #13448
Conversation
* @returns {string} a space demimited, lowercase string with | ||
* special characters removed. | ||
* | ||
* Example: 'xPack:fooBar:foo_bar_baz' -> 'x pack foo bar foo bar baz' |
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.
Is there a list somewhere of all the possible advanced configs? I'm just hoping to verify this logic will hold true for all possible values
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.
Agree, maybe we could make a text file or read it from there and utilize that complete list in the unit test. Otherwise this looks great!
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.
I don't think there is a master list. However, if there are specific cases you think we should test for, I can add additional tests. Seems overkill to process / maintain the entire list, when the logic really boils down to how it handles certain characters.
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.
Fair!
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.
Probably okay since we're not relying on a certain delimiter and I'm guessing/hoping the lodash words
method is robust enough to handle any future settings
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.
LGTM
@@ -166,6 +168,7 @@ | |||
ng-if="!conf.editing" | |||
ng-click="clear(conf)" | |||
ng-hide="isDefaultValue(conf)" | |||
aria-label="Clear {{conf.ariaName}}" |
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.
Would Reset {{conf.ariaName}} to default
maybe be more descriptive to users?
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.
Dunno. The button is labelled 'clear' so that's what I used for reference for the aria-label.
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.
I'm fine with whatever you chose :)
Closes #12872
Summary
aira-label
attributes to theEdit
andClear
buttons on the Advanced Settings page.getAriaName
function and tests that formats the setting names for the labels.ie: 'search:queryLanguage:switcher:enable' -> 'search query language switcher enable'