cancel
Showing results for 
Search instead for 
Did you mean: 

Move StoreView column renderer to Store module

0 Kudos

Move StoreView column renderer to Store module

Feature request from ldusan84, posted on GitHub Jul 12, 2017

When creating a custom grid using UI components, the "Store" column can be created like this:

<column name="store_id" class="Magento\Store\Ui\Component\Listing\Column\Store">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
                    <item name="sortable" xsi:type="boolean">false</item>
                    <item name="label" xsi:type="string" translate="true">Store View</item>
                </item>
            </argument>
        </column>

Where the class attribute value is the column renderer.

The Magento\Store\Ui\Component\Listing\Column\Store column renderer works correctly for the cases where the entity can belong to multiple store views such cms block, cms page, etc.

If you want your entity to belong to only one store view you need to use Magento\Search\Ui\Component\Listing\Column\StoreView as Magento\Store\Ui\Component\Listing\Column\Store doesn't work correctly in that case (shows blank for all store views).

I think that Magento\Search\Ui\Component\Listing\Column\StoreView belongs to the Store module instead of Search module.

There shouldn't be a need to have an additional dependency to Search module just to get the store view column renderer.

The naming can also be improved, maybe Magento\Store\Ui\Component\Listing\Column\MultipleStoreView and Magento\Store\Ui\Component\Listing\Column\SingleStoreView

Hope it makes sense.

2 Comments
apiuser
New Member

Comment from dmanners, posted on GitHub Jul 31, 2017

Hi @ldusan84 to me moving this into Magento\Store seems logical. I guess this one might just not have been migrated with the others like Magento\Store\Ui\Component\Listing\Column\Store and Magento\Store\Ui\Component\Listing\Column\Store\Options.

Also updating the naming could also help though I am not sure what that would mean with regards to BiC.

apiuser
New Member

Comment from korostii, posted on GitHub Aug 01, 2017

Also updating the naming could also help though I am not sure what that would mean with regards to BiC.

You can always create a new duplicate class (with new name) and mark the older one @deprecated instead of deleting it.