mirror of
https://github.com/nextcloud/passman.git
synced 2025-11-11 06:31:58 +08:00
Fix disabled edit save button after 2 different password entered. Fixes #370
This commit is contained in:
parent
812c88ec8c
commit
9a29e8ed82
3 changed files with 15 additions and 11 deletions
|
|
@ -186,13 +186,12 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.addFileToCustomField = function (file) {
|
$scope.addFileToCustomField = function (file) {
|
||||||
var _file = {
|
$scope.new_custom_field.value = {
|
||||||
filename: file.name,
|
filename: file.name,
|
||||||
size: file.size,
|
size: file.size,
|
||||||
mimetype: file.type,
|
mimetype: file.type,
|
||||||
data: file.data
|
data: file.data
|
||||||
};
|
};
|
||||||
$scope.new_custom_field.value = _file;
|
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -291,8 +290,9 @@
|
||||||
};
|
};
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
};
|
};
|
||||||
|
$scope.saving = false;
|
||||||
$scope.saveCredential = function () {
|
$scope.saveCredential = function () {
|
||||||
|
$scope.saving = true;
|
||||||
|
|
||||||
|
|
||||||
if ($scope.new_custom_field.label && $scope.new_custom_field.value) {
|
if ($scope.new_custom_field.label && $scope.new_custom_field.value) {
|
||||||
|
|
@ -301,7 +301,8 @@
|
||||||
|
|
||||||
|
|
||||||
if ($scope.storedCredential.password !== $scope.storedCredential.password_repeat){
|
if ($scope.storedCredential.password !== $scope.storedCredential.password_repeat){
|
||||||
NotificationService.showNotification($translate.instant('password.do.not.match'), 5000);
|
$scope.saving = false;
|
||||||
|
NotificationService.showNotification($translate.instant('password.do.not.match'), 5000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -312,8 +313,10 @@
|
||||||
if (!$scope.storedCredential.credential_id) {
|
if (!$scope.storedCredential.credential_id) {
|
||||||
$scope.storedCredential.vault_id = $scope.active_vault.vault_id;
|
$scope.storedCredential.vault_id = $scope.active_vault.vault_id;
|
||||||
CredentialService.createCredential($scope.storedCredential).then(function () {
|
CredentialService.createCredential($scope.storedCredential).then(function () {
|
||||||
|
$scope.saving = false;
|
||||||
$location.path('/vault/' + $routeParams.vault_id);
|
$location.path('/vault/' + $routeParams.vault_id);
|
||||||
NotificationService.showNotification($translate.instant('credential.created'), 5000);
|
NotificationService.showNotification($translate.instant('credential.created'), 5000);
|
||||||
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
@ -342,6 +345,7 @@
|
||||||
_credential.description = _credential.description.replace(regex, "");
|
_credential.description = _credential.description.replace(regex, "");
|
||||||
}
|
}
|
||||||
CredentialService.updateCredential(_credential, _useKey).then(function () {
|
CredentialService.updateCredential(_credential, _useKey).then(function () {
|
||||||
|
$scope.saving = false;
|
||||||
SettingsService.setSetting('edit_credential', null);
|
SettingsService.setSetting('edit_credential', null);
|
||||||
$location.path('/vault/' + $routeParams.vault_id);
|
$location.path('/vault/' + $routeParams.vault_id);
|
||||||
NotificationService.showNotification($translate.instant('credential.updated'), 5000);
|
NotificationService.showNotification($translate.instant('credential.updated'), 5000);
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ angular.module('views/credential_revisions.html', []).run(['$templateCache', fun
|
||||||
angular.module('views/edit_credential.html', []).run(['$templateCache', function ($templateCache) {
|
angular.module('views/edit_credential.html', []).run(['$templateCache', function ($templateCache) {
|
||||||
'use strict';
|
'use strict';
|
||||||
$templateCache.put('views/edit_credential.html',
|
$templateCache.put('views/edit_credential.html',
|
||||||
'<div id="controls"><div class="actions creatable"><div class="breadcrumb"><div class="crumb svg ui-droppable" data-dir="/"><a ng-click="logout()"><i class="fa fa-home"></i></a></div><div class="crumb svg" data-dir="/Test"><a ng-click="cancel()">{{active_vault.name}}</a></div><div class="crumb svg last" data-dir="/Test"><a ng-if="storedCredential.credential_id">{{ \'edit.credential\' | translate}} "{{storedCredential.label}}"</a> <a ng-if="!storedCredential.credential_id">{{ \'create.credential\' | translate}}</a></div></div></div></div><ul class="tab_header"><li ng-repeat="tab in tabs track by $index" class="tab" ng-class="{active:isActiveTab(tab)}" ng-click="onClickTab(tab)" use-theme color="\'true\'">{{tab.title}}<div class="indicator" use-theme negative="\'true\'"></div></li></ul><div class="tab_container edit_credential" use-theme type="\'border-top-color\'"><div ng-include="currentTab.url"></div><button ng-click="saveCredential()" click-disable>{{ \'save\' | translate}}</button> <button ng-click="cancel()">{{ \'cancel\' | translate}}</button></div>');
|
'<div id="controls"><div class="actions creatable"><div class="breadcrumb"><div class="crumb svg ui-droppable" data-dir="/"><a ng-click="logout()"><i class="fa fa-home"></i></a></div><div class="crumb svg" data-dir="/Test"><a ng-click="cancel()">{{active_vault.name}}</a></div><div class="crumb svg last" data-dir="/Test"><a ng-if="storedCredential.credential_id">{{ \'edit.credential\' | translate}} "{{storedCredential.label}}"</a> <a ng-if="!storedCredential.credential_id">{{ \'create.credential\' | translate}}</a></div></div></div></div><ul class="tab_header"><li ng-repeat="tab in tabs track by $index" class="tab" ng-class="{active:isActiveTab(tab)}" ng-click="onClickTab(tab)" use-theme color="\'true\'">{{tab.title}}<div class="indicator" use-theme negative="\'true\'"></div></li></ul><div class="tab_container edit_credential" use-theme type="\'border-top-color\'"><div ng-include="currentTab.url"></div><button ng-click="saveCredential()" ng-disabled="saving"><i class="fa fa-spinner fa-spin" ng-show="saving"></i> {{ \'save\' | translate}}</button> <button ng-click="cancel()">{{ \'cancel\' | translate}}</button></div>');
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
angular.module('views/partials/credential_template.html', []).run(['$templateCache', function ($templateCache) {
|
angular.module('views/partials/credential_template.html', []).run(['$templateCache', function ($templateCache) {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,6 @@
|
||||||
|
|
||||||
<div class="tab_container edit_credential" use-theme type="'border-top-color'">
|
<div class="tab_container edit_credential" use-theme type="'border-top-color'">
|
||||||
<div ng-include="currentTab.url"></div>
|
<div ng-include="currentTab.url"></div>
|
||||||
<button ng-click="saveCredential()" click-disable>{{ 'save' | translate}}</button>
|
<button ng-click="saveCredential()" ng-disabled="saving"><i class="fa fa-spinner fa-spin" ng-show="saving"></i> {{ 'save' | translate}}</button>
|
||||||
<button ng-click="cancel()">{{ 'cancel' | translate}}</button>
|
<button ng-click="cancel()">{{ 'cancel' | translate}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue