From b9654d534076bf1a8697107301e1e9c03ff10c96 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1s=C3=A1ry=20D=C3=A1niel?= Date: Mon, 4 Mar 2024 13:49:11 +0100 Subject: [PATCH] Search improvements --- .../ProjectRepositorySearchImpl.java | 2 +- .../user/lis/ui/view/ProjectsViewModel.java | 10 +- sly-crm-ui/src/main/resources/web/index.zul | 108 +++++++++--------- .../src/main/resources/web/invoices.zul | 80 ++++++------- .../src/main/resources/web/projects.zul | 41 +++---- .../main/resources/web/service-records.zul | 33 +++--- .../src/main/resources/web/settings.zul | 2 +- .../resources/web/widget/entity-selector.zul | 3 +- 8 files changed, 134 insertions(+), 145 deletions(-) diff --git a/sly-crm-db/src/main/java/hu/user/lis/db/repository/ProjectRepositorySearchImpl.java b/sly-crm-db/src/main/java/hu/user/lis/db/repository/ProjectRepositorySearchImpl.java index b1192e2..85221d1 100644 --- a/sly-crm-db/src/main/java/hu/user/lis/db/repository/ProjectRepositorySearchImpl.java +++ b/sly-crm-db/src/main/java/hu/user/lis/db/repository/ProjectRepositorySearchImpl.java @@ -64,7 +64,7 @@ public class ProjectRepositorySearchImpl implements ProjectRepositorySearch { predicates.add(cb.isFalse(root.get("active"))); } if (filter.isActual()) { - predicates.add(cb.isTrue(root.join("projectStatus").get("active"))); + predicates.add(cb.isTrue(root.join("projectStatus").get("actual"))); } if (Objects.nonNull(filter.getPartner())) { predicates.add(cb.equal(root.get("partner"), filter.getPartner())); diff --git a/sly-crm-ui/src/main/java/hu/user/lis/ui/view/ProjectsViewModel.java b/sly-crm-ui/src/main/java/hu/user/lis/ui/view/ProjectsViewModel.java index cf62b00..5d923cf 100644 --- a/sly-crm-ui/src/main/java/hu/user/lis/ui/view/ProjectsViewModel.java +++ b/sly-crm-ui/src/main/java/hu/user/lis/ui/view/ProjectsViewModel.java @@ -16,7 +16,12 @@ import lombok.Getter; import lombok.extern.log4j.Log4j2; import org.zkoss.bind.BindUtils; import org.zkoss.bind.PropertyChangeEvent; -import org.zkoss.bind.annotation.*; +import org.zkoss.bind.annotation.AfterCompose; +import org.zkoss.bind.annotation.Command; +import org.zkoss.bind.annotation.ContextParam; +import org.zkoss.bind.annotation.ContextType; +import org.zkoss.bind.annotation.Destroy; +import org.zkoss.bind.annotation.Init; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; @@ -81,7 +86,7 @@ public class ProjectsViewModel extends FilterActiveViewModel implements @Override @AfterCompose public void onAfterCompose(@ContextParam(ContextType.VIEW) Component view) { - entitySelectorRouter.configureSelector(Partner.class, this, "partnerFilter.partner"); + entitySelectorRouter.configureSelector(Partner.class, this, "activeFilter.partner"); } protected ActiveFilter createFilter() { @@ -134,6 +139,7 @@ public class ProjectsViewModel extends FilterActiveViewModel implements if (event instanceof PropertyChangeEvent) { PropertyChangeEvent propertyEvent = (PropertyChangeEvent) event; // (this.equals(propertyEvent.getBase()) && propertyEvent.getProperty().startsWith("invoiceFilter"))) + log.info("PropertyChangeEvent {} {}", propertyEvent.getBase().getClass().getSimpleName(), propertyEvent.getProperty()); if (getProjectFilter().equals(propertyEvent.getBase())) { log.info("Refresh needed, {} changed", propertyEvent.getProperty()); refresh(); diff --git a/sly-crm-ui/src/main/resources/web/index.zul b/sly-crm-ui/src/main/resources/web/index.zul index 9370c85..26faef6 100644 --- a/sly-crm-ui/src/main/resources/web/index.zul +++ b/sly-crm-ui/src/main/resources/web/index.zul @@ -45,7 +45,7 @@ - + @@ -77,69 +77,63 @@ - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + - + - - - - - - - - - - - - - + + + + + + + + + + + + + + +
diff --git a/sly-crm-ui/src/main/resources/web/invoices.zul b/sly-crm-ui/src/main/resources/web/invoices.zul index 52b8c0e..c57d6c4 100644 --- a/sly-crm-ui/src/main/resources/web/invoices.zul +++ b/sly-crm-ui/src/main/resources/web/invoices.zul @@ -21,56 +21,48 @@ - - - - - - - - - + + + + + - + - - - - - + + + + + - - - - + - - - - - - + + + + - + - - - - - + +
diff --git a/sly-crm-ui/src/main/resources/web/projects.zul b/sly-crm-ui/src/main/resources/web/projects.zul index 36d108b..02b7347 100644 --- a/sly-crm-ui/src/main/resources/web/projects.zul +++ b/sly-crm-ui/src/main/resources/web/projects.zul @@ -20,30 +20,27 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + - - - + + +
diff --git a/sly-crm-ui/src/main/resources/web/service-records.zul b/sly-crm-ui/src/main/resources/web/service-records.zul index 9696835..6b14b61 100644 --- a/sly-crm-ui/src/main/resources/web/service-records.zul +++ b/sly-crm-ui/src/main/resources/web/service-records.zul @@ -17,24 +17,23 @@ - + - - - - - - - - + + + + + + + + + + +
diff --git a/sly-crm-ui/src/main/resources/web/settings.zul b/sly-crm-ui/src/main/resources/web/settings.zul index cd21eda..f0fe429 100644 --- a/sly-crm-ui/src/main/resources/web/settings.zul +++ b/sly-crm-ui/src/main/resources/web/settings.zul @@ -34,7 +34,7 @@ - +