Laravel-Backpack / community-forum

A workspace to discuss improvement and feature ideas, before they're actually implemented.
28 stars 0 forks source link

[DevTools] Define CRUD columns & fields in the form #219

Open eleven59 opened 3 years ago

eleven59 commented 3 years ago

Feature Request

What's the feature you think DevTools should have?

It would be great to have some additional options for each of the model's columns to already define the column + field type. Now, I find myself going into the code to add it there after generating the CRUD, which is mightily inconvenient.

It would also be awesome to have some options per CRUD field type already there, but I know that might be a bit much (i.e. aspect ratio and crop for image fields)

Have you already implemented a prototype solution, for your own project?

Nope. The attached screenshot is just a sketch.

Do you see this as a core feature or an add-on?

Core feature!

sketch-devtools-crud-types

tabacitu commented 3 years ago

Totally agree! It's something we definitely want too, it's on the roadmap. We just didn't know how people will use DevTools, so we decided to launch without it.

Your mockup is interesting... to be honest we never even thought about defining them there 😅 But you make a valid point, that would be easiest to implement...

Personally I saw it as a second step... That this form would become sort of a wizard... Something like...

That would provide a maximum amount of customization for each file, using forms... without making the default use-case (where you don't need to customize stuff) any bulkier. But if you do all of that... it kind of becomes this huge wizard... and I don't really like that... What do you think about it @eleven59 ?

eleven59 commented 3 years ago

@tabacitu I agree. Too much clutter or bulky stuff is never helpful. I also think most of those extra configurable options are low-percentage use-cases. For example, I often want to define that something is a wysiwyg field, but I rarely have to configure anything beyond that. Same goes for other input field types, except possibly for more complex things like images (where I more often want to define things like crop ratio and upload disk).

So considering that, I think my mock-up would provide me with the tools I need for 80-90% of the CRUDs I actually require in real-world projects. For any fields in the other 10-20%: those are so specific that I don't mind digging into the Controller or Model code to add the changes there. It would already save me heaps of time if I could just pick the CRUD field and column types (including not using them for CRUD columns at all).

All of this being said; I think my sketch would actually not take that much work to implement, right? I'm not one to push anyone's schedule, so if you'd let me, I would love to make a PR and take a jab at it some time either this or next week? Willing to discuss in some more detail over PMs, too, before I make something that doesn't match the Backpack philosophy.

tabacitu commented 3 years ago

Totally agree - the aim to cover the 80% is ideal. For everything else... an interface would probably be overkill.

Thanks a lot of the offer to work on a PR for this. Let's wait a few weeks before we do it, though. Two reasons for it:

Both will come with a little bit of time and traction, perhaps 1-2-3 weeks. So we're in a "wait-and-see" moment 😀

Granted, I expect this feature (configurable columns and fields) to be the no 1 most requested feature, so it'll probably be the first one we work on 😀 It's a high-impact one, and as you said... not a very difficult one if we implement it this way...

Thanks a lot!

eleven59 commented 3 years ago

You're very welcome, of course. I understand the need to wait a while, it's good to be consistent and let others chime in.

Just to add one tiny bit of minor complexity then, it would also be great if additional custom fields and columns could be detected from the local view overrides folder. That way users could also select those as their field and column choices.