From 5ff5b7f9461dde1514184c81e98f5e27623bad56 Mon Sep 17 00:00:00 2001 From: Rafael da Veiga Cabral Date: Wed, 10 Jun 2020 14:04:28 -0300 Subject: [PATCH] NY-10585: [AN]: It does not allow to send problem report with empty description --- .../mvp/presenters/ReportAProblemPresenter.kt | 10 +++++++--- .../ui/fragments/settings/ReportAProblemFragment.kt | 2 +- app/src/main/res/values-en/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-ko/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 2 ++ app/src/main/res/values-zh/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 8 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/nynja/mobile/communicator/mvp/presenters/ReportAProblemPresenter.kt b/app/src/main/java/com/nynja/mobile/communicator/mvp/presenters/ReportAProblemPresenter.kt index 1ce09b8b82..dcd6b221a7 100644 --- a/app/src/main/java/com/nynja/mobile/communicator/mvp/presenters/ReportAProblemPresenter.kt +++ b/app/src/main/java/com/nynja/mobile/communicator/mvp/presenters/ReportAProblemPresenter.kt @@ -3,6 +3,7 @@ package com.nynja.mobile.communicator.mvp.presenters import android.os.Handler import com.arellomobile.mvp.InjectViewState import com.nynja.mobile.communicator.BuildConfig +import com.nynja.mobile.communicator.R import com.nynja.mobile.communicator.data.NynjaAwsManager import com.nynja.mobile.communicator.data.actions.CollectLatestLogFilesForReportAction import com.nynja.mobile.communicator.data.amazon.AwsTransfer @@ -17,6 +18,8 @@ import io.reactivex.disposables.Disposable import io.reactivex.schedulers.Schedulers import timber.log.Timber import java.io.File +import android.content.Context + @InjectViewState class ReportAProblemPresenter : BasePresenter() { @@ -26,16 +29,17 @@ class ReportAProblemPresenter : BasePresenter() { return arrayOf(Io::class.java) } - fun sendClick(description: String?) { + fun sendClick(description: String?, context: Context) { if (StringUtils.isNotEmpty(description)) { Timber.e("\n=====================================================================\r\n" + "### Problem Description: \n" + description + "\n" + Utils.getApplicationInfo() + "\n=====================================================================\r\n") + send() + }else { + DialogFactory.showAlert(context, R.string.report_a_problem_empty_description) } - - send() } private fun send() { diff --git a/app/src/main/java/com/nynja/mobile/communicator/ui/fragments/settings/ReportAProblemFragment.kt b/app/src/main/java/com/nynja/mobile/communicator/ui/fragments/settings/ReportAProblemFragment.kt index fd0580f2d9..c3e4aa125d 100644 --- a/app/src/main/java/com/nynja/mobile/communicator/ui/fragments/settings/ReportAProblemFragment.kt +++ b/app/src/main/java/com/nynja/mobile/communicator/ui/fragments/settings/ReportAProblemFragment.kt @@ -51,7 +51,7 @@ class ReportAProblemFragment : BaseFragment(), ReportAProblemView { @OnClick(R.id.f_report_a_problem_btn_send) fun onSaveButtonClick() { - mPresenter.sendClick(description.text.toString().trim()) + mPresenter.sendClick(description.text.toString().trim(), context) } override fun showInternetError() { diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index 8da13b5fc2..17cd972ecb 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -1224,6 +1224,7 @@ Description* Ask Nynja a question Email Support + The description is empty.\nPlease provide a description for the problem. This conference has not been started yet. Please wait for the conference to be started.\nYou can return to home screen and you will be notified when the conference starts diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index cc31e962dc..da436efc6d 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -1219,6 +1219,7 @@ Description* Ask Nynja a question Email Support + The description is empty.\nPlease provide a description for the problem. This conference has not been started yet. Please wait for the conference to be started.\nYou can return to home screen and you will be notified when the conference starts diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 58547c814f..3c77b53ff4 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -1219,6 +1219,7 @@ Description* Ask Nynja a question Email Support + The description is empty. Please provide a description for the problem. This conference has not been started yet. Please wait for the conference to be started.\nYou can return to home screen and you will be notified when the conference starts diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index c2bf97f05a..a27527030d 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -1219,6 +1219,8 @@ Description* 向NYNJA提问 电邮客服 + The description is empty. Please provide a description for the problem. + This conference has not been started yet. Please wait for the conference to be started.\nYou can return to home screen and you will be notified when the conference starts diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index c2bf97f05a..fe406a5cd3 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -1219,6 +1219,7 @@ Description* 向NYNJA提问 电邮客服 + The description is empty. Please provide a description for the problem. This conference has not been started yet. Please wait for the conference to be started.\nYou can return to home screen and you will be notified when the conference starts diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7930de99a5..5b7695d330 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1231,6 +1231,7 @@ Description* Ask Nynja a question Email Support + The description is empty.\nPlease provide a description for the problem. This conference has not been started yet. Please wait for the conference to be started.\nYou can return to home screen and you will be notified when the conference starts -- GitLab