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

fix(surveys): Fix survey prop naming #18225

Merged
merged 3 commits into from
Oct 26, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions frontend/src/lib/taxonomy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,8 @@ export function getKeyMapping(
description: `Whether the user responded to survey with ID: "${surveyId}".`,
}
}
} else if (value.startsWith('$survey_dismiss/')) {
const surveyId = value.replace(/^\$survey_dismiss\//, '')
} else if (value.startsWith('$survey_dismissed/')) {
const surveyId = value.replace(/^\$survey_dismissed\//, '')
if (surveyId) {
return {
label: `Survey Dismissed: ${surveyId}`,
Expand All @@ -826,6 +826,14 @@ export function getKeyMapping(
description: `The response value for the ${index}${suffix} question in the survey.`,
}
}
} else if (value.startsWith('$survey_responded/')) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one's already on line 800, just edit that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't that for the event property survey_response?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh no wait it has a slash in it. I assume survey_response_ handles survey_response from the event property?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think I added it a while ago LOL nvm

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a separate one in KEY_MAPPINGS for the response. These ones are needed only when it's a programmatic property, i.e some part changes, like the id

const surveyId = value.replace(/^\$survey_responded\//, '')
if (surveyId) {
return {
label: `Survey Responded: ${surveyId}`,
description: `Whether the user responded to survey with ID: "${surveyId}".`,
}
}
} else if (value.startsWith('$feature/')) {
const featureFlagKey = value.replace(/^\$feature\//, '')
if (featureFlagKey) {
Expand Down
Loading