Refactor assignee(s) API calls (#199)

Merge branch 'master' into refactor_issues_call

Remove credits, add donators (#268)

Merge branch 'master' into 264-remove-credits

Merge pull request 'Support for c header files' (#266) from 265-files-support-in-file-viewer into master

Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/266

Remove credits, add donators

support for c header files

Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/268

Merge pull request 'Support for c header files' (#266) from 265-files-support-in-file-viewer into master

Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/266

support for c header files

fix

Merge branch 'master' into refactor_issues_call

Support pdf files in file viewer (#259)

auto convert EOL

this fix it for me

fix layout

implement support for pdf files in file viewer

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/259
Reviewed-by: 6543 <6543@noreply.gitea.io>

Make DueDate optional on MilestoneCreaton (#252)

Merge branch 'master' into milestone-DueDate-optional_240

add check again if gitea is older than 1.10.0 ...

Crowdin [2020-01-04] + add Latvian (#253)

update Translators

add Latvian

update Crowdin

Co-authored-by: 6543 <6543@obermui.de>

make DueDate optional on MilestoneCreaton

Co-authored-by: 6543 <6543@obermui.de>

Crowdin [2020-01-04] + add Latvian (#253)

update Translators

add Latvian

update Crowdin

Co-authored-by: 6543 <6543@obermui.de>

Merge branch '51-custom-fonts' of gitnex/GitNex into master

Reviewed-by: 6543 <6543@noreply.gitea.io>

Implement across the whole app

Implementation of custom fonts app wide

Merge branch 'crowdin_2019-12-25' of gitnex/GitNex into master

add user to the “new issue” assignees dialog

refactor.start()

update from crowdin

Merge branch 'backport-243' of gitnex/GitNex into master

backport url slashes fix

Merge branch 'fix-238' of gitnex/GitNex into master

fix

Merge branch 'backport-235' of gitnex/GitNex into master

backport fix #235

Merge branch 'backport-232' of gitnex/GitNex into master

show all issues and prs

Merge branch '206-repos-in-explore-screen' of gitnex/GitNex into master

Load default list of explore repositories

Merge branch '225-backport' of gitnex/GitNex into master

copy and support files backport - #225

Merge branch '226-backport' of gitnex/GitNex into master

fix alignments backport

Co-authored-by: M M Arif <mmarif@swatian.com>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/199
This commit is contained in:
6543 2020-02-24 18:50:51 +00:00 committed by M M Arif
parent 5720c5f613
commit 3f4db112b1
6 changed files with 12 additions and 55 deletions

View File

@ -18,7 +18,7 @@ import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.models.Collaborators;
import org.mian.gitnex.models.Issues;
import org.mian.gitnex.models.MultiSelectModel;
import org.mian.gitnex.models.UpdateIssueAssignee;
import org.mian.gitnex.models.UpdateIssueAssignees;
import org.mian.gitnex.util.TinyDB;
import java.util.ArrayList;
import java.util.List;
@ -234,14 +234,14 @@ public class AddRemoveAssigneesActivity extends AppCompatActivity {
private void updateIssueAssignees(final String instanceUrl, final String instanceToken, String repoOwner, String repoName, String loginUid, int issueIndex, List<String> issueAssigneesList) {
UpdateIssueAssignee updateAssigneeJson = new UpdateIssueAssignee(issueAssigneesList);
UpdateIssueAssignees updateAssigneeJson = new UpdateIssueAssignees(issueAssigneesList);
Call<JsonElement> call3;
call3 = RetrofitClient
.getInstance(instanceUrl, getApplicationContext())
.getApiInterface()
.patchIssueAssignee(Authorization.returnAuthentication(getApplicationContext(), loginUid, instanceToken), repoOwner, repoName, issueIndex, updateAssigneeJson);
.patchIssueAssignees(Authorization.returnAuthentication(getApplicationContext(), loginUid, instanceToken), repoOwner, repoName, issueIndex, updateAssigneeJson);
call3.enqueue(new Callback<JsonElement>() {

View File

@ -78,6 +78,7 @@ public class CreateIssueActivity extends AppCompatActivity implements View.OnCli
TinyDB tinyDb = new TinyDB(getApplicationContext());
final String instanceUrl = tinyDb.getString("instanceUrl");
final String loginUid = tinyDb.getString("loginUid");
final String loginFullName = tinyDb.getString("userFullname");
String repoFullName = tinyDb.getString("repoFullName");
String[] parts = repoFullName.split("/");
final String repoOwner = parts[0];
@ -110,7 +111,7 @@ public class CreateIssueActivity extends AppCompatActivity implements View.OnCli
getMilestones(instanceUrl, instanceToken, repoOwner, repoName, loginUid);
getLabels(instanceUrl, instanceToken, repoOwner, repoName, loginUid);
getCollaborators(instanceUrl, instanceToken, repoOwner, repoName, loginUid);
getCollaborators(instanceUrl, instanceToken, repoOwner, repoName, loginUid, loginFullName);
disableProcessButton();
@ -377,13 +378,15 @@ public class CreateIssueActivity extends AppCompatActivity implements View.OnCli
}
private void getCollaborators(String instanceUrl, String instanceToken, String repoOwner, String repoName, String loginUid) {
private void getCollaborators(String instanceUrl, String instanceToken, String repoOwner, String repoName, String loginUid, String loginFullName) {
Call<List<Collaborators>> call = RetrofitClient
.getInstance(instanceUrl, getApplicationContext())
.getApiInterface()
.getCollaborators(Authorization.returnAuthentication(getApplicationContext(), loginUid, instanceToken), repoOwner, repoName);
listOfAssignees.add(new MultiSelectModel(-1, loginFullName));
call.enqueue(new Callback<List<Collaborators>>() {
@Override

View File

@ -8,7 +8,7 @@ import org.mian.gitnex.models.Files;
import org.mian.gitnex.models.MergePullRequest;
import org.mian.gitnex.models.NewFile;
import org.mian.gitnex.models.PullRequests;
import org.mian.gitnex.models.UpdateIssueAssignee;
import org.mian.gitnex.models.UpdateIssueAssignees;
import org.mian.gitnex.models.UpdateIssueState;
import org.mian.gitnex.models.Collaborators;
import org.mian.gitnex.models.CreateIssue;
@ -207,7 +207,7 @@ public interface ApiInterface {
Call<Releases> createNewRelease(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Body Releases jsonStr);
@PATCH("repos/{owner}/{repo}/issues/{issueIndex}") // patch issue assignees
Call<JsonElement> patchIssueAssignee(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("issueIndex") int issueIndex, @Body UpdateIssueAssignee jsonStr);
Call<JsonElement> patchIssueAssignees(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("issueIndex") int issueIndex, @Body UpdateIssueAssignees jsonStr);
@GET("admin/users") // get all users
Call<List<UserInfo>> adminGetUsers(@Header("Authorization") String token);

View File

@ -8,7 +8,6 @@ import java.util.List;
public class CreateIssue {
private String assignee;
private String body;
private boolean closed;
private String due_date;
@ -19,7 +18,6 @@ public class CreateIssue {
private int[] labels;
public CreateIssue(String assignee, String body, boolean closed, String due_date, int milestone, String title, List<String> assignees, int[] labels) {
this.assignee = assignee;
this.body = body;
this.closed = closed;
this.due_date = due_date;

View File

@ -25,7 +25,6 @@ public class Issues {
private List<labelsObject> labels;
private pullRequestObject pull_request;
private milestoneObject milestone;
private assigneeObject assignee;
private List<assigneesObject> assignees;
public Issues(String body) {
@ -154,45 +153,6 @@ public class Issues {
}
}
public class assigneeObject {
private int id;
private String login;
private String full_name;
private String email;
private String avatar_url;
private String language;
private String username;
public int getId() {
return id;
}
public String getLogin() {
return login;
}
public String getFull_name() {
return full_name;
}
public String getEmail() {
return email;
}
public String getAvatar_url() {
return avatar_url;
}
public String getLanguage() {
return language;
}
public String getUsername() {
return username;
}
}
public class assigneesObject {
private int id;
@ -292,10 +252,6 @@ public class Issues {
return milestone;
}
public assigneeObject getAssignee() {
return assignee;
}
public List<assigneesObject> getAssignees() {
return assignees;
}

View File

@ -6,11 +6,11 @@ import java.util.List;
* Author M M Arif
*/
public class UpdateIssueAssignee {
public class UpdateIssueAssignees {
private List<String> assignees;
public UpdateIssueAssignee(List<String> assignees) {
public UpdateIssueAssignees(List<String> assignees) {
this.assignees = assignees;
}