From 4a831eea772dfd2e3569bead76764cb01fe2f16a Mon Sep 17 00:00:00 2001
From: Rodiel Martinez <10471758+Rodielm@users.noreply.github.com>
Date: Wed, 15 Nov 2023 14:45:12 +0100
Subject: [PATCH] wc: replace select facet-filter #TASK-5070
---
src/webcomponents/commons/facet-filter.js | 67 ++++++++++---------
.../filters/consequence-type-select-filter.js | 8 +--
2 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/src/webcomponents/commons/facet-filter.js b/src/webcomponents/commons/facet-filter.js
index bc93a92b63..499009eb99 100644
--- a/src/webcomponents/commons/facet-filter.js
+++ b/src/webcomponents/commons/facet-filter.js
@@ -17,7 +17,7 @@
import {LitElement, html} from "lit";
import UtilsNew from "../../core/utils-new.js";
import "../commons/filters/consequence-type-select-filter.js";
-
+import "../commons/forms/select-field-filter2.js";
export default class FacetFilter extends LitElement {
@@ -135,7 +135,6 @@ export default class FacetFilter extends LitElement {
UtilsNew.initTooltip(this);
}
-
// Extracts facet field name, value and function (Avg or Percentile) from default list (or saved facet, in future)
parseFacet(str) {
const fnMatch = [...str.matchAll(/(avg|min|max|unique|hll|percentile|sumsq)\((\w+)\)/gi)];
@@ -226,7 +225,6 @@ export default class FacetFilter extends LitElement {
// this.requestUpdate();
// }
-
onFacetValueChange(e) {
const id = e.target.dataset.id;
// this.selectedFacet = {...this.selectedFacet, [id]: (e.target.value.trim() ? e.target.value : "")};
@@ -337,11 +335,14 @@ export default class FacetFilter extends LitElement {
Nested Facet (optional)
-
this.onNestedFacetFieldChange(e, facet.id)}">
-
+
${this.renderNestedField(this.selectedFacet[facet.id].nested, facet.id)}
@@ -357,9 +358,9 @@ export default class FacetFilter extends LitElement {
this.onFacetChange(e, facet.id)}">
+ .ct="${this.preparedQuery.ct}"
+ .config="${this.consequenceTypes || CONSEQUENCE_TYPES}"
+ @filterChange="${e => this.onFacetChange(e, facet.id)}">
@@ -370,14 +371,16 @@ export default class FacetFilter extends LitElement {
return html`
- this.onFacetChange(e, facet.id)}">
-
+
${renderNestedFieldWrapper(facet)}
@@ -415,13 +418,13 @@ export default class FacetFilter extends LitElement {
@@ -484,14 +487,16 @@ export default class FacetFilter extends LitElement {
[...facet.value.matchAll(/\[([^\s]+)]/gim)][0] : "";
return html`
-
-
+
+
`;
case "number":
@@ -528,14 +533,16 @@ export default class FacetFilter extends LitElement {
.value="\${num_value || ""}" @input="\${this.onNestedFacetValueChange}" />-->
-
-
+
`;
@@ -573,19 +580,17 @@ export default class FacetFilter extends LitElement {
}
}
-
render() {
return this.config ? html`
-
-
+
+
- or -