Skip to content

Commit fd2fa35

Browse files
authored
Merge pull request #2620 from CCAFS/aiccra-staging
Fix error in IPI 2.3 and activate OICRs in performance indicators.
2 parents 63b1f5f + a796035 commit fd2fa35

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

marlo-data/src/main/java/org/cgiar/ccafs/marlo/config/APConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ public final class APConstants {
790790
public static final int CLARISA_AVALIABLE_INFO_YEAR = 2018;
791791

792792
public static final String IGNORE_NEWER_YEARS = "ignoreNewer";
793+
public static final String DELIVERABLE_CRP_PROGRAM_OUTCOME_DEPRECATED = "DEPRECATED";
793794

794795
public static String getFilterBy() {
795796
return FILTER_BY;

marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/BaseAction.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3982,6 +3982,13 @@ public List<ProjectExpectedStudy> getexpectedCrpOutcomes(Long id) {
39823982
} catch (Exception e) {
39833983
e.printStackTrace();
39843984
}
3985+
3986+
// 10/10/2024 add functionality to avoid no active oicr
3987+
try {
3988+
expectedStudies = expectedStudies.stream().filter(o -> o.isActive()).collect(Collectors.toList());
3989+
} catch (Exception e) {
3990+
LOG.error(" error in function getexpectedCrpOutcomes - unable to extract inactive oicr");
3991+
}
39853992
return expectedStudies;
39863993
}
39873994

marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/projects/DeliverableAction.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,9 +1154,11 @@ public CrpProgramOutcome getTraineesIndicator() {
11541154
if (deliverableTraineesIndicator != null && deliverableTraineesIndicator.getIndicator() != null
11551155
&& !deliverableTraineesIndicator.getIndicator().isEmpty()) {
11561156
String indicator = deliverableTraineesIndicator.getIndicator();
1157-
crpProgramOutcomeIPI =
1158-
programOutcomes.stream().filter(o -> o.getAcronym() != null && o.getAcronym().equals(indicator))
1159-
.collect(Collectors.toList()).get(0);
1157+
crpProgramOutcomeIPI = programOutcomes.stream()
1158+
.filter(o -> o.getAcronym() != null && o.getAcronym().equals(indicator)
1159+
&& (o.getDescription() == null
1160+
|| !o.getDescription().contains(APConstants.DELIVERABLE_CRP_PROGRAM_OUTCOME_DEPRECATED)))
1161+
.collect(Collectors.toList()).get(0);
11601162
}
11611163
}
11621164

marlo-web/src/main/java/org/cgiar/ccafs/marlo/config/APConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,8 @@ public final class APConstants {
865865
public static final int CLARISA_AVALIABLE_INFO_YEAR = 2018;
866866

867867
public static final String IGNORE_NEWER_YEARS = "ignoreNewer";
868+
public static final String DELIVERABLE_CRP_PROGRAM_OUTCOME_DEPRECATED = "DEPRECATED";
869+
868870

869871
public static String getFilterBy() {
870872
return FILTER_BY;

0 commit comments

Comments
 (0)