1
0
mirror of https://github.com/moparisthebest/mail synced 2024-12-21 23:08:50 -05:00

[WO-906] Show confirm dialog for mobile phone number in account creation

This commit is contained in:
Tankred Hase 2015-04-01 18:29:23 +02:00
parent 8295806b1f
commit 1b8c6b6b8d
2 changed files with 18 additions and 3 deletions

View File

@ -1,18 +1,33 @@
'use strict';
var CreateAccountCtrl = function($scope, $location, $routeParams, $q, auth, admin, appConfig) {
var CreateAccountCtrl = function($scope, $location, $routeParams, $q, auth, admin, appConfig, dialog) {
!$routeParams.dev && !auth.isInitialized() && $location.path('/'); // init app
// init phone region
$scope.region = 'DE';
$scope.domain = '@' + appConfig.config.mailServer.domain;
$scope.createWhiteoutAccount = function() {
$scope.showConfirm = function() {
if ($scope.form.$invalid) {
$scope.errMsg = 'Please fill out all required fields!';
return;
}
return dialog.confirm({
title: 'SMS validation',
message: 'Your mobile phone number will be validated via SMS. Are you sure it\'s correct?',
positiveBtnStr: 'Yes',
negativeBtnStr: 'Check again',
showNegativeBtn: true,
callback: function(granted) {
if (granted) {
$scope.createWhiteoutAccount();
}
}
});
};
$scope.createWhiteoutAccount = function() {
return $q(function(resolve) {
$scope.busy = true;
$scope.errMsg = undefined; // reset error msg

View File

@ -294,7 +294,7 @@
<span class="spinner spinner--big"></span>
</div>
<div class="form__row">
<button class="btn" type="submit" ng-click="createWhiteoutAccount()">Create</button>
<button class="btn" type="submit" ng-click="showConfirm()">Create</button>
</div>
</form>
<p class="typo-paragraph">