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: delete past bookings #19120

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

Conversation

hp77-creator
Copy link

What does this PR do?

I have added two options for the user to delete past bookings.

They can delete individual bookings like this:
image
image

Or they can delete all the bookings in one go using the main button:
image

image

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Login with pro@example.com
  2. Go to bookings
  3. Click on delete button

/claim #18787

Copy link

vercel bot commented Feb 5, 2025

@hp77-creator is attempting to deploy a commit to the cal-staging Team on Vercel.

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Feb 5, 2025
@graphite-app graphite-app bot requested a review from a team February 5, 2025 21:07
Copy link
Contributor

github-actions bot commented Feb 5, 2025

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "Feature delete past meeting". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@github-actions github-actions bot added ✨ feature New feature or request 💎 Bounty A bounty on Algora.io labels Feb 5, 2025
@dosubot dosubot bot added the bookings area: bookings, availability, timezones, double booking label Feb 5, 2025
@dosubot dosubot bot added this to the v5.0 milestone Feb 5, 2025
@hp77-creator hp77-creator changed the title Feature delete past meeting feat: delete past bookings Feb 5, 2025
Copy link

graphite-app bot commented Feb 5, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (02/05/25)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add community label" took an action on this PR • (02/05/25)

1 label was added to this PR based on Keith Williams's automation.

"Add ready-for-e2e label" took an action on this PR • (02/07/25)

1 label was added to this PR based on Keith Williams's automation.

"Add foundation team as reviewer" took an action on this PR • (02/07/25)

1 reviewer was added to this PR based on Keith Williams's automation.

@hp77-creator
Copy link
Author

@jublevy @PeerRich please review the PR, I have added the all delete button as well for past booking, lmk if there is any changes required.

@retrogtx
Copy link
Contributor

retrogtx commented Feb 6, 2025

Hi @hp77-creator, thanks for your PR!
Can you please add a short loom video for the same? Meanwhile I will test your changes out locally :D

Copy link
Contributor

@retrogtx retrogtx left a comment

Choose a reason for hiding this comment

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

image

from the original issue, can you implement this?

edit: this is a separate thing, needs approval - nevermind

@retrogtx
Copy link
Contributor

retrogtx commented Feb 6, 2025

Got it running locally, the button shows up even though I have zero bookings in this account. Please make it such that it appears only if I have at least 1 booking in the past.

image

@hp77-creator
Copy link
Author

image from the original issue, can you implement this?

edit: this is a separate thing, needs approval - nevermind

Yes, I thought so too, this needs a separate development. It is not trivial as this feature.

@hp77-creator
Copy link
Author

Got it running locally, the button shows up even though I have zero bookings in this account. Please make it such that it appears only if I have at least 1 booking in the past.

image

will do this change

@hp77-creator
Copy link
Author

Screen.Recording.2025-02-06.at.9.34.55.PM.mov

@retrogtx added the change and the vid

@hp77-creator hp77-creator requested a review from retrogtx February 6, 2025 16:06
retrogtx
retrogtx previously approved these changes Feb 7, 2025
Copy link
Contributor

@retrogtx retrogtx left a comment

Choose a reason for hiding this comment

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

this works, lgtm

Copy link
Contributor

github-actions bot commented Feb 7, 2025

E2E results are ready!

Copy link
Contributor

@keithwillcode keithwillcode left a comment

Choose a reason for hiding this comment

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

Only marking as requested changes to ensure this gets a review from Foundation before merge due to the high-risk nature of this. @emrysal @zomars @ThyMinimalDev @eunjae-lee

@keithwillcode keithwillcode added the high-risk Requires approval by Foundation team label Feb 7, 2025
@graphite-app graphite-app bot requested a review from a team February 7, 2025 16:49
Copy link
Contributor

@keithwillcode keithwillcode left a comment

Choose a reason for hiding this comment

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

This code cannot be merged without automated tests verifying:

  • Deleting 1 booking only deletes the 1 record
  • Deleting multiple bookings deletes only the exact bookings it should
  • I cannot delete other bookings I don't have permission to delete

@hp77-creator
Copy link
Author

Thanks @keithwillcode
I will add the tests.

@retrogtx
Copy link
Contributor

Thanks @keithwillcode I will add the tests.

hey @hp77-creator
are you working on tests?

@hp77-creator
Copy link
Author

I am working on it @retrogtx
Was confused yesterday where to add these cases?
And do I need to add router tests or e2e UI tests?

@retrogtx
Copy link
Contributor

I am working on it @retrogtx Was confused yesterday where to add these cases? And do I need to add router tests or e2e UI tests?

Add router tests as we do not wish to delete something that is unnecessary as that will be dangerous
There is a test folder in app/web/test/lib

An example for the same: #19071

Thank you

@hp77-creator
Copy link
Author

I was checking the vitest.workspace.ts file @retrogtx
It seems the directory you mention isn't added there, are tests in those directory run?
I was hoping to also run them in my system before pushing them, how can I run them locally? I checked vitess docs, I see that we trigger them using scripts in package.json only but I didn't find any script command for the directory that you mentioned. Maybe I missed something, can you help?

@retrogtx
Copy link
Contributor

I was checking the vitest.workspace.ts file @retrogtx It seems the directory you mention isn't added there, are tests in those directory run? I was hoping to also run them in my system before pushing them, how can I run them locally? I checked vitess docs, I see that we trigger them using scripts in package.json only but I didn't find any script command for the directory that you mentioned. Maybe I missed something, can you help?

hey, the tests in that directory is just run. you can trigger it yourself by writing npx vitest yourfilepath/.../.. <- this helps trigger only the one test file

@hp77-creator
Copy link
Author

indeed we can, I was confused because I thought this needs to go into suite as well, i will follow what you have mentioned. Thanks.

@hp77-creator
Copy link
Author

@keithwillcode Thanks for the change request of adding test, It made me add check for unauthorized user, I have added tests, @retrogtx you may review, Thanks for your patience.
Here are the test results:
image

@hp77-creator hp77-creator force-pushed the feature_delete_past_meeting branch from 8628f43 to 65b25a3 Compare February 12, 2025 16:09
@retrogtx
Copy link
Contributor

thank you for the PR @hp77-creator

since this deals with risky parts (like permanently deleting) this will take some time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bookings area: bookings, availability, timezones, double booking 🙋 Bounty claim 💎 Bounty A bounty on Algora.io community Created by Linear-GitHub Sync ✨ feature New feature or request high-risk Requires approval by Foundation team ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-5114] Delete the booking history of past or canceled meetings
3 participants