mattbrailsford / umbraco-fluidity

A fluent CRUD user interface generator for Umbraco
https://our.umbraco.org/projects/backoffice-extensions/fluidity/
Apache License 2.0
48 stars 40 forks source link

Custom filters or DataViews to support more than just boolean expressions. #23

Closed kasperskov909 closed 6 years ago

kasperskov909 commented 6 years ago

Hi Matt The state of an entity isn't always determinated with a boolen but rather with a DateTime or maybe even a status code in the form of an interger. Imagine if you could make custom filters/DataViews on the list with ie. string or DateTime comparison. That would make this product perfect! I'm not sure what would be the best approach but I fancy the possibility of simply doing: listViewConfig.AddDataView("Ended", p => (p.End > DateTime.Now ));

What's your thoughts?

mattbrailsford commented 6 years ago

At this point, I think we are just at the whim of the built-in Umbraco linq to sql implementation. Any improvements to this would need to be made to the core as I'm not looking to implement a custom implementation. The only workaround I can think of at the moment would be to create a custom repository and implement the logic yourself. Unfortunately, my linq to sql knowledge isn't that good.

Closing the issue for now, but will see keep an eye on the demand.

mattbrailsford commented 6 years ago

Hmm, I thought I'd take a quick look at this and I have added a datetime property to my model, setting some db entries with a date in the past and some in the future, then had a list view config like so:

listViewConfig.AddDataView("Ended", person => person.End <= DateTime.Now);
listViewConfig.AddDataView("Open", person => person.End > DateTime.Now);

And this worked as expected. I had a dropdown for the dataview and could toggle between ended and open entries. I wonder if some other fix has had an affect on this? It might be worth you trying the nightly https://ci.appveyor.com/project/UMCO/umbraco-fluidity/build/1.0.2.37/artifacts