Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert "Revert "Fix EZP-27143 Fixed custom UDW to work with content o…
…n the fly.""

This fix should not have been reverted in the first place.

This reverts commit 21ac5b3.
  • Loading branch information
yannickroger committed Apr 18, 2017
1 parent 3ba4797 commit 463ba98
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Resources/public/js/apps/ez-platformuiapp.js
Expand Up @@ -618,6 +618,8 @@ YUI.add('ez-platformuiapp', function (Y) {
});
if ( createView ) {
viewInfo.instance = new viewInfo.type();
} else {
viewInfo.instance.reset();
}
view = viewInfo.instance;
view.addTarget(service);
Expand Down
Expand Up @@ -77,7 +77,7 @@ YUI.add('ez-discoverybarviewservice', function (Y) {
_navigateToLocation: function (e) {
this.get('app').navigateTo('viewLocation', {
id: e.selection.location.get('id'),
languageCode: e.selection.content.get('mainLanguageCode')
languageCode: e.selection.location.get('contentInfo').get('mainLanguageCode')
});
},

Expand Down
8 changes: 7 additions & 1 deletion Tests/js/apps/assets/ez-platformuiapp-tests.js
Expand Up @@ -1128,7 +1128,8 @@ YUI.add('ez-platformuiapp-tests', function (Y) {
}
},
initialized = 0, rendered = 0, bubble = 0,
activeSet = 0, nextCalls = 0;
activeSet = 0, nextCalls = 0,
sideViewReseted = false;


this.app.sideViews.sideView1.type = Y.Base.create('sideView1', Y.View, [], {
Expand All @@ -1138,6 +1139,10 @@ YUI.add('ez-platformuiapp-tests', function (Y) {
return this;
},

reset: function () {
sideViewReseted = true;
},

initializer: function () {
initialized++;
this.after('activeChange', function (e) {
Expand Down Expand Up @@ -1181,6 +1186,7 @@ YUI.add('ez-platformuiapp-tests', function (Y) {
this.app.sideViews.sideView1.instance.get('container')
)
);
Y.Assert.isTrue(sideViewReseted, "The side view should have been reseted");
},

"Should hide the side view instance": function () {
Expand Down
Expand Up @@ -96,6 +96,8 @@ YUI.add('ez-discoverybarviewservice-tests', function (Y) {
this.mainLanguage = 'LYO-69';
this.location = new Y.Base();
this.location.set('id', this.locationId);
this.location.set('contentInfo', new Y.Base());
this.location.get('contentInfo').set('mainLanguageCode', this.mainLanguage);

Y.eZ.LocationViewView = Y.Base.create('locationView', Y.Base, [], {}, {
ATTRS: {
Expand Down Expand Up @@ -230,12 +232,6 @@ YUI.add('ez-discoverybarviewservice-tests', function (Y) {
returns: this.activeView
});

Y.Mock.expect(contentMock, {
method: 'get',
args: ['mainLanguageCode'],
returns: this.mainLanguage
});

Mock.expect(this.app, {
method: 'navigateTo',
args: ["viewLocation", Y.Mock.Value.Object],
Expand Down

0 comments on commit 463ba98

Please sign in to comment.