misc styling fixes

pull/3392/head
Jens Ulferts 9 years ago
parent ca7d0e7a02
commit c996cca696
  1. 6
      frontend/app/work_packages/controllers/dialogs/save.js
  2. 7
      frontend/app/work_packages/view_models/children-relations-handler.js
  3. 17
      frontend/app/work_packages/view_models/common-relations-handler.js
  4. 4
      frontend/app/work_packages/view_models/index.js

@ -48,8 +48,10 @@ module.exports = function(
else {
// push query id to URL without reinitializing work-packages-list-controller
if (data.query) {
$state.go('work-packages.list', { query_id: data.query.id, query: null }, { notify: false });
AuthorisationService.initModelAuth("query", data.query._links);
$state.go('work-packages.list',
{ query_id: data.query.id, query: null },
{ notify: false });
AuthorisationService.initModelAuth('query', data.query._links);
}
saveModal.deactivate();

@ -26,7 +26,12 @@
// See doc/COPYRIGHT.rdoc for more details.
//++
module.exports = function(PathHelper, CommonRelationsHandler, WorkPackageService, ApiNotificationsService) {
module.exports = function(
PathHelper,
CommonRelationsHandler,
WorkPackageService,
ApiNotificationsService
) {
function ChildrenRelationsHandler(workPackage, children) {
var handler = new CommonRelationsHandler(workPackage, children, undefined);

@ -26,7 +26,13 @@
// See doc/COPYRIGHT.rdoc for more details.
//++
module.exports = function($timeout, WorkPackageService, ApiNotificationsService, PathHelper, MAX_AUTOCOMPLETER_ADDITION_ITERATIONS) {
module.exports = function(
$timeout,
WorkPackageService,
ApiNotificationsService,
PathHelper,
MAX_AUTOCOMPLETER_ADDITION_ITERATIONS
) {
function CommonRelationsHandler(workPackage,
relations,
relationsId) {
@ -34,7 +40,7 @@ module.exports = function($timeout, WorkPackageService, ApiNotificationsService,
this.relations = relations;
this.relationsId = relationsId;
this.type = "relation";
this.type = 'relation';
this.isSingletonRelation = false;
}
@ -56,7 +62,10 @@ module.exports = function($timeout, WorkPackageService, ApiNotificationsService,
},
addRelation: function(scope) {
WorkPackageService.addWorkPackageRelation(this.workPackage, scope.relationToAddId, this.relationsId).then(function(relation) {
WorkPackageService.addWorkPackageRelation(this.workPackage,
scope.relationToAddId,
this.relationsId)
.then(function() {
scope.relationToAddId = '';
scope.updateFocus(-1);
scope.$emit('workPackageRefreshRequired');
@ -89,7 +98,7 @@ module.exports = function($timeout, WorkPackageService, ApiNotificationsService,
getRelatedWorkPackage: function(workPackage, relation) {
var self = workPackage.links.self.href;
if (relation.links.relatedTo.href == self) {
if (relation.links.relatedTo.href === self) {
return relation.links.relatedFrom.fetch();
} else {
return relation.links.relatedTo.fetch();

@ -36,7 +36,9 @@ angular.module('openproject.viewModels')
'MAX_AUTOCOMPLETER_ADDITION_ITERATIONS',
require('./common-relations-handler')
])
.factory('ChildrenRelationsHandler', ['PathHelper', 'CommonRelationsHandler',
.factory('ChildrenRelationsHandler', [
'PathHelper',
'CommonRelationsHandler',
'WorkPackageService',
'ApiNotificationsService',
require('./children-relations-handler')

Loading…
Cancel
Save