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

Product quiz TS migration #116

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Product quiz TS migration #116

wants to merge 11 commits into from

Conversation

DevAOC
Copy link
Collaborator

@DevAOC DevAOC commented Nov 5, 2024

Adding type declarations and definitions for migration to ts

@DevAOC DevAOC requested a review from rdraward November 5, 2024 21:32
Copy link
Collaborator

@rdraward rdraward left a comment

Choose a reason for hiding this comment

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

The extension doesn't work - ts needs to be compiled and theme extensions don't do that (without a Vite plugin)

@DevAOC DevAOC requested a review from rdraward November 11, 2024 21:35
@DevAOC
Copy link
Collaborator Author

DevAOC commented Nov 11, 2024

Waiting on Nic to help me with that id issue. (quiz update)

Copy link
Collaborator

@rdraward rdraward left a comment

Choose a reason for hiding this comment

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

I cannot wait until we can rip most of this out for a simple AutoForm
🎩 ✅
some comments on typing in the frontend, but approving pending updates

@@ -74,7 +79,9 @@ export default ({
requiredIndicator
label="Name"
autoComplete="off"
error={errors.quiz?.title?.message}
error={
(errors.quiz as { title?: { message: string } })?.title?.message
Copy link
Collaborator

Choose a reason for hiding this comment

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

This feels like we should be passing in typing to useFormContext instead of using as here

@@ -89,7 +96,9 @@ export default ({
requiredIndicator
label="Description"
autoComplete="off"
error={errors.quiz?.body?.message}
error={
(errors.quiz as { body?: { message: string } })?.body?.message
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comment as above, typing on useFormContext vs as

error={errors.quiz?.questions?.[i]?.text?.message}
error={
(
errors.quiz as {
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comment, useFormContext typing vs as

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.

2 participants