From d4cac0119344fe81b216cc2ea3021752a8381aec Mon Sep 17 00:00:00 2001 From: Amigo <49749100+aamigo@users.noreply.github.com> Date: Wed, 26 Jun 2019 16:59:29 +0200 Subject: [PATCH] Updated 041 Upgrade to JCB v2.5.8 and using the new Admin View and Admin Fields (markdown) --- ...ing-the-new-Admin-View-and-Admin-Fields.md | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/041-Upgrade-to-JCB-v2.5.8-and-using-the-new-Admin-View-and-Admin-Fields.md b/041-Upgrade-to-JCB-v2.5.8-and-using-the-new-Admin-View-and-Admin-Fields.md index 9482cde..ac7363d 100644 --- a/041-Upgrade-to-JCB-v2.5.8-and-using-the-new-Admin-View-and-Admin-Fields.md +++ b/041-Upgrade-to-JCB-v2.5.8-and-using-the-new-Admin-View-and-Admin-Fields.md @@ -41,5 +41,25 @@ Within the Get file where most of these sub forms are now needed, we have in the It converts it and sets it back to the data set, and to ensure that we store it back into the database, this little string '$objectUpdate->addpermissions=json_encode($bucket);. So it goes on doing it everywhere where we [00:10:30](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m30s) expect to find values that still may have been missed. * ### Updates -?? -And at the very end of this function, which is big I supposed. If we found that there are any updates we run the update, and after that view is been updated, it will never need to be updated again. These are the kind of [00:10:56](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m56s) How can I put it Fixes really That we put in place when you already have a JCB with horrendous amount of Data and it is just too big to do just with the normal install Then all these admin views will Be Updated and adapted As you start using JCB And you should not really anywhere at any time experience Any conflicts [00:11:27](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m27s) In fact if you do the reason for me making this tutorial Is it you can actually get into the code And that you can You know Open an issue on GitHub And give me heads up so I can You know Patch whatever you find And push it out the rest the community Ok so that was just a code side of things now getting back to to our install here [00:11:53](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m53s) I think what I'll do is I'll just open Maybe this Admin view And then I'm gonna go And Basically Install The The upgrade [00:12:11](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m11s) I'm just gonna selected it's not been released yet So this is a pre-demostration Just to ensure everything works So if it doesn't you even see that So let's just select this file from my computer Ok there it goes busy installing it It should take a while it's quite a big dataset And you can just wait it out I'd wouldn't shout at you if it missed certain values I don't know why doesn't but [00:12:47](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m47s) there it goes Your upgrade is been successful And you are now on version 2.5.8 And if we were to open that Admin view Which Basically looked Like this And now just refresh it It should now look like that So you see it's moved [00:13:09](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m09s) These Fields to the side There's now a settings field And as you can see all the data is just been updated and moved to subform values Same with the taps And if we go to field and conditions There we go That's how the new field and conditions view looks like Now Because of many reasons we couldn't keep the subform fields within the admin View [00:13:38](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m38s) Especially when you Start having More than 50 admin Fields which in my case I have quite a few of those it's not advisable Because it actually causes the tremendous Slow down on page load I mean imagine each of these lines are actually 1 2 3 4 5 6 7 8 9 10 11 12 13 fields And if you start having a huge a lot of those fields Which you could have up to 800 [00:14:09](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m09s) By the limit we've set it really takes a long time to load that into the page Ok Enough about that how does it work now Well you could either click on this edit button here Or this edit button here to actually go and edit these and change their values If you would like to just edit one specific field You could click on any of these you know pencil editing Links So for example if I click on name [00:14:41](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m41s) It will ask me whether I've saved all my values in this current View And yes I just click ok And it will now open the name field And I can now come in here do any edits that I'd like And then save and close or just close out again if you wanna only wanna get some information Now Back into This area The same goes with the custom Fields I could click on any of those to edit them Or I could click on this edit here [00:15:12](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m12s) And it will again ask me if I saved all my work And then if I did click ok And opens Those values right here A nice new tweak with added is that it only loads the fields That are actually linked to this Admin view So that you can only Target The specific fields [00:15:34](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m34s) Which really makes sense That Those are the fields that needs to be targeted With this conditional option Then you could also create a field but creating a field will not Necessarily add it to the admin View It will just make it available to you If you were to have You know add it By going to admin fields [00:15:57](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m57s) Oh yes let me just say this this button here And this one here is the same button Just this is a shortcut Because sometimes you might have a lot of fields And it's a way down there to get to conditions So we added some shortcuts up here There's also the tutorial On how to use this but the tutorial still was made when we had the old Fields layout It should still make sense I mean you just need to keep in mind that things change a little So you could click here [00:16:27](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m27s) On any of these links To actually open That area where the fields are now found And make the changes So that's really the new admin Fields and moving away from repeatable fields To start using subforms for all our Repeatable concepts It's really what This upgrade is all about [00:16:53](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m53s) There is 1 heads up which I know is little different to how things were done previously Let me just close out of this Admin View Oh yes I could just mention this Here is a shortcut to get to the admin Fields without opening the admin view and then opening the admin fields You can click on this right here and it will automatically take you to the admin fields And you can make changes here [00:17:21](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m21s) And obviously it's link to the look Area or the look admin view And the same is true when looking at The conditions there the second button here is for conditions The thing that has changed is if you create a new admin View Now You would obviously add the single record name the list record name the short description And the system name And that's really all you need to add [00:17:51](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m51s) To save the admin view for the first time because The admin view at this stage It cannot be linked to any Fields until it has an ID Now I might still work on this and try and You know Tune it in a way that When you click the button and if the Admin view is not saved it saves it for you But [00:18:15](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m15s) I haven't done that yet so at this stage Since the admin field doesn't have an ID it's still new because we haven't clicked save Even once You can't link any Fields to them To it so what you would Natural do is just add some Add some name here And And then just save it once And having done that if you now go to Fields and conditions [00:18:57](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m57s) It basically says create To this button here and that one here is the same button You can click on any of them to create fields So if you would create a field So yes I did save everything And then I You can just click on this plus over here And there's a first field and you can start you know adding fields And tweak them as you would before [00:19:22](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m22s) And Yep so there you go That's the new subform Fields for admin views And that's what this upgrade is really all about I trust that it all benefit all of us in the future And make it more easier for us to transition into Joomla 4 And thank you for watching. + +At the very end of this function, which is big I supposed. If we found that there are any updates, we run the update, and after that view is been updated, it will never need to be updated again. These are the kind of [00:10:56](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m56s) Fixes that we put in place when you already have a JCB with horrendous amount of data. It is just too big to do the normal install, then all these admin views will be updated and adapted as you start using JCB. And you should not anywhere at any time experience any conflicts. [00:11:27](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m27s) In fact if you do, the reason for me making this tutorial, is that you can get into the code. Open an issue on GitHub, and give me heads up so that I can patch whatever you find, and push it out to the rest of the Community. That was just a code side of things. + +### Installing The Upgrade v2.5.8 + +Getting back to our install. [00:11:53](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m53s) I think what I'll do is I'll just open this Admin View - Look, and then I'm going to go and install the upgrade. [00:12:11](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m11s) I'm just going to select it, it's not been released yet, so this is a pre-demostration. Just to ensure everything works, if it doesn't, you even see that. Let's just select this file from my computer. There it goes, busy installing it. It should take a while, it's quite a big data set. You can just wait it out. [00:12:47](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m47s) Your upgrade is been successful. You are now on version 2.5.8. + +### New Field And Conditions View + +If we were to open that Admin View which looked like this(see video) and now refresh it, it should look like that(see video). It's moved [00:13:09](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m09s) these Fields to the side. There's now a Settings Field and as you can see all the data is just been updated and moved to Sub Form values. Same with the tabs. If we go to Field and Conditions, that's how the new Field and Conditions View looks like. Because of many reasons we couldn't keep the Sub Form Fields within the Admin View, [00:13:38](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m38s) especially when you start having more than 50 Admin Fields, which in my case, I have quite a few of those, it's not advisable. Because it causes a tremendous slow down on page load. I mean imagine each of these lines are 1 - 13 Fields. If you start having a lot of those Fields which you could have up to 800, [00:14:09](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m09s) by the limit we've set, it really takes a long time to load that into the page. + +### How The Field And Conditions View Works? + +How does it work? Well you could either click on the Edit button - Linked Fields, or the Edit button - Field Conditions to go and edit these and change their values. If you would like to just edit one specific field, you could click on any of these pencil editing links. For example, if I click on 'Name' [00:14:41](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m41s) it will ask me whether I've saved all my values in this current view, and yes I just click 'OK'. It will open the Name Field and I can now come in here do any edits that I'd like and then save and close, or just close out again, if you want to get some information. Back into Editing the Admin View area. + +### How To Edit Custom Fields + +The same goes with the Custom Fields. I could click on any of those to edit them. Or I could click on this Edit button. [00:15:12](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m12s) It will again ask me if I saved all my work, then if I did click 'OK'. Opens those values right here. A nice new tweak we added, is that it only loads the Fields that are linked to this Admin View(Match Field) that you can target the specific Fields [00:15:34](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m34s) which makes sense. That Those are the fields that needs to be targeted with this conditional option. + +### Creating Field - Available +??? +Then you could also create a field. Creating a field will not necessarily add it to the Admin View, it will just make it available to you, if you were to add it by going to Admin Fields .[00:15:57](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m57s) Edit (Linked Fields) and 'Edit admin fields conditions for this admin view' but Just this is a shortcut Because sometimes you might have a lot of fields And it's a way down there to get to conditions So we added some shortcuts up here There's also the tutorial On how to use this but the tutorial still was made when we had the old Fields layout It should still make sense I mean you just need to keep in mind that things change a little So you could click here [00:16:27](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m27s) On any of these links To actually open That area where the fields are now found And make the changes So that's really the new admin Fields and moving away from repeatable fields To start using subforms for all our Repeatable concepts It's really what This upgrade is all about [00:16:53](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m53s) There is 1 heads up which I know is little different to how things were done previously Let me just close out of this Admin View Oh yes I could just mention this Here is a shortcut to get to the admin Fields without opening the admin view and then opening the admin fields You can click on this right here and it will automatically take you to the admin fields And you can make changes here [00:17:21](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m21s) And obviously it's link to the look Area or the look admin view And the same is true when looking at The conditions there the second button here is for conditions The thing that has changed is if you create a new admin View Now You would obviously add the single record name the list record name the short description And the system name And that's really all you need to add [00:17:51](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m51s) To save the admin view for the first time because The admin view at this stage It cannot be linked to any Fields until it has an ID Now I might still work on this and try and You know Tune it in a way that When you click the button and if the Admin view is not saved it saves it for you But [00:18:15](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m15s) I haven't done that yet so at this stage Since the admin field doesn't have an ID it's still new because we haven't clicked save Even once You can't link any Fields to them To it so what you would Natural do is just add some Add some name here And And then just save it once And having done that if you now go to Fields and conditions [00:18:57](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m57s) It basically says create To this button here and that one here is the same button You can click on any of them to create fields So if you would create a field So yes I did save everything And then I You can just click on this plus over here And there's a first field and you can start you know adding fields And tweak them as you would before [00:19:22](https://www.youtube.com/watch?v=YaycQcsMpOs&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m22s) And Yep so there you go That's the new subform Fields for admin views And that's what this upgrade is really all about I trust that it all benefit all of us in the future And make it more easier for us to transition into Joomla 4 And thank you for watching.