domain remove does not require password

This commit is contained in:
Girish Ramakrishnan
2019-05-20 18:41:08 -07:00
parent a80c21d77f
commit 23b72620a1
3 changed files with 6 additions and 29 deletions

View File

@@ -187,24 +187,11 @@
<h4 class="modal-title">Really remove {{ domainRemove.domain.domain }} ?</h4>
</div>
<div class="modal-body">
<fieldset>
<form role="form" name="domainRemoveForm" ng-submit="domainRemove.submit()" autocomplete="off">
<div class="form-group" ng-class="{ 'has-error': (domainRemoveForm.password.$dirty && domainRemoveForm.password.$invalid) || (!domainRemoveForm.password.$dirty && domainRemove.error) }">
<label class="control-label">Provide your password to confirm this action</label>
<div class="control-label" ng-show="(domainRemoveForm.password.$dirty && domainRemoveForm.password.$invalid) || (!domainRemoveForm.password.$dirty && domainRemove.error)">
<small ng-show=" domainRemoveForm.password.$dirty && domainRemoveForm.password.$invalid">Password required</small>
<small ng-show="!domainRemoveForm.password.$dirty && domainRemove.error">{{ domainRemove.error }}</small>
</div>
<input type="password" class="form-control" ng-model="domainRemove.password" id="domainRemovePasswordInput" name="password" required autofocus>
</div>
<input class="ng-hide" type="submit" ng-disabled="domainRemoveForm.$invalid || busy"/>
</form>
</fieldset>
This will delete the domain {{ domainRemove.domain.domain }}.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-danger" ng-click="domainRemove.submit()" ng-disabled="domainRemoveForm.$invalid || domainRemove.busy"><i class="fa fa-circle-notch fa-spin" ng-show="domainRemove.busy"></i> Remove</button>
<button type="button" class="btn btn-danger" ng-click="domainRemove.submit()" ng-disabled="domainRemove.busy"><i class="fa fa-circle-notch fa-spin" ng-show="domainRemove.busy"></i> Remove</button>
</div>
</div>
</div>

View File

@@ -378,7 +378,6 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
busy: false,
error: null,
domain: null,
password: '',
show: function (domain) {
$scope.domainRemove.reset();
@@ -392,12 +391,9 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
$scope.domainRemove.busy = true;
$scope.domainRemove.error = null;
Client.removeDomain($scope.domainRemove.domain.domain, $scope.domainRemove.password, function (error) {
Client.removeDomain($scope.domainRemove.domain.domain, function (error) {
if (error && (error.statusCode === 403 || error.statusCode === 409)) {
$scope.domainRemove.password = '';
$scope.domainRemove.error = error.message;
$scope.domainRemoveForm.password.$setPristine();
$('#domainRemovePasswordInput').focus();
} else if (error) {
Client.error(error);
} else {
@@ -415,10 +411,6 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
$scope.domainRemove.busy = false;
$scope.domainRemove.error = null;
$scope.domainRemove.domain = null;
$scope.domainRemove.password = '';
$scope.domainRemoveForm.$setPristine();
$scope.domainRemoveForm.$setUntouched();
}
};