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

Add options to make name and email fields required #9479

Closed
billyvg opened this issue Nov 7, 2023 · 3 comments · Fixed by #9587
Closed

Add options to make name and email fields required #9479

billyvg opened this issue Nov 7, 2023 · 3 comments · Fixed by #9587

Comments

@billyvg
Copy link
Member

billyvg commented Nov 7, 2023

Currently only the description is required. We should add options to make either name and/or email as required fields.

Note that we have showName and showEmail options which only hides the input fields (but can still send the name/email values if they are set in Sentry core SDK). The "required" state should only be enforced if the UI elements are visible -- (or rather, disregard the show* if required is set).

@billyvg
Copy link
Member Author

billyvg commented Nov 7, 2023

@c298lee I'd recommend looking over some of the existing tests and maybe starting off with a test case - this should let you get started quicker than setting up local dev env (though I can help you with that too).

For local dev:

Setup

  • install yalc
  • build the sdk packages: yarn build (remember to do this when you're switching branches!)
  • In the package dirs that you're working on (in this case packages/feedback), run yarn yalc publish. Alternatively run yarn yalc:publish in the repo root to publish all packages
  • In your sentry repo, run yalc add <package name>

Workflow

When you're actively developing, I like to:

  • run yarn build:dev:watch in the package root (though you may need to do it in repo root if you're working on multiple packages)
  • after saving a file (and tsc builds), you'll need to yarn yalc:publish
  • in your local sentry dev env, you'll to need refresh after you see something like this in your console:

Image

@hckhanh
Copy link

hckhanh commented Nov 16, 2023

There is a bug with isEmailRequired and isNameRequired, I set them to true but I can submit data without these fields

export const sentryFeedback = new Feedback({
  autoInject: false,
  isAnonymous: false,
  showBranding: false,
  isNameRequired: true,
  isEmailRequired: true,
  colorScheme: 'system',
})

@billyvg
Copy link
Member Author

billyvg commented Nov 16, 2023

@hckhanh yes this is not implemented yet, it was mistakenly added in the types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants