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();
}
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();
}
Aggregations