Skip to content

Commit

Permalink
MID-7473 displaying empty delta fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Feb 1, 2022
1 parent d075da2 commit abec137
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

import org.apache.commons.collections4.CollectionUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
Expand Down Expand Up @@ -668,6 +670,10 @@ private SceneItemImpl createSceneItem(PrismReference reference, boolean descript
private SceneDeltaItemImpl createSceneDeltaItem(PropertyDelta<?> delta, SceneImpl owningScene, VisualizationContext context, Task task,
OperationResult result) throws SchemaException {
SceneDeltaItemImpl si = createSceneDeltaItemCommon(delta, owningScene);
if (delta.isDelete() && CollectionUtils.isEmpty(delta.getEstimatedOldValues()) &&
CollectionUtils.isNotEmpty(delta.getValuesToDelete())) {
delta.setEstimatedOldValues((Collection) delta.getValuesToDelete());
}
si.setOldValues(toSceneItemValues(delta.getEstimatedOldValues()));

PrismProperty property = prismContext.itemFactory().createProperty(delta.getElementName());
Expand Down Expand Up @@ -773,6 +779,10 @@ private SceneDeltaItemImpl createSceneDeltaItem(ReferenceDelta delta, SceneImpl
OperationResult result)
throws SchemaException {
SceneDeltaItemImpl di = createSceneDeltaItemCommon(delta, owningScene);
if (delta.isDelete() && CollectionUtils.isEmpty(delta.getEstimatedOldValues()) &&
CollectionUtils.isNotEmpty(delta.getValuesToDelete())) {
delta.setEstimatedOldValues((Collection) delta.getValuesToDelete());
}
di.setOldValues(toSceneItemValuesRef(delta.getEstimatedOldValues(), context, task, result));

PrismReference reference = prismContext.itemFactory().createReference(delta.getElementName());
Expand Down

0 comments on commit abec137

Please sign in to comment.