Skip to content

Commit

Permalink
fix: maker checker condition handling (openMF#1216)
Browse files Browse the repository at this point in the history
Added a test to check if the client created is actually
active or not. The app then shows the message accordingly.
  • Loading branch information
laxyapahuja authored and luckyman20 committed Dec 27, 2019
1 parent 4490f18 commit 326cfd0
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,12 @@ public void showClientCreatedSuccessfully(int message) {
getActivity().getSupportFragmentManager().popBackStack();
}

@Override
public void showWaitingForCheckerApproval(int message) {
Toaster.show(rootView, message);
getActivity().getSupportFragmentManager().popBackStack();
}

@Override
public void showMessage(int message) {
Toaster.show(rootView, message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public interface CreateNewClientMvpView extends MvpView {

void showClientCreatedSuccessfully(int s);

void showWaitingForCheckerApproval(int s);

void showMessage(int message);

void showMessage(String message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,14 @@ public void onError(Throwable e) {
@Override
public void onNext(Client client) {
getMvpView().showProgressbar(false);
getMvpView().showClientCreatedSuccessfully(
R.string.client_created_successfully);
if (client.getClientId() != null) {
getMvpView().showClientCreatedSuccessfully(
R.string.client_created_successfully);
} else {
getMvpView().showWaitingForCheckerApproval(
R.string.waiting_for_checker_approval
);
}
}
}));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@ public void showClientCreatedSuccessfully(Client client) {
}
}

@Override
public void showWaitingForCheckerApproval(int message) {
getActivity().getSupportFragmentManager().popBackStack();
Toaster.show(rootView, message, Toast.LENGTH_SHORT);
}

@Override
public void showProgressbar(boolean b) {
if (b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ public interface DataTableListMvpView extends MvpView {
void showMessage(String message);

void showClientCreatedSuccessfully(Client client);

void showWaitingForCheckerApproval(int message);
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,13 @@ public void onError(Throwable e) {
@Override
public void onNext(Client client) {
getMvpView().showProgressbar(false);
getMvpView().showClientCreatedSuccessfully(client);
if (client.getClientId() != null) {
getMvpView().showClientCreatedSuccessfully(
client);
} else {
getMvpView().showWaitingForCheckerApproval(
R.string.waiting_for_checker_approval);
}
}
}));
}
Expand Down
1 change: 1 addition & 0 deletions mifosng-android/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
<string name="no_search_result_found">No results found for entered query</string>
<string name="no_search_query_entered">No Search Query Entered!</string>
<string name="client_created_successfully">Client Created Successfully</string>
<string name="waiting_for_checker_approval">Waiting for Checker\'s Approval</string>
<string name="no_staff_associated_with_office">No Staff associated with this Office</string>
<string name="adding_client_address">Adding Client Address</string>
<string name="updating_client_address">Updating Client Address</string>
Expand Down

0 comments on commit 326cfd0

Please sign in to comment.