-
Notifications
You must be signed in to change notification settings - Fork 144
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
✨ [RUMF-385] implement a declarative API to set the action names #412
✨ [RUMF-385] implement a declarative API to set the action names #412
Conversation
@@ -1,16 +1,48 @@ | |||
export function getActionNameFromElement(element: Element): string { | |||
// Proceed to get the action name in two steps: | |||
// * first, use strategies that are known to return good results. Those strategies will be used on | |||
// * first, get the name programmatically, explicitely defined by the user. | |||
// * then, use strategies that are known to return good results. Those strategies will be used on |
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.
what do you think of renaming "getters" to "strategies" in order to have a more consistent wording between comments and implementation?
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.
Ok I'll rename this
fbfbc28
to
d08c0a5
Compare
Motivation
We want to allow RUM library users to declare action names directly within the HTML markup (or DOM tree).
Changes
Add a new, top priority strategy to the
getActionNameFromElement
function that look for adata-dd-action-name
attribute on the element or any of its parent.Testing
Unit tests should be enough
I have gone over the contributing documentation.