From 063a9d187e82759b4211a25c45817566235473c3 Mon Sep 17 00:00:00 2001 From: brianbrix Date: Wed, 15 Jul 2026 11:47:05 +0300 Subject: [PATCH 1/7] AMP-31133 : Remove risk and logframe --- amp/TEMPLATE/reamp/package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amp/TEMPLATE/reamp/package-lock.json b/amp/TEMPLATE/reamp/package-lock.json index e0c9f36b9ed..28f66216c09 100644 --- a/amp/TEMPLATE/reamp/package-lock.json +++ b/amp/TEMPLATE/reamp/package-lock.json @@ -309,7 +309,7 @@ }, "node_modules/amp-ui": { "version": "2.1.1", - "resolved": "git+ssh://git@github.com/devgateway/amp-ui.git#b033cf93099abd3fd308a1d3080f95ac9ddbb5fd", + "resolved": "git+ssh://git@github.com/devgateway/amp-ui.git#3d9e5e77fc050708375e1b7c83378cff34cb96d9", "dev": true, "license": "MIT", "dependencies": { @@ -9493,7 +9493,7 @@ "dev": true }, "amp-ui": { - "version": "git+ssh://git@github.com/devgateway/amp-ui.git#b033cf93099abd3fd308a1d3080f95ac9ddbb5fd", + "version": "git+ssh://git@github.com/devgateway/amp-ui.git#3d9e5e77fc050708375e1b7c83378cff34cb96d9", "dev": true, "from": "amp-ui@github:devgateway/amp-ui#fix/AMP-31133/Indicator-values-display-fixes", "requires": { From 0426b21e318fc4e07165ce2db1f6fbb92d087fa7 Mon Sep 17 00:00:00 2001 From: brianbrix Date: Wed, 15 Jul 2026 13:17:45 +0300 Subject: [PATCH 2/7] AMP-31133 : Failing activity preview --- .../ampapi/endpoints/activity/PossibleValuesEnumerator.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/PossibleValuesEnumerator.java b/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/PossibleValuesEnumerator.java index 1e2c76cf81f..1219f790f81 100644 --- a/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/PossibleValuesEnumerator.java +++ b/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/PossibleValuesEnumerator.java @@ -244,6 +244,12 @@ private PossibleValuesProvider getPossibleValuesForComplexField(APIField apiFiel discriminatorValue = apiField.getDiscriminatorValue(); } if (StringUtils.isBlank(discriminatorValue)) { + if (clazz.equals(AmpCategoryValue.class)) { + LOGGER.warn("Missing discriminator for category field " + apiField.getFieldName() + + " (" + apiField.getFieldNameInternal() + ")" + + ". Falling back to generic category value enumeration."); + return new GenericPossibleValuesProvider(clazz, () -> possibleValuesDAO.getGenericValues(clazz)); + } throw InterchangeUtils.newServerErrorException("Field without discriminator value. " + apiField); } From a28a650fbda94fd3defadc2a8dd9d4b95c8e0a8d Mon Sep 17 00:00:00 2001 From: brianbrix Date: Wed, 15 Jul 2026 14:31:52 +0300 Subject: [PATCH 3/7] AMP-31133 : Failing activity preview --- .../activity/ActivityInterchangeUtils.java | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java b/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java index 7fe40f11666..8ae1efb0487 100644 --- a/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java +++ b/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java @@ -304,12 +304,78 @@ private static void addExtraFieldsToActivity(Map activityFields, .map(Map.Entry::getValue) .findFirst(); + addNonDisaggregatedIndicatorValues(indicatorsObject, projectId); addActualIndicatorValues(indicatorsObject, projectId); addDisaggregationValues(indicatorsObject, projectId); resolveIndicatorActivityLocations(indicatorsObject); } } + private static void addNonDisaggregatedIndicatorValues(Optional indicatorsObject, Long projectId) { + indicatorsObject.ifPresent(indicators -> { + if (!(indicators instanceof ArrayList)) { + return; + } + List> indicatorsList = (ArrayList>) indicators; + AmpActivityVersion activity; + try { + activity = ActivityUtil.loadActivity(projectId); + } catch (DgException e) { + throw new RuntimeException(e); + } + + for (Map indicator : indicatorsList) { + Long indicatorId = parseLong(indicator.get("indicator")); + if (indicatorId == null) { + continue; + } + Long activityLocationId = parseLong(indicator.get("activity_location")); + AmpActivityLocation activityLocation = getActivityLocation(projectId, activityLocationId); + boolean singleLocationFallback = activityLocationId == null && activityLocation != null; + + AmpIndicator ind = new AmpIndicator(); + ind.setIndicatorId(indicatorId); + + List results = IndicatorUtil.findActivityIndicatorConnections(activity, ind); + AmpIndicatorValue baseValue = null; + AmpIndicatorValue targetValue = null; + AmpIndicatorValue revisedValue = null; + + for (IndicatorActivity result : results) { + if (result == null) { + continue; + } + if (!matchesIndicatorActivityLocation(result.getActivityLocation(), activityLocation, + singleLocationFallback)) { + continue; + } + if (result.getValues() == null) { + continue; + } + + for (AmpIndicatorValue indicatorValue : result.getValues()) { + if (!matchesIndicatorValueActivityLocation(indicatorValue, result, activityLocation, + singleLocationFallback)) { + continue; + } + + if (indicatorValue.getValueType() == AmpIndicatorValue.BASE && baseValue == null) { + baseValue = indicatorValue; + } else if (indicatorValue.getValueType() == AmpIndicatorValue.TARGET && targetValue == null) { + targetValue = indicatorValue; + } else if (indicatorValue.getValueType() == AmpIndicatorValue.REVISED && revisedValue == null) { + revisedValue = indicatorValue; + } + } + } + + indicator.put("base", serializeIndicatorValue(baseValue)); + indicator.put("target", serializeIndicatorValue(targetValue)); + indicator.put("revised", serializeIndicatorValue(revisedValue)); + } + }); + } + /** * Replaces each indicator's {@code activity_location} value (an AmpActivityLocation PK) * with the inner AmpCategoryValueLocations id so the frontend can hydrate it to a location name @@ -548,6 +614,13 @@ private static Map serializeIndicatorActualValue(AmpIndicatorVal return actualValue; } + private static Map serializeIndicatorValue(AmpIndicatorValue indicatorValue) { + if (indicatorValue == null) { + return null; + } + return serializeIndicatorActualValue(indicatorValue); + } + private static void filterPropertyBasedOnUserPermission(Map activity, Long projectId) { final Long donorRole = DbUtil.getAmpRole(Constants.FUNDING_AGENCY).getAmpRoleId(); UserSessionInformation userInformation = SecurityService.getInstance().getUserSessionInformation(); From e01843481a604d1eaac41587fb88b880a84a9392 Mon Sep 17 00:00:00 2001 From: brianbrix Date: Wed, 15 Jul 2026 15:30:57 +0300 Subject: [PATCH 4/7] AMP-31133 : Remove base/target from preview --- amp/TEMPLATE/reamp/package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amp/TEMPLATE/reamp/package-lock.json b/amp/TEMPLATE/reamp/package-lock.json index 28f66216c09..87957058d10 100644 --- a/amp/TEMPLATE/reamp/package-lock.json +++ b/amp/TEMPLATE/reamp/package-lock.json @@ -309,7 +309,7 @@ }, "node_modules/amp-ui": { "version": "2.1.1", - "resolved": "git+ssh://git@github.com/devgateway/amp-ui.git#3d9e5e77fc050708375e1b7c83378cff34cb96d9", + "resolved": "git+ssh://git@github.com/devgateway/amp-ui.git#0c77c783f9f652f22cb02fd99ed0aa34a101132a", "dev": true, "license": "MIT", "dependencies": { @@ -9493,7 +9493,7 @@ "dev": true }, "amp-ui": { - "version": "git+ssh://git@github.com/devgateway/amp-ui.git#3d9e5e77fc050708375e1b7c83378cff34cb96d9", + "version": "git+ssh://git@github.com/devgateway/amp-ui.git#0c77c783f9f652f22cb02fd99ed0aa34a101132a", "dev": true, "from": "amp-ui@github:devgateway/amp-ui#fix/AMP-31133/Indicator-values-display-fixes", "requires": { From 7e330c5c1332991556253e313be762a2ddc2415c Mon Sep 17 00:00:00 2001 From: brianbrix Date: Wed, 15 Jul 2026 15:56:22 +0300 Subject: [PATCH 5/7] AMP-3133 : Revert ME values table --- .../activity/ActivityInterchangeUtils.java | 66 ------------------- 1 file changed, 66 deletions(-) diff --git a/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java b/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java index 8ae1efb0487..1661b7fbf6c 100644 --- a/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java +++ b/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java @@ -304,78 +304,12 @@ private static void addExtraFieldsToActivity(Map activityFields, .map(Map.Entry::getValue) .findFirst(); - addNonDisaggregatedIndicatorValues(indicatorsObject, projectId); addActualIndicatorValues(indicatorsObject, projectId); addDisaggregationValues(indicatorsObject, projectId); resolveIndicatorActivityLocations(indicatorsObject); } } - private static void addNonDisaggregatedIndicatorValues(Optional indicatorsObject, Long projectId) { - indicatorsObject.ifPresent(indicators -> { - if (!(indicators instanceof ArrayList)) { - return; - } - List> indicatorsList = (ArrayList>) indicators; - AmpActivityVersion activity; - try { - activity = ActivityUtil.loadActivity(projectId); - } catch (DgException e) { - throw new RuntimeException(e); - } - - for (Map indicator : indicatorsList) { - Long indicatorId = parseLong(indicator.get("indicator")); - if (indicatorId == null) { - continue; - } - Long activityLocationId = parseLong(indicator.get("activity_location")); - AmpActivityLocation activityLocation = getActivityLocation(projectId, activityLocationId); - boolean singleLocationFallback = activityLocationId == null && activityLocation != null; - - AmpIndicator ind = new AmpIndicator(); - ind.setIndicatorId(indicatorId); - - List results = IndicatorUtil.findActivityIndicatorConnections(activity, ind); - AmpIndicatorValue baseValue = null; - AmpIndicatorValue targetValue = null; - AmpIndicatorValue revisedValue = null; - - for (IndicatorActivity result : results) { - if (result == null) { - continue; - } - if (!matchesIndicatorActivityLocation(result.getActivityLocation(), activityLocation, - singleLocationFallback)) { - continue; - } - if (result.getValues() == null) { - continue; - } - - for (AmpIndicatorValue indicatorValue : result.getValues()) { - if (!matchesIndicatorValueActivityLocation(indicatorValue, result, activityLocation, - singleLocationFallback)) { - continue; - } - - if (indicatorValue.getValueType() == AmpIndicatorValue.BASE && baseValue == null) { - baseValue = indicatorValue; - } else if (indicatorValue.getValueType() == AmpIndicatorValue.TARGET && targetValue == null) { - targetValue = indicatorValue; - } else if (indicatorValue.getValueType() == AmpIndicatorValue.REVISED && revisedValue == null) { - revisedValue = indicatorValue; - } - } - } - - indicator.put("base", serializeIndicatorValue(baseValue)); - indicator.put("target", serializeIndicatorValue(targetValue)); - indicator.put("revised", serializeIndicatorValue(revisedValue)); - } - }); - } - /** * Replaces each indicator's {@code activity_location} value (an AmpActivityLocation PK) * with the inner AmpCategoryValueLocations id so the frontend can hydrate it to a location name From a734fdaf5b251dc946f85889c0eead8d8a028c68 Mon Sep 17 00:00:00 2001 From: brianbrix Date: Wed, 15 Jul 2026 15:57:32 +0300 Subject: [PATCH 6/7] AMP-3133 : Revert ME values table --- .../ampapi/endpoints/activity/ActivityInterchangeUtils.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java b/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java index 1661b7fbf6c..0142e7f89a6 100644 --- a/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java +++ b/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java @@ -548,12 +548,6 @@ private static Map serializeIndicatorActualValue(AmpIndicatorVal return actualValue; } - private static Map serializeIndicatorValue(AmpIndicatorValue indicatorValue) { - if (indicatorValue == null) { - return null; - } - return serializeIndicatorActualValue(indicatorValue); - } private static void filterPropertyBasedOnUserPermission(Map activity, Long projectId) { final Long donorRole = DbUtil.getAmpRole(Constants.FUNDING_AGENCY).getAmpRoleId(); From b0ba67838bd83dfd045688928ebbc72a18b199a8 Mon Sep 17 00:00:00 2001 From: brianbrix Date: Wed, 15 Jul 2026 15:58:01 +0300 Subject: [PATCH 7/7] AMP-3133 : Revert ME values table --- .../ampapi/endpoints/activity/ActivityInterchangeUtils.java | 1 - 1 file changed, 1 deletion(-) diff --git a/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java b/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java index 0142e7f89a6..7fe40f11666 100644 --- a/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java +++ b/amp/src/main/java/org/digijava/kernel/ampapi/endpoints/activity/ActivityInterchangeUtils.java @@ -548,7 +548,6 @@ private static Map serializeIndicatorActualValue(AmpIndicatorVal return actualValue; } - private static void filterPropertyBasedOnUserPermission(Map activity, Long projectId) { final Long donorRole = DbUtil.getAmpRole(Constants.FUNDING_AGENCY).getAmpRoleId(); UserSessionInformation userInformation = SecurityService.getInstance().getUserSessionInformation();