Commit b4bf90c9 by Kunj Gupta

UOFLMA-94: Fix - In Variables form, do not display active=false items.

parent 48819ab5
...@@ -42,6 +42,10 @@ public class CatalogueVariable { ...@@ -42,6 +42,10 @@ public class CatalogueVariable {
@SerializedName("reference_display_column") @SerializedName("reference_display_column")
@Expose @Expose
private String referenceColumnName; private String referenceColumnName;
@SerializedName("Active")
@Expose
private boolean active;
// @SerializedName("type") // @SerializedName("type")
// @Expose // @Expose
...@@ -161,6 +165,14 @@ public class CatalogueVariable { ...@@ -161,6 +165,14 @@ public class CatalogueVariable {
this.referenceColumnName = referenceColumnName; this.referenceColumnName = referenceColumnName;
} }
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
public List<VariableChoice> getVariableChoiceList() { public List<VariableChoice> getVariableChoiceList() {
return mVariableChoiceList; return mVariableChoiceList;
} }
...@@ -228,6 +240,8 @@ public class CatalogueVariable { ...@@ -228,6 +240,8 @@ public class CatalogueVariable {
", isNoneRequired=" + isNoneRequired + ", isNoneRequired=" + isNoneRequired +
", referenceTable='" + referenceTable + '\'' + ", referenceTable='" + referenceTable + '\'' +
", order=" + order + ", order=" + order +
", referenceColumnName='" + referenceColumnName + '\'' +
", active=" + active +
", type=" + type + ", type=" + type +
", mVariableChoiceList=" + mVariableChoiceList + ", mVariableChoiceList=" + mVariableChoiceList +
'}'; '}';
......
...@@ -228,6 +228,8 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -228,6 +228,8 @@ public class CatalogueVariableScreen extends AppCompatActivity {
if(!mCatalogueVariableList.isEmpty()) { if(!mCatalogueVariableList.isEmpty()) {
for (int i = 0; i < mCatalogueVariableList.size(); i++) { for (int i = 0; i < mCatalogueVariableList.size(); i++) {
CatalogueVariable catalogueVariable = mCatalogueVariableList.get(i); CatalogueVariable catalogueVariable = mCatalogueVariableList.get(i);
/*If API return active false for a variable, there is no need show that variable*/
if(catalogueVariable.isActive()) {
ViewType viewType = catalogueVariable.getType(); ViewType viewType = catalogueVariable.getType();
CatalogueLog.e("viewType: " + viewType + ", Question: " + catalogueVariable.getQuestionText() + ", Order: " + catalogueVariable.getOrder()); CatalogueLog.e("viewType: " + viewType + ", Question: " + catalogueVariable.getQuestionText() + ", Order: " + catalogueVariable.getOrder());
if (catalogueVariable.getName() == null) { if (catalogueVariable.getName() == null) {
...@@ -303,6 +305,7 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -303,6 +305,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
} }
} }
} }
}
private View getErrorView() { private View getErrorView() {
TextView textView = new TextView(CatalogueVariableScreen.this); TextView textView = new TextView(CatalogueVariableScreen.this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment