-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add numberOfFolderishDocuments to catalog metadata #118
Draft
jaroel
wants to merge
7
commits into
main
Choose a base branch
from
numberOfFolderishDocuments
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7f1ae9c
Add numberOfFolderishDocuments catalog metadata to allow UX affordanc…
jaroel bdc3c4f
lint
jaroel da51313
black
jaroel fe87824
isort
jaroel 1aae57c
Any old DX Container is indicative of a branch node.
jaroel 5926384
black
jaroel bfb811c
isort
jaroel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- Add numberOfFolderishDocuments catalog metadata to allow UX affordance in folder contents in Volto. | ||
[jaroel] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@jaroel I think this metadata will not be updated if we add a content in the container. Indexing would have to be called in the event of adding content. I saw a discussion about this at: https://community.plone.org/t/indexing-how-to-index-contained-items/17428
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.
I'm adding an indexer, not an event listener. This works just fine (tm).
Thanks for having a look though!
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.
@jaroel surprisingly for me it works! I saw that when we add content to a container, it is reindexed. Even its modification date is changed.
@mauritsvanrees @jensens @davisagli , was that thought or is it an "accident"? Indexing is one of the most expensive things in Plone. If this has not been thought of, it would be good to remove this behavior.
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.
@wesleybl I don't think that is intentional. Unfortunately changing it could be disruptive since existing implementations are probably relying on it happening. So I would say we can change it in Plone 7 (but maybe there is a way to make it available in an opt-in fashion in Plone 6)
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.
I think it may be intentional. Think only of caching: if content is added to a container, but this does not mark the container as changed, then you will keep getting the previous version, and not see the new content.
Then again, the new content itself get indexed and causes the catalogCounter to be increased, which is usually checked in eTags by plone.app.caching. So it may not be needed for that.
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.
@mauritsvanrees I generally don't cache with eTag. But I think it has a modified date eTag. So it might make sense to change the container modification date when content is added. Perhaps what could be improved is reindexing only the modification date, instead of reindexing all indexes.