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

now able to remove user feedback after given #183

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GraysonQuartech
Copy link

Motivation and Context

previously users were unable to remove a like reaction or dislike reaction after providing feedback. now users can add or remove feedback freely.

Description

now able to like, dislike and deselect like or dislike.

Contribution Checklist

checklist complete.

@mattthiessendev
Copy link

suggestion: the backend doesn't support an undefined body. To fully support this feature the POST /chats/{guid}/messages/{guid} endpoint will need to be updated as well.

const currentFeedback = positive ? UserFeedback.Positive : UserFeedback.Negative;

// Determine if we're toggling the current selection off
const newFeedback = wasHelpful === currentFeedback ? undefined : currentFeedback;
Copy link

Choose a reason for hiding this comment

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

Would we prefer setting this to undefined or null ?

Choose a reason for hiding this comment

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

whatever gets decided here can cascade into each of my comments

@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.

Choose a reason for hiding this comment

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

polish: should remove this from the PR. Don't think we need a yarn.lock in our scripts directory

const token = await AuthHelper.getSKaaSAccessToken(instance, inProgress);

chatService
.rateMessageAync(selectedId, messageId, positive, token)
.rateMessageAync(selectedId, messageId, newFeedback === UserFeedback.Positive, token)

Choose a reason for hiding this comment

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

issue: newFeedback === UserFeedback.Positive evaluates to either true or false. We are going to need to pass undefined here if we want to remove a rating.

Choose a reason for hiding this comment

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

on testing I see that the frontend does update to allow you to remove a "like" or "dislike" but, the payload going to the backend is still either true or false

const currentFeedback = positive ? UserFeedback.Positive : UserFeedback.Negative;

// Determine if we're toggling the current selection off
const newFeedback = wasHelpful === currentFeedback ? undefined : currentFeedback;

Choose a reason for hiding this comment

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

whatever gets decided here can cascade into each of my comments

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.

3 participants