Skip to content

Commit

Permalink
Merge pull request #5385 from grzesiek2010/COLLECT-5383
Browse files Browse the repository at this point in the history
Include submissions that failed in View Sent Form
  • Loading branch information
seadowg committed Dec 19, 2022
2 parents 47b1982 + 57c7590 commit 426cbd2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class AutoSendTest {
testDependencies.scheduler.runDeferredTasks()

mainMenuPage
.clickViewSentForm(0)
.assertTextDoesNotExist("One Question")
.clickViewSentForm(1)
.assertText("One Question")

notificationDrawerRule
.open()
Expand Down Expand Up @@ -129,8 +129,8 @@ class AutoSendTest {
testDependencies.scheduler.runDeferredTasks()

mainMenuPage
.clickViewSentForm(0)
.assertTextDoesNotExist("One Question Autosend")
.clickViewSentForm(1)
.assertText("One Question Autosend")

notificationDrawerRule
.open()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,21 @@ public CursorLoaderFactory(CurrentProjectProvider currentProjectProvider) {
this.currentProjectProvider = currentProjectProvider;
}

public CursorLoader createSentInstancesCursorLoader(String sortOrder) {
String selection = DatabaseInstanceColumns.STATUS + " =? ";
String[] selectionArgs = {Instance.STATUS_SUBMITTED};

return getInstancesCursorLoader(selection, selectionArgs, sortOrder);
}

public CursorLoader createSentInstancesCursorLoader(CharSequence charSequence, String sortOrder) {
CursorLoader cursorLoader;
if (charSequence.length() == 0) {
cursorLoader = createSentInstancesCursorLoader(sortOrder);
String selection = DatabaseInstanceColumns.STATUS + "=? or " + DatabaseInstanceColumns.STATUS + "=?";
String[] selectionArgs = {Instance.STATUS_SUBMITTED, Instance.STATUS_SUBMISSION_FAILED};

cursorLoader = getInstancesCursorLoader(selection, selectionArgs, sortOrder);
} else {
String selection =
DatabaseInstanceColumns.STATUS + " =? and "
"(" + DatabaseInstanceColumns.STATUS + "=? or "
+ DatabaseInstanceColumns.STATUS + "=?) and "
+ DatabaseInstanceColumns.DISPLAY_NAME + " LIKE ?";
String[] selectionArgs = {
Instance.STATUS_SUBMITTED,
Instance.STATUS_SUBMISSION_FAILED,
"%" + charSequence + "%"};

cursorLoader = getInstancesCursorLoader(selection, selectionArgs, sortOrder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class InstancesAppState(
Instance.STATUS_COMPLETE,
Instance.STATUS_SUBMISSION_FAILED
)
val sentInstances = instancesRepository.getCountByStatus(Instance.STATUS_SUBMITTED)
val sentInstances = instancesRepository.getCountByStatus(Instance.STATUS_SUBMITTED, Instance.STATUS_SUBMISSION_FAILED)
val editableInstances = instancesRepository.getCountByStatus(
Instance.STATUS_INCOMPLETE,
Instance.STATUS_COMPLETE
Expand Down

0 comments on commit 426cbd2

Please sign in to comment.