Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AEM: Make side panel AI and content creation dialog work for Content Fragments #23

Open
stoerr opened this issue Oct 11, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@stoerr
Copy link
Member

stoerr commented Oct 11, 2023

In content fragments I had several problems on AEMaaCS: the layout of the buttons of the side panel AI is trashed when scrolling around, and there are exceptions within richtext editors in the content creation dialog. I assume this is because of some libraries not being loaded.

As a workaround for now I have disabled the AIs in registerdialogs.js isDisabled for /content/dam .

Rechecked: still appears in version 0.6.0 of Composum AI for the cloud SDK.

@stoerr stoerr added the enhancement New feature or request label Oct 11, 2023
@stoerr
Copy link
Member Author

stoerr commented Dec 7, 2023

@royteeuwen :

To switch the editing on for content fragment editors, it's necessary to override the default exclude "/content/dam/.*" for deniedPaths in the configuration . If there is no Sling Context Aware Configuration in place, that'd mean configuring the "Composum AI Permission Configuration" in the Felix Console : create a configuration if there is none and remove the /content/dam exclusion. (If you're deploying from the source, you could also change
com.composum.ai.backend.slingbase.model.GPTPermissionConfiguration#deniedPaths ).

@stoerr
Copy link
Member Author

stoerr commented Dec 7, 2023

In the content fragment editor :

The first problem is a CSS one: when the dialog in the sidebar AI gets longer than the screen, the history buttons get trashed as in the screenshot, despite having the same CSS code (from the Composum AI side) as in the other dialogs.

Screenshot 2023-12-07 at 10 52 55

@stoerr
Copy link
Member Author

stoerr commented Dec 7, 2023

This happens only on AEM cloud SDK, not on AEM 6.5 - it actually works there:

The much more difficult second problem is that the rich text editor in the content creation dialog throws an exception in initialization and doesn't work. To reproduce that one needs a content fragment with a richtext editor in it, and to open the content creation dialog from there. You get exceptions in the Chrome inspector:

impl.lc-41dfc578739383d4bf6e9d8f74b0367a-lc.js:1231 Uncaught TypeError: Cannot read properties of undefined (reading 'dataset')
    at instanceGenerator.initializeUI (impl.lc-41dfc578739383d4bf6e9d8f74b0367a-lc.js:1231:40)
    at instanceGenerator.createToolbar (richtext.lc-96388004f0a10be99eaa761feafa698c-lc.js:4932:20)
    at instanceGenerator.initializeEditorKernel (richtext.lc-96388004f0a10be99eaa761feafa698c-lc.js:48484:25)
    at instanceGenerator.startEditing (richtext.lc-96388004f0a10be99eaa761feafa698c-lc.js:48852:12)
    at instanceGenerator.start (richtext.lc-96388004f0a10be99eaa761feafa698c-lc.js:48883:12)
    at processConfig (richtext.lc-96388004f0a10be99eaa761feafa698c-lc.js:39368:15)
    at Object.success (richtext.lc-96388004f0a10be99eaa761feafa698c-lc.js:39397:17)
    at fire (jquery.lc-676f843463ac676e1918c97ea7dc1a20-lc.js:3233:31)
    at Object.fireWith [as resolveWith] (jquery.lc-676f843463ac676e1918c97ea7dc1a20-lc.js:3363:7)
    at done (jquery.lc-676f843463ac676e1918c97ea7dc1a20-lc.js:9845:14)

and if you later click into the source editor you get the following error, which is likely a consequence:

all.lc-dcd2b40a6b9242e0ffa8cd56271d3ff5-lc.js:2985 Uncaught TypeError: Cannot read properties of null (reading 'hide')
    at HTMLDivElement.<anonymous> (all.lc-dcd2b40a6b9242e0ffa8cd56271d3ff5-lc.js:2985:54)
    at Function.each (jquery.lc-676f843463ac676e1918c97ea7dc1a20-lc.js:371:19)
    at jQuery.fn.init.each (jquery.lc-676f843463ac676e1918c97ea7dc1a20-lc.js:137:17)
    at HTMLDivElement.<anonymous> (all.lc-dcd2b40a6b9242e0ffa8cd56271d3ff5-lc.js:2982:30)
    at HTMLDivElement.dispatch (jquery.lc-676f843463ac676e1918c97ea7dc1a20-lc.js:5232:27)
    at elemData.handle (jquery.lc-676f843463ac676e1918c97ea7dc1a20-lc.js:4884:28)

The initialization of the richtext editors normally happens due to the event 'foundation-contentloaded' that is triggered for the content creation dialog in registerdialogs.js showCreateDialog , which is something I mostly guessed and experimented. But that doesn't seem to work here for some reason. The code in ContentCreationDialog.js might be relevant, but not likely.

@stoerr
Copy link
Member Author

stoerr commented Jan 30, 2024

Thanks to @WietseV #51 the side panel AI CSS problem is solved. Open is "only" the rich text editor issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant