mirror of
https://github.com/moparisthebest/mail
synced 2024-12-22 07:18:49 -05:00
[WO-906] Show confirm dialog for mobile phone number in account creation
This commit is contained in:
parent
8295806b1f
commit
1b8c6b6b8d
@ -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
|
||||
|
@ -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">
|
||||
|
Loading…
Reference in New Issue
Block a user