Skip to content

Commit

Permalink
Fix minor readonly and submission bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcua committed Mar 21, 2018
1 parent 35df8d8 commit c21e3ab
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions orchestra/static/dist/main.js
Expand Up @@ -42609,7 +42609,11 @@ function orchestraService() {
var success = true;
registered[signalType] = registered[signalType] || [];
registered[signalType].forEach(function (callback) {
success = callback() && success;
// Explicitly check for falsiness in case callback returns
// undefined.
if (callback() === false) {
success = false;
}
});
return success;
}
Expand Down Expand Up @@ -58988,8 +58992,8 @@ function TaskController($location, $scope, $routeParams, $http, $rootScope, auto
});
});

requiredFields.setup(vm);
if (!vm.is_read_only) {
requiredFields.setup(vm);
$scope.$watch('vm.taskAssignment.task.data', function (newVal, oldVal) {
// Ensure save fired at initialization
// [http://stackoverflow.com/a/18915585]
Expand Down Expand Up @@ -59036,7 +59040,7 @@ function TaskController($location, $scope, $routeParams, $http, $rootScope, auto
vm.autoSaver.cancel();
orchestraService.signals.fireSignal('submit.success');
orchestraTasks.updateTasks();
$location.path('/timecard');
$location.path('/');
}).error(function (data, status, headers, config) {
orchestraService.signals.fireSignal('submit.error');
window.alert(data.message);
Expand Down
Expand Up @@ -48,7 +48,11 @@ export function orchestraService () {
var success = true
registered[signalType] = registered[signalType] || []
registered[signalType].forEach(function (callback) {
success = callback() && success
// Explicitly check for falsiness in case callback returns
// undefined.
if (callback() === false) {
success = false
}
})
return success
}
Expand Down
4 changes: 2 additions & 2 deletions orchestra/static/orchestra/task/task.controller.es6.js
Expand Up @@ -24,8 +24,8 @@ export default function TaskController (
})
})

requiredFields.setup(vm)
if (!vm.is_read_only) {
requiredFields.setup(vm)
$scope.$watch('vm.taskAssignment.task.data', function (newVal, oldVal) {
// Ensure save fired at initialization
// [http://stackoverflow.com/a/18915585]
Expand Down Expand Up @@ -80,7 +80,7 @@ export default function TaskController (
vm.autoSaver.cancel()
orchestraService.signals.fireSignal('submit.success')
orchestraTasks.updateTasks()
$location.path('/timecard')
$location.path('/')
})
.error(function (data, status, headers, config) {
orchestraService.signals.fireSignal('submit.error')
Expand Down

0 comments on commit c21e3ab

Please sign in to comment.