Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jt/visually segmented case search group #1389

Merged
merged 16 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/main/java/org/commcare/suite/model/QueryGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public class QueryGroup implements Externalizable {
private String key;
private DisplayUnit display;

@SuppressWarnings("unused")
public QueryGroup() {
}

public QueryGroup(String key, DisplayUnit display) {
this.key = key;
this.display = display;
Expand Down
13 changes: 12 additions & 1 deletion src/main/java/org/commcare/suite/model/RemoteQueryDatum.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
public class RemoteQueryDatum extends SessionDatum {
private List<QueryData> hiddenQueryValues;
private OrderedHashtable<String, QueryPrompt> userQueryPrompts;
private OrderedHashtable<String, QueryGroup> userQueryGroupHeaders;
private boolean useCaseTemplate;
private boolean defaultSearch;
private boolean dynamicSearch;
Expand All @@ -46,10 +47,12 @@ public RemoteQueryDatum() {
public RemoteQueryDatum(URL url, String storageInstance,
List<QueryData> hiddenQueryValues,
OrderedHashtable<String, QueryPrompt> userQueryPrompts,
boolean useCaseTemplate, boolean defaultSearch, boolean dynamicSearch, Text title, Text description) {
boolean useCaseTemplate, boolean defaultSearch, boolean dynamicSearch, Text title, Text description,
shubham1g5 marked this conversation as resolved.
Show resolved Hide resolved
OrderedHashtable<String, QueryGroup> userQueryGroupHeaders) {
super(storageInstance, url.toString());
this.hiddenQueryValues = hiddenQueryValues;
this.userQueryPrompts = userQueryPrompts;
this.userQueryGroupHeaders = userQueryGroupHeaders;
this.useCaseTemplate = useCaseTemplate;
this.defaultSearch = defaultSearch;
this.dynamicSearch = dynamicSearch;
Expand All @@ -61,6 +64,10 @@ public OrderedHashtable<String, QueryPrompt> getUserQueryPrompts() {
return userQueryPrompts;
}

public OrderedHashtable<String, QueryGroup> getUserQueryGroupHeaders() {
return userQueryGroupHeaders;
}

public List<QueryData> getHiddenQueryValues() {
return hiddenQueryValues;
}
Expand Down Expand Up @@ -104,6 +111,9 @@ public void readExternal(DataInputStream in, PrototypeFactory pf)
userQueryPrompts =
(OrderedHashtable<String, QueryPrompt>)ExtUtil.read(in,
new ExtWrapMap(String.class, QueryPrompt.class, ExtWrapMap.TYPE_ORDERED), pf);
userQueryGroupHeaders =
(OrderedHashtable<String, QueryGroup>)ExtUtil.read(in,
new ExtWrapMap(String.class, QueryGroup.class, ExtWrapMap.TYPE_ORDERED), pf);
title = (Text) ExtUtil.read(in, new ExtWrapNullable(Text.class), pf);
description = (Text) ExtUtil.read(in, new ExtWrapNullable(Text.class), pf);
useCaseTemplate = ExtUtil.readBool(in);
Expand All @@ -116,6 +126,7 @@ public void writeExternal(DataOutputStream out) throws IOException {
super.writeExternal(out);
ExtUtil.write(out, new ExtWrapList(hiddenQueryValues, new ExtWrapTagged()));
ExtUtil.write(out, new ExtWrapMap(userQueryPrompts));
ExtUtil.write(out, new ExtWrapMap(userQueryGroupHeaders));
ExtUtil.write(out, new ExtWrapNullable(title));
ExtUtil.write(out, new ExtWrapNullable(description));
ExtUtil.writeBool(out, useCaseTemplate);
Expand Down