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

[CM-2072] Show answer source url with bot answer #305

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

AbhijeetRanjan308
Copy link
Contributor

@AbhijeetRanjan308 AbhijeetRanjan308 commented Jun 24, 2024

Summary

  • Added a new view for Source URL.

Expected Data In Metadata

"sourceURLs" = ["https://dashboard.kommunicate.io", "https://docs.kommunicate.io"]

Image

SDK

Agent App

@@ -74,6 +74,16 @@ extension ALKConversationViewController: UITableViewDelegate, UITableViewDataSou
}
return cell

} else if let messageMetadata = message.metadata, let _ = messageMetadata["sourceURLs"], !message.isMyMessage {
Copy link
Contributor

Choose a reason for hiding this comment

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

create a variable for this sourceURLs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

@@ -314,6 +314,12 @@ open class ALKConversationViewModel: NSObject, Localizable {
switch messageModel.messageType {
case .text, .html, .email:
guard !configuration.isLinkPreviewDisabled, messageModel.messageType == .text, ALKLinkPreviewManager.extractURLAndAddInCache(from: messageModel.message, identifier: messageModel.identifier) != nil else {
if let messageMetadata = messageModel.metadata, let metadataValue = messageMetadata["sourceURLs"], !messageModel.isMyMessage {
Copy link
Contributor

Choose a reason for hiding this comment

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

convert raw string into variable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

nameLabel.text = viewModel.displayName
var urls = [""]

if let messageMetadata = viewModel.metadata, let metadataValue = messageMetadata["sourceURLs"] as? [String] {
Copy link
Contributor

Choose a reason for hiding this comment

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

here as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

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.

None yet

2 participants