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(newBrain): update data validation logic and add * on required fields #1065

Merged
merged 2 commits into from
Aug 30, 2023

Conversation

mamadoudicko
Copy link
Contributor

@mamadoudicko mamadoudicko commented Aug 30, 2023

Description

Screenshot 2023-08-30 at 15 17 00

@mamadoudicko mamadoudicko temporarily deployed to preview August 30, 2023 13:16 — with GitHub Actions Inactive
@vercel
Copy link

vercel bot commented Aug 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 30, 2023 1:19pm
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 30, 2023 1:19pm

@github-actions
Copy link
Contributor

Risk Level 2 - /home/runner/work/quivr/quivr/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/hooks/useSettingsTab.ts

  1. The addition of the check for an empty string in the name field is a good practice for form validation. However, it would be better to trim the name before checking if it's empty to avoid allowing names that are just spaces. For example:
if (name.trim() === \"\") {
  // Show error
}
  1. The check for an empty openai_api_key before validating it is also a good practice. However, it would be better to trim the openai_api_key before checking if it's empty to avoid allowing keys that are just spaces. For example:
if (openai_api_key.trim() !== \"\" && !(await validateOpenAIKey(openai_api_key.trim()))) {
  // Show error
}

Risk Level 2 - /home/runner/work/quivr/quivr/frontend/lib/components/ui/Field.tsx

The changes in this file include the addition of a required prop to the Field component and the display of an asterisk (*) next to the label if the field is required. This is a low to medium risk change. It could potentially cause issues if not all instances of the Field component have been updated to include the required prop where necessary. However, this is unlikely to introduce bugs or performance issues. The code is readable and follows SOLID principles.


📝🔍👍


Powered by Code Review GPT

@gozineb gozineb merged commit 2293558 into main Aug 30, 2023
12 checks passed
StanGirard pushed a commit that referenced this pull request Sep 12, 2023
…elds (#1065)

* feat(createBrain): add * on required fields

* fix: update brain data validation logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants