Lecoati / LeBlender

LeBlender is an open source Umbraco backoffice extension which made the Grid Canvas Editors management easier and flexible.
30 stars 63 forks source link

Umbraco V8 Support #105

Open cleversolutions opened 5 years ago

cleversolutions commented 5 years ago

Umbraco V8 is coming soon. This plugin doesn't show up in the packages section on v8, and installing via Nuget blows up a v8 site with an awesome message.

Boot failed: Umbraco cannot run. Sad. See Umbraco's log file for more details.

-> Umbraco.Core.Exceptions.BootFailedException: Boot failed.

-> System.Reflection.ReflectionTypeLoadException: Could not load all types from "Lecoati.LeBlender.Extension, Version=1.0.9.0, Culture=neutral, PublicKeyToken=null" due to LoaderExceptions, skipping:
. System.TypeLoadException on Umbraco.Core.ApplicationEventHandler: Could not load type 'Umbraco.Core.ApplicationEventHandler' from assembly 'Umbraco.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null'.
. System.IO.FileNotFoundException: Could not load file or assembly 'umbraco, Version=1.0.5820.25379, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
. System.IO.FileNotFoundException: Could not load file or assembly 'umbraco, Version=1.0.5820.25379, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
. System.IO.FileNotFoundException: Could not load file or assembly 'umbraco, Version=1.0.5820.25379, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
. System.IO.FileNotFoundException: Could not load file or assembly 'umbraco, Version=1.0.5820.25379, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
. System.IO.FileNotFoundException: Could not load file or assembly 'umbraco, Version=1.0.5820.25379, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Maybe this is a v8 bug, but thought I would start a conversation here.

PSinke commented 5 years ago

I've asked this question in the general discussion section of the Umbraco package, but it seems that the package is not compatible in it's current form, and needs to be adjusted to work with v8. https://our.umbraco.com/packages/backoffice-extensions/leblender/general-discussion/95577-anyone-have-any-success-with-umbraco-8

mirkomaty commented 5 years ago

The error messages appear, because LeBlender is compiled against the old V7 DLLs.

At least the tree integration has to be changed, because

There is some work to do. Question @ the project owners: Are you interested in porting the package? If this is the case, our company is ready to help.

soreng commented 5 years ago

Hi guys,

thank you very much for the interest in LeBlender on v8.

The future of the grid is already moving towards a "v2" where editors like LeBlender and DocTypeGridEditor are no longer needed. Because of this, we haven't really looked that much into how/when and even if, we should make LeBlender work on v8.

Have a look at this thread for some background info on the v8 grid: https://our.umbraco.com/forum/umbraco-8/94082-grid-v2

mirkomaty commented 5 years ago

We know about Grid "v2", but

So we decided to port LeBlender to v8. I managed to get it compiled today, but I guess it will need some debugging in the days to come.

PSinke commented 5 years ago

Nice @mirkomaty. Would you be able to share your fork when it's working? I'm also stuck with a large library of Leblender editors and would love to see it working on v8.

cleversolutions commented 5 years ago

But... from what I’ve read, v8 will not be shipping with grid 2.

Evan Moore

On Feb 7, 2019, at 10:13 AM, Søren Gregersen notifications@github.com wrote:

Hi guys,

thank you very much for the interest in LeBlender on v8.

The future of the grid is already moving towards a "v2" where editors like LeBlender and DocTypeGridEditor are no longer needed. Because of this, we haven't really looked that much into how/when and even if, we should make LeBlender work on v8.

Have a look at this thread for some background info on the v8 grid: https://our.umbraco.com/forum/umbraco-8/94082-grid-v2

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

mirkomaty commented 5 years ago

@soreng : I have a first version running. Are you interested in a pull request or should I create a fork under my ownership?

AndersBrohus commented 5 years ago

I guess a pull request could be great @mirkomaty :)

But a fork would be great now so we can start test it :)

mirkomaty commented 5 years ago

You can find the fork at https://github.com/mirkomaty/LeBlender, Note:

Installation:

  1. Compile the Extensions project. Copy the Lecoati.LeBlender.Extension.dll to the /bin folder of your Umbraco v8 installation. For debugging copy the .pdb file, too. After a restart the GridEditors tree will be integrated under settings below the DataTypes.
  2. Copy the complete App_Plugins/LeBlender folder to the /App_Plugins folder of your Umbraco v8 application.

It would be grateful if somebody could take care for the Nuget package.

mirkomaty commented 5 years ago

One more hint: Checkout the umbraco-v8 branch ;-)

soreng commented 5 years ago

@mirkomaty that looks like a lot of hard work -- very nice

We can't just update the nuget package, since people will then get a version for v8 that is not compatible with their v7 installs ;)

That whole "are we doing a new package, or maintain one" is, as you must know after doing the work, a bit hard to do.

Again, we really don't have a solid plan yet on what the (v8) future of this package is

mirkomaty commented 5 years ago

@cleversolutions, @PSinke, @AndersBrohus please try the code at https://github.com/mirkomaty/LeBlender and let me know, if it works for you.

@soreng: Take your time to decide. I think, a good idea will be to publish a new package like Umbraco.v8.LeBlender. I will publish it as soon as we did some testing. This allows your package to develop independent from my fork. We can join our work anytime, if necessary.

AndersBrohus commented 5 years ago

I'm gonna try it out! :)

bjarnef commented 5 years ago

@soreng if LeBlender is going to support Umbraco v8 the new/updated package can set minimum target version in Umbraco package file and require Umbraco >= 8.0.0 in NuGet package dependencies.

@mirkomaty how does it register the component (maybe also rename this to something else than UmbracoEvents)? https://github.com/mirkomaty/LeBlender/blob/umbraco-v8/Src/Lecoati.LeBlender.Extension/Events/UmbracoEvents.cs#L18

I think you need to create a composer to register it.

public class MyComposer : IUserComposer
{
    public void Compose(Composition composition)
    {
        composition.Components().Append<MyComponent>();
    }
}
public class MyComponent : IComponent
{
    private readonly IUserService _userService;
    private readonly ILogger _logger;

    public MyComponent(IUserService userService, ILogger logger)
    {
        _userService = userService;
        _logger = logger;
    }

    // Initialize: runs once when Umbraco starts
    public void Initialize()
    {

    }

    // Terminate: runs once when Umbraco stops
    public void Terminate()
    {
    }
}
soreng commented 5 years ago

@mirkomaty I would like to discuss more in-depth on how we should move on with this. Are you on the Umbraco Slack - if not join @ http://umbracians.chat/

@soreng: Take your time to decide. I think...

Well yes ;)

As @bjarnef also points out, there are ways to do this, but I want to make sure we do it right, and in a way that works for us on going forward.

I / We really appreciate the work done. You are more than welcome to do pull request, and then we can review it for futher development. I really wanted the v8 to use v8 features, so maybe this should be a seen as a beta of sorts.

bjarnef commented 5 years ago

@soreng it would be great if LeBlender in v8 use e.g. editorService to open overlays and benefits from infinite editing.

soreng commented 5 years ago

@bjarnef yes and yes :-)

And also use doc types (elements) like nested content (or some other grid editor)

No need to reinvent all of this :-)

mirkomaty commented 5 years ago

@bjarnef I used IComponent (see UmbracoEvents.cs). There was no need for IXxxxComposer. EDIT: Yes, the file should definitely be renamed. I didn't touch the name, so that finding the changes is more easy.

Further development: My intention was to get a running version of LeBlender with minimum effort. The result can be seen in the fork. It may have some bugs, but the main work is done. I see it as a provisionary solution to get our Umbraco based platform ported to Umbraco 8. It saves me from porting the grid editors immediately, but I don't think that that's the future.

As far as I understand, Grid2 will use Element doc types and therefore it may make LeBlender obsolete in the future. If somebode doesn't know about Grid2: Have a look at the branch temp8-grid2.

@soreng: I just created an account as "Mirko Matytschak".

bjarnef commented 5 years ago

@mirkomaty based on this comment in Our from Sebastiaan it seems it need a composer. Not sure how it register the component if it works without the composer at the moment (maybe via assembly scanning like dashboards, where there is a PR which a think remove that and it instead need to be registered).

https://our.umbraco.com/forum/umbraco-8/95981-how-do-you-get-content-compositionaliases-in-icomponent#comment-303587

mirkomaty commented 5 years ago

@bjarnef: You're right. We need a Composer. I added the necessary code and renamed UmbracoEvents into ApplicationInitializer, which fits the purpose of the class better.

PSinke commented 5 years ago

@mirkomaty Great work so far. I was able to install the plugin and see the grid editors section under Settings, but every action after that (Edit or create a grid editor) results in a 404 error. Any idea what I'm missing?

PSinke commented 5 years ago

@mirkomaty Great work so far. I was able to install the plugin and see the grid editors section under Settings, but every action after that (Edit or create a grid editor) results in a 404 error. Any idea what I'm missing?

Found it. There is a 'web.config' file in the /App_plugins/LeBlender folder. After removing that, all works fine.

PSinke commented 5 years ago

Has anyone tried to add a Multinode Treepicker with this port? I'm unable to pick more then one item, even thought the settings should allow me to pick 10.

mirkomaty commented 5 years ago

@PSinke: I managed to add multiple Nodes. But you have to select them one after another. Add, Pick, Submit Add, Pick, Submit

BUT: At the end the value array is empty. I don't understand, why. With other editors I can see a value in parameterconfig.controller.js in $scope.save. If I look at $scope.model.value[0].multiurl.value I get an empty array instead of what I selected in the MultiUrlPicker.

@all: Please note, that I pushed some bugfixes into the fork. Removed the web.config file which caused trouble and changed the Base.cshtml/LeBlender.cshtml to be inherited from WebViewPage

parachute-dev commented 5 years ago

How are you all building this/including in your project? Only ever installed via nuget before :( Apologies if it's a bargain basement question.

mirkomaty commented 5 years ago

@parachute-dev:

See https://github.com/Lecoati/LeBlender/issues/105#issuecomment-470211531

  1. Compile the Extensions project. Copy the Lecoati.LeBlender.Extension.dll to the /bin folder of your Umbraco v8 installation. For debugging copy the .pdb file, too. After a restart the GridEditors tree will be integrated under settings below the DataTypes.
  2. Copy the complete App_Plugins/LeBlender folder to the /App_Plugins folder of your Umbraco v8 application.
ConstroUmbraco commented 5 years ago

Hello @mirkomaty you have to create an installation package of LeBlender then Please provide to us because it will help us in our Umbraco version 8.

mirkomaty commented 5 years ago

you have to create an installation package of LeBlender then Please provide to us because it will help us in our Umbraco version 8.

I'm sorry, I'm currently not able to do that. I recommend doing the following:

ConstroUmbraco commented 5 years ago

Hello @mirkomaty Ok let me check your given step and if I face any issue then I will get back to you with detail.

parachute-dev commented 5 years ago

Thanks for your help @mirkomaty

We got it installed just fine, and we were exploring ways to create content in the PageGrid.

Have you used Nested Content in a Grid Editor?

Using a simple one on a doctype with text, a link and a content picker, the pickers won't show.

In the console we get this error:

Error: [$compile:ctreq] Controller 'valFormManager', required by directive 'valPropertyMsg', can't be found!

Any idea what might be going wrong?

mirkomaty commented 5 years ago

@parachute-dev Both Nested Content and LeBlender Grid Editors are containers for properties. I guess, that they disturb each other. If you aim at document variations I'd recommend to check out, if you can place a grid into Nested Content.

valFormManager and valPropertyMsg are not part of LeBlender.

If you take a look at the umbraco source code, you'll find valPropertyMsg in umbraco.directives.js (line 15332 in v8.0.1). At the beginning of the directive you see, that it declares the need of valFormManager. You see the according method in umbraco.directives.js at ~ line 15084. Note that both directives are part of the umbraco.directives.validation module. Try to debug valFormManager. It should be called by Umbraco, otherwise the directive is missing.

See: https://docs.angularjs.org/guide/directive:

The myPane directive has a require option with value ^^myTabs. When a directive uses this option, $compile will throw an error unless the specified controller is found. The ^^ prefix means that this directive searches for the controller on its parents.

cleversolutions commented 5 years ago

@agiraud or @soreng is there any interest among the LeBlender maintainers to publish @mirkomaty's hard work in a new package name such as Lecoati.LeBlenderV8? It's a silly thing I guess, but pulling a package down from Nuget feels much more production ready than grabbing the source from git. I think there is a viable use case for LeBlender in V8 for years to come. When (if) Grid2 comes out, I doubt it will automatically convert content from Grid1. Existing sites with a lot of content will likely still use Grid1 in V8 for years to come.

soreng commented 5 years ago

@agiraud or @soreng is there any interest among the LeBlender maintainers to publish @mirkomaty's hard work in a new package name such as Lecoati.LeBlenderV8?

Yes and no. He hasn’t made a pull request yet - that would be a first step.

mirkomaty commented 5 years ago

Tried to open a PR only to see that somebody was faster: https://github.com/Lecoati/LeBlender/pull/106

soreng commented 5 years ago

@mirkomaty Well, I would rather that you did it, and that the issues on it was resolved :-)

jacklawry commented 5 years ago

I would also love to see Le blender working on V8... I haven't seem any other alternative that offers the same great editor experience.

cleversolutions commented 5 years ago

DocType Grid Editor is almost ready for V8 and provides the same editor experience as LeBlender if you use Single Editor Mode. I’ve been using the alpha for V8 sites and it works very well. Check out https://github.com/umco/umbraco-doc-type-grid-editor/pull/137

bernardojbot commented 5 years ago

I'm having an issue getting LeBlender to work on v8.1.1. For some reason after adding the Grid Editor to my Grid and filling in the properties the UI freezes and I can't either save my settings or close the window. I haven't used LeBlender with other versions of Umbraco v8 yet, so I don't know if this is a known issue, but everyone commenting here seems to have it working just fine, and I couldn't find anyone mentioning having a similar issue. I've attached a screenshot showing where the UI freezes. At that point the only way to leave that screen is refreshing. I've tested different LeBlender editors with different properties and all of them seem to have the same issue. Any help would be appreciated. Thanks a lot.

LeBlender_issue

bjarnef commented 5 years ago

@bernardojbot I don't think it is an issue in LeBlender, but it seems to be an issue in core with overlays. https://github.com/umbraco/Umbraco-CMS/issues/6053

bernardojbot commented 5 years ago

@bjarnef thanks for your help. I'll keep an eye out on that issue to see if it gets solved.

mirkomaty commented 5 years ago

@bernardojbot: It might be my fault. I didn't merge Bjarnes fix into the umbraco-v8 branch until today. Note, that the v8 port resides here: https://github.com/mirkomaty/LeBlender/tree/umbraco-v8 Since I fixed some other issues, I recommend using the version of today.

pragneshmpatel commented 4 years ago

is there any update on V8 support?

mirkomaty commented 4 years ago

As far as I understand, here at Lecoati will be no further development. Check the following link: https://github.com/mirkomaty/LeBlender/tree/umbraco-v8

Read the installation procedure over there and post a comment, if you get problems using it. Note, that the version 2.1 converts your LeBlender grid property definitions into Element Document Types, which will be reusable in Umbraco.

davit20 commented 4 years ago

Hi guys, I'm want to use nested-content into Leblender grid editor but when I'm adding item getting an error.
image image has anyone had the same issue? Thank you @mirkomaty very much for Leblender update.

mirkomaty commented 4 years ago

Are you sure, you need NestedContent? LeBlender has the possibility to create multiple items of the property set you have designed in your element property type.

davit20 commented 4 years ago

Yes. I need multiple items for only Carousel Slides. Other properties no need multiple items. image this is U7 example it's using archetype editor.

mirkomaty commented 4 years ago

@davit20: I gave NestedContent a try and can confirm the issue. The directive val-form-manager is defined in the LeBlender forms, but isn't recognized by the NestedContent code. I don't believe, that somebody will fix this soon.

My suggestion for a workaround is the way we do it: Define a specific Media Type for your slides. The Media Type can be inherited from Image. This allows you to add additional information to your slide images. (If you don't need additional information for your slides, you can use plain images instead.) Put the slides of a slideshow into a specific media folder. Instead of picking each slide in the Nested Content in the LeBlender dialog, just pick the whole folder with a MediaPicker. Your rendering code must determine all slides in the folder and can use them to render the elements of your slideshow.

Another variant of this approach is to place your slides in the content tree. Create a parent document of an appropriate content type and place your slides under this parent document. After that use a ContentPicker to pick that parent document.

I hope, that helps.

davit20 commented 4 years ago

Thank you @mirkomaty for your very good suggestion but I have already fixed my problem using with Doc Type Grid Editor.

mirkomaty commented 4 years ago

@davit20: Glad to hear, that you found a solution.