From 0858956dab8ffb4969294e5dc828bcbeee9a86fa Mon Sep 17 00:00:00 2001 From: cocoa-dev003 <66989607+cocoa-dev003@users.noreply.github.com> Date: Thu, 20 Oct 2022 10:44:38 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A2=E3=83=B3=E3=82=B1=E3=83=BC=E3=83=88?= =?UTF-8?q?=E5=9B=9E=E7=AD=94=E3=81=AE=E9=81=B8=E6=8A=9E=E8=82=A2=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Covid19Radar/Model/SurveyContent.cs | 4 +- .../Resources/AppResources.Designer.cs | 74 ++++++++++++++++++- .../Resources/AppResources.ja.resx | 52 ++++++++++--- .../Covid19Radar/Resources/AppResources.resx | 44 +++++++++-- .../Resources/AppResources.zh-Hans.resx | 44 +++++++++-- .../Covid19Radar/Services/SurveyService.cs | 4 +- .../EndOfService/SurveyPageViewModel.cs | 5 +- .../Views/EndOfService/SurveyPage.xaml | 10 +++ .../Services/SurveyServiceTests.cs | 6 +- 9 files changed, 209 insertions(+), 34 deletions(-) diff --git a/Covid19Radar/Covid19Radar/Model/SurveyContent.cs b/Covid19Radar/Covid19Radar/Model/SurveyContent.cs index 6c74d0d1f..be416adc6 100644 --- a/Covid19Radar/Covid19Radar/Model/SurveyContent.cs +++ b/Covid19Radar/Covid19Radar/Model/SurveyContent.cs @@ -10,10 +10,10 @@ namespace Covid19Radar.Model public class SurveyContent { [JsonProperty("q1")] - public int Q1 { get; set; } + public int? Q1 { get; set; } [JsonProperty("q2")] - public int Q2 { get; set; } + public int? Q2 { get; set; } [JsonProperty("start_date")] public long? StartDate { get; set; } diff --git a/Covid19Radar/Covid19Radar/Resources/AppResources.Designer.cs b/Covid19Radar/Covid19Radar/Resources/AppResources.Designer.cs index 04e9de2bc..8661e18df 100644 --- a/Covid19Radar/Covid19Radar/Resources/AppResources.Designer.cs +++ b/Covid19Radar/Covid19Radar/Resources/AppResources.Designer.cs @@ -3008,6 +3008,15 @@ public static string SurveyPageExposureDataProvisionTitle { } } + /// + /// Looks up a localized string similar to TODO. + /// + public static string SurveyPageNotAnswer { + get { + return ResourceManager.GetString("SurveyPageNotAnswer", resourceCulture); + } + } + /// /// Looks up a localized string similar to TODO. /// @@ -3044,6 +3053,60 @@ public static string SurveyPageQ1A3 { } } + /// + /// Looks up a localized string similar to TODO. + /// + public static string SurveyPageQ1A4 { + get { + return ResourceManager.GetString("SurveyPageQ1A4", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to TODO. + /// + public static string SurveyPageQ1A5 { + get { + return ResourceManager.GetString("SurveyPageQ1A5", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to TODO. + /// + public static string SurveyPageQ1A6 { + get { + return ResourceManager.GetString("SurveyPageQ1A6", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to TODO. + /// + public static string SurveyPageQ1A7 { + get { + return ResourceManager.GetString("SurveyPageQ1A7", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to TODO. + /// + public static string SurveyPageQ1A8 { + get { + return ResourceManager.GetString("SurveyPageQ1A8", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to TODO. + /// + public static string SurveyPageQ1A9 { + get { + return ResourceManager.GetString("SurveyPageQ1A9", resourceCulture); + } + } + /// /// Looks up a localized string similar to TODO. /// @@ -3054,7 +3117,7 @@ public static string SurveyPageQ1Text { } /// - /// Looks up a localized string similar to 有り. + /// Looks up a localized string similar to TODO. /// public static string SurveyPageQ2A1 { get { @@ -3071,6 +3134,15 @@ public static string SurveyPageQ2A2 { } } + /// + /// Looks up a localized string similar to TODO. + /// + public static string SurveyPageQ2A3 { + get { + return ResourceManager.GetString("SurveyPageQ2A3", resourceCulture); + } + } + /// /// Looks up a localized string similar to TODO. /// diff --git a/Covid19Radar/Covid19Radar/Resources/AppResources.ja.resx b/Covid19Radar/Covid19Radar/Resources/AppResources.ja.resx index a2acfbd66..cbd37d5ef 100644 --- a/Covid19Radar/Covid19Radar/Resources/AppResources.ja.resx +++ b/Covid19Radar/Covid19Radar/Resources/AppResources.ja.resx @@ -1699,25 +1699,57 @@ COCOAのソースコードは次のURLから入手できます。 選択してください 選択してください + + 回答しない + 回答しない + - 〜9歳 - 〜9歳 + 14歳以下 + 14歳以下 - 10歳〜19歳 - 10歳〜19歳 + 15-19歳 + 15-19歳 - 20歳〜29歳 - 20歳〜29歳 + 20-24歳 + 20-24歳 + + + 25-29歳 + 25-29歳 + + + 30-39歳 + 30-39歳 + + + 40-49歳 + 40-49歳 + + + 50-59歳 + 50-59歳 + + + 60-69歳 + 60-69歳 + + + 70歳以上 + 70歳以上 - 有り - 有り + 通勤・通学をしていない + 通勤・通学をしていない - 無し - 無し + 公共交通機関以外のみで通勤通学 + 公共交通機関以外のみで通勤通学 + + + 公共交通機関を利用して通勤通学 + 公共交通機関を利用して通勤通学 回答を確定した後、利用を終了することで回答が送信されます。 diff --git a/Covid19Radar/Covid19Radar/Resources/AppResources.resx b/Covid19Radar/Covid19Radar/Resources/AppResources.resx index 1db11601b..85d9f5419 100644 --- a/Covid19Radar/Covid19Radar/Resources/AppResources.resx +++ b/Covid19Radar/Covid19Radar/Resources/AppResources.resx @@ -1801,25 +1801,57 @@ By collecting the number of notifications, we can use it to understand how many TODO 選択してください + + TODO + 回答しない + TODO - 〜9歳 + 14歳以下 TODO - 10歳〜19歳 + 15-19歳 TODO - 20歳〜29歳 + 20-24歳 + + + TODO + 25-29歳 + + + TODO + 30-39歳 + + + TODO + 40-49歳 + + + TODO + 50-59歳 + + + TODO + 60-69歳 + + + TODO + 70歳以上 - 有り - 有り + TODO + 通勤・通学をしていない TODO - 無し + 公共交通機関以外のみで通勤通学 + + + TODO + 公共交通機関を利用して通勤通学 TODO diff --git a/Covid19Radar/Covid19Radar/Resources/AppResources.zh-Hans.resx b/Covid19Radar/Covid19Radar/Resources/AppResources.zh-Hans.resx index c47e1e62c..793a07409 100644 --- a/Covid19Radar/Covid19Radar/Resources/AppResources.zh-Hans.resx +++ b/Covid19Radar/Covid19Radar/Resources/AppResources.zh-Hans.resx @@ -1701,25 +1701,57 @@ COCOAのソースコードは次のURLから入手できます。 TODO 選択してください + + TODO + 回答しない + TODO - 〜9歳 + 14歳以下 TODO - 10歳〜19歳 + 15-19歳 TODO - 20歳〜29歳 + 20-24歳 + + + TODO + 25-29歳 + + + TODO + 30-39歳 + + + TODO + 40-49歳 + + + TODO + 50-59歳 + + + TODO + 60-69歳 + + + TODO + 70歳以上 - 有り - 有り + TODO + 通勤・通学をしていない TODO - 無し + 公共交通機関以外のみで通勤通学 + + + TODO + 公共交通機関を利用して通勤通学 TODO diff --git a/Covid19Radar/Covid19Radar/Services/SurveyService.cs b/Covid19Radar/Covid19Radar/Services/SurveyService.cs index 2f14df8c3..5803ed7a4 100644 --- a/Covid19Radar/Covid19Radar/Services/SurveyService.cs +++ b/Covid19Radar/Covid19Radar/Services/SurveyService.cs @@ -38,8 +38,8 @@ public async Task BuildSurveyContent(int q1, int q2, bool isAppSt { var surveyContent = new SurveyContent { - Q1 = q1, - Q2 = q2, + Q1 = q1 > 0 ? (int?)q1 : null, + Q2 = q2 > 0 ? (int?)q2 : null, StartDate = isAppStartDate ? (long?)_userDataRepository.GetStartDate().ToUnixEpoch() : null, ExposureData = isExposureDataProvision ? await GetExopsureData() : null }; diff --git a/Covid19Radar/Covid19Radar/ViewModels/EndOfService/SurveyPageViewModel.cs b/Covid19Radar/Covid19Radar/ViewModels/EndOfService/SurveyPageViewModel.cs index 7d7f12385..95e0e0f11 100644 --- a/Covid19Radar/Covid19Radar/ViewModels/EndOfService/SurveyPageViewModel.cs +++ b/Covid19Radar/Covid19Radar/ViewModels/EndOfService/SurveyPageViewModel.cs @@ -3,13 +3,10 @@ // file, You can obtain one at https://mozilla.org/MPL/2.0/. using System; using System.ComponentModel; -using System.Runtime.CompilerServices; -using Covid19Radar.Common; using Covid19Radar.Model; using Covid19Radar.Repository; using Covid19Radar.Resources; using Covid19Radar.Services; -using Covid19Radar.Services.Logs; using Covid19Radar.Views.EndOfService; using Prism.Navigation; using Xamarin.CommunityToolkit.ObjectModel; @@ -83,7 +80,7 @@ public bool IsExposureDataProvision } public bool IsTerminationOfUsePageButtonEnabled - => _selectedIndexQ1 > 0 && _selectedIndexQ2 > 0; + => _selectedIndexQ1 != 0 && _selectedIndexQ2 != 0; private readonly IUserDataRepository _userDataRepository; private readonly ISurveyService _surveyService; diff --git a/Covid19Radar/Covid19Radar/Views/EndOfService/SurveyPage.xaml b/Covid19Radar/Covid19Radar/Views/EndOfService/SurveyPage.xaml index a487304c9..d22af3ec5 100644 --- a/Covid19Radar/Covid19Radar/Views/EndOfService/SurveyPage.xaml +++ b/Covid19Radar/Covid19Radar/Views/EndOfService/SurveyPage.xaml @@ -40,6 +40,14 @@ + + + + + + + + @@ -60,6 +68,8 @@ + + diff --git a/Covid19Radar/Tests/Covid19Radar.UnitTests/Services/SurveyServiceTests.cs b/Covid19Radar/Tests/Covid19Radar.UnitTests/Services/SurveyServiceTests.cs index 71f8d3fd4..88f2eff78 100644 --- a/Covid19Radar/Tests/Covid19Radar.UnitTests/Services/SurveyServiceTests.cs +++ b/Covid19Radar/Tests/Covid19Radar.UnitTests/Services/SurveyServiceTests.cs @@ -89,12 +89,12 @@ public async Task BuildSurveyContentTests_HasStartDate_HasExposureDataProvision( public async Task BuildSurveyContentTests_HasNotStartDate_HasNotExposureDataProvision() { SurveyService unitUnderTest = CreateService(); - SurveyContent result = await unitUnderTest.BuildSurveyContent(1, 2, false, false); + SurveyContent result = await unitUnderTest.BuildSurveyContent(-1, -1, false, false); _testOutputHelper.WriteLine($"TimeZoneInfo.Local: {TimeZoneInfo.Local}"); - Assert.Equal(1, result.Q1); - Assert.Equal(2, result.Q2); + Assert.Null(result.Q1); + Assert.Null(result.Q2); Assert.Null(result.StartDate); Assert.Null(result.ExposureData);