Move wp-group-header to wp-table components

pull/3956/head
Alex Dik 9 years ago
parent 48464a285c
commit a3b8533a49
  1. 16
      frontend/app/components/wp-table/directives/wp-group-header/wp-group-header.directive.js
  2. 8
      frontend/app/components/wp-table/directives/wp-group-header/wp-group-header.directive.test.js
  3. 4
      frontend/app/components/wp-table/directives/wp-row/wp-row.directive.js
  4. 2
      frontend/app/components/wp-table/directives/wp-table/wp-table.directive.html
  5. 2
      frontend/app/work_packages/directives/index.js

@ -1,4 +1,4 @@
//-- copyright
// -- copyright
// OpenProject is a project management system.
// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
//
@ -24,15 +24,19 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See doc/COPYRIGHT.rdoc for more details.
//++
// ++
module.exports = function() {
angular
.module('openproject.workPackages.directives')
.directive('wpGroupHeader', wpGroupHeader);
function wpGroupHeader() {
return {
restrict: 'A',
compile: function(tElement) {
compile: function() {
return {
pre: function(scope, iElement, iAttrs, controller) {
pre: function(scope) {
scope.currentGroup = scope.row.groupName;
pushGroup(scope.currentGroup);
@ -50,4 +54,4 @@ module.exports = function() {
};
}
};
};
}

@ -1,4 +1,4 @@
//-- copyright
// -- copyright
// OpenProject is a project management system.
// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
//
@ -24,7 +24,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See doc/COPYRIGHT.rdoc for more details.
//++
// ++
/*jshint expr: true*/
@ -32,11 +32,11 @@ describe('workPackageGroupHeader Directive', function() {
var compile, element, rootScope, scope;
beforeEach(angular.mock.module('openproject.workPackages.directives'));
beforeEach(module('openproject.templates'));
beforeEach(angular.mock.module('openproject.templates'));
beforeEach(inject(function($rootScope, $compile) {
var html;
html = '<tr work-package-group-header><td>{{ row["group_name"] }}</td></tr>';
html = '<tr wp-group-header><td>{{ row["group_name"] }}</td></tr>';
element = angular.element(html);
rootScope = $rootScope;

@ -27,8 +27,8 @@
// ++
angular
.module('openproject.wokrPackages.directives')
.directives('wpRow', wpRow);
.module('openproject.workPackages.directives')
.directive('wpRow', wpRow);
function wpRow(WorkPackagesTableService){

@ -40,7 +40,7 @@
<!-- Group headers -->
<tr work-package-group-header
<tr wp-group-header
ng-repeat-start="row in rows"
ng-if="!!groupByColumn &&
($first || row.groupName !== rows[$index-1].groupName)"

@ -76,8 +76,6 @@ angular.module('openproject.workPackages.directives')
])
.directive('workPackageDynamicAttribute', ['$compile', require(
'./work-package-dynamic-attribute-directive')])
.directive('workPackageGroupHeader', require(
'./work-package-group-header-directive'))
.directive('workPackageGroupSums', require(
'./work-package-group-sums-directive'))
.directive('workPackageTotalSums', [

Loading…
Cancel
Save