CRUD
CRUD copied to clipboard
Allow to use Tabs in show Operation
Hi there ! I've managed to get the "Show columns in tabs" feature on Show Operation.
Hope my PR will fit the requirements ;)
Regards
BOOM! Your first PR with us, thank you so much! Someone will take a look at it shortly.
Please keep in mind that:
- if this constitutes a breaking change, it might take quite a while for this to get merged; we try to emulate the Laravel release cycle as much as possible, so developers can upgrade both software once; this means a new big release every ~6 months;
- even if it's a non-breaking change, it might take a few days/weeks for the PR to get merged; unless it's a no-brainer, we like to have some community feedback on new features, before we merge them; this leads to higher-quality code, in the end; we learnt this the hard way :-)
- not all PRs get merged; sometimes we just have to hold out new features, to keep the packages lean; sometimes we don't include features that only apply to niche use cases;
- we're not perfect; if you think we're wrong, call us out on it; but in a kind way :-) we all make mistakes, best we learn from them and build better software together;
Thank you!
-- Justin Case The Backpack Robot
Whoops ! It seems that PHPStorm doesn't have the same formatting standards as your CI ;)
Hello @LemarinelNet
Thank you very much for your contribution.
From what I see, you just copy tabs functionality from create/update forms into show.
What I don't get is why you use the initializeFieldsWithJavascript
code in show.blade.php
when columns does not have that kind of functionality.
Let me know, Pedro
Well... That's a bad copy/paste ! Tes, I think this JS function is not needed ! Do you want me to commit to my fork and redo a PR ?
EDIT : I did a commit, it seems to be sufficient ...
The inspection completed: No new issues
Thanks a lot @LemarinelNet , nice work! It's indeed something I've considered always thought we could have, but nobody actually asked for it 🤣 so the intention got nowhere.
I think this could be particularly useful for HUGE entities (like Monsters). Since you have the fields grouped in a way (into tabs), it'd be intuitive to have the columns grouped in the same way in Show - you'll easily know where everything is.
We're currently in a feature freeze in 4.1.x, though. So please know @LemarinelNet that it's going to take at least 1 month to merge this, sorry. We're currently looking to first fix all bugs in 4.1.x, so that we can then focus on new features in 4.2.x. I see @pxpm has already placed it there, so it's on the roadmap and we'll take a look at it then, thanks a lot! Until then, I'll gladly take a look to understand the complexity of the feature, and see what we can do to get it in a mergeable state.
Cheers!
I agree with you that the function's name is not generic enough ;)
I must admit that I'm still confused about some operations calling fields "Columns" and some others calling them "fields" : when I started with backpack, I sometimes scratched my heads for hours because I did copied some code from setupListOperation to setupCreateOperation and it didn't worked, because one was using fields and the other awaited for columns...
It might be a huuuuge rework and breaking feature, but having the same "items" name in all operations would simplify beginner's life, and simplify code like the PR i did, which would avoid operation-specific tests ;)
Well, If anybody feels okay to handle the final modifications, I would feel more comfortable with that, and I'll have a shadow look to how it's made ;)
Great, thanks @LemarinelNet . I agree, it can be confusing...
Well I'm currently working on a project where it would be nice to use te showoperation which shows exact the same page as the update/create operation would do, with the only difference that this would only display the data, not make it changeable.
I think this can be done using this PR, which enables the tabs. What is the current status of this PR? Seems a bit dead to me after 3 months..
Waiting for this feature implemented
@dejury , @hellodit - thanks for voicing your support for this feature 🙏. As I said the reason we don't already have this is because very few people have asked for it.
I still think this is a cool feature to have, but it hasn't been a priority. We'll polish and merge it in Backpack 4.2 which is right around the corner (2 months probably).
If you need this feature before then, I think the quickest way to achieve this is a non-breaking manner is to create a custom view for the Show operation, and use that one. It's pretty easy to do for one project, a lot more difficult to do in a general way that would accomodate most projects.
Cheers!
@tabacitu yeah I've already implement using a custom view, it's easy. I just want to get the easiest way. But thanks for your support, appreciate it a lot!
Hi @tabacitu , any news on this?
It seems like such an obvious basic feature that is missing. Also for the purpose of consistency between edit and show views.
Hi @tabacitu ! Any news on this feature?
Looks like there's enough demand to have this! Thanks for the feedback everyone 🙏 Going to schedule and do this.