Skip to content
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

Merged
merged 4 commits into from
Jun 2, 2020

Conversation

BenoitZugmeyer
Copy link
Member

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 a data-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.

@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner June 2, 2020 13:25
packages/rum/README.md Outdated Show resolved Hide resolved
@@ -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
Copy link
Contributor

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?

Copy link
Member Author

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

@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/get-action-name-programmatically branch from fbfbc28 to d08c0a5 Compare June 2, 2020 14:44
@BenoitZugmeyer BenoitZugmeyer merged commit 3eaedaa into master Jun 2, 2020
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/get-action-name-programmatically branch June 2, 2020 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants