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 Prop Validation EVERYWHERE #285

Closed
3 tasks done
FlorianWendelborn opened this issue Sep 11, 2020 · 0 comments · Fixed by #504, #505, #506, #507 or #508
Closed
3 tasks done

Add Prop Validation EVERYWHERE #285

FlorianWendelborn opened this issue Sep 11, 2020 · 0 comments · Fixed by #504, #505, #506, #507 or #508
Assignees
Labels
package:kotti-ui @3yourmind/kotti-ui priority:4-high ⚠️ Needs to be fixed ASAP, but without HACKs state:help wanted type:enhancement features, etc.

Comments

@FlorianWendelborn
Copy link
Member

FlorianWendelborn commented Sep 11, 2020

Just saw a KtCol span="2.5". We absolutely need validators for everything.

  • Validate Numbers to be Integers if Required
  • Validate With Whitelists
  • Validate Yoco Icons

I think at this point it makes sense to create a @3yourmind/vue-validators package or similar.

This will now use zod

@FlorianWendelborn FlorianWendelborn added type:enhancement features, etc. state:help wanted priority:4-high ⚠️ Needs to be fixed ASAP, but without HACKs package:kotti-ui @3yourmind/kotti-ui labels Sep 11, 2020
@FlorianWendelborn FlorianWendelborn self-assigned this Sep 11, 2020
@FlorianWendelborn FlorianWendelborn pinned this issue Sep 15, 2020
carsoli pushed a commit that referenced this issue Sep 22, 2021
Also, this adds a surplus check so that jest sees that result.error is defined

This isn’t necessary for TS itself, but somehow ts-jest didn’t see this... upgrading to latest didn’t fix this bug unfortunately, so this is as good as it gets
carsoli pushed a commit that referenced this issue Sep 22, 2021
carsoli pushed a commit that referenced this issue Sep 22, 2021
carsoli pushed a commit that referenced this issue Sep 22, 2021
carsoli pushed a commit that referenced this issue Sep 22, 2021
FlorianWendelborn added a commit that referenced this issue Sep 24, 2021
Unfortunately, the makeProps type hints only work for some types in Vue, others somehow get resolved to any. As far as I can tell, this is due to PropType<> being buggy.

I also tested @vue/composition-api@1.1.5 and PropType does appear to be broken there as well.

Let’s hope that one day Vue will properly support this.
FlorianWendelborn added a commit that referenced this issue Sep 24, 2021
… Various PR Comments

Co-Authored-By: Carol Soliman <17387510+carsoli@users.noreply.github.com>
FlorianWendelborn added a commit that referenced this issue Sep 24, 2021
Co-Authored-By: Carol Soliman <17387510+carsoli@users.noreply.github.com>
FlorianWendelborn added a commit that referenced this issue Sep 24, 2021
Co-Authored-By: Carol Soliman <17387510+carsoli@users.noreply.github.com>
FlorianWendelborn added a commit that referenced this issue Sep 24, 2021
Co-Authored-By: Carol Soliman <17387510+carsoli@users.noreply.github.com>
FlorianWendelborn added a commit that referenced this issue Sep 24, 2021
z.array().nonempty() influences the type definitions, and causes issues with Array.prototype.map() not being aware of the underlying array's cardinality.
@FlorianWendelborn FlorianWendelborn unpinned this issue Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment