Skip to content

chore(clerk-js): Keep CreateOrganizationForm disabled if avatar has been uploaded and org name is empty - #1910

Merged
nikospapcom merged 1 commit into
mainfrom
nikospap/create-org-component-keep-form-disable-if-only-avatar-has-been-uploaded
Oct 18, 2023
Merged

chore(clerk-js): Keep CreateOrganizationForm disabled if avatar has been uploaded and org name is empty#1910
nikospapcom merged 1 commit into
mainfrom
nikospap/create-org-component-keep-form-disable-if-only-avatar-has-been-uploaded

Conversation

@nikospapcom

Copy link
Copy Markdown
Contributor

Description

In this pr we disable the form of CreateOrganizationForm when avatar has been selected but organization name is empty in order to have the same experience when no avatar has been selected

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/clerk-js
  • @clerk/clerk-react
  • @clerk/nextjs
  • @clerk/remix
  • @clerk/types
  • @clerk/themes
  • @clerk/localizations
  • @clerk/clerk-expo
  • @clerk/backend
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/fastify
  • @clerk/chrome-extension
  • gatsby-plugin-clerk
  • build/tooling/chore

Before

Screen.Recording.2023-10-18.at.12.00.38.PM.mov

After

Screen.Recording.2023-10-18.at.12.08.56.PM.mov

@nikospapcom
nikospapcom requested a review from a team as a code owner October 18, 2023 09:11
@changeset-bot

changeset-bot Bot commented Oct 18, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c80dbbf

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

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo 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


const dataChanged = !!nameField.value;
const canSubmit = dataChanged || !!file;
const canSubmit = dataChanged;

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.

Does the avatar get uploaded without submitting the form? Is that why we don't check for it here?

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.

Also, is there not form.isDirty or something similar in clerk-js?

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.

We upload the logo, after the org is created (after the submission)

No i don't think we support isDirty out of the box.

@chanioxaris chanioxaris 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.

🥇


const dataChanged = !!nameField.value;
const canSubmit = dataChanged || !!file;
const canSubmit = dataChanged;

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.

We upload the logo, after the org is created (after the submission)

No i don't think we support isDirty out of the box.

@nikospapcom
nikospapcom added this pull request to the merge queue Oct 18, 2023
Merged via the queue into main with commit 89932e1 Oct 18, 2023
@nikospapcom
nikospapcom deleted the nikospap/create-org-component-keep-form-disable-if-only-avatar-has-been-uploaded branch October 18, 2023 11:34
@clerk-cookie clerk-cookie mentioned this pull request Oct 18, 2023
@clerk-cookie

Copy link
Copy Markdown
Collaborator

This PR has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@clerk clerk locked as resolved and limited conversation to collaborators Oct 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants