Skip to content

Commit

Permalink
Fix MID-8310 hide cancel button
Browse files Browse the repository at this point in the history
  • Loading branch information
tchrapovic committed Oct 19, 2023
1 parent bfe25b1 commit 0a28702
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ public void onClick(AjaxRequestTarget ajaxRequestTarget) {
ajaxRequestTarget.add(getPageBase().getFeedbackPanel());
}
};
cancelButton.add(new VisibleBehaviour(this::isCancelButtonVisible));

buttonsContainer.add(cancelButton);
}

Expand All @@ -147,6 +149,10 @@ protected boolean isButtonPanelVisible() {
return true;
}

protected boolean isCancelButtonVisible() {
return true;
}

@Override
public void editItemPerformed(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<C>> rowModel,
List<PrismContainerValueWrapper<C>> listItems) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ protected QName getAssignmentType() {
return null;
}


protected ObjectQuery createCustomizeQuery() {
return getPageBase().getPrismContext().queryFor(AssignmentType.class)
.exists(AssignmentType.F_FOCUS_MAPPINGS).build();
Expand Down Expand Up @@ -92,4 +91,10 @@ protected void initializeNewAssignmentData(PrismContainerValue<AssignmentType> n
target.add(getPageBase().getFeedbackPanel());
}
}

@Override
protected boolean isCancelButtonVisible() {
return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public PolicyRuleAssignmentsPanel(String id, IModel<PrismObjectWrapper<AH>> mode
protected List<IColumn<PrismContainerValueWrapper<AssignmentType>, String>> initColumns() {
List<IColumn<PrismContainerValueWrapper<AssignmentType>, String>> columns = new ArrayList<>();


columns.add(new PrismContainerWrapperColumn<>(getContainerModel(), ItemPath.create(AssignmentType.F_POLICY_RULE, PolicyRuleType.F_POLICY_CONSTRAINTS), getPageBase()));

columns.add(new PrismPropertyWrapperColumn<>(getContainerModel(), ItemPath.create(AssignmentType.F_POLICY_RULE, PolicyRuleType.F_POLICY_SITUATION), AbstractItemWrapperColumn.ColumnType.STRING, getPageBase()));
Expand Down Expand Up @@ -114,4 +113,10 @@ protected List<PrismContainerValueWrapper<AssignmentType>> customPostSearch(
}
return super.customPostSearch(list);
}

@Override
protected boolean isCancelButtonVisible() {
return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import com.evolveum.midpoint.gui.api.component.wizard.BasicWizardStepPanel;
import com.evolveum.midpoint.gui.api.component.wizard.WizardModel;
import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.page.PageAdminLTE;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.gui.api.util.LocalizationUtil;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
Expand All @@ -52,7 +51,6 @@
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.security.MidPointApplication;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import com.evolveum.prism.xml.ns._public.query_3.SearchFilterType;

Expand Down

0 comments on commit 0a28702

Please sign in to comment.