You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2024/05/25 13:46:38 UTC

(causeway-app-petclinic) branch v2 updated (87dfaf7 -> b5eecb6)

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a change to branch v2
in repository https://gitbox.apache.org/repos/asf/causeway-app-petclinic.git


    from 87dfaf7  Resets prompt styles back to their defaults
     new 441ac5e  Injects ClockService into PetOwner
     new bf8c8de  adds PetOwner#getDaysSinceLastVisit derived property
     new b5eecb6  Updates .columnOrder.txt for new property

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../modules/petowner/dom/petowner/PetOwner.columnOrder.txt  |  6 +++++-
 .../domainapp/modules/petowner/dom/petowner/PetOwner.java   | 13 +++++++++++++
 .../homepage/HomePageViewModel#petOwners.columnOrder.txt    |  6 ++++--
 3 files changed, 22 insertions(+), 3 deletions(-)


(causeway-app-petclinic) 02/03: adds PetOwner#getDaysSinceLastVisit derived property

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/causeway-app-petclinic.git

commit bf8c8de5e64104f71147dfb24bbd34dc1b8c9355
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sat May 25 14:45:42 2024 +0100

    adds PetOwner#getDaysSinceLastVisit derived property
---
 .../java/domainapp/modules/petowner/dom/petowner/PetOwner.java    | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java
index 29a659e..166d0f8 100644
--- a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java
+++ b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java
@@ -2,6 +2,7 @@ package domainapp.modules.petowner.dom.petowner;
 
 import java.time.LocalTime;
 import java.time.ZoneOffset;
+import java.time.temporal.ChronoUnit;
 import java.util.Comparator;
 
 import javax.inject.Inject;
@@ -185,6 +186,13 @@ public class PetOwner implements Comparable<PetOwner>, CalendarEventable {
     private java.time.LocalDate lastVisit;
 
 
+    @Property
+    @PropertyLayout(fieldSetId = LayoutConstants.FieldSetId.DETAILS, sequence = "3.1")
+    public long getDaysSinceLastVisit() {
+        return Math.abs(ChronoUnit.DAYS.between(getLastVisit(), clockService.getClock().nowAsLocalDate()));
+    }
+
+
     @Override
     public String getCalendarName() {
         return "Last checked-in";


(causeway-app-petclinic) 03/03: Updates .columnOrder.txt for new property

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/causeway-app-petclinic.git

commit b5eecb688e9a32806f582feb9b35a2ad15e29584
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sat May 25 14:46:02 2024 +0100

    Updates .columnOrder.txt for new property
---
 .../modules/petowner/dom/petowner/PetOwner.columnOrder.txt          | 6 +++++-
 .../services/homepage/HomePageViewModel#petOwners.columnOrder.txt   | 6 ++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.columnOrder.txt b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.columnOrder.txt
index 1963db0..88a6b59 100644
--- a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.columnOrder.txt
+++ b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.columnOrder.txt
@@ -1,5 +1,9 @@
 name
 telephoneNumber
-lastVisit
 emailAddress
+daysSinceLastVisit
+#lastVisit
+#knownAs
+#attachment
+#notes
 #version
diff --git a/webapp/src/main/java/domainapp/webapp/application/services/homepage/HomePageViewModel#petOwners.columnOrder.txt b/webapp/src/main/java/domainapp/webapp/application/services/homepage/HomePageViewModel#petOwners.columnOrder.txt
index e667b81..88a6b59 100644
--- a/webapp/src/main/java/domainapp/webapp/application/services/homepage/HomePageViewModel#petOwners.columnOrder.txt
+++ b/webapp/src/main/java/domainapp/webapp/application/services/homepage/HomePageViewModel#petOwners.columnOrder.txt
@@ -1,7 +1,9 @@
 name
 telephoneNumber
 emailAddress
-#attachment
+daysSinceLastVisit
 #lastVisit
 #knownAs
-#version
\ No newline at end of file
+#attachment
+#notes
+#version


(causeway-app-petclinic) 01/03: Injects ClockService into PetOwner

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/causeway-app-petclinic.git

commit 441ac5e04cd4313667d549a04bb56ab038eaedb0
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sat May 25 14:30:44 2024 +0100

    Injects ClockService into PetOwner
---
 .../main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java  | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java
index 5548ddc..29a659e 100644
--- a/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java
+++ b/module-petowner/src/main/java/domainapp/modules/petowner/dom/petowner/PetOwner.java
@@ -25,6 +25,8 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
 import org.apache.causeway.applib.annotation.ObjectSupport;
 
+import org.apache.causeway.applib.services.clock.ClockService;
+
 import org.springframework.lang.Nullable;
 
 import org.apache.causeway.applib.annotation.Action;
@@ -116,6 +118,7 @@ public class PetOwner implements Comparable<PetOwner>, CalendarEventable {
     @Inject @Transient TitleService titleService;
     @Inject @Transient MessageService messageService;
 
+    @Inject @Transient ClockService clockService;
 
     @ObjectSupport
     public String title() {
@@ -153,6 +156,8 @@ public class PetOwner implements Comparable<PetOwner>, CalendarEventable {
     @PropertyLayout(fieldSetId = LayoutConstants.FieldSetId.DETAILS, sequence = "2")
     private String notes;
 
+
+
     @AttributeOverrides({
             @AttributeOverride(name="name",    column=@Column(name="attachment_name")),
             @AttributeOverride(name="mimeType",column=@Column(name="attachment_mimeType")),