Laravel-Backpack / addons

A place for the Backpack community to talk about possible Backpack add-ons.
5 stars 2 forks source link

[Add-on][Has Code] JSON field and column #19

Closed tabacitu closed 3 years ago

tabacitu commented 3 years ago

As I explained here, I don't think we'll have a built-in JSON field and column, because it would make it too easy for devs to create admin panels for devs, not for normal people.

But I still think this is a valid use case. Hell, backpackforlaravel.com uses the json_editor field πŸ‘€

So I think it would be AWESOME if we had an add-on that brought advanced functionality - the json field and json column. And if we want that, we just swap the built-in simple field/column with the advanced one, by specifying the view namespace.

The way I see it:

I'd LOVE to have this, and promise to use it ❀️ Best of all, it already has working code for both:

Who wants to do this? @ziming ? @stephanus-stuff ? anybody else?

tabacitu commented 3 years ago

PS. Of course, if you both want to create a package for your field/column, two packages will do just fine too:

and you could recommend each other's package in the README as complementary.

Let me know. Pretty excited about this! πŸ₯³

ziming commented 3 years ago

Hmm will think about it but the json column, since you already merged my earlier json column months ago, consider just upgrading to the more advanced one by steph

https://github.com/Laravel-Backpack/CRUD/blob/master/src/resources/views/crud/columns/json.blade.php

ziming commented 3 years ago

Ok i created the repo and invited you ( @tabacitu ) and @vesper8

https://github.com/ziming/json-field-for-backpack

There are no code there yet, I will add when free (which could be quite a while as i'm still busy with other work). Either of you can go ahead 1st if you wishes.

Update: Also added @stephanus-stuff as he edited the field recently when we were upgrading our admin to a newer backpack version

ziming commented 3 years ago

Hi @tabacitu

Just published it, I tagged it at 0.1.1 pre-release

https://github.com/ziming/json-field-for-backpack

Feel free to fix any issues spotted before we make it 1.0

tabacitu commented 3 years ago

Excellent @ziming ! What great news πŸ₯³ πŸŽ‰ I'm proud to say I was download no 1 πŸ˜† I've just submitted some PRs with docs and stuff like that. I've tested it and it worked fine for me! Good job!

Let me know when you're ready to make this public, when you tag a stable release, and I'll add it to the Backpack website and promote it to our community.

Cheers!

ziming commented 3 years ago

Ok sure, let me know by end of the month if you spot any new issues, if no issues we can tag a 1.0 release πŸ₯‡

On a side note I was wondering if is easy to do a readonly / disabled mode. So it's on the edit view simply for viewing purposes.

Currently in production what I do is I just remove it from the request before saving.

ziming commented 3 years ago

Oct has ended. After giving it some thought, I will tag the 1.0 release myself on 17 Nov. Hope you don't mind the wait.

It's a particular special date to me for personal reasons in my past

Thank you

pxpm commented 3 years ago

I find it quite embracing when people have special times/persons. I hope it's special for the best, if not, that you could make it special for some reason. Waiting for 17 Nov. πŸ‘ Best, Pedro

tabacitu commented 3 years ago

I think that was the right approach to tag it @ziming πŸ˜‚, I forgot about it too. Still - I have been using the field in production and enjoying it, excellent job on it!

To promote it, I've just finished:

Taken together, an audience in the thousands has definitely been reached, it should provide a great start for the addon.

More things we can do to promote it:

@ziming are you a member of any of the communities above? In that case it'd be better if it came from you, as a show-and-tell post.

ziming commented 3 years ago

Hi @tabacitu

Thanks for the write up! I enjoyed reading it. As a side note, I do use the field for non technical admins as well. But in read only & form only mode.

If I may have a small request, it will be that I hope you could skip /r/laravel & /r/php, as I'm a little afraid of people who knew me in real life might see it.

While I do have accounts in the other channels you mentioned, I don't really use those accounts. So I don't think I will be making any posts

Other than that, thanks a lot!

tabacitu commented 3 years ago

Sure, no problem @ziming ! I think we've done enough for the moment to hopefully get the ball rolling. Let's see how it goes. πŸŽ‰πŸ₯³πŸŽˆCongrats for the package launch! πŸ˜€ πŸ‘πŸ‘πŸ‘

promatik commented 3 years ago

@ziming the field looks neat! I'm really looking forward for an opportunity to use it ahah Well done πŸ‘Œ

azaricstefan commented 3 years ago

I have to write it here also: GREAT WORK! πŸ₯‡ πŸ₯‡ πŸ₯‡ πŸ₯‡ πŸ˜„ I needed this field desperately, @ziming thanks for creating this addon. Be proud of this, it will help many current Backpack users and who knows how many of new users.

Thanks a lot!

azaricstefan commented 3 years ago

Maybe it will be useful to others, I can explain shortly my scenario.

In non-admin part of my project users edit google_address field where they type the address and set it for their companies. Sometimes it happens that google doesn't have up to date address and editing of that particular address (json field) was painful (until now). This field gives me a way to edit that field in admin panel and set coordinates manually and to override the JSON field itself.