Skip to content

Commit

Permalink
Merge branch 'next-22222/refactor-list-filter-for-plugin' into 'trunk'
Browse files Browse the repository at this point in the history
NEXT-22222 - Refactor order filter for plugin

See merge request shopware/6/product/platform!8574
  • Loading branch information
jleifeld committed Jul 29, 2022
2 parents efb7d36 + ff81cc9 commit a1f845b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Refactor filter options for plugin
issue: NEXT-22222
---
# Administration
* Changed in `src/module/sw-order/page/sw-order-list/index.js`
* Added computed `listFilterOptions` to allow third party developers customize order filter options.
* Changed computed `listFilters` to use filter options with `listFilterOptions`.

* Changed in `src/module/sw-product/page/sw-product-list/index.js`
* Added computed `listFilterOptions` to allow third party developers customize order filter options.
* Changed computed `listFilters` to use filter options with `listFilterOptions`.

* Changed in `src/module/sw-customer/page/sw-customer-list/index.js`
* Added computed `listFilterOptions` in `src/module/sw-order/page/sw-order-list/index.js` to allow third party developers customize order filter options.
* Changed computed `listFilters` to use filter options with `listFilterOptions`.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ Component.register('sw-customer-list', {
return criteria;
},

listFilters() {
return this.filterFactory.create('customer', {
listFilterOptions() {
return {
'affiliate-code-filter': {
property: 'affiliateCode',
type: 'multi-select-filter',
Expand Down Expand Up @@ -171,7 +171,11 @@ Component.register('sw-customer-list', {
label: this.$tc('sw-customer.filter.tags.label'),
placeholder: this.$tc('sw-customer.filter.tags.placeholder'),
},
});
};
},

listFilters() {
return this.filterFactory.create('customer', this.listFilterOptions);
},
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ Component.register('sw-order-list', {
return criteria;
},

listFilters() {
listFilterOptions() {
if (this.feature.isActive('FEATURE_NEXT_7530')) {
return this.filterFactory.create('order', {
return {
'sales-channel-filter': {
property: 'salesChannel',
label: this.$tc('sw-order.filters.salesChannelFilter.label'),
Expand Down Expand Up @@ -221,10 +221,10 @@ Component.register('sw-order-list', {
criteria: this.productCriteria,
displayVariants: true,
},
});
};
}

return this.filterFactory.create('order', {
return {
'affiliate-code-filter': {
property: 'affiliateCode',
type: 'multi-select-filter',
Expand Down Expand Up @@ -315,7 +315,11 @@ Component.register('sw-order-list', {
criteria: this.productCriteria,
displayVariants: true,
},
});
};
},

listFilters() {
return this.filterFactory.create('order', this.listFilterOptions);
},

productCriteria() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ Component.register('sw-product-list', {
return !!this.productEntityVariantModal;
},

listFilters() {
return this.filterFactory.create('product', {
listFilterOptions() {
return {
'active-filter': {
property: 'active',
label: this.$tc('sw-product.filters.activeFilter.label'),
Expand Down Expand Up @@ -176,7 +176,11 @@ Component.register('sw-product-list', {
toFieldLabel: null,
showTimeframe: true,
},
});
};
},

listFilters() {
return this.filterFactory.create('product', this.listFilterOptions);
},

productBulkEditColumns() {
Expand Down

0 comments on commit a1f845b

Please sign in to comment.