Search in sources :

Example 1 with ReviewRequestModel

use of com.fastaccess.data.dao.ReviewRequestModel in project FastHub by k0shk0sh.

the class PullRequestPagerActivity method addPrReview.

private void addPrReview(@NonNull View view) {
    PullRequest pullRequest = getPresenter().getPullRequest();
    if (pullRequest == null)
        return;
    User author = pullRequest.getUser() != null ? pullRequest.getUser() : pullRequest.getHead() != null && pullRequest.getHead().getAuthor() != null ? pullRequest.getHead().getAuthor() : pullRequest.getUser();
    if (author == null)
        return;
    ReviewRequestModel requestModel = new ReviewRequestModel();
    requestModel.setComments(getPresenter().getCommitComment().isEmpty() ? null : getPresenter().getCommitComment());
    requestModel.setCommitId(pullRequest.getHead().getSha());
    boolean isAuthor = Login.getUser().getLogin().equalsIgnoreCase(author.getLogin());
    ReviewChangesActivity.Companion.startForResult(requestModel, getPresenter().getRepoId(), getPresenter().getLogin(), pullRequest.getNumber(), isAuthor, isEnterprise(), pullRequest.isMerged() || pullRequest.getState() == IssueState.closed).show(getSupportFragmentManager(), ReviewChangesActivity.class.getSimpleName());
}
Also used : User(com.fastaccess.data.dao.model.User) ReviewChangesActivity(com.fastaccess.ui.modules.reviews.changes.ReviewChangesActivity) PullRequest(com.fastaccess.data.dao.model.PullRequest) ReviewRequestModel(com.fastaccess.data.dao.ReviewRequestModel)

Aggregations

ReviewRequestModel (com.fastaccess.data.dao.ReviewRequestModel)1 PullRequest (com.fastaccess.data.dao.model.PullRequest)1 User (com.fastaccess.data.dao.model.User)1 ReviewChangesActivity (com.fastaccess.ui.modules.reviews.changes.ReviewChangesActivity)1