Skip to content

Commit

Permalink
unifying new report buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Sep 22, 2021
1 parent b71e262 commit 58e248b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ protected MultiFunctinalButtonDto load() {
});
}

if (!(isCollectionViewPanelForCompiledView() || isCollectionViewPanelForWidget()) && getNewObjectGenericButtonVisibility()) {
if (!(isCollectionViewPanelForCompiledView() || isCollectionViewPanelForWidget())
&& getNewObjectGenericButtonVisibility() && isGenericNewButtonVisible()) {
CompositedIconButtonDto defaultButton = new CompositedIconButtonDto();
DisplayType defaultButtonDisplayType = getNewObjectButtonSpecialDisplayType();
defaultButton.setAdditionalButtonDisplayType(defaultButtonDisplayType);
Expand All @@ -261,6 +262,10 @@ protected MultiFunctinalButtonDto load() {

}

protected boolean isGenericNewButtonVisible() {
return true;
}

@Override
protected List<IColumn<SelectableBean<O>, String>> createDefaultColumns() {
GuiObjectListViewType defaultView = DefaultColumnUtils.getDefaultView(getType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public enum PageTypes {
ARCHETYPE("archetypes", GuiStyleConstants.EVO_ARCHETYPE_TYPE_ICON, PageArchetypes.class, PageArchetype.class, com.evolveum.midpoint.web.page.admin.archetype.PageArchetype.class, ArchetypeType.COMPLEX_TYPE),
OBJECT_COLLECTION("objectCollections", GuiStyleConstants.CLASS_OBJECT_COLLECTION_ICON, PageObjectCollections.class, PageObjectCollection.class, com.evolveum.midpoint.web.page.admin.objectCollection.PageObjectCollection.class, ObjectCollectionType.COMPLEX_TYPE),
OBJECT_TEMPLATE("objectTemplates", GuiStyleConstants.CLASS_OBJECT_TEMPLATE_ICON, PageObjectTemplates.class, PageObjectTemplate.class, com.evolveum.midpoint.web.page.admin.objectTemplate.PageObjectTemplate.class, ObjectTemplateType.COMPLEX_TYPE),
REPORT("reports", GuiStyleConstants.CLASS_REPORT_ICON, PageReports .class, PageReport.class, com.evolveum.midpoint.web.page.admin.reports.PageReport.class, ReportType.COMPLEX_TYPE);
REPORT("reports", GuiStyleConstants.CLASS_REPORT_ICON, PageReports.class, PageReport.class, com.evolveum.midpoint.web.page.admin.reports.PageReport.class, ReportType.COMPLEX_TYPE);

private String identifier;
private String icon;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ private void initLayout() {
add(mainForm);

MainObjectListPanel<ReportType> table = new MainObjectListPanel<ReportType>(ID_TABLE, ReportType.class) {

private static final long serialVersionUID = 1L;

@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.PAGE_REPORTS;
Expand All @@ -98,6 +99,11 @@ protected IColumn<SelectableBean<ReportType>, String> createCheckboxColumn() {
protected List<InlineMenuItem> createInlineMenu() {
return PageReports.this.createInlineMenu();
}

@Override
protected boolean isGenericNewButtonVisible() {
return false;
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
Expand Down

0 comments on commit 58e248b

Please sign in to comment.