Use default loading of table for details pane (#4335)

pull/4339/head
Oliver Günther 9 years ago
parent c7f7b17088
commit 386d4b53e7
  1. 3
      frontend/app/components/routing/wp-details/wp-details.controller.js
  2. 6
      frontend/app/components/routing/wp-list/wp-list.controller.ts
  3. 3
      frontend/app/components/routing/wp-show/wp-show.controller.js
  4. 35
      frontend/app/components/wp-table/wp-td/wp-td.directive.js
  5. 5
      frontend/app/components/wp-table/wp-td/wp-td.directive.test.js

@ -54,9 +54,6 @@ function WorkPackageDetailsController($scope, $state, workPackage, I18n, RELATIO
$scope.$broadcast('workPackageRefreshed');
});
}
// Inform parent that work package is loaded so back url can be maintained
$scope.$emit('workPackgeLoaded');
function outputMessage(message, isError) {
if (!!isError) {
NotificationsService.addError(message);

@ -236,12 +236,6 @@ function WorkPackagesListController($scope,
});
$rootScope.$on('queryClearRequired', _ => wpListService.clearUrlQueryParams);
$rootScope.$on('workPackgeLoaded', function () {
wpListService.fromQueryInstance($scope.query, $scope.projectIdentifier)
.then(function (json:api.ex.WorkPackagesMeta) {
setupWorkPackagesTable(json);
});
});
function nextAvailableWorkPackage() {
var selected = WorkPackageService.cache().get('preselectedWorkPackageId');

@ -135,9 +135,6 @@ function WorkPackageShowController($scope, $rootScope, $state, workPackage, I18n
});
}
// Inform parent that work package is loaded so back url can be maintained
$scope.$emit('workPackgeLoaded');
function outputMessage(message, isError) {
$scope.$emit('flashMessage', {
isError: !!isError,

@ -67,30 +67,27 @@ function WorkPackageTdController($scope, I18n, PathHelper, WorkPackagesHelper) {
}
function updateAttribute() {
if (!vm.schema[vm.attribute]) {
return;
}
if (vm.object.isNew && vm.attribute === 'id') {
vm.displayText = 'text';
vm.displayText = I18n.t('js.work_packages.placeholders.new_label');
return;
}
vm.schema.$load().then(function() {
if (vm.object.isNew && vm.attribute === 'id') {
vm.displayText = 'text';
vm.displayText = I18n.t('js.work_packages.placeholders.new_label');
return;
}
if (!vm.object[vm.attribute] ) {
vm.displayText = I18n.t('js.work_packages.placeholders.default');
return;
}
if (!vm.object[vm.attribute] ) {
vm.displayText = I18n.t('js.work_packages.placeholders.default');
return;
}
setDisplayType();
setDisplayType();
var text = vm.object[vm.attribute].value ||
vm.object[vm.attribute].name ||
vm.object[vm.attribute];
var text = vm.object[vm.attribute].value ||
vm.object[vm.attribute].name ||
vm.object[vm.attribute];
vm.displayText = WorkPackagesHelper.formatValue(text, vm.displayType);
vm.displayText = WorkPackagesHelper.formatValue(text, vm.displayType);
});
}
$scope.$watch('vm.object.' + vm.attribute, updateAttribute);
$scope.$watch('vm.schema.$loaded', updateAttribute);
}

@ -60,7 +60,7 @@ describe('wpTd Directive', function() {
};
describe('element', function() {
beforeEach(function() {
beforeEach(inject(function($q) {
scope.workPackage = {
subject: 'Subject1',
type: { id: 1, name: 'Bug'},
@ -68,6 +68,7 @@ describe('wpTd Directive', function() {
customField1: 'asdf1234',
};
scope.schema = {
"$load": function() { return $q.when(true); },
"_type": "Schema",
"type": {
"type": "Type",
@ -104,7 +105,7 @@ describe('wpTd Directive', function() {
"writable": true
}
};
});
}));
describe('rendering an object field', function(){
beforeEach(function(){

Loading…
Cancel
Save