Skip to content

Commit

Permalink
Fix Blocking Bug - Part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dcollarana authored and dcollarana committed Sep 17, 2017
1 parent e4946df commit 69de7ed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
31 changes: 16 additions & 15 deletions app/assets/javascripts/results.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ var Container = React.createClass({
} else if (optionSelected === "5") {
type = "document"
}
this.setState({entityType: type, facetsDict: {}, orgFacetsDict: {}, loadMoreResults: false, exactMatching: false, loadMergedData: false});
if(type !== this.state.entityType){
this.setState({entityType: type, facetsDict: {}, orgFacetsDict: {}, loadMoreResults: false, exactMatching: false, loadMergedData: false, mergeData: {1: null, 2: null}});
}
else
this.setState({entityType: type, facetsDict: {}, orgFacetsDict: {}, loadMoreResults: false, exactMatching: false, loadMergedData: false});
},
setEntityType: function (type) {
this.setState({entityType: type,facetsDict: {}, orgFacetsDict: {}, loadMoreResults: false, exactMatching: false, loadMergedData: false});
Expand Down Expand Up @@ -287,7 +291,7 @@ var Container = React.createClass({
type: 'GET',
success: function() {
console.log("success");
alert("The data was merged");
alert(getTranslation("merge_success_message"));
this.setState({entityType: this.state.entityType, facetsDict: {}, orgFacetsDict: {}, loadMoreResults: false, exactMatching: false, loadMergedData: true, mergeData: {1: null, 2: null}});
}.bind(this),
error: function(xhr) {
Expand Down Expand Up @@ -1680,6 +1684,10 @@ var SnapshotLink = React.createClass({
window.open(url);
});
}
else {
var url = context + "/screenshot?url=" + this.props.webpage;
window.open(url);
}
},
render: function () {
return (
Expand All @@ -1696,7 +1704,7 @@ var ProductResultElement = React.createClass({
<div className="summary row">
<div className="thumbnail-wrapper col-md-2">
<div className="thumbnail">
<ThumbnailElement img={this.props.img} webpage={this.props.webpage} isDoc={false}/>
<ThumbnailElement img={this.props.img} webpage={this.props.source} isDoc={false}/>
</div>
</div>
<div className="summary-main-wrapper col-md-8">
Expand All @@ -1715,7 +1723,10 @@ var ProductResultElement = React.createClass({
<p>{getTranslation("price")}: {this.props.price}</p> : null }
{ this.props.condition !== undefined ?
<p>{getTranslation("condition")}: {this.props.condition}</p> : null }
<LinkElement webpage={this.props.webpage} />
{ this.props.webpage !== undefined ?
<p><b>{getTranslation("link")}: </b>
<a href={getValue(this.props.webpage)} target="_blank">{getValue(this.props.webpage)}</a></p>
: null }
</div>
</div>
</div>
Expand Down Expand Up @@ -2242,17 +2253,7 @@ var ThumbnailElement = React.createClass({
}
}
else {
var imgList = {};
if (Array.isArray(this.props.webpage)) {
var arr = this.props.webpage;
imgList = arr.map(function(){
return <li><img src={context + "/assets/images/datasources/Unknown.png"} height="60px" width="75px"/></li>;
});
return (<div className="flexslider"><ul className="slides">{imgList}</ul></div>)
}
else{
return <img src={context + "/assets/images/datasources/Unknown.png"} height="60px" width="75px"/>
}
return <img src={context + "/assets/images/datasources/Unknown.png"} height="60px" width="75px"/>
}
}
});
Expand Down
1 change: 1 addition & 0 deletions public/stylesheets/results.css
Original file line number Diff line number Diff line change
Expand Up @@ -1554,6 +1554,7 @@ color: #44639A;
-ms-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
transition: all 0.3s ease;
z-index: 99 !important;
}
#return-to-top i {
color: #fff;
Expand Down

0 comments on commit 69de7ed

Please sign in to comment.