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: add field checkbox and fieldswitch #509

Merged
merged 2 commits into from
Jul 22, 2024
Merged

Conversation

yoannfleurydev
Copy link
Member

@yoannfleurydev yoannfleurydev commented Jul 22, 2024

Describe your changes

  • add FieldCheckbox
  • add FieldSwitch
  • update their theme

Checklist

  • I performed a self review of my code
  • I ensured that everything is written in English
  • I tested the feature or fix on my local environment
  • I ran the pnpm storybook command and everything is working
  • If applicable, I updated the translations for english and french files
    (If you cannot update the french language, just let us know in the PR description)
  • If applicable, I updated the README.md
  • If applicable, I created a PR or an issue on the documentation repository
  • If applicable, I’m sure that my feature or my component is mobile first and available correctly on desktop

Copy link

vercel bot commented Jul 22, 2024

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

Name Status Preview Comments Updated (UTC)
start-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2024 3:23pm

@yoannfleurydev
Copy link
Member Author

Sonar is failing because of duplicated code in tests. We do not care about that 😄

src/components/Form/FieldCheckbox/FieldCheckBox.spec.tsx Outdated Show resolved Hide resolved
Comment on lines 36 to 48
<Controller
{...props}
render={({ field: { value, ...field } }) => (
<Flex direction="column" gap={1.5}>
<Checkbox
isChecked={!!value}
isDisabled={props.isDisabled}
{...props.checkboxProps}
{...field}
/>
<FormFieldError />
</Flex>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't want to use FormFieldItem & FormFieldLabel like the other fields ? Same comment goes to FieldSwitch

Copy link
Member Author

Choose a reason for hiding this comment

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

Another PR has changed the FormField API #505

Copy link

sonarcloud bot commented Jul 22, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
50.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@ivan-dalmet ivan-dalmet merged commit f098bd5 into master Jul 22, 2024
6 of 7 checks passed
@ivan-dalmet ivan-dalmet deleted the feat/more-fields branch July 22, 2024 15:44
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.

3 participants