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

Update flag count after moderator flags an annotation themselves #347

Merged
merged 4 commits into from
Apr 13, 2017

Conversation

robertknight
Copy link
Member

When a user who is also a moderator flags an annotation, the client updated the flagged key in its local copy of the annotation but not the moderation.flag_count key (if present), so the moderation banner did not reflect the change in flag status.

In the scenario where an unflagged annotation is flagged by a moderator, this meant that the moderation banner did not appear and the user had to reload the page to actually hide the annotation.

Fixes #346

…odule

Tests for actions should live in the test module associated with the
module that defines the actions.
Flagging or unflagging an annotation previously updated the status
flag indicating whether an annotation had been flagged by the current
user but did not update the flag count if the user was also a moderator.

This needs to be done to make the moderation banner's state update when
a user who is also a moderator flags an annotation.
@codecov-io
Copy link

codecov-io commented Apr 7, 2017

Codecov Report

Merging #347 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #347      +/-   ##
=========================================
+ Coverage   76.57%   76.6%   +0.02%     
=========================================
  Files         119     119              
  Lines        5952    5958       +6     
  Branches      968     971       +3     
=========================================
+ Hits         4558    4564       +6     
  Misses       1394    1394
Impacted Files Coverage Δ
src/sidebar/reducers/annotations.js 98% <100%> (+0.08%) ⬆️

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 10206b2...32768db. Read the comment docs.

@robertknight robertknight force-pushed the update-mod-flag-count-after-flag branch from e1106db to fe50275 Compare April 7, 2017 13:16
@robertknight robertknight self-assigned this Apr 10, 2017
@sheetaluk sheetaluk merged commit e1e50b0 into master Apr 13, 2017
@sheetaluk sheetaluk deleted the update-mod-flag-count-after-flag branch April 13, 2017 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants