sylius_grid:
    grids:
        sylius_admin_product:
            driver:
                name: doctrine/orm
                options:
                    class: "%sylius.model.product.class%"
                    repository:
                        method: createListQueryBuilder
                        arguments: ["expr:service('sylius.context.locale').getLocaleCode()", $taxonId]
            sorting:
                code: asc
            fields:
                image:
                    type: twig
                    label: sylius.ui.image
                    path: .
                    options:
                        template: "@SyliusAdmin/Product/Grid/Field/image.html.twig"
                code:
                    type: string
                    label: sylius.ui.code
                    sortable: ~
                name:
                    type: twig
                    label: sylius.ui.name
                    sortable: translation.name
                    options:
                        template: "@SyliusAdmin/Product/Grid/Field/name.html.twig"
                mainTaxon:
                    type: twig
                    label: sylius.ui.main_taxon
                    options:
                        template: "@SyliusAdmin/Product/Grid/Field/mainTaxon.html.twig"
                enabled:
                    type: twig
                    label: sylius.ui.enabled
                    options:
                        template: "@SyliusUi/Grid/Field/enabled.html.twig"
            filters:
                search:
                    type: string
                    label: sylius.ui.search
                    options:
                        fields: [code, translation.name]
                enabled:
                    type: boolean
                    label: sylius.ui.enabled
                channel:
                    type: entities
                    label: sylius.ui.channel
                    form_options:
                        class: "%sylius.model.channel.class%"
                    options:
                        field: "channels.id"
            actions:
                main:
                    create:
                        type: links
                        label: sylius.ui.create
                        options:
                            class: primary
                            icon: plus
                            header:
                                icon: cube
                                label: sylius.ui.type
                            links:
                                simple:
                                    label: sylius.ui.simple_product
                                    icon: plus
                                    route: sylius_admin_product_create_simple
                                configurable:
                                    label: sylius.ui.configurable_product
                                    icon: plus
                                    route: sylius_admin_product_create
                item:
                    details:
                        label: sylius.ui.details
                        type: show
                    update:
                        type: update
                    delete:
                        type: delete
                subitem:
                    variants:
                        type: links
                        label: sylius.ui.manage_variants
                        options:
                            icon: cubes
                            links:
                                index:
                                    label: sylius.ui.list_variants
                                    icon: list
                                    route: sylius_admin_product_variant_index
                                    parameters:
                                        productId: resource.id
                                create:
                                    label: sylius.ui.create
                                    icon: plus
                                    route: sylius_admin_product_variant_create
                                    parameters:
                                        productId: resource.id
                                generate:
                                    label: sylius.ui.generate
                                    icon: random
                                    route: sylius_admin_product_variant_generate
                                    visible: resource.hasOptions
                                    parameters:
                                        productId: resource.id
                bulk:
                    delete:
                        type: delete
