EZP-25767: Implement the Everyone's Content dashboard block #589
EZP-25767: Implement the Everyone's Content dashboard block #589
Conversation
ping @dpobel |
Another thing is that I would make more generic view for block view and block row view with tabular data that will be extended by other block views and block row views, but I'm afraid you don't not like this approach. |
I did not look at the code yet, but that seems a bad reason. If you want to represent tabular data, just use a table. The behavior you add around that table should not imply changing anything on the table.
That's a bit early to do that. I don't even see the added value of having a view per row given at the moment the columns are defined and fixed. So this block could be very simple in terms of rendering ie it receives a list Location and Content Type and it displays that with the template. |
new Y.eZ.DashboardBlockAllContentView({ | ||
priority: 1, | ||
identifier: 'everyones-content' | ||
}).addTarget(this).set('active', this.get('active')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should write:
new Y.eZ.DashboardBlockAllContentView({
priority: 1,
bubbleTargets: this,
});
the identifier
is read only (and should be set in the code of eZ.DashboardBlockAllContentView
itself. It's useless to forward the active
flag, we know it's not active and there's an event handler that takes care of keeping active up to date.
it's not needed to set the active flag, we know the view is not active yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I didn't know about the bubbleTargets
as it wasn't very well documented in YUI docs.
Alright now I read the whole patch. First, for the list:
For the edit and views buttons appearing when clicking a row:
|
criteria: { | ||
SubtreeCriterion: this.get('rootLocation').get('pathString') | ||
}, | ||
sortClauses: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one thing on that: this is not yet supported server side. Meaning the block will not display the modified content but a random list of content item. See https://jira.ez.no/browse/EZP-24315 (added it as a blocker).
thanks
I believe that keeping row views is a good idea. This way, the block makes a request for data and spreads the data into child views (row views) and renders them.
This is why I wanted to have the root detection in the dashboard service, in my previous PR.
This makes me wondering, what is |
I'm not saying it's a bad idea, I'm saying it's not needed at this point.
this only adds 2 loops:
Nothing really complicated.
AFAIK, this has not been asked anywhere. And doing it without the row views does not really prevent the extensibility. That's why at this point, the row views are not needed. If we need the row views, we could easily re-introduce them after without problems.
and I did not say that was a bad code, I said, that was not needed at that point. Now it is needed, so it's time to re-introduce that.
as written in the above comment, those were made to represent the button and the corresponding action in the bar views. Here, it's a different context, where we don't really want to act on the Location but more just navigate somewhere else, that's why regular links would work well for now and makes the whole thing a lot easier since we have everything in place to generate those links and the rest is done by the browser and the app without changing a single line. |
ping @dpobel |
* @extends eZ.DashboardBlockBaseView | ||
*/ | ||
Y.eZ.DashboardBlockAllContentView = Y.Base.create('dashboardBlockAllContentView', Y.eZ.DashboardBlockBaseView, [Y.eZ.AsynchronousView], { | ||
events: EVENTS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as I can remember, when using the asynchronous view extension, you can not define the dom event handlers this way otherwise the ones defined in asynchronous view (for the retry button) are completely overriden. You have to write it like
PlatformUIBundle/Resources/public/js/views/tabs/ez-locationviewlocationstabview.js
Line 39 in 206d055
this.events = Y.merge(this.events, events); |
ping @dpobel |
name: 'eZ Dashboard Blocks View Service root location default value test', | ||
|
||
setUp: function () { | ||
this.rootLocationModel = new Y.Mock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed can be removed
ping @dpobel |
Y.Assert.areSame(contentJSON, params.items[0].content, 'Should provide content data of 1 item'); | ||
Y.Assert.areSame(contentTypeJSON, params.items[0].contentType, 'Should provide content type data of 1 item'); | ||
Y.Assert.areSame(locationJSON, params.items[0].location, 'Should provide location data of 1 item'); | ||
Y.Assert.areSame(contentInfoJSON, params.items[0].location.contentInfo, 'Should provide content info data of 1 item'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is incorrect, in this context, the point is to check that the contentInfo
is directly available without using the Location (basically the result of https://github.com/ezsystems/PlatformUIBundle/pull/589/files#diff-b26270100a3f8b2b43dbc1f0c0ed3604R70)
So this should be written:
Y.Assert.areSame(contentInfoJSON, params.items[0].contentInfo, 'Should provide content info data of 1 item');
ping @dpobel |
+1 |
bfd27c8
to
2459568
Compare
+1 |
@dpobel this PR has just been rebased with feature branch |
https://jira.ez.no/browse/EZP-25767
TO DO:
Y.eZ.DashboardBlockAllContentView
,Y.eZ.DashboardBlockAllContentRowView
,