-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests for tiles + support contentlistingtiles without collections #133
Conversation
The default content selector also needs to change. |
@petschki The original reason for the PR was to have tiles tested so we can get other PRs merged to reduce our technical debt. If the inclusion of the contentlisting stuff is going to cause a delay I can potentially split the PR and change the tests to use collections. |
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.
In general I like the approach and the simplification for mosaic filtering but right now, there's a hard dependency to plone.app.blocks which should not be in this package. Please refactor into the tiles
folder which is only included when plone.tiles
is installed.
@djay that would be a great idea 👍🏼 |
I'm saying I'd rather not because its extra work. Is the change I've made that big? if the current tests don't show it works then perhaps thats a bigger problem? |
@petschki done making changes. |
I just tried this with a buildout.coredev 5.2 and it works very nice. Since the But there's one issue I've had when testing it: If you enable
This is due to the transient state of the mosaic page ... after you save the page with a contentlisting tile and edit it again you can add filter tiles as expected ... @djay I think this should be solved before we merge this. |
@petschki hmm. I need to have some tests that run just for tiles only, so can test adding to a page instead of a collection. This happens when you add a filter to a page before a content listing? or is the content listing not saved at all until teh page is saved? |
This is a |
@petschki in that case I have to change the validation let you pick a collection or any ILayoutAware even if no listing tile. |
Maybe remove the validator and show a portal message when the page was saved which says |
Good idea. I think I can do it with a status message. At least the user will get some feedback.
|
@petschki is CF supposed to work if there is a collection anywhere in the acquaisition path? or only if it's in the direct context? |
Only direct context makes sense to me ... |
@petschki the problem with the tests is the one already identified and still not fixed :( |
@petschki fixed the problem with the test setup. RichTextValue wasn't created correctly. |
@djay I was able to test this locally and it works very well. Especially the automagical linking between filter and contentlisting is a huge improvement! The only thing I found is, that when you save a page with filtertile and without contentlisting, the status message is shown correctly. When you edit and save the second time (also with filter and without contentlisting) the portal message doesn't show up anymore ... also if you have a page with filter/contentlisting -> edit it and remove the contentlisting and save -> there is no status message/warning about missing contentlisting. |
Thats when you save the layout or save the filtertile? I only have an handler on the modify event for the filtertile but if you edit that again it should warn you again? To have a more general warning system for editing anything on the page or just saving the whole layout then I'd need more clever code that finds all the possible filter tiles tests if they are ok. I'll have a think about it |
@petschki it should now warn you whenever you save it. Please review. |
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.
LGTM
I'll merge this later today, I just want to test it more in a productive project of us. |
@djay just to be sure: the refactored UI of the tile-add-form isn't in this PR anymore, right? At least my add-forms are the same as before ... |
@petschki ah there was one UI change. I switched it to using the select2 widget. https://github.com/collective/collective.collectionfilter/pull/133/files#diff-4c74ac2fd432682735f055c860ac2e0dbc61b47acaed3ee94a1553660707f299 ah it was because the in and out widget breaks if used in tiles in plone 5.0. |
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.
lgtm
@agitator I merge or you? |
This now makes the flow of creating a custom search page using mosaic much easier
It still supports using a filter tile targeting a collection but it's not clear how you would get the collection results onto the page when using ajax. You might still be able to use the "existing content" tile?
In addition this adds layer to test tiles. ie every robot test for portlets now becomes a test for tiles also. If you want to test just portlets or tiles use --layer tiles or --layer Portlet.
In addition this switches the settings to using the select2 widget. It's more tidy (and works in 5.0 when used in a tile).
Deco/Mosaic was designed to remove the need for collection objects completely. The contentlisting tile does everything a collection does (except syndication) so there isn't a need for it.
This does perhaps make the name collectionfilter confusing however. #135 aims to fix the names and simplify the settings panels.
Without further changes to contentlisting tile 5.0 is not supported when using tiles (because the change to standardtiles to allow this tile to listen to the request was made non compatible with 5.0 due to dependencies).