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

Add event cancellation #4273

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from
Open

Add event cancellation #4273

wants to merge 28 commits into from

Conversation

spreeni
Copy link
Contributor

@spreeni spreeni commented May 1, 2024

closes #4178

  • Backend: Added RPC for event cancellation and deletion
  • Backend: Adjusted Event DB schema
  • Backend: Deny selected actions on cancelled event
  • Backend: Deleted events should never show up
  • Backend: Notify attendants if an event got cancelled/deleted
  • Frontend: Add button to cancel event
  • Frontend: Display cancelled events accordingly
    • Grey cancelled events out in overview
    • Make all buttons disabled for cancelled events
    • Add red chip for cancelled events

Backend checklist

  • Formatted my code by running autoflake --exclude src/proto -r -i --remove-all-unused-imports src && isort . && black . in app/backend
  • Added tests for any new code or added a regression test if fixing a bug
  • All tests pass
  • Run the backend locally and it works
  • Added migrations if there are any database changes, rebased onto develop if necessary for linear migration history

Web frontend checklist

  • Formatted my code with make format
  • There are no warnings from make lint
  • There are no console warnings when running the app
  • Added any new components to storybook
  • Added tests where relevant
  • All tests pass
  • Clicked around my changes running locally and it works
  • Checked Desktop, Mobile and Tablet screen sizes

@spreeni spreeni added backend This issue relates to the python backend web feature request A *requested* feature labels May 1, 2024
@spreeni spreeni self-assigned this May 1, 2024
@spreeni spreeni marked this pull request as draft May 1, 2024 22:27
@aapeliv aapeliv added the release notes: pending Add to stuff that should be included in release notes label May 4, 2024
@aapeliv
Copy link
Member

aapeliv commented May 7, 2024

Let me know if you need anything for this.

@jesseallhands jesseallhands mentioned this pull request May 21, 2024
@schradert schradert added this to the V1 milestone May 23, 2024
@schradert schradert added feature Implementation of a feature and removed feature request A *requested* feature labels May 23, 2024
@spreeni
Copy link
Contributor Author

spreeni commented May 24, 2024

@aapeliv @jesseallhands How do we want to display cancelled events? In my idea, they should later not show up in event searches at all, but should still show up under a tab "My Events" or so, if you joined one previously.

In the current version, as we don't have too many events yet, I guess we display cancelled events as well, but should make it visually clear that they are/were cancelled. How should we do that best? (I am slightly limited by my frontend dev skills here) My idea for now was to grey them out a bit and include a "cancelled" badge.

@jesseallhands
Copy link
Contributor

jesseallhands commented May 24, 2024

@aapeliv @jesseallhands How do we want to display cancelled events? In my idea, they should later not show up in event searches at all, but should still show up under a tab "My Events" or so, if you joined one previously.

In the current version, as we don't have too many events yet, I guess we display cancelled events as well, but should make it visually clear that they are/were cancelled. How should we do that best? (I am slightly limited by my frontend dev skills here) My idea for now was to grey them out a bit and include a "cancelled" badge.

Yes, I think cancelled events should be under a separate cancelled events tab and the event itself should use a bright "cancelled!" pill (badge) to mark it, so if someone has the link to the event and they go to it, they easily see it has been cancelled.

As far as deleted events go, those shouldn't be shown on the website at all, but should still be queryable on the backend.

@spreeni
Copy link
Contributor Author

spreeni commented May 24, 2024

So I chose to include a switch for now to display cancelled events. I think soon, as discussed, we could have a new events page layout (see #3989).

Cancelled events are greyed out and highlighted with a "cancelled" chip. On the page of a cancelled event the buttons are disabled and greyed out.

Deleted events can't be queried at all through the API, but are still available in the database. I thought it might be better to avoid accidentally displaying a deleted event. But an alternative could be that only superusers can query deleted events.

Screenshot 2024-05-24 at 14 13 49 Screenshot 2024-05-24 at 14 14 06

# Conflicts:
#	app/backend/src/couchers/errors.py
#	app/backend/src/couchers/servicers/admin.py
#	app/backend/src/couchers/servicers/events.py
#	app/backend/src/tests/test_admin.py
#	app/proto/admin.proto
#	app/proto/events.proto
@spreeni spreeni marked this pull request as ready for review May 28, 2024 22:31
@spreeni spreeni requested a review from aapeliv May 28, 2024 22:31
@spreeni
Copy link
Contributor Author

spreeni commented May 28, 2024

There are 4 different places where events are currently listed, this is how I chose to deal with cancelled events for each of these:

  • Dashboard: Cancelled events are not shown (Here ListMyEvents is called, where a include_cancelled flag could be used to include these though)
  • Events page: Cancelled events are by default not shown, but can be toggled to be shown
  • Community page overview: Cancelled events are not shown
  • Community page events tab: Cancelled events are not shown

I think viewing cancelled events does only make sense if wondering why an event I joined previously was cancelled or to look for other attendees/information and is therefore quite conscious.

@aapeliv
Copy link
Member

aapeliv commented May 28, 2024

There are 4 different places where events are currently listed, this is how I chose to deal with cancelled events for each of these:

  • Dashboard: Cancelled events are not shown (Here ListMyEvents is called, where a include_cancelled flag could be used to include these though)

  • Events page: Cancelled events are by default not shown, but can be toggled to be shown

  • Community page overview: Cancelled events are not shown

  • Community page events tab: Cancelled events are not shown

I think viewing cancelled events does only make sense if wondering why an event I joined previously was cancelled or to look for other attendees/information and is therefore quite conscious.

I think this is great!

Copy link
Member

@aapeliv aapeliv left a comment

Choose a reason for hiding this comment

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

It looks mostly good on the backend, a few small comments. I will have another look when I'm back on my computer!



def upgrade():
with op.get_context().autocommit_block():
Copy link
Member

Choose a reason for hiding this comment

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

What does this one do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Altering a type has to be run outside of a transaction, which this context manager allows, if I understood that correctly. Read this in Stackoverflow and on alembic docs.

Howevery, I saw that you did it in a previous migration without it, so maybe it is not necessary...



def downgrade():
raise Exception("Can't downgrade")
Copy link
Member

Choose a reason for hiding this comment

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

Could you please combine the two migrations into one file. And please rebase on develop (you might need to change the down revision to the latest value) to keep a linear alembic history.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I combined the migrations now - I merged develop into this branch already and added these migrations on top, so the history is linear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend This issue relates to the python backend feature Implementation of a feature release notes: pending Add to stuff that should be included in release notes web
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cancellation of an event
4 participants