Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Oct 20, 2023
2 parents d72d1b8 + f73a2e4 commit 79e8fd4
Show file tree
Hide file tree
Showing 6 changed files with 44 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 @@ -615,7 +615,11 @@ private void addUsersPerformed(AjaxRequestTarget target, List<UserType> users) {
@Override
public boolean onBackPerformed(AjaxRequestTarget target) {
if (selectionState.getObject() == SelectionState.TILES) {
return super.onBackPerformed(target);
boolean executeDefaultBehaviour = super.onBackPerformed(target);
if (!executeDefaultBehaviour) {
getPageBase().redirectBack();
}
return executeDefaultBehaviour;
}

selectionState.setObject(SelectionState.TILES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,17 @@ private void initLayout(){

DropDownFormGroup<QName> type = new DropDownFormGroup<>(ID_OBJECT_TYPE, Model.of(getDefaultObjectType()), Model.ofList(getSupportedObjectTypes()),
new QNameObjectTypeChoiceRenderer(), createStringResource("chooseFocusTypeAndRelationDialogPanel.type"),
createStringResource("chooseFocusTypeAndRelationDialogPanel.tooltip.type"), "col-md-4", "col-md-8", true);
createStringResource("chooseFocusTypeAndRelationDialogPanel.tooltip.type"), null, null, true){
@Override
protected String getLabelContainerCssClass() {
return "col-md-4";
}

@Override
protected String getPropertyContainerCssClass() {
return "col-md-8";
}
};
type.getInput().add(new EmptyOnChangeAjaxFormUpdatingBehavior());
type.setOutputMarkupId(true);
type.add(new VisibleBehaviour(this::isFocusTypeSelectorVisible));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ private void initLayout(IModel<List<T>> choices, IChoiceRenderer<T> renderer, IM
String labelCssClass, String textCssClass, final boolean required,
boolean isSimilarAsPropertyPanel) {
WebMarkupContainer labelContainer = new WebMarkupContainer(ID_LABEL_CONTAINER);
labelContainer.add(AttributeAppender.prepend("class", getLabelContainerCssClass()));
labelContainer.add(new VisibleBehaviour(() -> label != null && StringUtils.isNotEmpty(label.getObject())));
add(labelContainer);

Expand Down Expand Up @@ -96,6 +97,7 @@ private void initLayout(IModel<List<T>> choices, IChoiceRenderer<T> renderer, IM
labelContainer.add(requiredContainer);

WebMarkupContainer propertyLabel = new WebMarkupContainer(ID_PROPERTY_LABEL);
propertyLabel.add(AttributeAppender.prepend("class", getPropertyContainerCssClass()));
WebMarkupContainer rowLabel = new WebMarkupContainer(ID_ROW);
WebMarkupContainer selectWrapper = new WebMarkupContainer(ID_SELECT_WRAPPER);
if (StringUtils.isNotEmpty(textCssClass)) {
Expand Down Expand Up @@ -162,4 +164,12 @@ public DropDownChoice<T> getInput() {
protected String getNullValidDisplayValue() {
return getString("DropDownChoicePanel.empty");
}

protected String getLabelContainerCssClass() {
return "";
}

protected String getPropertyContainerCssClass() {
return "";
}
}

0 comments on commit 79e8fd4

Please sign in to comment.