Merge pull request #1851 from getredash/fix/alerts

Don't allow saving dashboard with empty name
This commit is contained in:
Arik Fraimovich 2017-06-28 19:30:23 +03:00 committed by GitHub
commit fae1e7152a
2 changed files with 4 additions and 2 deletions

View File

@ -17,5 +17,5 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" ng-disabled="$ctrl.saveInProgress" ng-click="$ctrl.dismiss()">Close</button>
<button type="button" class="btn btn-primary" ng-disabled="$ctrl.saveInProgress" ng-click="$ctrl.saveDashboard()">Save</button>
<button type="button" class="btn btn-primary" ng-disabled="$ctrl.saveInProgress || !$ctrl.isFormValid()" ng-click="$ctrl.saveDashboard()">Save</button>
</div>

View File

@ -1,4 +1,4 @@
import { sortBy } from 'underscore';
import { isEmpty, sortBy } from 'underscore';
import template from './edit-dashboard-dialog.html';
const EditDashboardDialog = {
@ -45,6 +45,8 @@ const EditDashboardDialog = {
});
}
this.isFormValid = () => !isEmpty(this.dashboard.name);
this.saveDashboard = () => {
this.saveInProgress = true;