Commit 929024a2 authored by abirembaut's avatar abirembaut Committed by GitHub

feat (Modal Container) add new UID container (#2530)

- Open an close modal on Button
- Add animation properties for modal
- reorganize palette
- Add outset border-style to differenciate modal in editor

Covers [BS-18773](https://bonitasoft.atlassian.net/browse/BS-18773)
Covers [BS-18780](https://bonitasoft.atlassian.net/browse/BS-18780)
parent d800f768
......@@ -43,6 +43,7 @@ import org.bonitasoft.web.designer.model.JacksonObjectMapper;
import org.bonitasoft.web.designer.model.page.Component;
import org.bonitasoft.web.designer.model.page.Container;
import org.bonitasoft.web.designer.model.page.FormContainer;
import org.bonitasoft.web.designer.model.page.ModalContainer;
import org.bonitasoft.web.designer.model.page.Page;
import org.bonitasoft.web.designer.model.page.TabsContainer;
import org.bonitasoft.web.designer.model.widget.Widget;
......@@ -87,7 +88,7 @@ public class DesignerConfig {
@Bean
public Class[] jacksonSubTypes() {
return new Class[]{Component.class, Container.class, FormContainer.class, TabsContainer.class};
return new Class[]{Component.class, Container.class, FormContainer.class, TabsContainer.class, ModalContainer.class};
}
@Bean
......
/**
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.web.designer.model.page;
import static org.apache.commons.lang3.builder.ToStringStyle.SHORT_PREFIX_STYLE;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonView;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.bonitasoft.web.designer.model.JsonViewPersistence;
import org.bonitasoft.web.designer.visitor.ElementVisitor;
@JsonTypeName("modalContainer")
public class ModalContainer extends Component {
private String controller;
private Container container = new Container();
// We override this id to make import of old pages enable. We do this to fix faster.
// It would be better to create a migration step for each page or widget
// This migration step will be migrate all element before 1.4.21 to add id for each type container.
@Override
public String getId() {
return "pbModalContainer";
}
@JsonView({JsonViewPersistence.class})
public String getController() {
return controller;
}
public void setController(String controller) {
this.controller = controller;
}
public <T> T accept(ElementVisitor<T> visitor) {
return visitor.visit(this);
}
@Override
public boolean equals(final Object obj) {
if (obj instanceof ModalContainer) {
final ModalContainer other = (ModalContainer) obj;
return new EqualsBuilder()
.append(container, other.container)
.append(getDimension(), other.getDimension())
.append(getPropertyValues(), other.getPropertyValues())
.isEquals();
} else {
return false;
}
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37)
.append(container)
.append(getDimension())
.append(getPropertyValues())
.toHashCode();
}
@Override
public String toString() {
return new ToStringBuilder(this, SHORT_PREFIX_STYLE)
.append("container", container)
.append("dimension", getDimension())
.append("propertyValues", getPropertyValues())
.toString();
}
@JsonView({JsonViewPersistence.class})
public Container getContainer() {
return container;
}
public ModalContainer setContainer(Container container) {
this.container = container;
return this;
}
}
......@@ -24,6 +24,7 @@ import org.bonitasoft.web.designer.model.page.Component;
import org.bonitasoft.web.designer.model.page.Container;
import org.bonitasoft.web.designer.model.page.Element;
import org.bonitasoft.web.designer.model.page.FormContainer;
import org.bonitasoft.web.designer.model.page.ModalContainer;
import org.bonitasoft.web.designer.model.page.Previewable;
import org.bonitasoft.web.designer.model.page.Tab;
import org.bonitasoft.web.designer.model.page.TabsContainer;
......@@ -57,6 +58,11 @@ public class AnyLocalContainerVisitor implements ElementVisitor<Iterable<Element
})));
}
@Override
public Iterable<Element> visit(ModalContainer modalContainer) {
return concat(singletonList(modalContainer), modalContainer.getContainer().accept(this));
}
@Override
public Iterable<Element> visit(Component component) {
return emptyList();
......
......@@ -29,6 +29,7 @@ import org.bonitasoft.web.designer.model.page.Component;
import org.bonitasoft.web.designer.model.page.Container;
import org.bonitasoft.web.designer.model.page.Element;
import org.bonitasoft.web.designer.model.page.FormContainer;
import org.bonitasoft.web.designer.model.page.ModalContainer;
import org.bonitasoft.web.designer.model.page.Previewable;
import org.bonitasoft.web.designer.model.page.Tab;
import org.bonitasoft.web.designer.model.page.TabsContainer;
......@@ -81,6 +82,14 @@ public class AssetVisitor implements ElementVisitor<Set<Asset>> {
return widget.getAssets();
}
@Override
public Set<Asset> visit(ModalContainer modalContainer) {
Set<Asset> assets = new HashSet<>();
assets.addAll(linkAssetToComponent(modalContainer.getId()));
assets.addAll(modalContainer.getContainer().accept(this));
return assets;
}
private List<Asset> linkAssetToComponent(String id) {
Widget widget = widgetRepository.get(id);
return widget.getAssets().stream().map(asset -> {
......
......@@ -26,6 +26,7 @@ import org.bonitasoft.web.designer.model.page.Component;
import org.bonitasoft.web.designer.model.page.Container;
import org.bonitasoft.web.designer.model.page.Element;
import org.bonitasoft.web.designer.model.page.FormContainer;
import org.bonitasoft.web.designer.model.page.ModalContainer;
import org.bonitasoft.web.designer.model.page.Previewable;
import org.bonitasoft.web.designer.model.page.Tab;
import org.bonitasoft.web.designer.model.page.TabsContainer;
......@@ -69,6 +70,11 @@ public class AuthRulesCollector implements ElementVisitor<Set<String>> {
return authRules;
}
@Override
public Set<String> visit(ModalContainer modalContainer) {
return modalContainer.getContainer().accept(this);
}
@Override
public <P extends Previewable & Identifiable> Set<String> visit(P previewable) {
return visitRows(previewable.getRows());
......
......@@ -23,6 +23,7 @@ import org.bonitasoft.web.designer.model.page.Component;
import org.bonitasoft.web.designer.model.page.Container;
import org.bonitasoft.web.designer.model.page.Element;
import org.bonitasoft.web.designer.model.page.FormContainer;
import org.bonitasoft.web.designer.model.page.ModalContainer;
import org.bonitasoft.web.designer.model.page.Previewable;
import org.bonitasoft.web.designer.model.page.Tab;
import org.bonitasoft.web.designer.model.page.TabsContainer;
......@@ -60,6 +61,11 @@ public class ComponentVisitor implements ElementVisitor<Iterable<Component>> {
}));
}
@Override
public Iterable<Component> visit(ModalContainer modalContainer) {
return modalContainer.getContainer().accept(this);
}
@Override
public Iterable<Component> visit(Component component) {
return singleton(component);
......
......@@ -26,6 +26,7 @@ import org.bonitasoft.web.designer.model.page.Component;
import org.bonitasoft.web.designer.model.page.Container;
import org.bonitasoft.web.designer.model.page.Element;
import org.bonitasoft.web.designer.model.page.FormContainer;
import org.bonitasoft.web.designer.model.page.ModalContainer;
import org.bonitasoft.web.designer.model.page.Previewable;
import org.bonitasoft.web.designer.model.page.Tab;
import org.bonitasoft.web.designer.model.page.TabsContainer;
......@@ -76,6 +77,11 @@ public class DataModelVisitor implements ElementVisitor<Map<String, Map<String,
return data;
}
@Override
public Map<String, Map<String, Data>> visit(ModalContainer modalContainer) {
return modalContainer.getContainer().accept(this);
}
public <P extends Previewable & Identifiable> String generate(P previewable) {
return new TemplateEngine("factory.hbs.js")
.with("name", "dataModel")
......
......@@ -18,6 +18,7 @@ import org.bonitasoft.web.designer.model.Identifiable;
import org.bonitasoft.web.designer.model.page.Component;
import org.bonitasoft.web.designer.model.page.Container;
import org.bonitasoft.web.designer.model.page.FormContainer;
import org.bonitasoft.web.designer.model.page.ModalContainer;
import org.bonitasoft.web.designer.model.page.Previewable;
import org.bonitasoft.web.designer.model.page.TabsContainer;
......@@ -34,6 +35,8 @@ public interface ElementVisitor<T> {
T visit(TabsContainer tabsContainer);
T visit(ModalContainer modalContainer);
T visit(Component component);
<P extends Previewable & Identifiable> T visit(P previewable);
......
......@@ -15,7 +15,8 @@
package org.bonitasoft.web.designer.visitor;
import static com.google.common.collect.Iterables.concat;
import static org.bonitasoft.web.designer.model.widget.BondType.*;
import static org.bonitasoft.web.designer.model.widget.BondType.CONSTANT;
import static org.bonitasoft.web.designer.model.widget.BondType.EXPRESSION;
import java.util.List;
......@@ -23,13 +24,13 @@ import org.bonitasoft.web.designer.model.page.Component;
import org.bonitasoft.web.designer.model.page.Container;
import org.bonitasoft.web.designer.model.page.Element;
import org.bonitasoft.web.designer.model.page.FormContainer;
import org.bonitasoft.web.designer.model.page.ModalContainer;
import org.bonitasoft.web.designer.model.page.Previewable;
import org.bonitasoft.web.designer.model.page.PropertyValue;
import org.bonitasoft.web.designer.model.page.Tab;
import org.bonitasoft.web.designer.model.page.TabsContainer;
import org.bonitasoft.web.designer.model.widget.BondType;
import org.bonitasoft.web.designer.model.widget.Property;
import org.bonitasoft.web.designer.visitor.ElementVisitor;
public class FixBondsTypesVisitor implements ElementVisitor<Void> {
......@@ -61,6 +62,12 @@ public class FixBondsTypesVisitor implements ElementVisitor<Void> {
return null;
}
@Override
public Void visit(ModalContainer modalContainer) {
visit(modalContainer.getContainer());
return null;
}
@Override
public Void visit(Component component) {
for (Property property : properties) {
......
......@@ -31,6 +31,7 @@ import org.bonitasoft.web.designer.model.page.Component;
import org.bonitasoft.web.designer.model.page.Container;
import org.bonitasoft.web.designer.model.page.Element;
import org.bonitasoft.web.designer.model.page.FormContainer;
import org.bonitasoft.web.designer.model.page.ModalContainer;
import org.bonitasoft.web.designer.model.page.Page;
import org.bonitasoft.web.designer.model.page.Previewable;
import org.bonitasoft.web.designer.model.page.Tab;
......@@ -62,11 +63,11 @@ public class HtmlBuilderVisitor implements ElementVisitor<String> {
private AssetRepository<Widget> widgetAssetRepository;
public HtmlBuilderVisitor(List<PageFactory> pageFactories,
RequiredModulesVisitor requiredModulesVisitor,
AssetVisitor assetVisitor,
DirectivesCollector directivesCollector,
AssetRepository<Page> pageAssetRepository,
AssetRepository<Widget> widgetAssetRepository) {
RequiredModulesVisitor requiredModulesVisitor,
AssetVisitor assetVisitor,
DirectivesCollector directivesCollector,
AssetRepository<Page> pageAssetRepository,
AssetRepository<Widget> widgetAssetRepository) {
this.pageFactories = pageFactories;
this.requiredModulesVisitor = requiredModulesVisitor;
this.assetVisitor = assetVisitor;
......@@ -103,6 +104,14 @@ public class HtmlBuilderVisitor implements ElementVisitor<String> {
.build(tabsContainer);
}
@Override
public String visit(ModalContainer modalContainer) {
return new TemplateEngine("modalContainer.hbs.html")
.with("content", modalContainer.getContainer().accept(this))
.with("modalidHtml", modalContainer.getPropertyValues().get("modalId").getValue())
.build(modalContainer);
}
@Override
public String visit(Component component) {
......@@ -122,7 +131,7 @@ public class HtmlBuilderVisitor implements ElementVisitor<String> {
* Build a previewable HTML, based on the given list of widgets
* TODO: once resourceContext remove we can merge this method with HtmlBuilderVisitor#visit(Previewable)
*
* @param previewable to build
* @param previewable to build
* @param resourceContext the URL context can change on export or preview...
*/
public <P extends Previewable & Identifiable> String build(final P previewable, String resourceContext) {
......
......@@ -25,6 +25,7 @@ import org.bonitasoft.web.designer.model.page.Component;
import org.bonitasoft.web.designer.model.page.Container;
import org.bonitasoft.web.designer.model.page.Element;
import org.bonitasoft.web.designer.model.page.FormContainer;
import org.bonitasoft.web.designer.model.page.ModalContainer;
import org.bonitasoft.web.designer.model.page.Previewable;
import org.bonitasoft.web.designer.model.page.PropertyValue;
import org.bonitasoft.web.designer.model.page.Tab;
......@@ -67,6 +68,13 @@ public class PropertyValuesVisitor implements ElementVisitor<Map<String, Map<Str
return propertyValues;
}
@Override
public Map<String, Map<String, PropertyValue>> visit(ModalContainer modalContainer) {
Map<String, Map<String, PropertyValue>> propertyValues = modalContainer.getContainer().accept(this);
propertyValues.put(modalContainer.getReference(), modalContainer.getPropertyValues());
return propertyValues;
}
@Override
public Map<String, Map<String, PropertyValue>> visit(Previewable previewable) {
return getPropertyValuesFor(previewable.getRows());
......
......@@ -23,6 +23,7 @@ import org.bonitasoft.web.designer.model.page.Component;
import org.bonitasoft.web.designer.model.page.Container;
import org.bonitasoft.web.designer.model.page.Element;
import org.bonitasoft.web.designer.model.page.FormContainer;
import org.bonitasoft.web.designer.model.page.ModalContainer;
import org.bonitasoft.web.designer.model.page.Previewable;
import org.bonitasoft.web.designer.model.page.Tab;
import org.bonitasoft.web.designer.model.page.TabsContainer;
......@@ -66,6 +67,15 @@ public class RequiredModulesVisitor implements ElementVisitor<Set<String>> {
return modules;
}
@Override
public Set<String> visit(ModalContainer modalContainer) {
Set<String> modules = new HashSet<>();
Widget widget = widgetRepository.get(modalContainer.getId());
modules.addAll(widget.getRequiredModules());
modules.addAll(modalContainer.getContainer().accept(this));
return modules;
}
@Override
public Set<String> visit(Component component) {
Widget widget = widgetRepository.get(component.getId());
......
......@@ -24,6 +24,7 @@ import org.bonitasoft.web.designer.model.page.Component;
import org.bonitasoft.web.designer.model.page.Container;
import org.bonitasoft.web.designer.model.page.Element;
import org.bonitasoft.web.designer.model.page.FormContainer;
import org.bonitasoft.web.designer.model.page.ModalContainer;
import org.bonitasoft.web.designer.model.page.Previewable;
import org.bonitasoft.web.designer.model.page.Tab;
import org.bonitasoft.web.designer.model.page.TabsContainer;
......@@ -61,6 +62,14 @@ public class WidgetIdVisitor implements ElementVisitor<Set<String>> {
return widgetIds;
}
@Override
public Set<String> visit(ModalContainer modalContainer) {
Set<String> widgetIds = new HashSet<>();
widgetIds.addAll(modalContainer.getContainer().accept(this));
widgetIds.add(modalContainer.getId());
return widgetIds;
}
@Override
public Set<String> visit(Component component) {
return singleton(component.getId());
......
......@@ -15,8 +15,6 @@
package org.bonitasoft.web.designer.workspace;
import java.io.IOException;
import java.lang.reflect.ParameterizedType;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
......@@ -27,7 +25,6 @@ import javax.servlet.ServletContext;
import org.bonitasoft.web.designer.config.DesignerInitializerException;
import org.bonitasoft.web.designer.migration.LiveRepositoryUpdate;
import org.bonitasoft.web.designer.model.widget.Widget;
import org.springframework.web.context.ServletContextAware;
/**
......
<div pb-property-values='{{ reference }}' class="modal-container">
<pb-modal-container>
<script type="text/ng-template" id="{{{modalidHtml}}}-modalContent.html">
<div class="modal-body bonita-modal-body" id="modal-body">
{{{ content }}}
</div>
</script>
</pb-modal-container>
</div>
function PbButtonCtrl($scope, $http, $location, $log, $window, localStorageService) {
function PbButtonCtrl($scope, $http, $location, $log, $window, localStorageService, modalService) {
'use strict';
......@@ -9,17 +9,36 @@ function PbButtonCtrl($scope, $http, $location, $log, $window, localStorageServi
if ($scope.properties.action === 'Remove from collection') {
removeFromCollection();
closeModal($scope.properties.closeOnSuccess);
} else if ($scope.properties.action === 'Add to collection') {
addToCollection();
closeModal($scope.properties.closeOnSuccess);
} else if ($scope.properties.action === 'Start process') {
startProcess();
closeModal($scope.properties.closeOnSuccess);
} else if ($scope.properties.action === 'Submit task') {
submitTask();
closeModal($scope.properties.closeOnSuccess);
} else if ($scope.properties.action === 'Open modal') {
closeModal($scope.properties.closeOnSuccess);
openModal($scope.properties.modalId);
} else if ($scope.properties.action === 'Close modal') {
closeModal(true);
} else if ($scope.properties.url) {
doRequest($scope.properties.action, $scope.properties.url);
closeModal($scope.properties.closeOnSuccess);
}
};
function openModal(modalId) {
modalService.open(modalId);
};
function closeModal(shouldClose) {
if(shouldClose)
modalService.close();
};
function removeFromCollection() {
if ($scope.properties.collectionToModify) {
if (!Array.isArray($scope.properties.collectionToModify)) {
......
......@@ -82,6 +82,16 @@
"value": "Remove from collection",
"label": "Remove from collection",
"group": "Collection"
},
{
"value": "Open modal",
"label": "Open modal",
"group": "Modal"
},
{
"value": "Close modal",
"label": "Close modal",
"group": "Modal"
}
],
"defaultValue": "Submit task",
......@@ -111,6 +121,15 @@
"showFor": "['POST', 'PUT', 'GET', 'DELETE', 'Submit task', 'Start process'].indexOf(properties.action.value) > -1",
"bond": "variable"
},
{
"label": "Close modal on success",
"help": "Close modal when the action is successful",
"name": "closeOnSuccess",
"type": "boolean",
"defaultValue": false,
"showFor": "['POST', 'PUT', 'GET', 'DELETE', 'Submit task', 'Start process', 'Remove from collection', 'Add to collection', 'Open modal'].indexOf(properties.action.value) > -1",
"bond": "expression"
},
{
"label": "Failed response value",
"help": "Holds the response when the request has failed",
......@@ -136,6 +155,14 @@
"showFor": "properties.action.value === 'Remove from collection' || properties.action.value === 'Add to collection'",
"bond": "variable"
},
{
"label": "Modal Id",
"name": "modalId",
"type": "text",
"defaultValue": "",
"showFor": "properties.action.value === 'Open modal'",
"bond": "expression"
},
{
"label": "Add",
"name": "collectionPosition",
......
......@@ -5,7 +5,7 @@
"template": "",
"icon": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 20\"><path fill=\"#fff\" d=\"M50,6.7V3.8h-1v2.9H50z M50,11.4V8.6h-1v2.9H50z M50,16.2v-2.9h-1v2.9H50z M49,20h1v-1.9h-1v1V20zM44.1,20h2.9v-1h-2.9V20z M39.2,20h2.9v-1h-2.9V20z M34.3,20h2.9v-1h-2.9V20z M29.4,20h2.9v-1h-2.9V20z M24.5,20h2.9v-1h-2.9V20zM19.6,20h2.9v-1h-2.9V20z M14.7,20h2.9v-1h-2.9V20z M9.8,20h2.9v-1H9.8V20z M4.9,20h2.9v-1H4.9V20z M0,18.1V20h2.9v-1H1v-1H0zM0,13.3v2.9h1v-2.9H0z M0,8.6v2.9h1V8.6H0z M0,3.8v2.9h1V3.8H0z M2.9,0H0v1.9h1V1h2V0z M7.8,0H4.9v1h2.9V0z M12.7,0H9.8v1h2.9V0zM17.6,0h-2.9v1h2.9V0z M22.5,0h-2.9v1h2.9V0z M27.5,0h-2.9v1h2.9V0z M32.4,0h-2.9v1h2.9V0z M37.3,0h-2.9v1h2.9V0z M42.2,0h-2.9v1h2.9V0z M47.1,0h-2.9v1h2.9V0z M50,0h-1v1v1h1V0z\"/></svg>",
"description": "Group of widgets used to define the arrangement of the page elements. Its content can be repeated over an array",
"order": -2,
"order": -3,
"properties": [
{
"name": "repeatedCollection",
......
......@@ -4,7 +4,7 @@
"template": "",
"icon": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 20\"><path fill=\"#fff\" d=\"M5 19h3v1H5v-1zm5-18h3V0h-3v1zM5 1h3V0H5v1zm5 19h3v-1h-3v1zm5 0h3v-1h-3v1zm5 0h3v-1h-3v1zM15 1h3V0h-3v1zM1 9H0v2h1V9zM0 2h1V1h2V0H0v2zm23-2h-3v1h3V0zM1 4H0v3h1V4zm0 14H0v2h3v-1H1v-1zm0-5H0v3h1v-3zM27 0h-2v1h2V0zm22 19v1h1v-1.9h-1v.9zm-24 1h2v-1h-2v1zM44 1h3V0h-3v1zm5 15h1v-3h-1v3zm0-16v2h1V0h-1zm0 7h1V4h-1v3zm0 4h1V9h-1v2zm-5 9h3v-1h-3v1zM39 1h3V0h-3v1zM29 1h3V0h-3v1zm0 19h3v-1h-3v1zm5 0h3v-1h-3v1zm0-19h3V0h-3v1zm5 19h3v-1h-3v1zm-9-6H18v4h12v-4z\"/><path fill=\"#CBD5E1\" d=\"M45 2v4H18V2h27zM18 12h27V8H18v4zm4 5h4v-2h-4v2zM7 5h9V3H7v2zm-2 6h7V9H5v2zm8 0h3V9h-3v2z\"/></svg>",
"name": "Form container",
"order": 0,
"order": -1,
"description": "Container used for a form. Eases validation",
"properties": []
}
function PbModalContainerCtrl($scope, $log, $modal, modalService) {
var ctrl = this;
$scope.currentModal = this;
modalService.register($scope.properties.modalId, this);
var modalInstances =[];
ctrl.close = function(){
if(modalInstances){
modalInstances.pop().close();
}else{
console.log('No instance of modal to close');
}
}
ctrl.open=function (){
var modalInstance = $modal.open({
scope: $scope,
animation: $scope.properties.animation,
ariaLabelledBy: 'modal-title',
ariaDescribedBy: 'modal-body',
templateUrl: $scope.properties.modalId+'-modalContent.html',
appendTo: undefined
});
modalInstances.push(modalInstance);
}
}
{
"id": "pbModalContainer",
"name": "ModalContainer",
"type": "container",
"controller":"@pbModalContainer.ctrl.js",
"template": "",
"icon": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"50\" height=\"20\"><rect x=\"-1\" y=\"-1\" width=\"5.1\" height=\"3.2\" fill=\"none\"/><path d=\"m49.5 5.9l0-2.5 -0.9 0 0 2.5 0.9 0zm0 4.1l0-2.4 -0.9 0 0 2.5 0.9 0 0-0.1zm0 4.2l0-2.5 -0.9 0 0 2.5 0.9 0zm-0.9 3.3l0.9 0 0-1.7 -0.9 0 0 0.9 0 0.8zm-4.6 0l2.7 0 0-0.9 -2.7 0 0 0.9zm-4.6 0l2.7 0 0-0.9 -2.7 0 0 0.9zm-4.6 0l2.7 0 0-0.9 -2.7 0 0 0.9zm-4.6 0l2.7 0 0-0.9 -2.7 0 0 0.9zm-4.6 0l2.7 0 0-0.9 -2.7 0 0 0.9zm-4.6 0l2.7 0 0-0.9 -2.7 0 0 0.9zm-4.6 0l2.7 0 0-0.9 -2.7 0 0 0.9zm-4.6 0l2.7 0 0-0.9 -2.7 0 0 0.9zm-4.6 0l2.7 0 0-0.9 -2.7 0 0 0.9zm-4.6-1.7l0 1.7 2.7 0 0-0.9 -1.8 0 0-0.9 -0.9 0 0 0.1zm0-4.2l0 2.5 0.9 0 0-2.5 -0.9 0zm0-4.1l0 2.5 0.9 0 0-2.5 -0.9 0zm0-4.2l0 2.5 0.9 0 0-2.5 -0.9 0zm2.7-3.3l-2.7 0 0 1.7 0.9 0 0-0.8 1.9 0 0-0.9 -0.1 0zm4.6 0l-2.7 0 0 0.9 2.7 0 0-0.9zm4.6 0l-2.7 0 0 0.9 2.7 0 0-0.9zm4.6 0l-2.7 0 0 0.9 2.7 0 0-0.9zm4.6 0l-2.7 0 0 0.9 2.7 0 0-0.9zm4.7 0l-2.7 0 0 0.9 2.7 0 0-0.9zm4.6 0l-2.7 0 0 0.9 2.7 0 0-0.9zm4.6 0l-2.7 0 0 0.9 2.7 0 0-0.9zm4.6 0l-2.7 0 0 0.9 2.7 0 0-0.9zm4.6 0l-2.7 0 0 0.9 2.7 0 0-0.9zm2.7 0l-0.9 0 0 0.9 0 0.9 0.9 0 0-1.7z\" style=\"fill:#fff;stroke:null\"/><rect x=\"0.6\" y=\"3.7\" width=\"0.9\" height=\"15.3\" style=\"fill:#fff;stroke-width:null;stroke:#fff\"/><rect y=\"18.7\" width=\"45\" height=\"1.2\" style=\"fill-opacity:null;fill:#fff;stroke-width:null;stroke:#fff\"/></svg>",
"description": "Group of widgets used to define the arrangement of the page elements. Its content can be repeated over an array",
"order": 0,
"properties": [
{
"name": "modalId",
"label": "Modal Id",
"help": "Unique ID of this modal",
"caption": "Unique ID of this modal",
"type": "text",
"bond": "constant"
},
{
"label": "Animation",
"name": "animation",
"help": "Choose true if you want display this modal with an animation, false otherwise",
"type": "boolean",
"defaultValue": true
}
],
"assets": [
{
"name": "ui-bootstrap-tpls-0.13.0.min.js",
"type": "js",
"order": 1
},
{
"name": "style.css",
"type": "css",
"order": 2
}
],
"requiredModules": ["ui.bootstrap"]
}
......@@ -2,7 +2,7 @@
"id": "pbTabsContainer",
"name": "Tabs container",
"type": "container",
"order": -1,
"order": -2,
"description": "Multiple groups of widgets, each group in a tab",
"template": "",
"requiredModules": ["ui.bootstrap.tabs", "ui.bootstrap.tpls"],
......
......@@ -15,7 +15,6 @@
function createContext(modelCtrl, scope) {
var context = modelCtrl.createGateway();
expand(context)
.with('$item', {
......
(function() {
'use strict';
//FIXME: Move this service in subscription package
// Use decorator to override button in sp
function modalService() {
var modals = {};
var openModals = [];
return {
open:openModal,
close:closeModal,
register:registerModal
};
function openModal(name) {
openModals.push(name);
modals[name].open();
}
function closeModal() {
var name = openModals.pop();
modals[name].close();
}
function registerModal(name, modal) {
modals[name] = modal;
}
}
angular.module('bonitasoft.ui.services')
.service('modalService', modalService);
})();
/**
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify