Skip to content

Commit

Permalink
fix bugs from testing flow on role wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Jan 24, 2023
1 parent c975f68 commit 678bf5d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<span>
<wicket:message key="SelectObjectClassesStepPanel.selectedItem"/>
</span>
<div class="d-inline-flex">
<div class="d-flex flex-wrap gap-2">
<wicket:container wicket:id="selectedItemContainer">
<div class="btn-sm btn-primary d-flex mr-2" style="cursor: auto;">
<div wicket:id="selectedItem"/>
<div class="text-break" wicket:id="selectedItem"/>
<a wicket:id="deselectButton">
<i class="fa fa-xmark ml-2 text-white"></i>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.evolveum.midpoint.gui.impl.component.search.SearchContext;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.model.IModel;

import com.evolveum.midpoint.gui.impl.component.tile.MultiSelectTileTablePanel;
Expand Down Expand Up @@ -100,10 +101,17 @@ protected SelectableBeanObjectDataProvider<O> createProvider() {
@Override
protected TemplateTile<SelectableBean<O>> createTileObject(SelectableBean<O> object) {
TemplateTile<SelectableBean<O>> tile = super.createTileObject(object);
MultiSelectTileWizardStepPanel.this.customizeTile(tile);
MultiSelectTileWizardStepPanel.this.customizeTile(object, tile);
return tile;
}

@Override
public void refresh(AjaxRequestTarget target) {
super.refresh(target);
target.add(this);
}
};
tilesTable.setOutputMarkupId(true);
add(tilesTable);
}

Expand All @@ -125,7 +133,7 @@ protected boolean isSelectedItemsPanelVisible() {
return false;
}

protected void customizeTile(TemplateTile<SelectableBean<O>> tile) {
protected void customizeTile(SelectableBean<O> object, TemplateTile<SelectableBean<O>> tile) {
}

protected SelectableBeanObjectDataProvider<O> createProvider(SelectableBeanObjectDataProvider<O> defaultProvider) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public class ConstructionGroupStepPanel
private IModel<List<AssociationWrapper>> selectedItems = Model.ofList(new ArrayList<>());
private final IModel<PrismContainerValueWrapper<AssignmentType>> assignmentModel;
private IModel<PrismContainerValueWrapper<ConstructionType>> valueModel;
// private IModel<SearchValue<ItemName>> associationRef = Model.of();

public ConstructionGroupStepPanel(FocusDetailsModels<RoleType> model,
IModel<PrismContainerValueWrapper<AssignmentType>> assignmentModel) {
Expand Down Expand Up @@ -274,6 +273,20 @@ protected SearchContext getAdditionalSearchContext() {
return searchContext;
}

@Override
protected void customizeTile(SelectableBean<ShadowType> object, TemplateTile<SelectableBean<ShadowType>> tile) {
object.setSelected(false);
tile.setSelected(false);

getSelectedItemsModel().getObject().forEach(association -> {
if (association.oid.equals(object.getValue().getOid())
&& association.associationName.equivalent(getAssociationRef().getValue())) {
object.setSelected(true);
tile.setSelected(true);
}
});
}

public class AssociationWrapper implements Serializable {

private final String oid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,16 @@
<collectionRef oid="00000000-0000-0000-0000-000000000321" relation="org:default" type="c:ArchetypeType"/>
</collection>
</objectCollectionView>
<objectCollectionView>
<identifier>application</identifier>
<display>
<label>Application.panel.applications</label>
</display>
<type>ServiceType</type>
<collection>
<collectionRef oid="00000000-0000-0000-0000-000000000329" relation="org:default" type="c:ArchetypeType"/>
</collection>
</objectCollectionView>
</objectCollectionViews>
<objectDetails>
<objectDetailsPage>
Expand Down

0 comments on commit 678bf5d

Please sign in to comment.