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

fix: allows hard delete for feedbacks #6154

Merged

Conversation

shreyanshdwivedi
Copy link
Member

Fixes #6153

Short description of what this resolves:

Currently there is hard delete for feedback.

Changes proposed in this pull request:

  • Hard deletes the feedback if deleted_at is not NULL
  • Changes range from 0-5 to 1-5 for rating

Checklist

  • I have read the Contribution & Best practices Guide and my PR follows them.
  • My branch is up-to-date with the Upstream development branch.
  • The unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • All the functions created/modified in this PR contain relevant docstrings.

@codecov
Copy link

codecov bot commented Jul 7, 2019

Codecov Report

Merging #6154 into development will decrease coverage by 0.03%.
The diff coverage is 37.5%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #6154      +/-   ##
===============================================
- Coverage        66.29%   66.26%   -0.04%     
===============================================
  Files              286      287       +1     
  Lines            14415    14430      +15     
===============================================
+ Hits              9557     9562       +5     
- Misses            4858     4868      +10
Impacted Files Coverage Δ
app/api/schema/feedbacks.py 100% <100%> (ø) ⬆️
app/api/feedbacks.py 51.28% <20%> (-2.15%) ⬇️
app/api/helpers/feedback.py 40% <40%> (ø)

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 28f9fb8...ad788ac. Read the comment docs.

mrsaicharan1
mrsaicharan1 previously approved these changes Jul 8, 2019
Copy link
Member

@mrsaicharan1 mrsaicharan1 left a comment

Choose a reason for hiding this comment

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

This looks fine.

uds5501
uds5501 previously approved these changes Jul 8, 2019
app/api/feedbacks.py Outdated Show resolved Hide resolved
@@ -23,7 +23,7 @@ class Meta:
inflect = dasherize

id = fields.Str(dump_only=True)
rating = fields.Float(required=True, validate=Range(min=0, max=5))
rating = fields.Float(required=True, validate=Range(min=1, max=5))
Copy link
Member

Choose a reason for hiding this comment

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

This behaviour of frontend deleting the record when setting the rating to 0 is wrong IMO. Delete action should be very explicit. Either show a dialog on frontend that setting rating to 0 will delete the feedback

Copy link
Member Author

Choose a reason for hiding this comment

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

FE is using ui-rating from semantic UI. If a user selects rating 2 suppose and wants to clear out the rating, he/she needs to click on 2 stars again and the rating is cleared (set to 0). I think showing a dialog box will be better.
@CosmicCoder96 your opinion?

Copy link
Member Author

Choose a reason for hiding this comment

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

@iamareebjamal please review this PR again. The FE PR is still WIP so I can include your suggestions there

updates login and includes logger
@shreyanshdwivedi shreyanshdwivedi changed the title fix: allows hard delete for users fix: allows hard delete for feedbacks Jul 9, 2019
@iamareebjamal iamareebjamal merged commit 76f42b1 into fossasia:development Jul 9, 2019
iamareebjamal pushed a commit to iamareebjamal/open-event-server that referenced this pull request Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No hard delete for feedback
5 participants