Skip to content

Commit

Permalink
Revert "logging for autoselect bug"
Browse files Browse the repository at this point in the history
This reverts commit a6cd6ad.
  • Loading branch information
Jtang-1 committed Nov 14, 2024
1 parent a6cd6ad commit 6f604f1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
6 changes: 0 additions & 6 deletions src/cli/java/org/commcare/util/screen/EntityScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ public EntityScreen(boolean handleCaseIndex, boolean needsFullInit, SessionWrapp
public void evaluateAutoLaunch(String nextInput) throws CommCareSessionException {
EvaluationContext subContext = getAutoLaunchEvaluationContext(nextInput);
for (Action action : mShortDetail.getCustomActions(evalContext)) {
System.out.println("in evaluateAutoLaunch, action: " + action);
if (action.isAutoLaunchAction(subContext)) {
// Supply an empty case list so we can "select" from it later using getEntityFromID
mCurrentScreen = new EntityListSubscreen(mShortDetail, new Vector<>(), evalContext,
Expand Down Expand Up @@ -236,13 +235,10 @@ protected void setSession(SessionWrapper session) throws CommCareSessionExceptio
}

evalContext = mSession.getEvaluationContext();
System.out.println("in setSession, evalContext: " + evalContext);
}

@Trace
private Vector<TreeReference> expandEntityReferenceSet(EvaluationContext context) {
System.out.println("in expandEntityReferenceSet, mNeededDatum: " + mNeededDatum);
System.out.println("in expandEntityReferenceSet, mNeededDatum.getNodeset(): " + mNeededDatum.getNodeset());
return evalContext.expandReference(mNeededDatum.getNodeset());
}

Expand Down Expand Up @@ -510,8 +506,6 @@ public boolean evalAndExecuteAutoLaunchAction(String nextInput, CommCareSession
throws CommCareSessionException {
evaluateAutoLaunch(nextInput);
if (getAutoLaunchAction() != null) {
// JT NOTE for some reason, when autoselect for entry datum is true, this evaluates to false
// when autoselect for entry datum is false, it evaluates to true
setPendingAction(getAutoLaunchAction());
executePendingAction(session);
return true;
Expand Down
11 changes: 0 additions & 11 deletions src/cli/java/org/commcare/util/screen/MultiSelectEntityScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import java.util.Arrays;

/**
* Variation of EntityScreen to allow for selection of multiple entities at once
*/
Expand Down Expand Up @@ -72,28 +70,21 @@ public void updateSelection(String input, TreeReference[] selectedRefs)

@Override
protected boolean shouldAutoSelect() {
// System.out.println("in show autoselect");
// System.out.println("mneededdatum " + mNeededDatum);
return mNeededDatum.isAutoSelectEnabled() && references.size() != 0;
}

@Override
public boolean autoSelectEntities(SessionWrapper session) {
System.out.println("Starting autoSelectEntities with " + references.size() + " references");
int selectionSize = references.size();
if (validateSelectionSize(selectionSize)) {
System.out.println("Selection size " + selectionSize + " validated successfully");
String[] evaluatedValues = new String[selectionSize];
for (int i = 0; i < selectionSize; i++) {
evaluatedValues[i] = getReturnValueFromSelection(references.elementAt(i));
System.out.println("Evaluated value " + (i + 1) + ": " + evaluatedValues[i]);
}
processSelectionIntoInstance(evaluatedValues, getNeededDatumId());
System.out.println("Processed selection into instance with datum ID: " + getNeededDatumId());
updateSession(session);
return true;
}
System.out.println("Auto-selection failed validation check");
return false;
}

Expand Down Expand Up @@ -178,8 +169,6 @@ private void processSelectedValues(String[] selectedValues)
TreeReference currentReference = getAndValidateEntityReference(selectedValues[i]);
evaluatedValues[i] = getReturnValueFromSelection(currentReference);
}
System.out.println("in processSelectedValues, evaluatedValues: " + Arrays.toString(evaluatedValues));
System.out.println("in processSelectedValues, getNeededDatumId(): " + getNeededDatumId());
processSelectionIntoInstance(evaluatedValues, getNeededDatumId());
}
}
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/org/commcare/suite/model/EntityDatum.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,4 @@ public TreeReference getEntityFromID(EvaluationContext ec, String elementId) {
return null;
}
}

@Override
public String toString() {
return "EntityDatum{" +
"nodeset=" + nodeset +
", shortDetail='" + shortDetail + '\'' +
", autoSelectEnabled=" + autoSelectEnabled +
'}';
}
}

0 comments on commit 6f604f1

Please sign in to comment.