mirror of https://github.com/moparisthebest/mail
[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';
|
'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
|
!$routeParams.dev && !auth.isInitialized() && $location.path('/'); // init app
|
||||||
|
|
||||||
// init phone region
|
// init phone region
|
||||||
$scope.region = 'DE';
|
$scope.region = 'DE';
|
||||||
$scope.domain = '@' + appConfig.config.mailServer.domain;
|
$scope.domain = '@' + appConfig.config.mailServer.domain;
|
||||||
|
|
||||||
$scope.createWhiteoutAccount = function() {
|
$scope.showConfirm = function() {
|
||||||
if ($scope.form.$invalid) {
|
if ($scope.form.$invalid) {
|
||||||
$scope.errMsg = 'Please fill out all required fields!';
|
$scope.errMsg = 'Please fill out all required fields!';
|
||||||
return;
|
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) {
|
return $q(function(resolve) {
|
||||||
$scope.busy = true;
|
$scope.busy = true;
|
||||||
$scope.errMsg = undefined; // reset error msg
|
$scope.errMsg = undefined; // reset error msg
|
||||||
|
|
|
@ -294,7 +294,7 @@
|
||||||
<span class="spinner spinner--big"></span>
|
<span class="spinner spinner--big"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form__row">
|
<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>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<p class="typo-paragraph">
|
<p class="typo-paragraph">
|
||||||
|
|
Loading…
Reference in New Issue