[ios] Added downloader migration prohibited dialogue.

This commit is contained in:
Ilya Grechuhin 2016-03-22 16:18:52 +03:00 committed by Sergey Yershov
parent c23f2fb7d5
commit 8b16b65fcd
8 changed files with 37 additions and 3 deletions

View file

@ -6,7 +6,7 @@
@interface MWMAlertViewController : MWMViewController
@property (weak, nonatomic, readonly) UIViewController * ownerViewController;
@property (weak, nonatomic, readonly) UIViewController * _Null_unspecified ownerViewController;
- (nonnull instancetype)initWithViewController:(nonnull UIViewController *)viewController;
- (void)presentAlert:(routing::IRouter::ResultCode)type;
@ -22,6 +22,7 @@
- (void)presentLocationAlert;
- (void)presentLocationServiceNotSupportedAlert;
- (void)presentNoConnectionAlert;
- (void)presentMigrationProhibitedAlert;
- (void)presentUnsavedEditsAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock;
- (void)presentNoWiFiAlertWithName:(nonnull NSString *)name okBlock:(nullable TMWMVoidBlock)okBlock;
- (void)presentPedestrianToastAlert:(BOOL)isFirstLaunch;

View file

@ -82,6 +82,11 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController
[self displayAlert:[MWMAlert noConnectionAlert]];
}
- (void)presentMigrationProhibitedAlert
{
[self displayAlert:[MWMAlert migrationProhibitedAlert]];
}
- (void)presentUnsavedEditsAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock
{
[self displayAlert:[MWMAlert unsavedEditsAlertWithOkBlock:okBlock]];

View file

@ -18,6 +18,7 @@
+ (MWMAlert *)disabledLocationAlert;
+ (MWMAlert *)noWiFiAlertWithName:(NSString *)name okBlock:(TMWMVoidBlock)okBlock;
+ (MWMAlert *)noConnectionAlert;
+ (MWMAlert *)migrationProhibitedAlert;
+ (MWMAlert *)unsavedEditsAlertWithOkBlock:(TMWMVoidBlock)okBlock;
+ (MWMAlert *)locationServiceNotSupportedAlert;
+ (MWMAlert *)pedestrianToastShareAlert:(BOOL)isFirstLaunch;

View file

@ -52,6 +52,11 @@
return [MWMDefaultAlert noConnectionAlert];
}
+ (MWMAlert *)migrationProhibitedAlert
{
return [MWMDefaultAlert migrationProhibitedAlert];
}
+ (MWMAlert *)unsavedEditsAlertWithOkBlock:(TMWMVoidBlock)okBlock
{
return [MWMDefaultAlert unsavedEditsAlertWithOkBlock:okBlock];

View file

@ -15,6 +15,7 @@
+ (instancetype)disabledLocationAlert;
+ (instancetype)noWiFiAlertWithName:(NSString *)name okBlock:(TMWMVoidBlock)okBlock;
+ (instancetype)noConnectionAlert;
+ (instancetype)migrationProhibitedAlert;
+ (instancetype)unsavedEditsAlertWithOkBlock:(TMWMVoidBlock)okBlock;
+ (instancetype)locationServiceNotSupportedAlert;
+ (instancetype)point2PointAlertWithOkBlock:(TMWMVoidBlock)okBlock needToRebuild:(BOOL)needToRebuild;

View file

@ -74,6 +74,18 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert";
return alert;
}
+ (instancetype)migrationProhibitedAlert
{
kStatisticsEvent = @"Migration Prohibited Alert";
MWMDefaultAlert * alert = [self defaultAlertWithTitle:@"navigation_migration_prohibited_error"
message:nil
rightButtonTitle:@"ok"
leftButtonTitle:nil
rightButtonAction:nil];
[alert setNeedsCloseAlertAfterEnterBackground];
return alert;
}
+ (instancetype)unsavedEditsAlertWithOkBlock:(TMWMVoidBlock)okBlock
{
kStatisticsEvent = @"Editor unsaved changes on delete";

View file

@ -257,8 +257,16 @@ extern NSString * const kAlohalyticsTapEventKey;
{
if (platform::migrate::NeedMigrate())
{
[Statistics logEvent:kStatDownloaderMigrationDialogue withParameters:@{kStatFrom : kStatDownloader}];
[self.ownerController openMigration];
if (GetFramework().IsRoutingActive())
{
[Statistics logEvent:kStatDownloaderMigrationProhibitedDialogue withParameters:@{kStatFrom : kStatDownloader}];
[self.alertController presentMigrationProhibitedAlert];
}
else
{
[Statistics logEvent:kStatDownloaderMigrationDialogue withParameters:@{kStatFrom : kStatDownloader}];
[self.ownerController openMigration];
}
}
else
{

View file

@ -62,6 +62,7 @@ static NSString * const kStatDownloaderMapError = @"Downloader_Map_error";
static NSString * const kStatDownloaderMigrationCompleted = @"Downloader_Migration_completed";
static NSString * const kStatDownloaderMigrationDialogue = @"Downloader_Migration_dialogue";
static NSString * const kStatDownloaderMigrationError = @"Downloader_Migration_error";
static NSString * const kStatDownloaderMigrationProhibitedDialogue = @"Downloader_Migration_Prohibited_dialogue";
static NSString * const kStatDownloaderMigrationStarted = @"Downloader_Migration_started";
static NSString * const kStatEdit = @"Edit";
static NSString * const kStatEditorSecondTimeShareClick = @"Editor_SecondTimeShare_click";