docs
docs copied to clipboard
Propagating datetime of last update on ancestors
Feature Request
Is your feature request related to a problem or unsupported use case? Please describe. When a sub-document is updated, the parent document "updated_on" datetime does not change. As a result, the parent document does not get promoted on top of the list view for users having access to it.
Describe the solution you'd like
- Add a field "descendants_updated_on" to the Document model.
- When a document is updated, set its field '"updated_on" and set the field "descendants_updated_on" on all the document's ancestors.
- Sort documents in the list view by the value of the "descendants_updated_on" field.
Describe alternatives you've considered We could skip adding a new field "descendants_updated_on" and force the value of the "updated_on" field on ancestors when a sub-document is updated. Or we could compute the value of the "updated_on" field but I think this would have an impact on performance.
Hey @sampaccoud I'm not sur about this. I'd keep updated on independant.
What do you guys think @rl-83 @lunika ?
I just got annoyed by that actually. I find @sampaccoud proposal with "descendants_updated_on" good personally.
I agree with @sampaccoud's proposal.
We also have the case of a pinned sub-doc. If we follow a similar logic, would we want the sub-doc to move up in the pinned documents bar when we update its parent? This would essentially mean going in both directions. And instead of adding an "ascendants_updated_on" alongside the "descendants_updated_on," we could have something like "global-updated-on" that gets updated whenever any "page" (subdoc or parent) is updated in the batch.
Shouldn’t we think of displaying the child documents in the document list instead ? It’s planned and the specs are here https://github.com/suitenumerique/docs/issues/677
Okay guys let's go for @sampaccoud 's solution. I also got annoyed by this in last few days.