Skip to content

Commit

Permalink
MID-8096 request access wizard, green checkmarks improved, title added
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Sep 13, 2022
1 parent 9e19575 commit 2821e60
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 6 deletions.
5 changes: 5 additions & 0 deletions gui/admin-gui/src/frontend/scss/_tiles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
position: relative;
top: -20px;
left: 32px;
margin-bottom: -20px;

&.rounded-icon-none {
margin-bottom: 0;
}
}

& > .title {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public class CatalogTile<T extends Serializable> extends Tile<T> {

private RoundedIconPanel.State checkState;

private String checkTitle;

public CatalogTile() {
this(null, null);
}
Expand Down Expand Up @@ -54,4 +56,12 @@ public RoundedIconPanel.State getCheckState() {
public void setCheckState(RoundedIconPanel.State checkState) {
this.checkState = checkState;
}

public String getCheckTitle() {
return checkTitle;
}

public void setCheckTitle(String checkTitle) {
this.checkTitle = checkTitle;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void initLayout() {
RoundedImagePanel logo1 = new RoundedImagePanel(ID_LOGO, () -> createDisplayType(getModel()), createPreferredImage(getModel()));
add(logo1);

RoundedIconPanel check = new RoundedIconPanel(ID_CHECK, () -> "fa fa-check", () -> getModelObject().getCheckState());
RoundedIconPanel check = new RoundedIconPanel(ID_CHECK, () -> "fa fa-check", () -> getModelObject().getCheckState(), () -> getModelObject().getCheckTitle());
add(check);

Label description = new Label(ID_DESCRIPTION, () -> getModelObject().getDescription());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,17 +728,26 @@ private QName findDefaultRelation() {
}

public boolean isAssignedToAll(String oid) {
return countNumberOfAssignees(oid) == requestItems.keySet().size();
}

public boolean isAssignedToNone(String oid) {
return countNumberOfAssignees(oid) == 0;
}

private int countNumberOfAssignees(String oid) {
if (oid == null) {
return false;
return 0;
}

int count = 0;
for (List<ObjectReferenceType> memberships : existingPoiRoleMemberships.values()) {
boolean found = memberships.stream().anyMatch(m -> oid.equals(m.getOid()));
if (!found) {
return false;
if (found) {
count++;
}
}

return true;
return count;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,20 @@ protected CatalogTile createTileObject(SelectableBean<ObjectType> object) {
t.setValue(object);

RequestAccess ra = RoleCatalogPanel.this.getModelObject();
t.setCheckState(ra.isAssignedToAll(obj.getOid()) ? RoundedIconPanel.State.FULL : RoundedIconPanel.State.PARTIAL);

RoundedIconPanel.State checkState;
String checkTitle = null;
if (ra.isAssignedToAll(obj.getOid())) {
checkState = RoundedIconPanel.State.FULL;
checkTitle = getString("RoleCatalogPanel.tileFullCheckState");
} else if (ra.isAssignedToNone(obj.getOid())) {
checkState = RoundedIconPanel.State.NONE;
} else {
checkState = RoundedIconPanel.State.PARTIAL;
checkTitle = getString("RoleCatalogPanel.tilePartialCheckState");
}
t.setCheckState(checkState);
t.setCheckTitle(checkTitle);

return t;
}
Expand Down

0 comments on commit 2821e60

Please sign in to comment.