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

feat(dashboard): step conditions analytics #7684

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

LetItRock
Copy link
Contributor

What changed? Why was the change needed?

Step Conditions Analytics

Screenshots

Screenshot 2025-02-07 at 14 02 03

Screen.Recording.2025-02-07.at.14.03.45.mov

Copy link

linear bot commented Feb 7, 2025

Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit bc57f4e
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/67a605f81bf46d00088984fd
😎 Deploy Preview https://deploy-preview-7684.dashboard.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for dashboard-v2-novu-staging ready!

Name Link
🔨 Latest commit bc57f4e
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/67a605f853d59800083b3c0d
😎 Deploy Preview https://deploy-preview-7684.dashboard-v2.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines +132 to +133
const uniqueFieldTypes: string[] = getUniqueFieldNamespaces(skip);
const uniqueOperators: string[] = getUniqueOperators(skip);
Copy link
Contributor Author

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',
Copy link
Contributor Author

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

Comment on lines +18 to +24
export const countConditions = (jsonLogic?: RQBJsonLogic) => {
if (!jsonLogic) return 0;

const query = parseJsonLogic(jsonLogic);

return countRules(query);
};
Copy link
Contributor Author

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

Comment on lines +46 to +52
export const getUniqueFieldNamespaces = (jsonLogic?: RQBJsonLogic): string[] => {
if (!jsonLogic) return [];

const query = parseJsonLogic(jsonLogic);

return recursiveGetUniqueFields(query);
};
Copy link
Contributor Author

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[] => {
Copy link
Contributor Author

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

@LetItRock LetItRock merged commit 70ead81 into next Feb 10, 2025
34 checks passed
@LetItRock LetItRock deleted the nv-5342-step-conditions-analytics branch February 10, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants