Skip to content

Commit

Permalink
Fixed a bug where messages with card and search doesnt show any results
Browse files Browse the repository at this point in the history
  • Loading branch information
rmdort committed Jun 28, 2018
1 parent 462ac16 commit 0f15882
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 232 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@olasearch/chat",
"version": "3.6.14",
"version": "3.6.15",
"description": "Chat User Interface elements",
"main": "lib/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/Version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = '3.6.14'
module.exports = '3.6.15'
20 changes: 20 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,26 @@ export function createMessageSequence (response) {
})
}

/**
* Check if answer card source === 'results' and if search results are empty and no reply
*/
if (
!results.length &&
answer.card &&
answer.card.source &&
answer.card.source === 'results'
) {
/**
* Always push a message along with search
*/
if (!sequence.message.length) {
sequence.message.push({
type: 'text',
search: true
})
}
}

if (isSearchActive) {
/**
* Always push a message along with search
Expand Down
230 changes: 0 additions & 230 deletions style/_chart.scss
Original file line number Diff line number Diff line change
@@ -1,233 +1,3 @@
/**
* Ola viz
*/

.ola-viz{
margin-bottom: 1em;
}
/*-- Chart --*/


.bb svg {
font-size: 11px;
}
.bb path, .bb line {
fill: none;
stroke: #000;
}
.bb text {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}

.bb-legend-item-tile,
.bb-xgrid-focus,
.bb-ygrid,
.bb-event-rect,
.bb-bars path {
shape-rendering: crispEdges;
}

.bb-chart-arc path {
stroke: #fff;

}
.bb-chart-arc text {
fill: #fff;
font-size: 13px;
}

/*-- Axis --*/

.bb-axis-x .tick {
}
.bb-axis-x-label {
}

.bb-axis-y .tick {
}
.bb-axis-y-label {
}

.bb-axis-y2 .tick {
}
.bb-axis-y2-label {
}

/*-- Grid --*/

.bb-grid line {
stroke: #aaa;
}
.bb-grid text {
fill: #aaa;
}
.bb-xgrid, .bb-ygrid {
stroke-dasharray: 3 3;
}
.bb-xgrid-focus {
}

/*-- Text on Chart --*/

.bb-text {
}

.bb-text.bb-empty {
fill: #808080;
font-size: 2em;
}

/*-- Line --*/

.bb-line {
stroke-width: 1px;
}
/*-- Point --*/

.bb-circle._expanded_ {
stroke-width: 1px;
stroke: white;
}
.bb-selected-circle {
fill: white;
stroke-width: 2px;
}

/*-- Bar --*/

.bb-bar {
stroke-width: 0;
}
.bb-bar._expanded_ {
fill-opacity: 0.75;
}

/*-- Arc --*/

.bb-chart-arcs-title {
font-size: 1.3em;
}

/*-- Focus --*/

.bb-target.bb-focused {
opacity: 1;
}
.bb-target.bb-focused path.bb-line, .bb-target.bb-focused path.bb-step {
stroke-width: 2px;
}
.bb-target.bb-defocused {
opacity: 0.3 !important;
}


/*-- Region --*/

.bb-region {
fill: steelblue;
fill-opacity: .1;
}

/*-- Brush --*/

.bb-brush .extent {
fill-opacity: .1;
}

/*-- Select - Drag --*/

.bb-dragarea {
}

/*-- Legend --*/

.bb-legend-item {
font-size: 12px;
}
.bb-legend-item-hidden {
opacity: 0.15;
}

.bb-legend-background {
opacity: 0.75;
fill: white;
stroke: lightgray;
stroke-width: 1
}

/*-- Tooltip --*/

.bb-tooltip-container {
z-index: 10;
}
.bb-tooltip {
border-collapse:collapse;
border-spacing:0;
background-color:#fff;
empty-cells:show;
-webkit-box-shadow: 7px 7px 12px -9px rgb(119,119,119);
-moz-box-shadow: 7px 7px 12px -9px rgb(119,119,119);
box-shadow: 7px 7px 12px -9px rgb(119,119,119);
opacity: 0.9;
}
.bb-tooltip tr {
border:1px solid #CCC;
}
.bb-tooltip th {
background-color: #333;
font-size:14px;
padding:2px 5px;
text-align:left;
color:#FFF;
}
.bb-tooltip td {
font-size:13px;
padding: 3px 6px;
background-color:#fff;
border-left:1px dotted #999;
}
.bb-tooltip td > span {
display: inline-block;
width: 10px;
height: 10px;
margin-right: 6px;
}
.bb-tooltip td.value{
text-align: right;
}

.bb-area {
stroke-width: 0;
opacity: 0.2;
}

.bb-chart-arcs .bb-chart-arcs-background {
fill: #e0e0e0;
stroke: none;
}
.bb-chart-arcs .bb-chart-arcs-gauge-unit {
fill: #000;
font-size: 16px;
}
.bb-chart-arcs .bb-chart-arcs-gauge-max {
fill: #777;
}
.bb-chart-arcs .bb-chart-arcs-gauge-min {
fill: #777;
}

.bb-chart-arc .bb-gauge-value {
fill: #000;
/* font-size: 28px !important;*/
}

/* https://github.com/masayuki0812/c3/issues/784*/

.bb-xgrid-focus line { display: none; }



/* Sample space select */

Expand Down

0 comments on commit 0f15882

Please sign in to comment.