Skip to content

Commit

Permalink
Merge pull request #104 from AndreySBer/pr_comments_fix
Browse files Browse the repository at this point in the history
PR comments fix
  • Loading branch information
phansier authored Feb 25, 2018
2 parents 42f616c + f2044a2 commit d2b391c
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

import android.test.AndroidTestCase;

import com.github.mobile.api.model.Milestone;
import com.github.mobile.core.issue.IssueFilter;

import org.eclipse.egit.github.core.Milestone;
import org.eclipse.egit.github.core.Repository;
import org.eclipse.egit.github.core.User;

Expand Down Expand Up @@ -56,11 +56,11 @@ public void testEqualFilter() {
assertEquals(filter1, filter2);
assertEquals(filter1.hashCode(), filter2.hashCode());

Milestone milestone = new Milestone().setNumber(3);
com.github.mobile.api.model.Milestone extraMilestone = new com.github.mobile.api.model.Milestone(milestone);
filter1.setMilestone(extraMilestone);
Milestone milestone = new Milestone();
milestone.number = 3;
filter1.setMilestone(milestone);
assertFalse(filter1.equals(filter2));
filter2.setMilestone(extraMilestone);
filter2.setMilestone(milestone);
assertEquals(filter1, filter2);
assertEquals(filter1.hashCode(), filter2.hashCode());
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/github/mobile/api/model/Issue.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public org.eclipse.egit.github.core.Issue getOldModel() {
issue.setCreatedAt(created_at);
issue.setClosedAt(closed_at);
issue.setUpdatedAt(updated_at);

if (milestone != null){
issue.setMilestone(milestone.getOldModel());
}
Expand All @@ -92,4 +93,4 @@ public org.eclipse.egit.github.core.Issue getOldModel() {
}
return issue;
}
}
}
5 changes: 0 additions & 5 deletions app/src/main/java/com/github/mobile/api/model/Milestone.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ public Milestone() {
}

public Milestone(org.eclipse.egit.github.core.Milestone milestone) {
//todo this.id=?
//there are two variants of id usage
//1)id is like an id in Issues, but it is in old Issues class too - the remove field
//2)id is like an serialVersionUID - then generate it using "serialver -classpath . Milestone" in terminal
this.number = milestone.getNumber();
this.state = milestone.getState();
this.title = milestone.getTitle();
Expand All @@ -65,7 +61,6 @@ public Milestone(org.eclipse.egit.github.core.Milestone milestone) {
this.closed_issues = milestone.getClosedIssues();
this.created_at = milestone.getCreatedAt();
this.url = milestone.getUrl();
//todo this.updated_at=???
this.due_on = milestone.getDueOn();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@
import retrofit2.http.Query;

public interface MilestoneService {
@Headers("Accept: application/vnd.github.v3+json")
@GET("repos/{owner}/{repo}/milestones/{number}")
Call<Milestone> getMilestone(
@Path("owner") String owner,
@Path("repo") String repo,
@Path("number") long number);

@Headers("Accept: application/vnd.github.v3+json")
@GET("repos/{owner}/{repo}/milestones")
Call<List<Milestone>> getMilestones(
@Path("owner") String owner,
Expand All @@ -50,22 +48,19 @@ Call<List<Issue>> getIssues(
@Path("repo") String repo,
@Query("milestone") long milestone);

@Headers("Accept: application/vnd.github.v3+json")
@POST("repos/{owner}/{repo}/milestones")
Call<Milestone> createMilestone (
@Path("owner") String owner,
@Path("repo") String repo,
@Body Milestone milestone);

@Headers("Accept: application/vnd.github.v3+json")

@PATCH("repos/{owner}/{repo}/milestones/{number}")
Call<Milestone> editMilestone (
@Path("owner") String owner,
@Path("repo") String repo,
@Path("number") long number,
@Body Milestone milestone);

@Headers("Accept: application/vnd.github.v3+json")
@DELETE("repos/{owner}/{repo}/milestones/{number}")
Call<Milestone> deleteMilestone(
@Path("owner") String owner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,12 @@ public void onClick(View v) {
milestoneDialog = new MilestoneDialog(
EditIssuesFilterActivity.this, REQUEST_MILESTONE,
repository, milestones);
milestoneDialog.show(filter.getMilestone().getOldModel());
com.github.mobile.api.model.Milestone milestone = filter.getMilestone();
if (milestone == null) {
milestoneDialog.show(null);
} else {
milestoneDialog.show(milestone.getOldModel());
}
}
};

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/menu/repository.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<item
android:id="@+id/m_milestone"
app:showAsAction="never"
android:title="@string/milestone"/>
android:title="@string/milestones"/>

<item
android:id="@+id/m_parent_repo"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-bg/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
<string name="invalid_login_or_password">Моля, въведете коректно име и парола</string>
<string name="invalid_password">Моля, въведете коректна парола.</string>
<string name="password">Парола</string>
<string name="login_or_email">Име или имейл</string>
<string name="followers">Фенове</string>
<string name="following">Следва</string>
<string name="followers_self">Фенове</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
<string name="invalid_login_or_password">Παρακαλούμε εισάγετε έγκυρο όνομα χρήστη &amp; συνθηματικό</string>
<string name="invalid_password">Παρακαλούμε εισάγετε έγκυρο συνθηματικό.</string>
<string name="password">Συνθηματικό</string>
<string name="login_or_email">Όνομα ή Email</string>
<string name="followers">Ακόλουθοι</string>
<string name="following">Ακολουθούν</string>
<string name="followers_self">Ακόλουθοι</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
<string name="invalid_login_or_password">Por favor introduce un usuario y contraseña válidos</string>
<string name="invalid_password">Por favor introduce una contraseña válida.</string>
<string name="password">Contraseña</string>
<string name="login_or_email">Usuario o Correo Electrónico</string>
<string name="followers">Seguidores</string>
<string name="following">Siguiendo</string>
<string name="followers_self">Seguidores</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
<string name="invalid_login_or_password">Veuillez entrer un login et un mot de passe valides</string>
<string name="invalid_password">Veuillez entrer un mot de passe valide</string>
<string name="password">Mot de passe</string>
<string name="login_or_email">Login ou Email</string>
<string name="followers">Abonnés</string>
<string name="following">Abonnements</string>
<string name="followers_self">Abonnés</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-hu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
<string name="invalid_login_or_password">Adj meg érvényes felhasználónevet &amp; jelszót</string>
<string name="invalid_password">Adj meg érvényes jelszót.</string>
<string name="password">Jelszó</string>
<string name="login_or_email">Felhasználónév vagy E-mail cím</string>
<string name="followers">Követők</string>
<string name="following">Követettek</string>
<string name="followers_self">Követőim</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
<string name="invalid_login_or_password">Inserisci un nome utente e una password validi</string>
<string name="invalid_password">Inserisci una password valida.</string>
<string name="password">Password</string>
<string name="login_or_email">Login o Email</string>
<string name="followers">Followers</string>
<string name="following">Following</string>
<string name="followers_self">Followers</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
<string name="invalid_login_or_password">Por favor, digite um login e senha válidos.</string>
<string name="invalid_password">Por favor, digite uma senha válida.</string>
<string name="password">Senha</string>
<string name="login_or_email">Login ou Email</string>
<string name="followers">Seguidores</string>
<string name="following">Seguindo</string>
<string name="members">Membros</string>
Expand Down
31 changes: 16 additions & 15 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<string name="error_gists_load">Ошибка при загрузке Gists</string>
<string name="error_issue_load">Ошибка при загрузке задачи</string>
<string name="error_collaborators_load">Ошибка при загрузке соучастников</string>
<string name="error_milestones_load">Ошибка при загрузке вех</string>
<string name="error_milestones_load">Ошибка при загрузке целей</string>
<string name="error_labels_load">Ошибка при загрузке тегов</string>
<string name="error_bookmarks_load">Ошибка при загрузке закладок</string>
<string name="error_members_load">Ошибка при загрузке членов</string>
Expand Down Expand Up @@ -73,7 +73,7 @@
<string name="loading_gists">Загружаем Gists…</string>
<string name="loading_collaborators">Загружаем соучастников…</string>
<string name="loading_teams">Загружаем сотрудников…</string>
<string name="loading_milestones">Загружаем вехи…</string>
<string name="loading_milestones">Загружаем цели…</string>
<string name="loading_labels">Загружаем теги…</string>
<string name="loading_commits">Загружаем коммиты…</string>
<string name="loading_files_and_comments">Загружаем файлы и комментарии…</string>
Expand Down Expand Up @@ -104,7 +104,7 @@
<string name="updating_assignee">Обновляем ответственного…</string>
<string name="updating_issue">Обновляем задачу…</string>
<string name="updating_labels">Обновляем теги…</string>
<string name="updating_milestone">Обновляем веху…</string>
<string name="updating_milestone">Обновляем цель…</string>
<!-- -->

<!-- Issue events texts -->
Expand All @@ -114,8 +114,8 @@
<string name="issue_event_label_self_unassigned">назначение себе снято</string>
<string name="issue_event_label_added">добавлен %1$s тег</string>
<string name="issue_event_label_removed">удалён %1$s тег</string>
<string name="issue_event_milestone_added">добавлено к %1$s вехе</string>
<string name="issue_event_milestone_removed">удалено из %1$s вехи</string>
<string name="issue_event_milestone_added">добавлено к %1$s цели</string>
<string name="issue_event_milestone_removed">удалено из %1$s цели</string>
<string name="issue_event_merged">объединён коммит %1$s</string>
<string name="issue_event_referenced">ссылается на задачу для коммита %1$s</string>
<string name="issue_event_cross_referenced">ссылается на задачу в %1$s</string>
Expand Down Expand Up @@ -183,8 +183,8 @@
<string name="contributors">Участники</string>
<string name="issues_title">Задачи</string>
<string name="edit_labels">Редактировать теги</string>
<string name="milestone_prefix">Веха:</string>
<string name="edit_milestone">Изменить веху</string>
<string name="milestone_prefix">Цель:</string>
<string name="edit_milestone">Изменить цель</string>
<string name="edit_assignee">Назначить ответственного</string>
<string name="description">Описание</string>
<string name="gist_description_hint">Gist, созданный на Android</string>
Expand All @@ -194,16 +194,16 @@
<string name="unstarring_gist">Снимаем отметку с Gist…</string>
<string name="accounts_label">Аккаунты</string>
<string name="select_assignee">Выбрать ответственного</string>
<string name="select_milestone">Выбрать веху</string>
<string name="select_milestone">Выбрать цель</string>
<string name="select_labels">Выбрать тег</string>
<string name="select_ref">Выбрать ветку или метку</string>
<string name="login_pass_explanation">ForkHub будет использовать ваш пароль только для генерации &lt;i>Personal Access Token&lt;/i>. Вы можете &lt;a href=\"https://github.com/settings/tokens\">создать его самостоятельно&lt;/a> и использовать его здесь вместо пароля.</string>
<string name="enter_otp_code_title">Код аутентификации</string>
<string name="enter_otp_code_message">Для вашего аккаунта включена двухэтапная аутентификация. Введите код аутентификации для подтверждения личности.</string>
<string name="star_forkhub_dialog_text">Если вам нравится это приложение, пожалуйста оцените его звёздами.</string>
<string name="rate_forkhub_dialog_text">Если вам нравится это приложение, пожалуйста оцените его рейтингом Play Store.</string>
<string name="rate">Оценить</string>
<string name="no_milestone">Нет вех</string>
<string name="rate">Rate</string>
<string name="no_milestone">Нет целей</string>
<string name="unassigned">Нет ответственных</string>
<string name="assigned">ответственен</string>
<string name="no_gists_found">Gists не найдены</string>
Expand All @@ -229,7 +229,7 @@
<string name="status_closed">Закрыта</string>
<string name="section_issue_assigned">Ответственный:</string>
<string name="assignee_anyone">Кто угодно</string>
<string name="section_issue_milestone">Веха:</string>
<string name="section_issue_milestone">Цель:</string>
<string name="none">Нет</string>
<string name="section_issue_labels">Теги:</string>
<string name="log_in">Войти</string>
Expand Down Expand Up @@ -272,7 +272,7 @@
<string name="apply">ОК</string>
<string name="labels_prefix">Теги:</string>
<string name="assignee">Ответственный</string>
<string name="milestone">Вехи</string>
<string name="milestone">Цель</string>
<string name="labels">Теги</string>
<string name="issue_confirm_close_message">Вы действительно хотите закрыть эту задачу?</string>
<string name="issue_confirm_reopen_message">Вы действительно хотите переоткрыть эту задачу?</string>
Expand Down Expand Up @@ -358,11 +358,12 @@
<string name="ms_time_past">Просрочен</string>
<string name="ms_days">дней</string>
<string name="ms_select_issue">Выбрать задачу</string>
<string name="ms_new_milestone">Новая веха</string>
<string name="ms_new_milestone">Новая цель</string>
<string name="ms_empty_title_error">Ошибка при сохранении с пустым заголовком</string>
<string name="milestones">Цели</string>

<string name="creating_milestone">Создаем веху…</string>
<string name="deleting_milestone">Удаляем веху…</string>
<string name="creating_milestone">Создаем цель…</string>
<string name="deleting_milestone">Удаляем цель…</string>
<string name="issue_event_review_pending">начата проверка</string>
<string name="parent_repo">Родительский репозиторий</string>

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-sv/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
<string name="invalid_password">Ange ett giltligt lösenord.</string>
<string name="password">Lösenord</string>
<string name="username_or_email">Användarnamn eller Email</string>
<string name="login_or_email">Användarnamn eller Email</string>
<string name="followers">Följare</string>
<string name="following">följar på</string>
<string name="follow">följa</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-uk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
<string name="invalid_login_or_password">Введіть правильні логін та пароль</string>
<string name="invalid_password">Введіть правильний пароль.</string>
<string name="password">Пароль</string>
<string name="login_or_email">Логін або пошта</string>
<string name="followers">Читачі</string>
<string name="following">Підписки</string>
<string name="followers_self">Читачі</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
<string name="invalid_login_or_password">请输入正确的账户名和密码。</string>
<string name="invalid_password">请输入正确的密码。</string>
<string name="password">密码</string>
<string name="login_or_email">账户名 / 电子邮件</string>
<string name="followers">关注者</string>
<string name="following">正在关注</string>
<string name="followers_self">关注我的</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
<string name="invalid_login_or_password">請輸入正確的帳號與密碼</string>
<string name="invalid_password">請輸入正確的密碼.</string>
<string name="password">密碼</string>
<string name="login_or_email">帳號或電子郵件</string>
<string name="followers">追隨我的</string>
<string name="following">我追隨的</string>
<string name="followers_self">追隨我的</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@
<string name="ms_date_format" translatable="false">dd MMM yyyy</string>
<string name="ms_select_issue">Select Issue</string>
<string name="ms_empty_title_error">Saving with empty title failed</string>
<string name="milestones">Milestones</string>


</resources>

0 comments on commit d2b391c

Please sign in to comment.