Skip to content

chore(clerk-js): Replace text and email fields with Form.PlainInput#2036

Merged
panteliselef merged 2 commits into
mainfrom
elef/SDK-674-form-plaininput
Nov 6, 2023
Merged

chore(clerk-js): Replace text and email fields with Form.PlainInput#2036
panteliselef merged 2 commits into
mainfrom
elef/SDK-674-form-plaininput

Conversation

@panteliselef

Copy link
Copy Markdown
Contributor

Description

Droping the usage of Form.Control for simple text field with type text or email.

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/backend
  • @clerk/chrome-extension
  • @clerk/clerk-js
  • @clerk/clerk-expo
  • @clerk/fastify
  • gatsby-plugin-clerk
  • @clerk/localizations
  • @clerk/nextjs
  • @clerk/clerk-react
  • @clerk/remix
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/themes
  • @clerk/types
  • build/tooling/chore

@panteliselef panteliselef self-assigned this Nov 3, 2023
@panteliselef
panteliselef requested a review from a team as a code owner November 3, 2023 14:59
@changeset-bot

changeset-bot Bot commented Nov 3, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 92bfed2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@clerk/clerk-js Patch
@clerk/localizations Patch
@clerk/types Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
@clerk/backend Patch
@clerk/fastify Patch
gatsby-plugin-clerk Patch
@clerk/nextjs Patch
@clerk/clerk-react Patch
@clerk/remix Patch
@clerk/clerk-sdk-node Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@anagstef anagstef left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💯

{...confirmationField.props}
required
/>
<Form.PlainInput {...confirmationField.props} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❓ Shouldn't this have the isRequired property?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the hook above is defined as

  const confirmationField = useFormControl('deleteOrganizationConfirmation', '', {
...
    isRequired: true,
...
  });

so we are good

</Form.ControlRow>
<Form.ControlRow elementId={slugField.id}>
<Form.Control
<Form.PlainInput

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❓ This was required before, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

with the previous implementation of FormControl required would be overriden with required={isRequired} which in this situation is false. After checking the tests we had for ProfileSettings and the signature of organization.update i decided to remove this completely.

Comment thread packages/clerk-js/src/ui/components/UserProfile/DeletePage.tsx Outdated
{...confirmationField.props}
required
/>
<Form.PlainInput {...confirmationField.props} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❓ Same question about required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

isRequired is defined above in the hook, we should be good.

<Form.Root onSubmit={addEmail}>
<Form.ControlRow elementId={emailField.id}>
<Form.Control
<Form.PlainInput

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

required?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

prop is coming from the hook

@panteliselef
panteliselef force-pushed the elef/SDK-674-form-plaininput branch from 351082b to 76bffab Compare November 3, 2023 17:04
@panteliselef
panteliselef force-pushed the elef/SDK-674-form-plaininput branch from 76bffab to 92bfed2 Compare November 3, 2023 17:49
@panteliselef
panteliselef added this pull request to the merge queue Nov 6, 2023
Merged via the queue into main with commit 4edb776 Nov 6, 2023
@panteliselef
panteliselef deleted the elef/SDK-674-form-plaininput branch November 6, 2023 09:13
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