Merge pull request #1454 from opf/feature/title-drop=down-refreshes

Feature/title drop=down refreshes
pull/1435/merge
manwithtwowatches 11 years ago
commit d4770290f3
  1. 2
      app/assets/javascripts/angular/controllers/dialogs/share.js
  2. 2
      app/assets/javascripts/angular/directives/components/toggled-multiselect-directive.js
  3. 6
      app/assets/javascripts/angular/services/query-service.js

@ -51,8 +51,6 @@ angular.module('openproject.workPackages.controllers')
.then(function(data){
shareModal.deactivate();
$scope.$emit('flashMessage', data.status);
QueryService.fetchAvailableGroupedQueries($scope.query.project_id);
});
};
}]);

@ -47,7 +47,7 @@ angular.module('openproject.uiComponents')
};
scope.isSelected = function(value) {
return (Array.isArray(scope.values) && (scope.values.indexOf(value) !== -1) || scope.values.indexOf(value.toString()) !== -1);
return (Array.isArray(scope.values) && ((scope.values.indexOf(value) !== -1) || scope.values.indexOf(value.toString()) !== -1));
};
scope.isMultiselect = (Array.isArray(scope.values) && scope.values.length > 1);

@ -305,6 +305,8 @@ angular.module('openproject.services')
saveQuery: function() {
var url = PathHelper.apiProjectQueryPath(query.project_id, query.id);
return QueryService.doQuery(url, query.toUpdateParams(), 'PUT', function(response){
QueryService.fetchAvailableGroupedQueries(query.project_id);
return angular.extend(response.data, { status: { text: I18n.t('js.notice_successful_update') }} );
});
},
@ -314,6 +316,8 @@ angular.module('openproject.services')
var url = PathHelper.apiProjectQueriesPath(query.project_id);
return QueryService.doQuery(url, query.toParams(), 'POST', function(response){
query.save(response.data.query);
QueryService.fetchAvailableGroupedQueries(query.project_id);
return angular.extend(response.data, { status: { text: I18n.t('js.notice_successful_create') }} );
});
},
@ -321,7 +325,9 @@ angular.module('openproject.services')
deleteQuery: function() {
var url = PathHelper.apiProjectQueryPath(query.project_id, query.id);
return QueryService.doQuery(url, query.toUpdateParams(), 'DELETE', function(response){
QueryService.fetchAvailableGroupedQueries(query.project_id);
QueryService.resetQuery();
return angular.extend(response.data, { status: { text: I18n.t('js.notice_successful_delete') }} );
});
},

Loading…
Cancel
Save