N°3985 - Performance checks on the back end - Enhance KPIs

This commit is contained in:
Eric Espie
2021-09-09 17:21:50 +02:00
parent 27c397cc1a
commit 15e99a898e
22 changed files with 119 additions and 78 deletions

View File

@@ -25,6 +25,7 @@ class FieldBadgeUIBlockFactory extends AbstractUIBlockFactory
public static function MakeForField(string $sValue, ?ormStyle $oStyle)
{
$oBadge = null;
$sHtml = '';
if ($oStyle) {
$sStyleClass = $oStyle->GetStyleClass();
$sPrimaryColor = $oStyle->GetMainColor();
@@ -34,27 +35,26 @@ class FieldBadgeUIBlockFactory extends AbstractUIBlockFactory
$oBadge = new FieldBadge(null, $aCSSClasses);
$sDecorationClasses = $oStyle->GetDecorationClasses();
if (!is_null($sDecorationClasses) && !empty($sDecorationClasses)) {
$oBadge->AddHtml("<span class=\"ibo-field-badge--decoration\"><i class=\"$sDecorationClasses\"></i></span>");
$sHtml .= "<span class=\"ibo-field-badge--decoration\"><i class=\"$sDecorationClasses\"></i></span>";
}
$oBadge->AddHtml("<span class=\"ibo-field-badge--label\">$sValue</span>");
$sHtml .= "<span class=\"ibo-field-badge--label\">$sValue</span>";
// Add custom style
// TODO 3.0 To be removed when compilation supports generated CSS
$oBadge->AddHtml(<<<HTML
$sHtml .= <<<HTML
<style>
.$sStyleClass {
color: $sComplementaryColor;
background-color: $sPrimaryColor;
}
</style>
HTML
);
HTML;
}
}
if (!$oBadge) {
$oBadge = new FieldBadge();
$oBadge->AddHtml("<span>$sValue</span>");
$sHtml .= "<span>$sValue</span>";
}
$oBadge->AddHtml($sHtml);
return $oBadge;
}
}