shopware6-phpstorm-plugin icon indicating copy to clipboard operation
shopware6-phpstorm-plugin copied to clipboard

[FEATURE] Allow overriding/extending async admin components

Open rohithmeethal opened this issue 1 year ago • 2 comments

For admin components registered synchronously, it is possible to extend components methods using context menu. But for components registered async, context menu does not provide override suggestion. It would be nice to have this feature if possible.

eg: Context menu does not show extend/override on sw-customer-list Shopware.Component.register('sw-customer-list', () => import('./page/sw-customer-list'));

context-not-available

In old version of Shopware : We can get context menu to override the component

Component.register('sw-customer-list', {
    template,
    ....
    }

context-available

rohithmeethal avatar Sep 20 '24 09:09 rohithmeethal

The problem is I have no idea, that this export is an component. Idk if there is some way to understand that is export is an component

shyim avatar Sep 20 '24 11:09 shyim

I am sorry I also don't know if there is any way to identify the current file as component.

But for a dirty fix, if we just use some tag like

/**
* @component
* /

Will forcefully consider file as component ? So I can just edit the source file and add the tag when I want to extend/override some component.

This would still save a lot of time for extending components, than going manually to create folder structure and creating component file.

I hope some other better method exists and hopefully someone will give a solution

rohithmeethal avatar Sep 27 '24 13:09 rohithmeethal