CRUD icon indicating copy to clipboard operation
CRUD copied to clipboard

Allow to use Tabs in show Operation

Open Adesin-fr opened this issue 4 years ago • 13 comments

Hi there ! I've managed to get the "Show columns in tabs" feature on Show Operation.

Hope my PR will fit the requirements ;)

Regards

Adesin-fr avatar Nov 06 '20 08:11 Adesin-fr

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

welcome[bot] avatar Nov 06 '20 08:11 welcome[bot]

Whoops ! It seems that PHPStorm doesn't have the same formatting standards as your CI ;)

Adesin-fr avatar Nov 06 '20 08:11 Adesin-fr

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

pxpm avatar Nov 06 '20 12:11 pxpm

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 ...

Adesin-fr avatar Nov 06 '20 15:11 Adesin-fr

The inspection completed: No new issues

scrutinizer-notifier avatar Nov 06 '20 15:11 scrutinizer-notifier

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!

tabacitu avatar Nov 08 '20 11:11 tabacitu

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 ;)

Adesin-fr avatar Nov 08 '20 11:11 Adesin-fr

Great, thanks @LemarinelNet . I agree, it can be confusing...

tabacitu avatar Nov 08 '20 11:11 tabacitu

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..

dejury avatar Feb 11 '21 13:02 dejury

Waiting for this feature implemented

hellodit avatar Jun 09 '21 13:06 hellodit

@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 avatar Jun 11 '21 08:06 tabacitu

@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!

hellodit avatar Jun 12 '21 10:06 hellodit

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.

engel-m avatar Mar 24 '22 10:03 engel-m

Hi @tabacitu ! Any news on this feature?

helderpgoncalves avatar Oct 11 '22 19:10 helderpgoncalves

Looks like there's enough demand to have this! Thanks for the feedback everyone 🙏 Going to schedule and do this.

tabacitu avatar Oct 11 '22 19:10 tabacitu

This is happening! 🥳

Closing this in favor of a new PR. Thanks everyone for your input!

maurohmartinez avatar Apr 20 '23 12:04 maurohmartinez