Skip to content

Commit

Permalink
Fix EZP-26433: Impossible to select a Content in the UDW search metho…
Browse files Browse the repository at this point in the history
…d if the UDW is configured to allow a multiple selection
  • Loading branch information
dpobel committed Oct 17, 2016
1 parent fa0a64b commit 40797d8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Resources/public/js/views/ez-universaldiscoveryview.js
Expand Up @@ -283,7 +283,7 @@ YUI.add('ez-universaldiscoveryview', function (Y) {

method.setAttrs({
'multiple': this.get('multiple'),
'loadContent': this.get('loadContent'),
'loadContent': true,
'startingLocationId': startingLocationId,
'visible': visible,
'isSelectable': Y.bind(this.get('isSelectable'), this),
Expand Down
Expand Up @@ -110,7 +110,7 @@ YUI.add('ez-universaldiscoverysearchview', function (Y) {
* @protected
*/
_searchResultChanged: function () {
this.get('selectedView').set('contentStruct', null);
this._unselectContent();
this._uiPageEndLoading();
},

Expand Down Expand Up @@ -175,7 +175,8 @@ YUI.add('ez-universaldiscoverysearchview', function (Y) {
},
});
} else {
this.reset();
this.reset('searchResultList');
this.render();
}
},

Expand Down
Expand Up @@ -691,7 +691,19 @@ YUI.add('ez-universaldiscoverysearchview-tests', function (Y) {
},

"Should reset the view if provided search text is empty": function () {
var selectContentFired = false;

this.view.set('searchText', 'Grunwald 1410');

this.view.on('selectContent', function (e) {
selectContentFired = true;

Assert.isNull(
e.selection,
"The selection should be null"
);
});

this.view.set('searchText', '');

Assert.areEqual(this.view.get('offset'), 0, "The offset attribute should be reset");
Expand All @@ -705,6 +717,14 @@ YUI.add('ez-universaldiscoverysearchview-tests', function (Y) {
0,
"The searchResultList attribute should be reset"
);
Assert.isNull(
this.view.get('selectedView').get('contentStruct'),
"The contentStruct should be null in the selected view"
);
Assert.isTrue(
selectContentFired,
"The selectContent should have been fired"
);
}
});

Expand Down

0 comments on commit 40797d8

Please sign in to comment.