Skip to content

Commit

Permalink
#12604 - Add a line-listing feature to event participants - fix "Line… (
Browse files Browse the repository at this point in the history
#12797)

* #12604 - Add a line-listing feature to event participants - fix "Line listing" button readOnly behavior

* #12604 - Add a line-listing feature to event participants - fix "Line listing" button readOnly behavior
  • Loading branch information
sergiupacurariu authored Nov 30, 2023
1 parent 0af61ed commit a10d1df
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,17 @@ public HorizontalLayout createTopBar() {
final ExpandableButton lineListingButton = new ExpandableButton(Captions.lineListing)
.expand(e -> ControllerProvider.getEventParticipantController().openLineListingWindow(getEventRef()));
addHeaderComponent(lineListingButton);
lineListingButton.setEnabled(isGridEnabled());
}

topLayout.addStyleName(CssStyles.VSPACE_3);
return topLayout;
}

private boolean isGridEnabled() {
return !isEventDeleted() && isEditAllowed() && UserProvider.getCurrent().hasUserRight(UserRight.EVENTPARTICIPANT_EDIT);
}

private boolean shouldDisableButton() {
return FacadeProvider.getFeatureConfigurationFacade().isFeatureDisabled(FeatureType.EDIT_ARCHIVED_ENTITIES)
&& FacadeProvider.getEventFacade().isArchived(getEventRef().getUuid());
Expand Down Expand Up @@ -347,7 +352,7 @@ protected void initView(String params) {
gridLayout.setStyleName("crud-main-layout");
grid.addDataSizeChangeListener(e -> updateStatusButtons());
setSubComponent(gridLayout);
gridLayout.setEnabled(!isEventDeleted() && isEditAllowed() && UserProvider.getCurrent().hasUserRight(UserRight.EVENTPARTICIPANT_EDIT));
gridLayout.setEnabled(isGridEnabled());
}

if (params.startsWith("?")) {
Expand Down

0 comments on commit a10d1df

Please sign in to comment.