Closed mahfouzhseineweev closed 11 months ago
You made no mention of the error management that should be covered for wrongly produced layouts, please add these to the description
@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 ?
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
I opened a QA issue for Layout https://github.com/Geeks-Solutions/vue-sections/issues/119 that include QA as well of issue 103
[ ] In edit mode, put the name of the regions next to the add new section button and make the row similar to the rows at the top of the page so with grey background so it shows that this is an admin section regions
[ ] Add a checkbox next to the layout dropdown that will show borders around the regions when selected
[ ] When starting to drag a section show the borders of the regions and if the regions are empty, adjust their height and width (by injecting fake values) so the borders shows correctly and this is only while dragging
[ ] When deleting a sections show an alert popup that will state that the section will no longer be present on any other layout once removed
[ ] Add the below 404 icon when a page is not found and put
404 page not found under it
[ ] Show the same icon when selecting a layout that has errors and incorrect structure and state all errors under the icon: The errors management should start with the props availability => the slotNames prop filled with slots or regions => the presence of each slot of slotNames prop in the template as
<slot name="{nameOfTheSlot}"></slot>