hatnote / montage

📷 Photo evaluation tool for and by Wiki Loves competitions
https://commons.wikimedia.org/wiki/Commons:Montage
BSD 3-Clause "New" or "Revised" License
36 stars 11 forks source link

Hiding inactive campaigns (Archive flag) #178

Closed mahmoud closed 3 years ago

mahmoud commented 3 years ago

Rather than coopt the status field of the Campaign table, as in #169, this PR introduces a new Archive feature, which hides the campaign from Jurors' and Coordinators' dashboards. Campaigns in any state can be archived without affecting their status.

Current status is that the backend is tested and passing. Now, need to make the modifications to the frontend.

For rollout:

codecov-commenter commented 3 years ago

Codecov Report

Merging #178 into master will increase coverage by 0.38%. The diff coverage is 83.67%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #178      +/-   ##
==========================================
+ Coverage   76.11%   76.49%   +0.38%     
==========================================
  Files          19       19              
  Lines        3805     3820      +15     
  Branches      479      479              
==========================================
+ Hits         2896     2922      +26     
+ Misses        666      655      -11     
  Partials      243      243              
Impacted Files Coverage Δ
montage/admin_endpoints.py 82.32% <66.66%> (+0.97%) :arrow_up:
montage/juror_endpoints.py 80.58% <75.00%> (+0.87%) :arrow_up:
montage/rdb.py 77.89% <78.57%> (+0.25%) :arrow_up:
montage/tests/test_web_basic.py 91.84% <100.00%> (+0.46%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 883970d...d5bf6a9. Read the comment docs.

mahmoud commented 3 years ago

The commit above adds the frontend. This is basically done except for maybe some cleanup and rollout activities.

Also, it appears the double-load I spotted in the original PR is also on production. Seems like the dashboard's onInit is being executed twice, kinda like this: https://stackoverflow.com/questions/38787795/why-is-ngoninit-called-twice

slaporte commented 3 years ago

Nice! The frontend is all working for me.

A few small things (that I don't think should hold back this PR):

slaporte commented 3 years ago

The commit above adds the frontend. This is basically done except for maybe some cleanup and rollout activities.

Also, it appears the double-load I spotted in the original PR is also on production. Seems like the dashboard's onInit is being executed twice, kinda like this: https://stackoverflow.com/questions/38787795/why-is-ngoninit-called-twice

I think onInit for the toolbar is the culprit. Admin and juror data is not necessary to load for the toolbar, and we load it again for for the dashboard. I think we can cut those two lines without a problem.

mahmoud commented 3 years ago

All valid points.

  1. I can update the header to say "Active Campaigns"
  2. I thought the same about canCloseCampaign, but the server-returned error message is actually pretty descriptive, so I didn't foray too late.
  3. Are closed campaigns not in the "all" view? If not, I'll address that.
  4. I'd say ideally all archived content is paused and encased in glass until unarchived. Closed campaigns are certainly archivable, though right now the only effect I can think of would be the button changing labels.
  5. 20.09.16! :)
mahmoud commented 3 years ago

Just confirmed that closed campaigns are on the "All" page.

mahmoud commented 3 years ago

Screenshots with one open and one closed campaign:

Screenshot from 2020-09-16 23-54-28 Screenshot from 2020-09-16 23-55-30

mahmoud commented 3 years ago

Alright, let's get this deployed. Merging.

mahmoud commented 3 years ago

Steps for deploying this

  1. Build frontend
  2. Migrate DB (add column)
  3. Upload code (frontend+backend)
  4. Restart
  5. Test
  6. One-time archive campaigns older than X months

Do ^ for dev/beta before prod.