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

[sc-11409] change accordingly to API response change, fix some UI issues #143

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "addsearch-search-ui",
"version": "0.9.2",
"version": "0.9.3",
"description": "JavaScript library to develop Search UIs for the web",
"repository": {
"type": "git",
Expand Down
6 changes: 6 additions & 0 deletions src/components/aianswersresult/aianswersresult.scss
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,12 @@
justify-content: flex-end;
gap: 24px;

button {
background-color: transparent;
border-width: 0;
cursor: pointer;
}

.copy-confirm-message {
font-size: 70%;
color: #587293;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
</div>
<div class='action-buttons-group'>
<span class='copy-confirm-message'></span>
<button class='copy-btn'><svg
<button class='copy-btn' type="button">
<svg
width='24'
height='24'
viewBox='0 0 24 24'
Expand All @@ -82,7 +83,7 @@
/>
</svg>
</button>
<button class='thumbs-up-btn'>
<button class='thumbs-up-btn' type="button">
{{#equals sentimentState 'positive'}}
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_184_2273)">
Expand All @@ -108,7 +109,7 @@
</svg>
{{/equals}}
</button>
<button class='thumbs-down-btn'>
<button class='thumbs-down-btn' type="button">
{{#equals sentimentState 'negative'}}
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_184_2278)">
Expand Down Expand Up @@ -140,15 +141,15 @@
<h4 class='sources-headline'>{{sourcesHeadlineText}}</h4>
<div class='sources-list'>
{{#each sources}}
<a href='{{url}}' class='source'>
<a href='{{url}}' class='source' target="_blank">
{{title}}
</a>
{{/each}}
</div>
</div>
{{/if}}
</div>
<button class='show-more-btn'>
<button class='show-more-btn' type="button">
<span class='button-text'>Show more</span>
<svg
class='chevron'
Expand Down
7 changes: 4 additions & 3 deletions src/util/create-ai-answers-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ export function createAiAnswersData(aiAnswersResponse) {
id: aiAnswersResponse.conversation_id,
answerText: aiAnswersResponse.answer || '',
sources:
aiAnswersResponse.source_documents?.hits?.map((hit) => ({
url: hit.url,
title: hit.title
aiAnswersResponse.sources?.map((source) => ({
id: source.id,
url: source.url,
title: source.title
})) || []
};
}