This blog post will showcase an option which can be used by organizers to lock/unlock a session in Open Event Frontend. Let’s start by understanding what this feature means and why is it important for organizers. If a session is locked by an organizer, it cannot be edited by the session creator.
Suppose an event organizer wants final session submission by a particular date so that he/she can shortlist the sessions based on final submission, but the user goes on editing the session event after final date of submission. This is a situation where this feature will help the organizer to prohibit the user from further modification of session.
If a session is unlocked, then unlock icon is shown:
However, if a session is locked, lock icon is shown:
Snippet to toggle locked/unlocked icon
On clicking these icon buttons, corresponding action is triggered which updates the status of is-locked attribute of the session. When an organizer clicks on lock icon button, unlockSession action is triggered which sets is-locked property of session to false. However if unlock icon button is clicked, lockSession action is triggered which sets the is-locked property of session to true.
Snippet to lock a session:
Snippet to unlock a session:
These changes required few server checks so that only a person with admin or organizer access can update the value of is-locked attribute of session. Also, any try to edit a locked session via API call must be rejected.
Server checks related to locking/unlocking a session:
Related work and code repo:
- Front-End Repository
- API Server Repository
- Redesigning session page and adding columns to the table
- Implement locking session feature on server
Eventyay, FOSSASIA, Flask, Ember.js, Open Event