mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-06-09 05:48:20 +00:00
Categorical filter is now mutually exclusive
This commit is contained in:
parent
e72fcda5fe
commit
bb3f9e7bcb
@ -2,7 +2,6 @@ package tech.ailef.dbadmin.internal.model;
|
|||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.format.datetime.standard.DateTimeFormatterFactory;
|
import org.springframework.format.datetime.standard.DateTimeFormatterFactory;
|
||||||
|
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
@ -11,9 +10,6 @@ import jakarta.persistence.GeneratedValue;
|
|||||||
import jakarta.persistence.GenerationType;
|
import jakarta.persistence.GenerationType;
|
||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
import jakarta.persistence.Lob;
|
import jakarta.persistence.Lob;
|
||||||
import jakarta.persistence.Transient;
|
|
||||||
import tech.ailef.dbadmin.external.DbAdmin;
|
|
||||||
import tech.ailef.dbadmin.external.dbmapping.DbObjectSchema;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An action executed by any user from the web UI.
|
* An action executed by any user from the web UI.
|
||||||
|
@ -49,11 +49,17 @@
|
|||||||
<!--/*--> Handle non categorical filter <!--*/-->
|
<!--/*--> Handle non categorical filter <!--*/-->
|
||||||
<th:block th:if="${!field.isFilterableCategorical()}">
|
<th:block th:if="${!field.isFilterableCategorical()}">
|
||||||
<form action="" method="GET">
|
<form action="" method="GET">
|
||||||
<!--/*--> Propagate queryParams containing other filters with hidden fields <!--*/-->
|
<!--/*--> Propagate query filters with hidden fields <!--*/-->
|
||||||
<th:block th:each="p : ${queryParams.keySet()}">
|
<th:block th:each="filter : ${activeFilters}">
|
||||||
<input th:each="v : ${queryParams.get(p)}"
|
<input type="hidden"
|
||||||
th:name="${p}" th:value="${v}" type="hidden"
|
name="filter_field"
|
||||||
th:if="${p.startsWith('filter_')}">
|
th:value="${filter.getField().getJavaName()}">
|
||||||
|
<input type="hidden"
|
||||||
|
name="filter_op"
|
||||||
|
th:value="${filter.getOp()}">
|
||||||
|
<input type="hidden"
|
||||||
|
name="filter_value"
|
||||||
|
th:value="${filter.getValue()}">
|
||||||
</th:block>
|
</th:block>
|
||||||
|
|
||||||
<div class="input-group pe-2">
|
<div class="input-group pe-2">
|
||||||
@ -103,11 +109,20 @@
|
|||||||
<ul class="categorical-select">
|
<ul class="categorical-select">
|
||||||
<li th:each="categoricalValue : ${field.getConnectedSchema().findAll()}">
|
<li th:each="categoricalValue : ${field.getConnectedSchema().findAll()}">
|
||||||
<form action="" method="GET">
|
<form action="" method="GET">
|
||||||
<!--/*--> Propagate queryParams containing other filters with hidden fields <!--*/-->
|
<!--/*--> Propagate query filters with hidden fields <!--*/-->
|
||||||
<th:block th:each="p : ${queryParams.keySet()}">
|
<th:block th:each="filter : ${activeFilters}">
|
||||||
<input th:each="v : ${queryParams.get(p)}"
|
<!--/*--> This field is categorical so we don't propagate it, to make it mutually exclusive <!--*/-->
|
||||||
th:name="${p}" th:value="${v}" type="hidden"
|
<th:block th:unless="${field.getJavaName() == filter.getField().getJavaName()}">
|
||||||
th:if="${p.startsWith('filter_')}">
|
<input type="hidden"
|
||||||
|
name="filter_field"
|
||||||
|
th:value="${filter.getField().getJavaName()}">
|
||||||
|
<input type="hidden"
|
||||||
|
name="filter_op"
|
||||||
|
th:value="${filter.getOp()}">
|
||||||
|
<input type="hidden"
|
||||||
|
name="filter_value"
|
||||||
|
th:value="${filter.getValue()}">
|
||||||
|
</th:block>
|
||||||
</th:block>
|
</th:block>
|
||||||
|
|
||||||
<!-- Reset page when applying filter to start back at page 1 -->
|
<!-- Reset page when applying filter to start back at page 1 -->
|
||||||
@ -130,11 +145,20 @@
|
|||||||
<ul class="categorical-select">
|
<ul class="categorical-select">
|
||||||
<li th:each="categoricalValue : ${field.getAllValues()}">
|
<li th:each="categoricalValue : ${field.getAllValues()}">
|
||||||
<form action="" method="GET">
|
<form action="" method="GET">
|
||||||
<!--/*--> Propagate queryParams containing other filters with hidden fields <!--*/-->
|
<!--/*--> Propagate query filters with hidden fields <!--*/-->
|
||||||
<th:block th:each="p : ${queryParams.keySet()}">
|
<th:block th:each="filter : ${activeFilters}">
|
||||||
<input th:each="v : ${queryParams.get(p)}"
|
<!--/*--> This field is categorical so we don't propagate it, to make it mutually exclusive <!--*/-->
|
||||||
th:name="${p}" th:value="${v}" type="hidden"
|
<th:block th:unless="${field.getJavaName() == filter.getField().getJavaName()}">
|
||||||
th:if="${p.startsWith('filter_')}">
|
<input type="hidden"
|
||||||
|
name="filter_field"
|
||||||
|
th:value="${filter.getField().getJavaName()}">
|
||||||
|
<input type="hidden"
|
||||||
|
name="filter_op"
|
||||||
|
th:value="${filter.getOp()}">
|
||||||
|
<input type="hidden"
|
||||||
|
name="filter_value"
|
||||||
|
th:value="${filter.getValue()}">
|
||||||
|
</th:block>
|
||||||
</th:block>
|
</th:block>
|
||||||
|
|
||||||
<!-- Reset page when applying filter to start back at page 1 -->
|
<!-- Reset page when applying filter to start back at page 1 -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user