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

feat(core): add delete address functionality for account #787

Merged
merged 1 commit into from
May 16, 2024

Conversation

bc-alexsaiannyi
Copy link
Contributor

@bc-alexsaiannyi bc-alexsaiannyi commented Apr 18, 2024

What/Why?

This PR brings delete address functionality for Account.

Testing

locally

Copy link

vercel bot commented Apr 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
catalyst-au 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 16, 2024 10:04am
catalyst-core ❌ Failed (Inspect) May 16, 2024 10:04am
catalyst-latest ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2024 10:04am
catalyst-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2024 10:04am
catalyst-test-store 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 16, 2024 10:04am
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
catalyst-1millionproducts-store ⬜️ Ignored (Inspect) Visit Preview May 16, 2024 10:04am
catalyst-uk ⬜️ Ignored (Inspect) Visit Preview May 16, 2024 10:04am

Copy link

changeset-bot bot commented Apr 18, 2024

🦋 Changeset detected

Latest commit: b20168c

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

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst-core 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

Comment on lines 31 to 34

if (startCursor) {
beforeSearchParams.set('before', String(startCursor));
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI, I've experienced issues with navigation on deleting last item on page (like Customer's address). After the action I've received url like https://your-store/addresses?before=null which prevents smooth navigation afterwards. So I've put this condition and if there is no cursor we just basically return start position for pagination.

Copy link
Contributor

@avattipalli avattipalli left a comment

Choose a reason for hiding this comment

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

Can you please attach a PoL to this PR?

"deleteButton": "Delete"
"deleteButton": "Delete",
"confirmDeleteAddress": "Delete address",
"deleteModalTitle": "Are you sure you want to delete Address"
Copy link
Contributor

Choose a reason for hiding this comment

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

🍹 We can probably change this to Are you sure you want to delete address? or Are you sure? if we show the Delete Address somewhere within the dialog

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, Anudeep. It's updated.

revalidatePath('/account/addresses', 'page');

if (response.customer.deleteCustomerAddress.errors.length === 0) {
return { status: 'success', message: 'The address has been deleted' };
Copy link
Contributor

Choose a reason for hiding this comment

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

🍹 This address has been deleted

@bc-alexsaiannyi bc-alexsaiannyi changed the title feat(core): add delete address functionality for account feat(core): add delete/add address functionality for account Apr 23, 2024
Copy link
Contributor

⚡️🏠 Lighthouse report

Lighthouse ran against https://catalyst-latest-n8umgdnq3-bigcommerce-platform.vercel.app

🖥️ Desktop

We ran Lighthouse against the changes on a desktop and produced this report. Here's the summary:

Category Score
🟢 Performance 100
🟢 Accessibility 100
🟢 Best practices 100
🟢 SEO 90

📱 Mobile

We ran Lighthouse against the changes on a mobile and produced this report. Here's the summary:

Category Score
🟢 Performance 99
🟢 Accessibility 100
🟢 Best practices 100
🟢 SEO 92

@bc-alexsaiannyi bc-alexsaiannyi added this pull request to the merge queue May 16, 2024
Merged via the queue into main with commit 6198648 May 16, 2024
11 checks passed
@bc-alexsaiannyi bc-alexsaiannyi deleted the delete-address branch May 16, 2024 10:14
@github-actions github-actions bot mentioned this pull request May 16, 2024
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.

5 participants