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

Allow state editing via moderation. #2381

Merged
merged 1 commit into from
Jan 16, 2019
Merged

Allow state editing via moderation. #2381

merged 1 commit into from
Jan 16, 2019

Conversation

dracos
Copy link
Member

@dracos dracos commented Jan 15, 2019

If a state is passed in (on a cobrand), update problem state and add a comment to record this (as state changes are updates not moderations).

  • Is new functionality tested? CodeCov will warn you about the diff coverage, but won’t complain about e.g. new files;
  • Have you updated the changelog? If this is not necessary, put square brackets around this: skip changelog

@ghost ghost assigned dracos Jan 15, 2019
@ghost ghost added the Reviewing label Jan 15, 2019
@dracos dracos requested review from struan and removed request for struan January 15, 2019 16:58
@dracos dracos requested a review from struan January 15, 2019 17:09
@codecov
Copy link

codecov bot commented Jan 15, 2019

Codecov Report

Merging #2381 into master will increase coverage by 0.02%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2381      +/-   ##
=========================================
+ Coverage   80.68%   80.7%   +0.02%     
=========================================
  Files         192     192              
  Lines       12314   12328      +14     
  Branches     2287    2293       +6     
=========================================
+ Hits         9935    9949      +14     
+ Misses       1613    1612       -1     
- Partials      766     767       +1
Impacted Files Coverage Δ
perllib/FixMyStreet/App/Controller/Moderate.pm 89.88% <85.71%> (-0.38%) ⬇️
perllib/FixMyStreet/DB/Result/Comment.pm 88.6% <0%> (+2.53%) ⬆️

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 53624a3...be0944d. Read the comment docs.

Copy link
Member

@struan struan left a comment

Choose a reason for hiding this comment

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

One small query but otherwise, this looks good.

$problem->state($new_state);
$problem->update;
$problem->add_to_comments( {
text => $c->stash->{moderation_reason},
Copy link
Member

Choose a reason for hiding this comment

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

Normally this doesn't get made public so is that not going to be a bit unexpected?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, so this won't be on .com, only on a cobrand that's deliberately added state to the moderation form (like kiitc) where it's clearer it's a public editing, but yes, I guess it still might be odd. Guess I'll add a comment here at least about thinking about that for any other cobrand that might use it.

If a state is passed in (on a cobrand), update problem state and add a
comment to record this (as state changes are updates not moderations).
@dracos dracos merged commit be0944d into master Jan 16, 2019
@ghost ghost removed the Reviewing label Jan 16, 2019
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.

2 participants