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

PR to implement copy to clipboard functionality to AAP virtual assistant #1450

Merged
merged 5 commits into from
Dec 9, 2024

Conversation

justjais
Copy link
Contributor

@justjais justjais commented Dec 9, 2024

Jira Issue: https://issues.redhat.com/browse/AAP-37122

Description

PR to implement copy to clipboard functionality to AAP virtual assistant

Testing

Steps to test

  1. Pull down the PR
  2. run npm install
  3. change An unexpected error occured to
const chatResponse: ChatResponse = {
  conversation_id: "1",
  response: "this to implement copy to clipboard!!",
  referenced_documents: [],
  truncated: false
};
const referenced_documents = chatResponse.referenced_documents;
if (!conversationId) {
  setConversationId(chatResponse.conversation_id);
}
const newBotMessage: any = botMessage(chatResponse, message);
newBotMessage.referenced_documents = referenced_documents;
addMessage(newBotMessage);

and feedback exception to:

const newBotMessage = {
  referenced_documents: [],
  ...feedbackMessage(feedbackRequest),
};
  1. run: npm run start
  2. Check for copy to clipboard functionality.

ref:
image

Scenarios tested

Production deployment

  • This code change is ready for production on its own
  • This code change requires the following considerations before going to production:

@justjais justjais requested a review from TamiTakamiya December 9, 2024 08:55
copy: {
onClick: () => {
if (message.actions) {
message.actions.copy.isDisabled = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we do not need to disable the copy icon after a user clicked it once. Would you remove this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack, updated and removed the disabled check.

Copy link
Contributor

@TamiTakamiya TamiTakamiya left a comment

Choose a reason for hiding this comment

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

I left one comment. Thanks!

@justjais justjais requested a review from TamiTakamiya December 9, 2024 15:39
@justjais justjais merged commit c8b6f03 into main Dec 9, 2024
11 checks passed
@justjais justjais deleted the AAP-37122 branch December 9, 2024 18:07
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