From cefa82c262a5bf445aeaf57d798011ae0599a11a Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Wed, 18 Dec 2024 21:26:54 +0200 Subject: [PATCH 1/2] mark generated by script as false when creating new domain --- .../orcid/persistence/dao/impl/ProfileEmailDomainDaoImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/dao/impl/ProfileEmailDomainDaoImpl.java b/orcid-persistence/src/main/java/org/orcid/persistence/dao/impl/ProfileEmailDomainDaoImpl.java index 9a8bffd0b4e..c4482afb5bd 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/dao/impl/ProfileEmailDomainDaoImpl.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/dao/impl/ProfileEmailDomainDaoImpl.java @@ -28,6 +28,7 @@ public ProfileEmailDomainEntity addEmailDomain(String orcid, String emailDomain, e.setEmailDomain(emailDomain); e.setOrcid(orcid); e.setVisibility(visibility); + e.setGeneratedByScript(false); entityManager.persist(e); return e; } From 298497b27054b0a38f611aa6e00ad8d914453669 Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Wed, 18 Dec 2024 22:26:54 +0200 Subject: [PATCH 2/2] add todo to remove conditional statement --- .../core/common/manager/impl/SummaryManagerImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java index 7e2bad43662..226c3f8d6be 100644 --- a/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java @@ -524,9 +524,13 @@ public void generateEmailDomainsSummary(RecordSummary recordSummary, String orci for (ProfileEmailDomainEntity ped : emailDomains) { ed = new EmailDomain(); ed.setValue(ped.getEmailDomain()); - if (!ped.getGeneratedByScript() && ped.getDateCreated() != null) { - VerificationDate verificationDate = new VerificationDate(DateUtils.convertToXMLGregorianCalendar(ped.getDateCreated())); - ed.setVerificationDate(verificationDate); + if (!ped.getGeneratedByScript()) { + //TODO: There is a bug where the date_created is null for some records, so, we need to add this one meanwhile we fix this card https://trello.com/c/qh1uioKO/9557-qa-verified-date-not-displayed-for-new-email-domains + //Remove this if statement once that card get to PROD + if(ped.getDateCreated() != null) { + VerificationDate verificationDate = new VerificationDate(DateUtils.convertToXMLGregorianCalendar(ped.getDateCreated())); + ed.setVerificationDate(verificationDate); + } } edList.add(ed); }