Save onboarding survey response to user preferences#28530
Merged
michellescripts merged 1 commit intomasterfrom Jul 3, 2023
Merged
Save onboarding survey response to user preferences#28530michellescripts merged 1 commit intomasterfrom
michellescripts merged 1 commit intomasterfrom
Conversation
d0d88b3 to
52bf4a4
Compare
52bf4a4 to
7dba6a4
Compare
ryanclark
approved these changes
Jun 30, 2023
kimlisa
approved these changes
Jul 3, 2023
5b4a481 to
75ea1f5
Compare
75ea1f5 to
b803712
Compare
|
@michellescripts See the table below for backport results.
|
Contributor
Author
|
Backport with fix to #28740 |
michellescripts
added a commit
that referenced
this pull request
Jul 21, 2023
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Jul 21, 2023
* Add onboarding questionnaire components (#27977) * Posthog event for onboarding questionnaire submit (#28328) * update protos * create Posthog event for onboarding questionnaire submit * set onboarding survey on user preferences (#28530) * Fix panic when fetching user preferences (#28751) * Fix panic when fetching user preferences Closes #28740 * Prevent overwriting mismatched types in user preferences * Add error handling to user preferences service * GCI imports * Refactor user preferences test and logic This commit updates the approach for comparing equality in user preferences test. It introduces the use of the "go-cmp" library which provides more flexibility in handling comparison of struct elements, thus helping to catch any unexpected changes that could be overlooked with the standard equality checking. We also revised the logic to handle default preferences by overwriting values for better efficiency and readability, also removing unnecessary checking and merging of values. * Add comments to overwriteValues method in userpreferences.go Added detailed comments to better explain the overwriteValues function in userpreferences.go file. The comments clarify how the function uses proto.Ranges to iterate over fields and only overwrite non-nil/empty fields. * Apply some magic to preferences test * Change the import to avoid go.mod changed and match our other imports * Onboarding changes to support e survey (#28981) * Display a survey during onboarding - Adds user context wrapper to the Welcome flow in order to update preferences - Sets selected resources on user preferences * imports & describes * named enums * remove onboard survey from oss - will be moved to /e - export shared types * refactor welcome - move new credential to welcome prop * refactor new credentails - container passes questionnaire to component * remove survey ls dispatch * pr feedback * Revert "pr feedback" This reverts commit 060f34fb60242856f233df6a1006c5192ea321fb. --------- Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds an onboard object to the user preferences cluster state. For now, this is leveraged by the onboarding questionnaire to save the "preferred resources" answer.
This also fixes a few minor issues: it does not allow us to overwrite
DefaultUserPreferences; mocks useUser in UI tests and adds an optional decorator to Storybook ifargs: { userContext: true }is present on the story.The onboarding questionnaire will not be integrated into onboarding flow as part of this PR, that will follow in #28119 (no user change with merge). I will also handle outstanding user permissions issues in that PR (currently 403s/pre-session).