Skip to content
Snippets Groups Projects
Commit 63aec8b0 authored by Jawnnypoo's avatar Jawnnypoo
Browse files

Fix broken load when loading merge requests by their url

parent 43946594
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -102,7 +102,7 @@ public class LoadSomeInfoActivity extends AppCompatActivity {
return;
case LOAD_TYPE_MERGE_REQUEST:
String mergeRequestId = getIntent().getStringExtra(EXTRA_MERGE_REQUEST);
GitLabClient.instance().getMergeRequest(response.getId(), Long.valueOf(mergeRequestId)).enqueue(mMergeRequestCallback);
GitLabClient.instance().getMergeRequestsByIid(response.getId(), mergeRequestId).enqueue(mMergeRequestCallback);
return;
case LOAD_TYPE_BUILD:
long buildId = getIntent().getLongExtra(EXTRA_BUILD_ID, -1);
Loading
Loading
@@ -137,11 +137,15 @@ public class LoadSomeInfoActivity extends AppCompatActivity {
}
};
 
private final EasyCallback<MergeRequest> mMergeRequestCallback = new EasyCallback<MergeRequest>() {
private final EasyCallback<List<MergeRequest>> mMergeRequestCallback = new EasyCallback<List<MergeRequest>>() {
@Override
public void onResponse(@NonNull MergeRequest response) {
NavigationManager.navigateToMergeRequest(LoadSomeInfoActivity.this, mProject, response);
finish();
public void onResponse(@NonNull List<MergeRequest> response) {
if (!response.isEmpty()) {
NavigationManager.navigateToMergeRequest(LoadSomeInfoActivity.this, mProject, response.get(0));
finish();
} else {
onError();
}
}
 
@Override
Loading
Loading
Loading
Loading
@@ -189,7 +189,7 @@ public interface GitLab {
 
@GET(API_VERSION + "/projects/{id}/issues")
Call<List<Milestone>> getMilestonesByIid(@Path("id") long projectId,
@Query("iid") String internalMilestoneId);
@Query("iid") String internalMilestoneId);
 
@GET(API_VERSION + "/projects/{id}/milestones/{milestone_id}/issues")
Call<List<Issue>> getMilestoneIssues(@Path("id") long projectId,
Loading
Loading
@@ -228,6 +228,10 @@ public interface GitLab {
Call<List<MergeRequest>> getMergeRequests(@Url String url,
@Query("state") String state);
 
@GET(API_VERSION + "/projects/{id}/merge_requests")
Call<List<MergeRequest>> getMergeRequestsByIid(@Path("id") long projectId,
@Query("iid") String internalMergeRequestId);
@GET(API_VERSION + "/projects/{id}/merge_request/{merge_request_id}")
Call<MergeRequest> getMergeRequest(@Path("id") long projectId,
@Path("merge_request_id") long mergeRequestId);
Loading
Loading
@@ -272,7 +276,7 @@ public interface GitLab {
 
@GET(API_VERSION + "/projects/{id}/issues")
Call<List<Issue>> getIssuesByIid(@Path("id") long projectId,
@Query("iid") String internalIssueId);
@Query("iid") String internalIssueId);
 
@FormUrlEncoded
@POST(API_VERSION + "/projects/{id}/issues")
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@ import android.net.Uri;
public interface RoutingNavigator {
void onRouteToIssue(String projectNamespace, String projectName, String issueIid);
void onRouteToCommit(String projectNamespace, String projectName, String commitSha);
void onRouteToMergeRequest(String projectNamespace, String projectName, String mergeRequestId);
void onRouteToMergeRequest(String projectNamespace, String projectName, String mergeRequestIid);
void onRouteToProject(String namespace, String projectId);
void onRouteToBuild(String projectNamespace, String projectName, String buildNumber);
void onRouteToMilestone(String projectNamespace, String projectName, String milestoneNumber);
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment