-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(dashboard): step conditions analytics #7684
Conversation
✅ Deploy Preview for dev-web-novu ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for dashboard-v2-novu-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
const uniqueFieldTypes: string[] = getUniqueFieldNamespaces(skip); | ||
const uniqueOperators: string[] = getUniqueOperators(skip); |
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.
calculate unique field namespaces and operators used
stepType: step.type, | ||
fieldTypes: uniqueFieldTypes, | ||
operators: uniqueOperators, | ||
type: newConditionsCount < oldConditionsCount ? 'deletion' : 'update', |
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.
determine whether conditions were removed or updated
export const countConditions = (jsonLogic?: RQBJsonLogic) => { | ||
if (!jsonLogic) return 0; | ||
|
||
const query = parseJsonLogic(jsonLogic); | ||
|
||
return countRules(query); | ||
}; |
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.
moved from the useConditionsCount
hook
export const getUniqueFieldNamespaces = (jsonLogic?: RQBJsonLogic): string[] => { | ||
if (!jsonLogic) return []; | ||
|
||
const query = parseJsonLogic(jsonLogic); | ||
|
||
return recursiveGetUniqueFields(query); | ||
}; |
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.
helper to calculate unique field namespaces
return Array.from(operators); | ||
} | ||
|
||
export const getUniqueOperators = (jsonLogic?: RQBJsonLogic): string[] => { |
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.
helper to calculate unique operators
What changed? Why was the change needed?
Step Conditions Analytics
Screenshots
Screen.Recording.2025-02-07.at.14.03.45.mov