Search in sources :

Example 1 with ResourceAllocationsGridItem

use of io.imunity.furms.ui.components.resource_allocations.ResourceAllocationsGridItem in project furms by unity-idm.

the class ProjectAllocationDashboardFormView method createViewModel.

private ProjectAllocationViewModel createViewModel() {
    final ResourceAllocationsGridItem item = ComponentUtil.getData(UI.getCurrent(), ResourceAllocationsGridItem.class);
    ComponentUtil.setData(UI.getCurrent(), ResourceAllocationsGridItem.class, null);
    return ProjectAllocationViewModel.builder().communityId(item.getCommunityId()).resourceType(new ResourceTypeComboBoxModel(item.getResourceType().id, item.getResourceType().name, item.getResourceType().unit)).allocationCommunity(new AllocationCommunityComboBoxModel(item.getId(), item.getName(), item.isSplit(), item.getCredit().getUnit())).build();
}
Also used : ResourceTypeComboBoxModel(io.imunity.furms.ui.components.support.models.allocation.ResourceTypeComboBoxModel) AllocationCommunityComboBoxModel(io.imunity.furms.ui.components.support.models.allocation.AllocationCommunityComboBoxModel) ResourceAllocationsGridItem(io.imunity.furms.ui.components.resource_allocations.ResourceAllocationsGridItem)

Example 2 with ResourceAllocationsGridItem

use of io.imunity.furms.ui.components.resource_allocations.ResourceAllocationsGridItem in project furms by unity-idm.

the class DashboardResourceAllocateFormView method createViewModel.

private CommunityAllocationViewModel createViewModel() {
    final ResourceAllocationsGridItem item = ComponentUtil.getData(UI.getCurrent(), ResourceAllocationsGridItem.class);
    ComponentUtil.setData(UI.getCurrent(), ResourceAllocationsGridItem.class, null);
    return CommunityAllocationViewModel.builder().site(new ComboBoxModel(item.getSiteId(), item.getSiteName())).resourceType(new ResourceTypeComboBoxModel(item.getResourceType().id, item.getResourceType().name, item.getResourceType().unit)).resourceCredit(new ResourceCreditComboBoxModel(item.getId(), item.getName(), item.getCredit().getAmount(), item.isSplit())).build();
}
Also used : ResourceTypeComboBoxModel(io.imunity.furms.ui.components.support.models.allocation.ResourceTypeComboBoxModel) ResourceAllocationsGridItem(io.imunity.furms.ui.components.resource_allocations.ResourceAllocationsGridItem) ComboBoxModel(io.imunity.furms.ui.components.support.models.ComboBoxModel) ResourceCreditComboBoxModel(io.imunity.furms.ui.components.support.models.allocation.ResourceCreditComboBoxModel) ResourceTypeComboBoxModel(io.imunity.furms.ui.components.support.models.allocation.ResourceTypeComboBoxModel) ResourceCreditComboBoxModel(io.imunity.furms.ui.components.support.models.allocation.ResourceCreditComboBoxModel)

Aggregations

ResourceAllocationsGridItem (io.imunity.furms.ui.components.resource_allocations.ResourceAllocationsGridItem)2 ResourceTypeComboBoxModel (io.imunity.furms.ui.components.support.models.allocation.ResourceTypeComboBoxModel)2 ComboBoxModel (io.imunity.furms.ui.components.support.models.ComboBoxModel)1 AllocationCommunityComboBoxModel (io.imunity.furms.ui.components.support.models.allocation.AllocationCommunityComboBoxModel)1 ResourceCreditComboBoxModel (io.imunity.furms.ui.components.support.models.allocation.ResourceCreditComboBoxModel)1