Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Apr 3, 2023
2 parents be52408 + 96a7047 commit 3a0d7d2
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,24 +357,17 @@ private IModel<InfoBoxData> createSchemaStatusInfoBoxModel() {
String numberMessage;
String description = null;

Integer progress = null;
ResourceSchema refinedSchema;
try {
refinedSchema = getObjectDetailsModels().getRefinedSchema();
if (refinedSchema != null) {
backgroundColor = "bg-purple";
icon = "fa fa-cubes";
// TODO is this correct?
// This is a preliminary solution for MID-8391.
int numObjectTypes = refinedSchema.getObjectTypeDefinitions().size();
int numAllDefinitions = numObjectTypes + refinedSchema.getObjectClassDefinitions().size();
int numObjectClasses = refinedSchema.getObjectClassDefinitions().size();
numberMessage = numObjectTypes + " " + getString("PageResource.resource.objectTypes");
if (numAllDefinitions != 0) {
progress = numObjectTypes * 100 / numAllDefinitions;
if (progress > 100) {
progress = 100;
}
}
description = numAllDefinitions + " " + getString("PageResource.resource.schemaDefinitions");
description = numObjectClasses + " " + getString("PageResource.resource.schemaDefinitions");
} else {
numberMessage = getString("PageResource.resource.noSchema");
}
Expand All @@ -386,8 +379,8 @@ private IModel<InfoBoxData> createSchemaStatusInfoBoxModel() {

InfoBoxData data = new InfoBoxData(backgroundColor, icon, getString("PageResource.resource.schema"));
data.setNumber(numberMessage);
data.setProgress(progress);
data.setDescription(description);
// There is no use in providing a ratio of objects to classes or vice versa. Hence we do not set the progress here.

return data;
};
Expand Down

0 comments on commit 3a0d7d2

Please sign in to comment.