Skip to content

Commit

Permalink
Prepare release 1.6.0
Browse files Browse the repository at this point in the history
Prepare release 1.6.0
  • Loading branch information
sven1103 authored Oct 24, 2022
2 parents 7ef132c + 39719de commit 31449e6
Show file tree
Hide file tree
Showing 25 changed files with 836 additions and 647 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package life.qbic.portal.offermanager.components

import life.qbic.business.UseCaseFailure
import life.qbic.portal.offermanager.components.AppViewModel

/**
* Handles the presentation of the qoffer-2.0 use cases and its internal data model to the ViewModel.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
package life.qbic.portal.offermanager.components

import com.vaadin.ui.Alignment
import com.vaadin.ui.Button
import com.vaadin.ui.HorizontalLayout
import com.vaadin.ui.Label
import com.vaadin.ui.VerticalLayout
import com.vaadin.ui.Window
import com.vaadin.ui.themes.ValoTheme
import com.vaadin.ui.*

/**
* <h1>Dialog to ask for user confirmation</h1>
Expand Down Expand Up @@ -72,4 +66,4 @@ class ConfirmationDialog extends Window{
})
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,13 @@ class CreateOfferView extends FormLayout{
*/
private static List<ProductItem> getProductItems(List<ProductItemViewModel> items){
List<ProductItem> productItems = []
items.each {
productItems.add(new ProductItem(it.quantity,it.product))
for (int position = 0; position < items.size(); position++) {
ProductItemViewModel currentItem = items.get(position)
ProductItem productItem = new ProductItem(currentItem.quantity, currentItem.product)
productItem.setOrderPosition(position)
productItems.add(productItem)
}

return productItems
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package life.qbic.portal.offermanager.components.offer.create
import com.vaadin.data.provider.ListDataProvider
import com.vaadin.icons.VaadinIcons
import com.vaadin.ui.*
import com.vaadin.ui.components.grid.GridRowDragger
import com.vaadin.ui.components.grid.HeaderRow
import com.vaadin.ui.renderers.NumberRenderer
import com.vaadin.ui.themes.ValoTheme
Expand Down Expand Up @@ -42,6 +43,7 @@ class OfferOverviewView extends VerticalLayout {
ListDataProvider<ProductItemViewModel> dataProvider =
new ListDataProvider(createOfferViewModel.getProductItems())
itemGrid.setDataProvider(dataProvider)
enableDraggable(itemGrid)
setupFilters(dataProvider, itemGrid)
}

Expand All @@ -56,6 +58,13 @@ class OfferOverviewView extends VerticalLayout {
customerFilterRow)
}

static void enableDraggable(Grid<ProductItemViewModel> grid) {
new GridRowDragger<>(grid)
grid.setStyleGenerator(row -> {
return "draggable-row-grab"
})
}

/**
* Initializes the start layout for this view
*/
Expand Down Expand Up @@ -210,7 +219,6 @@ class OfferOverviewView extends VerticalLayout {
Small helper object, that will display information
about individual price positions for offer overviews.
*/

private class PriceField {

String name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package life.qbic.portal.offermanager.components.offer.create


import com.vaadin.data.ValidationResult
import com.vaadin.data.Validator
import com.vaadin.data.ValueContext
import com.vaadin.icons.VaadinIcons
import com.vaadin.server.UserError
import com.vaadin.ui.*
import com.vaadin.ui.themes.ValoTheme
import groovy.beans.Bindable
import life.qbic.portal.offermanager.components.Resettable

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.vaadin.ui.themes.ValoTheme
import life.qbic.datamodel.dtos.business.ProjectManager
import life.qbic.portal.offermanager.components.GridUtils
import life.qbic.portal.offermanager.components.Resettable
import life.qbic.portal.offermanager.components.offer.create.CreateOfferViewModel

/**
* This class generates a Layout in which the user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.vaadin.server.UserError
import com.vaadin.shared.data.sort.SortDirection
import com.vaadin.shared.ui.grid.HeightMode
import com.vaadin.ui.*
import com.vaadin.ui.components.grid.GridRowDragger
import com.vaadin.ui.components.grid.HeaderRow
import com.vaadin.ui.renderers.NumberRenderer
import com.vaadin.ui.themes.ValoTheme
Expand Down Expand Up @@ -78,6 +79,13 @@ class SelectItemsView extends VerticalLayout implements Resettable {

TabSheet packageAccordion

static void enableDraggable(Grid<ProductItemViewModel> grid) {
new GridRowDragger<>(grid)
grid.setStyleGenerator(row -> {
return "draggable-row-grab"
})
}

/**
* Contains regex for filtering the different product types
*
Expand Down Expand Up @@ -312,6 +320,7 @@ class SelectItemsView extends VerticalLayout implements Resettable {
generateProductGrid(externalServiceGrid)
// This grid summarises product items selected for this specific offer, so we set quantity = true
generateItemGrid(overviewGrid)
enableDraggable(overviewGrid)

packageAccordion = new TabSheet()
packageAccordion.addTab(seqLayout, "Sequencing")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,13 @@ package life.qbic.portal.offermanager.components.offer.overview.projectcreation

import com.vaadin.icons.VaadinIcons
import com.vaadin.shared.ui.ContentMode
import com.vaadin.ui.Alignment
import com.vaadin.ui.Button
import com.vaadin.ui.ComboBox
import com.vaadin.ui.GridLayout
import com.vaadin.ui.HorizontalLayout
import com.vaadin.ui.Label
import com.vaadin.ui.Panel
import com.vaadin.ui.RadioButtonGroup
import com.vaadin.ui.TextArea
import com.vaadin.ui.TextField
import com.vaadin.ui.VerticalLayout
import com.vaadin.ui.*
import com.vaadin.ui.themes.ValoTheme
import life.qbic.datamodel.dtos.business.Offer
import life.qbic.datamodel.dtos.projectmanagement.ProjectCode
import life.qbic.datamodel.dtos.projectmanagement.ProjectIdentifier
import life.qbic.datamodel.dtos.projectmanagement.ProjectSpace



/**
* <h1>Enables a user to create a project based on an existing offer</h1>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import life.qbic.datamodel.dtos.projectmanagement.ProjectCode
import life.qbic.datamodel.dtos.projectmanagement.ProjectIdentifier
import life.qbic.datamodel.dtos.projectmanagement.ProjectSpace
import life.qbic.portal.offermanager.dataresources.ResourcesService
import life.qbic.portal.offermanager.dataresources.projects.ProjectResourceService
import life.qbic.portal.offermanager.dataresources.projects.ProjectSpaceResourceService

/**
* <h1>Holds the create project state information and logic</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,13 @@ class UpdateOfferView extends FormLayout {
*/
private static List<ProductItem> getProductItems(List<ProductItemViewModel> items) {
List<ProductItem> productItems = []
items.each {
productItems.add(new ProductItem(it.quantity, it.product))
for (int position = 0; position < items.size(); position++) {
ProductItemViewModel currentItem = items.get(position)
ProductItem productItem = new ProductItem(currentItem.quantity, currentItem.product)
productItem.setOrderPosition(position)
productItems.add(productItem)
}

return productItems
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package life.qbic.portal.offermanager.components.offer.update

import life.qbic.datamodel.dtos.business.Customer
import life.qbic.datamodel.dtos.business.Offer
import life.qbic.datamodel.dtos.business.ProductItem
import life.qbic.datamodel.dtos.business.ProjectManager
import life.qbic.datamodel.dtos.business.services.Product
import life.qbic.datamodel.dtos.general.Person
Expand All @@ -10,6 +11,8 @@ import life.qbic.portal.offermanager.components.offer.create.CreateOfferViewMode
import life.qbic.portal.offermanager.components.offer.create.ProductItemViewModel
import life.qbic.portal.offermanager.dataresources.ResourcesService

import java.util.stream.Collectors

/**
* Model with data for updating an existing offer.
*
Expand All @@ -23,7 +26,7 @@ import life.qbic.portal.offermanager.dataresources.ResourcesService
*
* @since 1.0.0
*/
class UpdateOfferViewModel extends CreateOfferViewModel{
class UpdateOfferViewModel extends CreateOfferViewModel {

final private EventEmitter<Offer> offerUpdate

Expand All @@ -50,8 +53,15 @@ class UpdateOfferViewModel extends CreateOfferViewModel{
super.projectManager = offer.projectManager
super.experimentalDesign = offer.experimentalDesign.orElse("")
super.productItems.clear()
super.productItems.addAll(offer.items.collect {
new ProductItemViewModel(it.quantity, it.product)})

super.productItems.addAll(
offer.items.stream().sorted(new Comparator<ProductItem>() {
@Override
int compare(ProductItem o1, ProductItem o2) {
return o1.offerPosition() - o2.offerPosition()
}
}).map(productItem -> new ProductItemViewModel(productItem.quantity, productItem.product)).collect(Collectors.toList())
)
super.savedOffer = Optional.of(offer)
validateProjectInformation()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package life.qbic.portal.offermanager.components.person.update


import com.vaadin.data.provider.ListDataProvider
import com.vaadin.event.selection.SelectionListener
import com.vaadin.icons.VaadinIcons
import com.vaadin.shared.ui.grid.HeightMode
import com.vaadin.ui.Button
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package life.qbic.portal.offermanager.security.liferay

import com.liferay.portal.kernel.exception.PortalException
import com.liferay.portal.model.User
import com.liferay.portal.model.UserGroupRole
import com.liferay.portal.service.UserGroupRoleLocalServiceUtil
import com.liferay.portal.service.UserLocalServiceUtil
import groovy.util.logging.Log4j2
import life.qbic.portal.offermanager.security.Role
import life.qbic.portal.offermanager.security.RoleService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,12 @@
.scrollable-layout {
overflow: auto;
}

.draggable-row-grab:hover {
cursor: grab;
}

.draggable-row-grab:active {
cursor: grabbing;
}
}
3 changes: 1 addition & 2 deletions offer-manager-app/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<!-- Set to false only if you know what you are doing. -->
<!-- You don't know what you're doing but want to know?
Expand Down
Loading

0 comments on commit 31449e6

Please sign in to comment.