-
Notifications
You must be signed in to change notification settings - Fork 8
Pages MetaData Editing Mode Support #29
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
Conversation
…d EditScripts TagHelper
…d in editing config request. Updated related tests
src/Sitecore.AspNetCore.SDK.Pages/Middleware/PageSetupMiddlewa
8000
re.cs
Fixed
Show fixed
Hide fixed
src/Sitecore.AspNetCore.SDK.Pages/Controllers/PagesSetupController.cs
Fixed
Show resolved
Hide resolved
…DictionaryService
…th customisable HeaderCollection instead
…ons as its not supported by MetaData Editing
src/Sitecore.AspNetCore.SDK.Pages/Controllers/PagesSetupController.cs
Outdated
Show resolved
Hide resolved
I have tried this and it is working (almost) as expected 👍 When I have the SXA LinkList rendering inserted on a page then editing that page in Pages is failing: I think the reason is that this rendering has an Integrated GraphQL query specified in Sitecore. Layout response with ContentResolvers are properly handled, because it is rendered as an array. When parsing the layout in Line 22 in af13261
CustomContrentFieldKey and hereby handled in Line 195 in af13261
However this result from the Integrated Query is not going into this code path but is ending up as a standard field with the serialization error shown. I completely acknowledge that this is something we need to handle in the ASP.NET SDK because we are using model binding with (real) strong types while the node based SDK is (more or less) just ignoring this difference 😄 |
Good catch @jballe, I'd forgotten about the iGQL in use on that control. I've updated the error handling in the I think this will work for now, and we can say that anything implemented with a custom Rendering Contents Resolvers, or with iGQL that changes the structure of the data returned will no longer be editable. We can then have a look at how to better handle deserialisation of these custom types, as the strong typing model in dotnet will make this more challenging than in node as you mentioned! |
Thank you @robearlam that was really fast! I have tried it and it is now working with those changes. I have two other comments - with the risk of delaying the PR (and especially when I have been poking @IvanLieckens it might not be the best timing) - so let me just give the input and then you can decide if it should actually be part of this PR or a future improvement - or maybe even something unrelated to this... When using metadata editing in Pages there is a request to config endpoint, implemented in the PagesSetupController. I had to make two changes here to get rid of console/CORS errors, so I have added More important: In this example I have moved the Promo view to a subfolder and changed the view name with a registration like this: renderingEngineOptions.AddModelBoundView<Promo>("Promo", "HeadlessExperienceAccelerator/Promo")
For ViewComponents it is actually worse, the extension method to register the view component Line 154 in 17e0b09
But the method signature is changed to have a locator as a second paramter, so we end up with a registration with an empty componentName Line 34 in 17e0b09
I can see you have had a bit back and forth on how this actually should be so it was probably not changed everywhere. But, from what I see, I think we need to store the actual component name that is used to build the predicate so that it can be exposed in the config endpoint. Right now I think there is a bit confusion on what is the component name used in the layout response and what is the name used to render the component. |
Thanks again for the feedback @jballe. Chatting with Ivan, we're hoping to get this completed and merged in the next couple of weeks. With the points you raised above:
I also noticed we weren't handling the naming for PartialView registration either so added that in as well. You're right, we have gone back and forth a bit having discussions about what will be supported in this Component list. The main thing that won't be is the predicate matching e.g. After discussing, we didn't want to hold up the release of this feature and figured as predicate matching isn't a feature offered by JSS, we would move without Pages MetaData supporting it for now and we can figure that out after the fact. |
So fast again. We are really looking forward to this, thank you. I agree, it looks tempting with such generic block and registration (which is then a new feature in the ASP.NET SDK, even though the default view is using that internally) but then you cannot expect that to work in Pages. When making the "usual" registrations it should work in Pages out of the box (and I see the matching more as an implementation detail on the inside) |
src/Sitecore.AspNetCore.SDK.RenderingEngine/Extensions/RenderingEngineOptionsExtensions.cs
Show resolved
Hide resolved
@robearlam, there seems to be an issue in this PR where the placeholders are not rendering properly. After lots of digging around, it seems that Pages is not properly outputting the needed HTML DOM elements. Compared to the chrome mode, it seems that the elements and attributes needed inside the |
…ect use of placeholder key
Good spot Amir. Turns out I was using the incorrect placeholder ID for nested placholder code blocks, that was causing them to render incorrectly, when empty. Should be fixed now. |
Please be aware that ExperienceEditor will still need to be enabled for Preview to work in Pages (and taking Thumbnails in Content Editor but I am in doubt if that is really supported) |
Yeah that is true. This is the same situation with the JS based ContentSDK, and there is work being performed internally to shift Preview away from using the EE. We can still merge this in for now, and once that work is complete then add the functionality in to the SDK here at that point. |
src/Sitecore.AspNetCore.SDK.Pages/Controllers/PagesSetupController.cs
Fixed
Show resolved
Hide resolved
src/Sitecore.AspNetCore.SDK.Pages/Controllers/PagesSetupController.cs
Outdated
Show resolved
Hide resolved
src/Sitecore.AspNetCore.SDK.Pages/Controllers/PagesSetupController.cs
Outdated
Show resolved
Hide resolved
src/Sitecore.AspNetCore.SDK.Pages/Extensions/PagesAppConfigurationExtensions.cs
Outdated
Show resolved
Hide resolved
src/Sitecore.AspNetCore.SDK.Pages/Request/Handlers/GraphQL/GraphQLEditingServiceHandler.cs
Outdated
Show resolved
Hide resolved
src/Sitecore.AspNetCore.SDK.Pages/Request/Handlers/GraphQL/GraphQLEditingServiceHandler.cs
Outdated
Show resolved
Hide resolved
src/Sitecore.AspNetCore.SDK.Pages/Request/Handlers/GraphQL/GraphQLEditingServiceHandler.cs
Show resolved
Hide resolved
src/Sitecore.AspNetCore.SDK.Pages/Sitecore.AspNetCore.SDK.Pages.csproj
Outdated
Show resolved
Hide resolved
src/Sitecore.AspNetCore.SDK.RenderingEngine/TagHelpers/PlaceholderTagHelper.cs
Show resolved
Hide resolved
+ QL vs Ql fixed (added QL to abbreviations) + Added additional options for valid methods and headers + Moved strings to constants + Adjusted multi return functions to single result + Resolved logging style warnings + Removed vars + Fixed variable naming + EE added to abbreviations
src/Sitecore.AspNetCore.SDK.Pages/Controllers/PagesSetupController.cs
Dismissed
Show dismissed
Hide dismissed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Srry about that one @robearlam. Seeing the new situation I realized it's not optimal for cognitive understanding of the usage as per our teams conversation.
This PR adds support for Pages MetaData Editing.
Description / Motivation
Testing
Terms
Closes #17