Offroadcode / Umbraco-Bulk-Edit

An Umbraco package for the bulk editing and reporting of content.
http://www.offroadcode.com/packages
MIT License
5 stars 0 forks source link

Properties To Edit: Filter out properties without valid editor types, already selected properties #1

Closed cssquirrel closed 7 years ago

cssquirrel commented 7 years ago

In particular, this is going to be valuable to avoid Grid properties. We actually get the grid JSON back, there just doesn't seem to be a good way to edit it in this format.

Also, prevent adding duplicates of the same field.

PeteDuncanson commented 7 years ago

Tempted to just use a regexp that looks for anything starting and ending with curley brackets...

Something like: /^{.*}$/

Should do it? If we find that they render out (or return in the API response) "Non-editable data" or similar (we don't wnat that chunk of JSON going down the wire, they could be huge and will make the site sluggish.

cssquirrel commented 7 years ago

It would be pretty slick if the API didn't return these types of properties. But a regex solution like that on the front-end seems like a clean way to filter whatever comes in.

PeteDuncanson commented 7 years ago

Lets make the API not return them then. Suggest we add a flag that says "no JSON content if found in fields" or similar which would make the API return a placeholder or something. Could just run that regex server-side to do it. I think the UI still needs to know that there IS some json content for those fields (so it can show something different) but it doesn't need to know what that content actually is.

cssquirrel commented 7 years ago

We're currently filtering grid, we also now filter out already selected properties.