Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

[DO NOT MERGE] v2.0.0-closed beta #652

Draft
wants to merge 89 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
835a875
WIP
keiji Jan 15, 2022
2e89e16
Create zipped-logfile at tapped "Send Operating information" button.
keiji Jan 15, 2022
251b20a
Fix tests.
keiji Jan 15, 2022
1e8913c
Connect to V2DiagnosisApi.
keiji Jan 4, 2022
7756c99
Improve Open Source Software section.
keiji Jan 8, 2022
2cb6eae
Change InqueryPage for Beta.
keiji Jan 10, 2022
66a6784
Make SplashPage as BetaAgreementPage.
keiji Jan 14, 2022
3979fcd
Add UseStable button in InqueryPage.
keiji Jan 14, 2022
be6c987
Fix upload failed.
keiji Jan 15, 2022
9f4894f
Fix tests.
keiji Jan 15, 2022
b41b486
Merge branch 'improve_log_share' into feature/beta
keiji Jan 15, 2022
ab95d17
Improve InqueryPage
keiji Jan 15, 2022
ed5c6f8
Delete temporary files on destroy InqueryPage.
keiji Jan 15, 2022
acb3c4c
Disable operation-log/event-log/exposure-data uploading services.
keiji Jan 15, 2022
0cf4678
Merge pull request #729 from keiji/beta/improve_log_share
keiji Jan 15, 2022
639809a
Disable CheckVersion.
keiji Jan 15, 2022
d5d87da
Fix test.
keiji Jan 15, 2022
ee5be1a
Merge pull request #730 from keiji/beta/disable_check_version
keiji Jan 15, 2022
67f0e12
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into feature/beta
keiji Jan 16, 2022
b1dc771
Fix build.
keiji Jan 16, 2022
a06d8af
Make InqueryTelephoneNumber invisible and show message that recommend…
keiji Jan 16, 2022
918564a
Merge pull request #738 from keiji/replace_inquery_notifyotherpage
keiji Jan 16, 2022
bcffc8a
Handle response 204 No Content as success.
keiji Jan 16, 2022
89578df
Merge pull request #740 from keiji/beta/handle_204_response
keiji Jan 16, 2022
9695121
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into feature/beta
keiji Jan 16, 2022
639c3e2
Merge branch 'feature/beta' of github.com:cocoa-mhlw/cocoa into featu…
keiji Jan 16, 2022
8597c3e
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into feature/beta
keiji Jan 17, 2022
4963449
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into feature/beta
keiji Jan 18, 2022
1423440
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into feature/beta
keiji Jan 18, 2022
6df627b
Show beta suffix.
keiji Jan 18, 2022
7077c53
Merge pull request #766 from keiji/beta/version_suffix
keiji Jan 18, 2022
c07892f
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into feature/beta
keiji Jan 18, 2022
915b8b3
Merge branch 'feature/beta' of github.com:cocoa-mhlw/cocoa into featu…
keiji Jan 18, 2022
bbddd03
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into feature/beta
keiji Jan 20, 2022
f8e5cb5
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into feature/beta
keiji Jan 20, 2022
e77c57e
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into feature/beta
keiji Jan 23, 2022
2bcd79c
Bump up version to v2.0.0-beta02
keiji Jan 24, 2022
9b0e29d
Merge pull request #811 from cocoa-mhlw/cocoa2beta/update_version-1
keiji Jan 24, 2022
c8341ec
Add Header image to LowRiskContactPage.
keiji Jan 24, 2022
7b2314d
show score as ratio 100%
keiji Jan 24, 2022
3a63b0c
WIP
keiji Jan 25, 2022
0a1a946
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into cocoa2/ref…
keiji Jan 25, 2022
1ed5131
WIP
keiji Jan 25, 2022
e6239f4
Merge LowRiskContactLayout and NoRiskContactLayout.
keiji Jan 25, 2022
b38b6bf
Rmove resources.
keiji Jan 25, 2022
45f6e7a
Refactoring.
keiji Jan 26, 2022
5944237
Fix text.
keiji Jan 26, 2022
8c00b91
Prevent Div0.
keiji Jan 26, 2022
3713b8c
Tweak card design.
keiji Jan 26, 2022
d407d87
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into feature/beta
keiji Jan 26, 2022
171d57b
Fix tests.
keiji Jan 26, 2022
ff4e063
Bump up version to v2.0.0-beta03
keiji Jan 27, 2022
a829297
Fix NPE when come from DebugPage
keiji Jan 31, 2022
e370775
Fix test.
keiji Jan 31, 2022
d2cd1d7
Refactoring.
keiji Jan 31, 2022
fcb6aee
Merge pull request #825 from keiji/cocoa2/refine_exposurecheck
kazuhiro4949 Jan 31, 2022
e67233a
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into feature/beta
keiji Jan 31, 2022
18eb75e
Merge branch 'feature/beta' of github.com:cocoa-mhlw/cocoa into featu…
keiji Jan 31, 2022
a8f16fc
Add padding to button
takikunxo Feb 6, 2022
1b444b5
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into feature/beta
keiji Feb 7, 2022
cc409f9
Fixed padding value
takikunxo Feb 8, 2022
2912003
Merge pull request #854 from tacitusxo/add_padding_to_button
keiji Feb 9, 2022
d773bf3
Improve text.
keiji Jan 26, 2022
ac2ffc2
Show datetime details about considering timezone.
keiji Feb 9, 2022
50182bf
Refactoring.
keiji Feb 10, 2022
30233c8
Tweak resources.
keiji Feb 10, 2022
e76b4c8
Specify that the timezone
keiji Feb 10, 2022
9e2eb74
Merge pull request #863 from keiji/beta/contact_notify
kazuhiro4949 Feb 10, 2022
65e91e4
Merge pull request #826 from keiji/beta/beta03
kazuhiro4949 Feb 10, 2022
105442f
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into feature/beta
keiji Feb 14, 2022
e71dd77
Fixed an issue that exposure duration was always displayed.
keiji Feb 14, 2022
c0c9e75
Merge branch 'develop' of github.com:cocoa-mhlw/cocoa into feature/beta
keiji Feb 16, 2022
5a0d28c
Clarify that the cost of the testing due to the notification will not…
keiji Feb 17, 2022
a132f84
Clarify exposure date AM or PM.
keiji Feb 18, 2022
823ddd4
Merge pull request #868 from keiji/fix_exposure_duration_never_dismiss
kazuhiro4949 Feb 18, 2022
45dff9f
Merge pull request #874 from keiji/beta/clarify_testing_cost_is_not_c…
kazuhiro4949 Feb 18, 2022
9ac0aae
Merge pull request #878 from keiji/beta/clarify_exposuredate_am
kazuhiro4949 Feb 18, 2022
e0d6004
Remove a paragraph about taking a screenshot.
keiji Feb 21, 2022
2140b40
Fix wrong low-risk exposure start date calculation.
keiji Feb 21, 2022
534e02a
Add note on ExposureCheckPage.
keiji Feb 21, 2022
339d366
Use DateTime formatter.
keiji Feb 22, 2022
70a004e
Apply translation.
keiji Feb 22, 2022
39ccbf9
Merge pull request #885 from keiji/remove_screenshot_para
kazuhiro4949 Feb 22, 2022
3fb7cbe
Update Covid19Radar/Covid19Radar/Resources/AppResources.ja.resx
keiji Feb 23, 2022
529c1d9
Merge pull request #889 from keiji/beta/improve_low_risk_exposure
kazuhiro4949 Feb 23, 2022
dd6a50d
Improve English and Chinese translation.
keiji Feb 24, 2022
725c52c
Merge pull request #895 from keiji/closedbeta/translation
kazuhiro4949 Feb 27, 2022
146344d
Bump up version to v2.0.0-beta04(closed)
keiji Feb 28, 2022
c470656
Merge pull request #896 from cocoa-mhlw/update_version/closedbeta04
kazuhiro4949 Feb 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions Covid19Radar/Covid19Radar.Android/Covid19Radar.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,6 @@
<SubType></SubType>
<Generator></Generator>
</AndroidResource>
<AndroidResource Include="Resources\drawable-zh-xhdpi\Nocontact10.png">
<SubType></SubType>
<Generator></Generator>
</AndroidResource>
<AndroidResource Include="Resources\drawable-zh-xxhdpi\Nocontact10.png">
<SubType></SubType>
<Generator></Generator>
</AndroidResource>
<AndroidResource Include="Resources\drawable\ic_notification.xml">
<SubType></SubType>
<Generator></Generator>
Expand Down Expand Up @@ -389,6 +381,10 @@
<SubType></SubType>
<Generator></Generator>
</AndroidResource>
<AndroidResource Include="Resources\drawable-xxhdpi\exposure_check_page_head.png">
<SubType></SubType>
<Generator></Generator>
</AndroidResource>
</ItemGroup>
<ItemGroup>
<None Include="Properties\AndroidManifest.xml" />
Expand Down Expand Up @@ -553,15 +549,9 @@
<ItemGroup>
<AndroidResource Include="Resources\drawable-ja-xhdpi\HelpPage22.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-ja-xhdpi\Nocontact10.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-ja-xxhdpi\HelpPage22.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-ja-xxhdpi\Nocontact10.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xhdpi\HeaderLogo.png" />
</ItemGroup>
Expand All @@ -571,9 +561,6 @@
<ItemGroup>
<AndroidResource Include="Resources\drawable-xhdpi\InfoMark.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xhdpi\Nocontact10.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxhdpi\HeaderLogo.png" />
</ItemGroup>
Expand All @@ -583,9 +570,6 @@
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxhdpi\InfoMark.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxhdpi\Nocontact10.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xhdpi\SplashImg.png" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,13 @@
<action android:name="android.intent.action.SEND" />
<data android:scheme="mailto" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="https"
android:host="github.com"
android:path="cocoa-mhlw/cocoa/"
/>
</intent>
</queries>
</manifest>
</manifest>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class DeviceCheckService : IDeviceVerifier
{
public Task<string> VerifyAsync(DiagnosisSubmissionParameter submission)
{
var nonce = DeviceVerifierUtils.CreateAndroidNonceV3(submission);
var nonce = DeviceVerifierUtils.CreateAndroidNonceV2(submission);
return GetSafetyNetAttestationAsync(nonce);
}

Expand Down
11 changes: 1 addition & 10 deletions Covid19Radar/Covid19Radar.iOS/Covid19Radar.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,6 @@
<BundleResource Include="Resources\Base.lproj\privacypolicy_img01%402x.png" />
<BundleResource Include="Resources\Base.lproj\arrow_icon%403x.png" />
<BundleResource Include="Resources\Base.lproj\arrow_icon%402x.png" />
<BundleResource Include="Resources\Base.lproj\Nocontact10%402x.png" />
<BundleResource Include="Resources\Base.lproj\Nocontact10%403x.png" />
<BundleResource Include="Resources\Base.lproj\HelpPage20%402x.png" />
<BundleResource Include="Resources\Base.lproj\HelpPage20%403x.png" />
<BundleResource Include="Resources\Base.lproj\HelpPage21%402x.png" />
Expand All @@ -329,8 +327,6 @@
<BundleResource Include="Resources\zh-Hans.lproj\HelpPage31%403x.png" />
<BundleResource Include="Resources\zh-Hans.lproj\HelpPage32%402x.png" />
<BundleResource Include="Resources\zh-Hans.lproj\HelpPage32%403x.png" />
<BundleResource Include="Resources\zh-Hans.lproj\Nocontact10%402x.png" />
<BundleResource Include="Resources\zh-Hans.lproj\Nocontact10%403x.png" />
<BundleResource Include="Resources\license.html" />
<BundleResource Include="Resources\Base.lproj\app_share_icon%402x.png" />
<BundleResource Include="Resources\Base.lproj\app_share_icon%403x.png" />
Expand Down Expand Up @@ -362,6 +358,7 @@
<BundleResource Include="Resources\zh-Hans.lproj\icon_menu%403x.png" />
<BundleResource Include="Resources\Base.lproj\icon_arrow%402x.png" />
<BundleResource Include="Resources\Base.lproj\icon_arrow%403x.png" />
<BundleResource Include="Resources\Base.lproj\exposure_check_page_head.png" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down Expand Up @@ -514,12 +511,6 @@
<ItemGroup>
<BundleResource Include="Resources\ja.lproj\HelpPage32%403x.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\ja.lproj\Nocontact10%402x.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\ja.lproj\Nocontact10%403x.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\ja.lproj\HelpPage22%402x.png" />
</ItemGroup>
Expand Down
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 6 additions & 3 deletions Covid19Radar/Covid19Radar/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
<Setter Property="BorderWidth" Value="4" />
<Setter Property="TextColor" Value="{StaticResource ButtonText}" />
<Setter Property="FontSize" Value="Medium" />
<Setter Property="Padding" Value="0,0,0,0" />
<Setter Property="Padding" Value="10" />
<Setter Property="Margin" Value="0,10,0,5" />
<Setter Property="HorizontalOptions" Value="Center" />
<Setter Property="WidthRequest" Value="{x:OnPlatform Android=300, iOS=310}" />
Expand Down Expand Up @@ -273,13 +273,16 @@
</Style>

<Style x:Key="FrameCardViewStyle" TargetType="Frame">
<Setter Property="CornerRadius" Value="5" />
<Setter Property="CornerRadius" Value="6" />
<Setter Property="Margin" Value="5" />
<Setter Property="Padding" Value="10" />
<Setter Property="HorizontalOptions" Value="FillAndExpand" />
<Setter Property="OutlineColor" Value="LightGray" />
<Setter Property="BorderColor" Value="LightGray" />
<Setter Property="HasShadow" Value="True" />
</Style>

<Style x:Key="FrameCardViewStyle_Diabled" TargetType="Frame" BasedOn="{StaticResource FrameCardViewStyle}">
<Setter Property="Opacity" Value="0.5" />
</Style>

<Style x:Key="LinkLabelStyleLarge" TargetType="Label">
Expand Down
11 changes: 5 additions & 6 deletions Covid19Radar/Covid19Radar/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ protected override void RegisterTypes(IContainerRegistry containerRegistry)
containerRegistry.RegisterForNavigation<PrivacyPolicyPage2>();
containerRegistry.RegisterForNavigation<InqueryPage>();
containerRegistry.RegisterForNavigation<TermsofservicePage>();
containerRegistry.RegisterForNavigation<ThankYouNotifyOtherPage>();
containerRegistry.RegisterForNavigation<NotifyOtherPage>();
containerRegistry.RegisterForNavigation<ExposureCheckPage>();
containerRegistry.RegisterForNavigation<ContactedNotifyPage>();
Expand All @@ -183,7 +182,6 @@ private static void RegisterCommonTypes(IContainer container)
container.Register<ILoggerService, LoggerService>(Reuse.Singleton);
container.Register<ILogFileService, LogFileService>(Reuse.Singleton);
container.Register<ILogPathService, LogPathService>(Reuse.Singleton);
container.Register<ILogUploadService, LogUploadService>(Reuse.Singleton);
container.Register<IEssentialsService, EssentialsService>(Reuse.Singleton);
container.Register<IUserDataService, UserDataService>(Reuse.Singleton);
container.Register<ITermsUpdateService, TermsUpdateService>(Reuse.Singleton);
Expand Down Expand Up @@ -217,11 +215,12 @@ private static void RegisterCommonTypes(IContainer container)
container.Register<IExposureConfigurationRepository, ExposureConfigurationRepository>(Reuse.Singleton);
container.Register<IExposureRiskCalculationConfigurationRepository, ExposureRiskCalculationConfigurationRepository>(Reuse.Singleton);

#if EVENT_LOG_ENABLED
container.Register<IEventLogService, EventLogService>(Reuse.Singleton);
#else
// Privacy
container.Register<IEventLogService, EventLogServiceNop>(Reuse.Singleton);
#endif

// Beta
container.Register<ILogUploadService, LogUploadServiceNop>(Reuse.Singleton);
container.Register<ICheckVersionService, CheckVersionServiceNop>(Reuse.Singleton);

// Utilities
container.Register<IDateTimeUtility, DateTimeUtility>(Reuse.Singleton);
Expand Down
4 changes: 2 additions & 2 deletions Covid19Radar/Covid19Radar/Common/AppConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class AppConstants
/// <summary>
/// Number of days covered from the date of diagnosis or onset
/// </summary>
public const int DaysToSendTek = -15;
public const int DaysToSendTek = -3;

/// <summary>
/// Max Error Count
Expand Down Expand Up @@ -47,7 +47,7 @@ public static class AppConstants
/// DiagnosisApi version.
/// (e.g. v2, v3)
/// </summary>
public const string DiagnosisApiVersionCode = "v3";
public const string DiagnosisApiVersionCode = "v2";

/// <summary>
/// Number of day(s) that ExposureConfiguration file downloaded cache.
Expand Down
47 changes: 0 additions & 47 deletions Covid19Radar/Covid19Radar/Common/AppUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

using Acr.UserDialogs;
using Covid19Radar.Resources;
using Covid19Radar.Services.Logs;
using Newtonsoft.Json.Linq;
using System;
using System.Diagnostics;
using System.Net.Http;
using Xamarin.Essentials;
using Xamarin.Forms;

Expand Down Expand Up @@ -36,45 +29,5 @@ await Share.RequestAsync(new ShareTextRequest
}

}

public static async void CheckVersion(ILoggerService loggerService)
{
loggerService.StartMethod();

var uri = AppResources.UrlVersion;
using (var client = new HttpClient())
{
try
{
var json = await client.GetStringAsync(uri);
var versionString = JObject.Parse(json).Value<string>("version");

if (new Version(versionString).CompareTo(new Version(AppInfo.VersionString)) > 0)
{
await UserDialogs.Instance.AlertAsync(AppResources.AppUtilsGetNewVersionDescription, AppResources.AppUtilsGetNewVersionTitle, Resources.AppResources.ButtonOk);

if (Device.RuntimePlatform == Device.iOS)
{
await Browser.OpenAsync(AppSettings.Instance.AppStoreUrl, BrowserLaunchMode.External);
}
else if (Device.RuntimePlatform == Device.Android)
{
await Browser.OpenAsync(AppSettings.Instance.GooglePlayUrl, BrowserLaunchMode.External);
}

}

}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
loggerService.Exception("Failed to check version.", ex);
}
finally
{
loggerService.EndMethod();
}
}
}
}
}
6 changes: 0 additions & 6 deletions Covid19Radar/Covid19Radar/Covid19Radar.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<Compile Remove="Controls\**" />
<EmbeddedResource Remove="Controls\**" />
<None Remove="Controls\**" />
<None Remove="Views\ExposureCheck\" />
<None Remove="ViewModels\ExposureCheckPage\" />
</ItemGroup>

Expand Down Expand Up @@ -87,9 +86,6 @@
<Compile Update="Views\HomePage\PrivacyPolicyPage2.xaml.cs">
<DependentUpon>PrivacyPolicyPage2.xaml</DependentUpon>
</Compile>
<Compile Update="Views\HomePage\ThankYouNotifyOtherPage.xaml.cs">
<DependentUpon>ThankYouNotifyOtherPage.xaml</DependentUpon>
</Compile>
<Compile Update="Views\Settings\LicenseAgreementPage.xaml.cs">
<DependentUpon>LicenseAgreementPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -149,8 +145,6 @@
<Folder Include="Controls\" />
<Folder Include="Services\Migration\" />
<Folder Include="Repository\" />
<Folder Include="Views\ExposureCheck\" />
<Folder Include="ViewModels\ExposureCheck\" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='Release'">
<Compile Remove="ViewModels/Settings/DebugPageViewModel.cs" />
Expand Down
10 changes: 7 additions & 3 deletions Covid19Radar/Covid19Radar/Model/DiagnosisSubmissionParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ namespace Covid19Radar.Model
{
public class DiagnosisSubmissionParameter
{
[JsonProperty("symptomOnsetDate")]
//[JsonProperty("symptomOnsetDate")]
[JsonIgnore]
public string SymptomOnsetDate { get; set; }

[JsonProperty("keys")]
Expand All @@ -25,7 +26,8 @@ public class DiagnosisSubmissionParameter
[JsonProperty("verificationPayload")]
public string VerificationPayload { get; set; }

[JsonProperty("idempotency_key")]
//[JsonProperty("idempotency_key")]
[JsonIgnore]
public string IdempotencyKey { get; set; }

// Random data to obscure the size of the request network packet sniffers.
Expand All @@ -40,7 +42,9 @@ public class Key
public uint RollingStartNumber { get; set; }
[JsonProperty("rollingPeriod")]
public uint RollingPeriod { get; set; }
[JsonProperty("reportType")]

//[JsonProperty("reportType")]
[JsonIgnore]
public uint ReportType { get; set; }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ await SaveAsync(
}
}

private static V1ExposureRiskCalculationConfiguration CreateDefaultConfiguration()
public static V1ExposureRiskCalculationConfiguration CreateDefaultConfiguration()
{
return new V1ExposureRiskCalculationConfiguration()
{
Expand Down
34 changes: 34 additions & 0 deletions Covid19Radar/Covid19Radar/Repository/IExposureDataRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks;
using Chino;
using Covid19Radar.Model;
using Covid19Radar.Resources;

namespace Covid19Radar.Repository
{
Expand Down Expand Up @@ -38,5 +41,36 @@ int minimumRiskScore

void RemoveExposureInformation();
void RemoveOutOfDateExposureInformation(int offsetDays);

public static string ConvertToDate(DateTime utcDatetime)
=> utcDatetime.Date
.ToLocalTime()
.ToString("D", CultureInfo.CurrentCulture);

public static string ConvertToTerm(DateTime utcDatetime)
{
var from = utcDatetime.Date.ToLocalTime();
var to = from.AddDays(1).ToLocalTime();

bool changeMonth = from.Month != to.Month;
bool changeYear = from.Year != to.Year;

string fromFormat = AppResources.ExposureDateFormatMonth;
string toFormat = AppResources.ExposureDateFormatDate;
if (changeMonth)
{
toFormat = AppResources.ExposureDateFormatMonth;
}
if (changeYear)
{
fromFormat = AppResources.ExposureDateFormatYear;
toFormat = AppResources.ExposureDateFormatYear;
}

string fromStr = from.ToString(fromFormat, CultureInfo.CurrentCulture);
string toStr = to.ToString(toFormat, CultureInfo.CurrentCulture);

return string.Format("{0}{1} {2} {3}", AppResources.ExposuresPageFrom, fromStr, AppResources.ExposuresPageTo, toStr);
}
}
}
Loading