Geeks-Solutions / vue-sections

This npm package provides a VueJS Component to use right off the bat to interface with Sections' server
https://sections.geeks.solutions
2 stars 3 forks source link

Layout and region Enhancements #118

Closed mahfouzhseineweev closed 11 months ago

mahfouzhseineweev commented 1 year ago

noun-404-error-5161324

noun-404-error-5161324

jfayad commented 1 year ago

You made no mention of the error management that should be covered for wrongly produced layouts, please add these to the description

mahfouzhseineweev commented 1 year ago

@jfayad I am struggling with the last point the presence of each slot of slotNames prop in the template as <slot name="{nameOfTheSlot}"></slot>

All the other errors are properly managed now and displayed except the one concerning the template as it turned out there is no easy way to read the template from the component.

I tried many ways such as registering the component and calling its options.template but that did not work. I tried calling the render() function on the imported layout but it is returning this error Error in render: "TypeError: Cannot read property '_c' of undefined"

The last option which is not efficient, is to read the file with fs library fs.readFileSync and check the existence of the slotes in the template

What do you think ?

mahfouzhseineweev commented 12 months ago

The issue took more time and still needs 1.5 hour to be finalized because of the following:

All the point of the issue has been tackled during the estimated time except last point which was not completely done as I faced I faced the problem reported in the last comment. Which is about reading the slot names of the layout files and verify they are placed correctly based on their names provided in the slotNames prop array.

After discussion with Julien in a call about this point, the suggested solution was to create empty sections with IDs for all the slots, then make a sanity check on this slot regions and if one of these IDs is not found. Then we show the error and specify which slot is missing or have a problem

akramsarkis commented 11 months ago

I opened a QA issue for Layout https://github.com/Geeks-Solutions/vue-sections/issues/119 that include QA as well of issue 103