diff --git a/changelog/_unreleased/2020-11-23-open-categories-in-new-tabs-with-right-click.md b/changelog/_unreleased/2020-11-23-open-categories-in-new-tabs-with-right-click.md new file mode 100644 index 00000000000..9bb6c14c036 --- /dev/null +++ b/changelog/_unreleased/2020-11-23-open-categories-in-new-tabs-with-right-click.md @@ -0,0 +1,9 @@ +--- +title: Open categories in new tabs with right-click +issue: NEXT-9586 +--- +# Administration +* Added a method `getCategoryUrl` in `src/module/sw-category/component/sw-category-tree/index.js`. +* Added a new prop `getItemUrl` in `src/app/component/tree/sw-tree-item/index.js`. +* Added a method `showItemUrl` in `src/app/component/tree/sw-tree-item/index.js`. +* Added `href` attribute into tag in `{% block sw_tree_items_item_content_default %}` and `{% block sw_tree_item_children_items_slot_content_default %}` in `src/app/component/tree/sw-tree-item/sw-tree-item.html.twig` diff --git a/src/Administration/Resources/app/administration/src/app/component/tree/sw-tree-item/index.js b/src/Administration/Resources/app/administration/src/app/component/tree/sw-tree-item/index.js index 90741045f41..5eb278cd391 100644 --- a/src/Administration/Resources/app/administration/src/app/component/tree/sw-tree-item/index.js +++ b/src/Administration/Resources/app/administration/src/app/component/tree/sw-tree-item/index.js @@ -101,6 +101,12 @@ Component.register('sw-tree-item', { type: Boolean, required: false, default: true + }, + + getItemUrl: { + type: Function, + required: false, + default: null } }, @@ -375,6 +381,14 @@ Component.register('sw-tree-item', { } return item.data.name; + }, + + showItemUrl(item) { + if (this.getItemUrl) { + return this.getItemUrl(item); + } + + return false; } } }); diff --git a/src/Administration/Resources/app/administration/src/app/component/tree/sw-tree-item/sw-tree-item.html.twig b/src/Administration/Resources/app/administration/src/app/component/tree/sw-tree-item/sw-tree-item.html.twig index 00b2a6a59b4..e09103d5f2c 100644 --- a/src/Administration/Resources/app/administration/src/app/component/tree/sw-tree-item/sw-tree-item.html.twig +++ b/src/Administration/Resources/app/administration/src/app/component/tree/sw-tree-item/sw-tree-item.html.twig @@ -62,7 +62,7 @@ {% block sw_tree_items_item_content_default %}