Commit 7e22ac83 authored by Colin PUY's avatar Colin PUY

Display icon marker on repeated container, custom widgets and fragments

parent e188fdd1
......@@ -101,4 +101,8 @@ angular.module('bonitasoft.designer.editor.whiteboard').controller('ContainerDir
$scope.isEmpty = function(container) {
return componentUtils.isEmpty(container);
};
$scope.isRepeated = function(container) {
return container && container.propertyValues && container.propertyValues.repeatedCollection && container.propertyValues.repeatedCollection.value;
};
});
<div class="widget-wrapper">
<i ng-if="isRepeated(container)" class="fa fa-list-ul Component-marker" title="{{ 'Repeated container' | translate }}"></i>
<component-mover component="container" on-delete="editor.removeCurrentComponent()" ng-if="editor.isCurrentComponent(container)"></component-mover>
<div ng-repeat="row in container.rows" ng-init="rowIndex = $index" >
......
......@@ -209,3 +209,16 @@
.tab-title {
margin: 0 5px;
}
.Component-marker {
position: absolute;
z-index: 99;
right: 1.4em;
top: 0.5em;
color: #aaa;;
background-color: transparent;
}
.component-element--selected .Component-marker {
color: @widget-active-color;
}
......@@ -69,6 +69,33 @@ describe('ContainerDirectiveCtrl', function() {
expect($scope.isEmpty(container)).toBeFalsy();
});
it('should verify that a container is repeated when property value repeatedCollection has a value', function() {
init();
var container = {
propertyValues: {
repeatedCollection: {
value: 'aValue'
}
}
};
expect($scope.isRepeated(container)).toBeTruthy();
});
it('should verify that a container is not repeated otherwise', function() {
init();
var container = {
propertyValues: {
repeatedCollection: {
value: ''
}
}
};
expect($scope.isRepeated(container)).toBeFalsy();
expect($scope.isRepeated({})).toBeFalsy();
});
describe('We can move rows', function() {
beforeEach(function() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment