@ergonode/categories
Version:
Ergonode categories module
66 lines (64 loc) • 1.66 kB
JavaScript
/*
* Copyright © Ergonode Sp. z o.o. All rights reserved.
* See LICENSE for license details.
*/
import {
Components,
Icons,
Store,
} from '/config/imports';
import {
getCategory,
setCategory,
} from '/extends/product/methods';
export default {
extendStore: {
product: Store.Product,
},
extendComponents: {
'/components/Forms/ProductForm': {
__ALL: [
{
component: Components.ProductFormCategory,
props: {},
order: 20,
},
],
},
},
extendMethods: {
'/components/Tabs/CategoryTreeDesignerTab/verticalTabs': ({
props,
$this,
}) => [
{
title: $this.$t('.category._.title'),
component: Components.CategoriesVerticalTab,
icon: Icons.IconTree,
props: {
scope: $this.scope,
isSelectLanguage: false,
...props,
},
},
],
'/store/product/action/getProduct/__after': ({
$this, data,
}) => {
setCategory({
$this,
data,
});
},
'/store/product/action/updateProduct/__before': ({
$this,
}) => getCategory({
$this,
}),
'/store/product/action/createProduct/__before': ({
$this,
}) => getCategory({
$this,
}),
},
};