Skip to content
Snippets Groups Projects
Verified Commit a75635a9 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

feat(filter): add new feature flag autoFilter #279

parent 3e732ce5
No related branches found
No related tags found
No related merge requests found
...@@ -241,6 +241,7 @@ class Filter extends CustomElement { ...@@ -241,6 +241,7 @@ class Filter extends CustomElement {
* @property {Object} formatter.marker.close Marker close * @property {Object} formatter.marker.close Marker close
* @property {Object} features Feature definitions * @property {Object} features Feature definitions
* @property {boolean} features.storedConfig Stored configuration, this replaces the setting `storedConfig.enabled` @since 3.97.0 * @property {boolean} features.storedConfig Stored configuration, this replaces the setting `storedConfig.enabled` @since 3.97.0
* @property {boolean} features.autoFilter Auto filter @since 3.100.0
* @property {Object} storedConfig Stored configuration * @property {Object} storedConfig Stored configuration
* @property {boolean} storedConfig.enabled The store has been enabled, this option will no longer have any effect. @deprecated 20250101 * @property {boolean} storedConfig.enabled The store has been enabled, this option will no longer have any effect. @deprecated 20250101
* @property {string} storedConfig.selector Selector * @property {string} storedConfig.selector Selector
...@@ -275,6 +276,7 @@ class Filter extends CustomElement { ...@@ -275,6 +276,7 @@ class Filter extends CustomElement {
features: { features: {
storedConfig: false, storedConfig: false,
autoFilter: true,
}, },
storedConfig: { storedConfig: {
...@@ -317,6 +319,8 @@ class Filter extends CustomElement { ...@@ -317,6 +319,8 @@ class Filter extends CustomElement {
* @fires monster-filter-initialized * @fires monster-filter-initialized
*/ */
[assembleMethodSymbol]() { [assembleMethodSymbol]() {
const self = this;
this.setOption( this.setOption(
"templateMapping.filter-save-label", "templateMapping.filter-save-label",
this.getOption("labels.save"), this.getOption("labels.save"),
...@@ -329,26 +333,30 @@ class Filter extends CustomElement { ...@@ -329,26 +333,30 @@ class Filter extends CustomElement {
super[assembleMethodSymbol](); super[assembleMethodSymbol]();
initControlReferences.call(this); initControlReferences.call(self);
getWindow().requestAnimationFrame(() => { getWindow().requestAnimationFrame(() => {
initEventHandler.call(this); initEventHandler.call(self);
}); });
initFromConfig initFromConfig
.call(this) .call(self)
.then(() => {}) .then(() => {})
.catch((error) => { .catch((error) => {
addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, error?.message); addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, error?.message);
}) })
.finally(() => { .finally(() => {
initFilter.call(this); initFilter.call(self);
updateFilterTabs.call(this); updateFilterTabs.call(self);
if (self.getOption("features.autoFilter")===true) {
doSearch doSearch
.call(this, { showEffect: false }) .call(self, {showEffect: false})
.then(() => { .then(() => {
fireCustomEvent(this, "monster-filter-initialized"); fireCustomEvent(self, "monster-filter-initialized");
}) })
.catch(() => {}); .catch(() => {
});
}
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment