Skip to content

Add delete confirmation#1454

Merged
raptisj merged 3 commits intomainfrom
add_delete_confirmation
Jul 7, 2023
Merged

Add delete confirmation#1454
raptisj merged 3 commits intomainfrom
add_delete_confirmation

Conversation

@raptisj
Copy link
Copy Markdown
Contributor

@raptisj raptisj commented Jul 5, 2023

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

Description

  • npm test runs as expected.
  • npm run build runs as expected.

Add delete confirmation input as an additional check when doing destructive actions.
The action added when users try to:

  • delete an organization(USR-60)
  • delete their account(URS-61)
  • leaves an organization
Screen.Recording.2023-07-06.at.12.48.05.PM.mov

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jul 5, 2023

🦋 Changeset detected

Latest commit: 1a151e7

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

This PR includes changesets to release 12 packages
Name Type
@clerk/localizations Minor
@clerk/clerk-js Minor
@clerk/types Minor
@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

Copy link
Copy Markdown

@jit-ci jit-ci Bot left a comment

Choose a reason for hiding this comment

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

✅ Great news! Jit hasn't found any security issues in your PR. Good Job! 🏆

@raptisj raptisj marked this pull request as ready for review July 5, 2023 15:47
@nikosdouvlis
Copy link
Copy Markdown
Member

@raptisj Can you please add a screenshot/video to help with the review process?

Comment thread .changeset/few-dingos-happen.md Outdated
@nikosdouvlis
Copy link
Copy Markdown
Member

Is this UI final?
Can I get a link to the figma design please?

@raptisj
Copy link
Copy Markdown
Contributor Author

raptisj commented Jul 6, 2023

Is this UI final? Can I get a link to the figma design please?

https://www.figma.com/file/1JQGZB7NyGvfpMLY0RpnIh/Clerk-Components?type=design&node-id=3334-31375&mode=design&t=PCn4csKYRaTkUsM7-0

@nikosdouvlis mind that I broke the message into two lines since on the other screens we had two lines as well. If we want all to be one-liners we will have to change/delete other localization keys as well.

raptisj added 2 commits July 6, 2023 13:45
… an organization

fix(clerk-js): Add delete confirmation input when users try to delete an organization
@raptisj raptisj force-pushed the add_delete_confirmation branch from 21607f4 to 6c105bb Compare July 6, 2023 10:45
@nikosdouvlis nikosdouvlis requested a review from desiprisg July 6, 2023 12:17
Copy link
Copy Markdown
Contributor

@panteliselef panteliselef left a comment

Choose a reason for hiding this comment

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

Looks good, but let's figure out if hasMoreThanOneAdmin is calculated correctly

});
const { navigate } = useRouter();

const hasMoreThanOneAdmin = (membershipList || [])?.filter(m => m.role === 'admin')?.length > 1;
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.

🚫 I believe this will not work. membershipList will not contain all members

The following code, will fetch memberships with a default limit and a default offset.

const { organization, membership, membershipList } = useCoreOrganization({
    membershipList: {},
  });  

For BAPI the default values are mentioned here. I couldn't find the default values for FAPI

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.

@panteliselef you are right, we probably need to have the limit higher like 50 or something. Ideally, we would want to filter by role and get only the admins but I know we don't have that functionality yet. cc @chanioxaris

I think we are ok limiting it to 50 since I have the suspicion we don't have an active organization with more members.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes Pantelis is right. I would suggest to ignore this for now, until we introduce support for filtering by role to make it more future proof. I am gonna create a ticket to tackle this asap

Copy link
Copy Markdown
Contributor Author

@raptisj raptisj Jul 7, 2023

Choose a reason for hiding this comment

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

@panteliselef @chanioxaris reverting this change since it will be handled in another ticket by team organization

@raptisj raptisj force-pushed the add_delete_confirmation branch from 6c105bb to 087fef9 Compare July 7, 2023 09:20
…nization

fix(clerk-js): Add confirmation input when users try to leave an organization

fix(clerk-js): Allow admin to leave organization if there are more than one

fix(clerk-js): Add placeholders in inputs

fix(clerk-js): Add placeholders in inputs

fix(clerk-js): Revert organization admins count

fix(clerk-js): Revert organization admins count
@raptisj raptisj force-pushed the add_delete_confirmation branch from 087fef9 to 1a151e7 Compare July 7, 2023 09:34
@raptisj raptisj merged commit 949959f into main Jul 7, 2023
@raptisj raptisj deleted the add_delete_confirmation branch July 7, 2023 09:46
@clerk-cookie clerk-cookie mentioned this pull request Jul 7, 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 Jul 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants