Move WP toolbar directive to components

pull/4010/head
Alex Dik 9 years ago
parent 2f5202aa19
commit 7767feb66e
  1. 2
      frontend/app/components/routing/views/work-packages.list.html
  2. 2
      frontend/app/components/routing/views/work-packages.show.html
  3. 24
      frontend/app/components/work-packages/directives/wp-toolbar/wp-toolbar.directive.js
  4. 12
      frontend/app/components/work-packages/directives/wp-toolbar/wp-toolbar.directive.test.js
  5. 1
      frontend/app/ui_components/index.js

@ -1,5 +1,5 @@
<div class="toolbar-container">
<div toolbar class="toolbar">
<div wp-toolbar class="toolbar">
<selectable-title focus
selected-title="selectedTitle"
groups="groups"

@ -1,6 +1,6 @@
<div class="work-packages--show-view" ng-class="{'edit-all-mode': editAll.state}">
<div class="toolbar-container">
<div toolbar id="toolbar">
<div wp-toolbar id="toolbar">
<ul id="toolbar-items" class="toolbar-items">
<li class="toolbar-item">
<wp-create-button project-identifier="projectIdentifier"

@ -1,4 +1,4 @@
//-- copyright
// -- copyright
// OpenProject is a project management system.
// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
//
@ -24,13 +24,17 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See doc/COPYRIGHT.rdoc for more details.
//++
// ++
// TODO move to UI components
module.exports = function() {
return {
restrict: 'EA',
link: function(scope, element, attributes) {
}
};
};
angular
.module('openproject.uiComponents')
.directive('wpToolbar', wpToolbar);
function wpToolbar() {
return {
restrict: 'A',
link: function(scope, element, attributes) {
}
};
}

@ -1,4 +1,4 @@
//-- copyright
// -- copyright
// OpenProject is a project management system.
// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
//
@ -24,19 +24,17 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See doc/COPYRIGHT.rdoc for more details.
//++
/*jshint expr: true*/
// ++
describe('toolbar Directive', function() {
var compile, element, rootScope, scope;
beforeEach(angular.mock.module('openproject.uiComponents'));
beforeEach(module('openproject.templates'));
beforeEach(angular.mock.module('openproject.templates'));
beforeEach(inject(function($rootScope, $compile) {
beforeEach(angular.mock.inject(function($rootScope, $compile) {
var html;
html = '<div toolbar></div>';
html = '<div wp-toolbar></div>';
element = angular.element(html);
rootScope = $rootScope;

@ -98,7 +98,6 @@ angular.module('openproject.uiComponents')
'./sort-link-directive')])
.directive('toggledMultiselect', ['I18n', require(
'./toggled-multiselect-directive')])
.directive('toolbar', require('./toolbar-directive'))
.constant('ESC_KEY', 27)
.directive('userField', ['PathHelper', require('./user-field-directive')])
.directive('wikiToolbar', [require('./wiki-toolbar-directive')])

Loading…
Cancel
Save