From 03c78cd52fd0d4812e38dd92375e022b516ef220 Mon Sep 17 00:00:00 2001 From: Kenji Tanaka Date: Mon, 19 Feb 2024 07:59:39 -0500 Subject: [PATCH 1/5] :wrench: chore(OICRs): Increase the number of references to 20 --- .../src/main/webapp/WEB-INF/crp/views/projects/projectStudy.ftl | 2 +- marlo-web/src/main/webapp/WEB-INF/crp/views/studies/study.ftl | 2 +- marlo-web/src/main/webapp/crp/js/projects/projectStudy.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/marlo-web/src/main/webapp/WEB-INF/crp/views/projects/projectStudy.ftl b/marlo-web/src/main/webapp/WEB-INF/crp/views/projects/projectStudy.ftl index f43bad3035..abb8b0f8ce 100644 --- a/marlo-web/src/main/webapp/WEB-INF/crp/views/projects/projectStudy.ftl +++ b/marlo-web/src/main/webapp/WEB-INF/crp/views/projects/projectStudy.ftl @@ -3,7 +3,7 @@ [#assign currentSectionString = "project-${actionName?replace('/','-')}-${expectedID}-phase-${(actualPhase.id)!}" /] [#assign pageLibs = [ "select2", "blueimp-file-upload", "flag-icon-css", "components-font-awesome"] /] [#assign customJS = [ - "${baseUrlMedia}/js/projects/projectStudy.js?20230418", + "${baseUrlMedia}/js/projects/projectStudy.js?20240219", "${baseUrlCdn}/global/js/fieldsValidation.js", "${baseUrlCdn}/crp/js/feedback/feedbackAutoImplementation.js?20231017" ] diff --git a/marlo-web/src/main/webapp/WEB-INF/crp/views/studies/study.ftl b/marlo-web/src/main/webapp/WEB-INF/crp/views/studies/study.ftl index 52d64f75dc..04cc267db5 100644 --- a/marlo-web/src/main/webapp/WEB-INF/crp/views/studies/study.ftl +++ b/marlo-web/src/main/webapp/WEB-INF/crp/views/studies/study.ftl @@ -3,7 +3,7 @@ [#assign currentSectionString = "${actionName?replace('/','-')}-${(expectedStudy.id)!}-phase-${(actualPhase.id)!}" /] [#assign pageLibs = ["select2" ,"blueimp-file-upload", "flag-icon-css" ] /] [#assign customJS = [ - "${baseUrlMedia}/js/projects/projectStudy.js?20230413", + "${baseUrlMedia}/js/projects/projectStudy.js?20240219", "${baseUrlCdn}/global/js/fieldsValidation.js" ] /] [#assign customCSS = [ diff --git a/marlo-web/src/main/webapp/crp/js/projects/projectStudy.js b/marlo-web/src/main/webapp/crp/js/projects/projectStudy.js index c2aaf6e44a..7c15a29466 100644 --- a/marlo-web/src/main/webapp/crp/js/projects/projectStudy.js +++ b/marlo-web/src/main/webapp/crp/js/projects/projectStudy.js @@ -246,7 +246,7 @@ function attachEvents() { var $element = $('#multiInput-references-template').clone(true).removeAttr("id"); var $listLength = $list.children().length; - if ($listLength <= 10) { + if ($listLength <= 20) { // Remove template tag $element.find('input, textarea').each(function (i, e) { e.name = (e.name).replace("_TEMPLATE_", ""); From 6cb8d192b7411f95ca307e7a81d499bc2ac1f49c Mon Sep 17 00:00:00 2001 From: Kenji Tanaka Date: Mon, 19 Feb 2024 11:48:36 -0500 Subject: [PATCH 2/5] :bug: fix(OICRs): Eliminate duplicated info in outcomes relationships --- .../src/main/java/org/cgiar/ccafs/marlo/action/BaseAction.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/BaseAction.java b/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/BaseAction.java index 9c2543c9d5..478b02ef0e 100644 --- a/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/BaseAction.java +++ b/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/BaseAction.java @@ -3461,7 +3461,9 @@ public List getexpectedCrpOutcomes(Long id) { .collect(Collectors.toList()); if (filteredCrpOutcomes != null && !filteredCrpOutcomes.isEmpty()) { projectExpectedStudy.setCrpOutcomes(new ArrayList<>(filteredCrpOutcomes)); + if(!expectedStudies.contains(projectExpectedStudy)) { expectedStudies.add(projectExpectedStudy); + } } } } From c5e2157c570a153e0a37e2d48ce6f3a47abd6a6c Mon Sep 17 00:00:00 2001 From: Kenji Tanaka Date: Mon, 19 Feb 2024 14:07:04 -0500 Subject: [PATCH 3/5] :wrench: chore(OICRs): Filter active shared OICRs in contribution to performance indicators --- .../marlo/data/dao/mysql/ExpectedStudyProjectMySQLDAO.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/marlo-data/src/main/java/org/cgiar/ccafs/marlo/data/dao/mysql/ExpectedStudyProjectMySQLDAO.java b/marlo-data/src/main/java/org/cgiar/ccafs/marlo/data/dao/mysql/ExpectedStudyProjectMySQLDAO.java index c56afb5bc7..c42d418a82 100644 --- a/marlo-data/src/main/java/org/cgiar/ccafs/marlo/data/dao/mysql/ExpectedStudyProjectMySQLDAO.java +++ b/marlo-data/src/main/java/org/cgiar/ccafs/marlo/data/dao/mysql/ExpectedStudyProjectMySQLDAO.java @@ -72,8 +72,8 @@ public List findAll() { @Override public List getByProjectAndPhase(long projectId, long phaseId) { - String query = - "select distinct esp from ExpectedStudyProject esp " + "where project.id = :projectId and phase.id = :phaseId"; + String query = "select distinct esp from ExpectedStudyProject esp " + + "where project.id = :projectId and phase.id = :phaseId and is_active = 1"; Query createQuery = this.getSessionFactory().getCurrentSession().createQuery(query); createQuery.setParameter("projectId", projectId); createQuery.setParameter("phaseId", phaseId); From 05cfb205027b8aaa26ceaba944c5a495992cb5b4 Mon Sep 17 00:00:00 2001 From: Kenji Tanaka Date: Tue, 20 Feb 2024 11:49:28 -0500 Subject: [PATCH 4/5] :sparkles: feat(Contribution to performance indicators): Improve the loading speed of indicator relationships through conditionals --- ...blesByDisseminationURLHandleDOIAction.java | 10 ++-- .../crp/macros/relationsPopupMacro.ftl | 59 ++++++++++++++----- 2 files changed, 47 insertions(+), 22 deletions(-) diff --git a/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/json/project/DeliverablesByDisseminationURLHandleDOIAction.java b/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/json/project/DeliverablesByDisseminationURLHandleDOIAction.java index e6a21026e8..2d5aaba8c0 100644 --- a/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/json/project/DeliverablesByDisseminationURLHandleDOIAction.java +++ b/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/json/project/DeliverablesByDisseminationURLHandleDOIAction.java @@ -84,18 +84,16 @@ public String execute() throws Exception { } if (deliverables != null && !deliverables.isEmpty() && phase != null) { - deliverables = deliverables.stream() - .filter(d -> d != null && d.isActive() && d.getId() != null && d.getId() != deliverableID - && d.getDeliverableInfo(phase).isActive()) + deliverables = deliverables.stream().filter(d -> d != null && d.getId() != deliverableID) .sorted(Comparator.comparing(Deliverable::getId)).collect(Collectors.toList()); if (deliverables != null && !deliverables.isEmpty()) { List deliverableDTOs = new ArrayList<>(); for (Deliverable deliverable : deliverables) { - if (deliverable != null && deliverable.getId() != null) { - deliverable = deliverableManager.getDeliverableById(deliverable.getId()); - } + + deliverable = deliverableManager.getDeliverableById(deliverable.getId()); + DeliverableDissemination deliverableDissemination = new DeliverableDissemination(); boolean isDOIDuplicated = false; boolean isDisseminationURLDuplicated = false; diff --git a/marlo-web/src/main/webapp/WEB-INF/crp/macros/relationsPopupMacro.ftl b/marlo-web/src/main/webapp/WEB-INF/crp/macros/relationsPopupMacro.ftl index 7994295d8f..1d97f16959 100644 --- a/marlo-web/src/main/webapp/WEB-INF/crp/macros/relationsPopupMacro.ftl +++ b/marlo-web/src/main/webapp/WEB-INF/crp/macros/relationsPopupMacro.ftl @@ -2,29 +2,48 @@ [#macro relationsMacro element labelText=true tag=""] [#local className = ((element.class.name)?split('.')?last)!''/] [#local composedID = "${className}-${(element.id)!}"] + [#-- [#local deliverablesProject = (action.getDeliverableRelationsProject(element.id, element.class.name,(element.project.id)!-1))! /] [#local deliverablesImpact = (action.getDeliverableRelationsImpact(element.id, element.class.name))! /] [#local deliverablesPartner = (action.getDeliverablesLedByPartner(element.id))! /] - - [#if className == "ProjectPartner"] - [#local deliverables = deliverablesPartner /] - [#elseif ((className == "ProjectOutcome") && (tag == "")) || (className == "ProjectBudget")] - [#local deliverables = deliverablesProject /] + --] + + [#if tag == "shfrm"] + [#-- [#-local shfrmDeliverables = (action.getShfrmActionDeliverablesRelation(element.id))! /] + [#local deliverables = (shfrmDeliverables)![] /] --] [#else] - [#local deliverables = ((deliverablesImpact)!deliverablesPartner)! /] + + [#if className == "ProjectPartner"] + [#local deliverablesPartner = (action.getDeliverablesLedByPartner(element.id))! /] + [#local deliverables = deliverablesPartner /] + [#elseif ((className == "ProjectOutcome") && (tag == "")) || (className == "ProjectBudget")] + [#local deliverablesProject = (action.getDeliverableRelationsProject(element.id, element.class.name,(element.project.id)!-1))! /] + [#local deliverables = deliverablesProject /] + [#else] + [#local deliverablesImpact = (action.getDeliverableRelationsImpact(element.id, element.class.name))! /] + [#local deliverablesPartner = (action.getDeliverablesLedByPartner(element.id))! /] + [#local deliverables = ((deliverablesImpact)!deliverablesPartner)! /] + [/#if] + [/#if] + [#local projects = (action.getProjectRelationsImpact(element.id, element.class.name))! /] [#-- News buttons --] - [#local policies = (action.getPolicyContributingByPartner(element.id))![] /] - [#local innovations = (action.getInnovationContributingByPartner(element.id))![] /] - [#local evidencies = (action.getStudyContributingByPartner(element.id))![] /] + [#if !action.isAiccra()] + [#local policies = (action.getPolicyContributingByPartner(element.id))![] /] + [/#if] [#if tag == "expectedOutcomes"] [#local evidencies = (action.getexpectedCrpOutcomes(element.id))![] /] + [#else] + [#local evidencies = (action.getStudyContributingByPartner(element.id))![] /] [/#if] + [#if tag == "innovationOutcomes"] [#local innovations = (action.getInnovationProjectOutcomes(element.id))![] /] + [#else] + [#local innovations = (action.getInnovationContributingByPartner(element.id))![] /] [/#if] [#-- News buttons --] @@ -137,9 +156,13 @@ [@s.text name="projectsList.projectids" /] [@s.text name="project.deliverableList.deliverableName" /] - [@s.text name="project.deliverableList.subtype" /] - [@s.text name="project.deliverableList.owner" /] - [@s.text name="project.deliverableList.sharedW" /] + + [#if tag != "shfrm"] + [@s.text name="project.deliverableList.subtype" /] + [@s.text name="project.deliverableList.owner" /] + [@s.text name="project.deliverableList.sharedW" /] + [/#if] + [@s.text name="project.deliverableList.status" /] [@s.text name="project.deliverableList.year" /] @@ -160,10 +183,14 @@ [#else] ${(d.deliverableInfo.title)!'Untitled'} [/#if] - - ${(d.deliverableInfo.deliverableType.name?capitalize)!'-'} - ${(d.owner)!'-'} - ${(d.sharedWithProjects)!'-'} + + + [#if tag != "shfrm"] + ${(d.deliverableInfo.deliverableType.name?capitalize)!'-'} + ${(d.owner)!'-'} + ${(d.sharedWithProjects)!'-'} + [/#if] + ${(d.deliverableInfo.getStatusName(action.getActualPhase()))!'None'} [#-- Deliverable Year --] From 59b3af8ff7d3bfc2fd202d517af6123d500fd371 Mon Sep 17 00:00:00 2001 From: Kenji Tanaka Date: Wed, 21 Feb 2024 09:08:14 -0500 Subject: [PATCH 5/5] :wrench: chore(POM): Desactivate crp-minify custom execution in deploy process --- marlo-web/pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/marlo-web/pom.xml b/marlo-web/pom.xml index ddeab2474f..9bfc58161c 100644 --- a/marlo-web/pom.xml +++ b/marlo-web/pom.xml @@ -555,7 +555,7 @@ minify - + + **/*.min.* @@ -578,6 +578,7 @@ minify + -->