use of io.imunity.furms.ui.components.MenuButton in project furms by unity-idm.
the class ProjectsView method createContextMenu.
private Component createContextMenu(String projectId, String projectName, String communityId) {
GridActionMenu contextMenu = new GridActionMenu();
if (projectService.isProjectInTerminalState(communityId, projectId)) {
contextMenu.addItem(new MenuButton(getTranslation("view.community-admin.projects.menu.edit"), EDIT), event -> UI.getCurrent().navigate(ProjectFormView.class, projectId));
Dialog confirmDialog = createConfirmDialog(projectId, projectName, communityId);
contextMenu.addItem(new MenuButton(getTranslation("view.community-admin.projects.menu.delete"), TRASH), event -> confirmDialog.open());
}
MenuButton adminComponent = new MenuButton(getTranslation("view.community-admin.projects.menu.administrators"), USERS);
RouterLink administratorsPool = new RouterGridLink(adminComponent, projectId, ProjectView.class, PARAM_NAME, ADMINISTRATORS_PARAM);
contextMenu.addItem(administratorsPool);
MenuButton allocationComponent = new MenuButton(getTranslation("view.community-admin.projects.menu.allocations"), PIE_CHART);
RouterLink allocationsPool = new RouterGridLink(allocationComponent, projectId, ProjectView.class, PARAM_NAME, ALLOCATIONS_PARAM);
contextMenu.addItem(allocationsPool);
getContent().add(contextMenu);
return contextMenu.getTarget();
}
use of io.imunity.furms.ui.components.MenuButton in project furms by unity-idm.
the class ProjectsView method createLastColumnContent.
private HorizontalLayout createLastColumnContent(ProjectViewGridModel projectViewModel) {
if (projectViewModel.communityId == null) {
GridActionMenu contextMenu = new GridActionMenu();
contextMenu.addItem(new MenuButton(getTranslation("view.community-admin.projects.menu.refresh"), REFRESH), event -> loadGridContent());
return new GridActionsButtonLayout(contextMenu.getTarget());
}
return new GridActionsButtonLayout(new RouterGridLink(USERS, projectViewModel.projectId, ProjectView.class, PARAM_NAME, ADMINISTRATORS_PARAM), new RouterGridLink(PIE_CHART, projectViewModel.projectId, ProjectView.class, PARAM_NAME, ALLOCATIONS_PARAM), createContextMenu(projectViewModel.projectId, projectViewModel.name, projectViewModel.communityId));
}
use of io.imunity.furms.ui.components.MenuButton in project furms by unity-idm.
the class ProjectAllocationComponent method createContextMenu.
private Component createContextMenu(ProjectAllocationGridModel model) {
GridActionMenu contextMenu = new GridActionMenu();
if (hasTerminalStatus(model)) {
contextMenu.addItem(new MenuButton(getTranslation("view.community-admin.project-allocation.menu.edit"), EDIT), event -> UI.getCurrent().navigate(ProjectAllocationFormView.class, model.id));
}
Dialog confirmDialog = createConfirmDialog(model.id, model.name);
final MenuItem deleteItem = contextMenu.addItem(new MenuButton(getTranslation("view.community-admin.project-allocation.menu.delete"), TRASH), event -> confirmDialog.open());
deleteItem.setEnabled(projectInTerminalState && !projectExpired);
getRefreshMenuItem(contextMenu);
getContent().add(contextMenu);
return contextMenu.getTarget();
}
use of io.imunity.furms.ui.components.MenuButton in project furms by unity-idm.
the class ResourceAccessView method getGridActionsButtonLayout.
private GridActionsButtonLayout getGridActionsButtonLayout(ResourceAccessModel resourceAccessModel) {
GridActionMenu contextMenu = new GridActionMenu();
if (resourceAccessViewService.isRevokeAvailable(resourceAccessModel)) {
contextMenu.addItem(new MenuButton(getTranslation("view.project-admin.resource-access.grid.context-menu.revoke"), MINUS_CIRCLE), event -> {
resourceAccessViewService.revokeAccess(resourceAccessModel);
reloadGrid();
});
} else {
contextMenu.addItem(new MenuButton(getTranslation("view.project-admin.resource-access.grid.context-menu.grant"), PLUS_CIRCLE), event -> {
resourceAccessViewService.grantAccess(resourceAccessModel);
reloadGrid();
});
}
return new GridActionsButtonLayout(contextMenu.getTarget());
}
use of io.imunity.furms.ui.components.MenuButton in project furms by unity-idm.
the class CommunityAllocationComponent method createContextMenu.
private Component createContextMenu(String CommunityAllocationId, String CommunityAllocation) {
GridActionMenu contextMenu = new GridActionMenu();
contextMenu.addItem(new MenuButton(getTranslation("view.fenix-admin.resource-credits-allocation.menu.edit"), EDIT), event -> UI.getCurrent().navigate(CommunityAllocationFormView.class, CommunityAllocationId));
Dialog confirmDialog = createConfirmDialog(CommunityAllocationId, CommunityAllocation);
contextMenu.addItem(new MenuButton(getTranslation("view.fenix-admin.resource-credits-allocation.menu.delete"), TRASH), event -> confirmDialog.open());
getContent().add(contextMenu);
return contextMenu.getTarget();
}
Aggregations