Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Idea: Unversion, but for the recycle bin #26

Open
skttl opened this issue Jun 5, 2020 · 4 comments
Open

Idea: Unversion, but for the recycle bin #26

skttl opened this issue Jun 5, 2020 · 4 comments

Comments

@skttl
Copy link
Owner

skttl commented Jun 5, 2020

So instead of pruning old versions, you prune the recycle bin for nodes trashed more than X days ago, or so you'll only have X amount of nodes in your recycle bin.

This should probably run on startup, or as a scheduled task.

@jannikanker
Copy link

Hey @skttl - would you still be interested in a PR for this? It seems a great idea and not too complicated, so I'd love to have a go at it :-) On first glance I might have a question or two regarding configuration, though. How do we best allow X to be set without breaking the current config setup, etc.

@skttl
Copy link
Owner Author

skttl commented Oct 23, 2020

Hi @jannikanker

I would love a PR for this 👍

My inital thought on the config, was to add a type attribute with a default value of version. By setting this to trash in stead, it would instruct UnVersion to remove matching nodes in the trash.

<add type="trash" docTypeAlias="newsPage" rootXpath="//newsIndex" maxDays="2" maxCount="10" />

I'm not sure if rootXPath is going to be useable in this scenario though :)

For the scheduling, I was thinking of seeing if it was possible to extend Umbracos own scheduled publishing to take care of this too. Maybe it fires an event or something similar.

@jannikanker
Copy link

@skttl Cool! I'll give it a go then...

Regarding config it looks a bit like what I was thinking, but I was worried if it's a bit too "dirty" to mix two "functionalities" into the same config system :-) Adding a type makes excellent sense, though. As you say, it might get interesting if it needs to support specific doctypes, but we'll see :-D

I was thinking about setting up some RecurringTaskBase stuff for scheduling - I'll be sure to first take a look at what already exists with scheduled publishing.

@jannikanker
Copy link

@skttl I've made a draft PR for now. I'd like to fix encoding/line endings weirdness as well as - of course - discuss the consequences of my changes :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants