Midburn / spark

"burn in a box" suite of services that composes everything required to run a burn event throughout the year
Apache License 2.0
18 stars 46 forks source link

Prevent editing camps from old events #991

Open NitayRabi opened 5 years ago

NitayRabi commented 5 years ago

Proposed solution

  1. Homepage
    • got events + current event from service (ajax) instead of jade.
    • Implemented block editing logic in events service.
    • added logic to test if events end date has passed. (Fixed start+end date saving for event)
  2. Camp View
    • Fixed if statements for showing editing button for admin and camp manager.
    • Used event service to test if camp is editable.

Tradeoffs

Data is fetched through ajax instead of server rendered. We should consider showing disabled buttons instead of hiding them. What's the expected behavior for events without end_time.

Testing Done

  1. Login as camp manager.
  2. Login separately as admin.
  3. disable editing for event (refresh as manager and see effects)
  4. play with events end_time in admin panel (refresh as manager and see effects)