Merge branch 'ent-7938-bug-visual-en-item-odometro-cv' into 'develop'

Ent 7938 bug visual en item odometro cv

See merge request artica/pandorafms!4386
This commit is contained in:
Daniel Rodriguez 2021-10-05 09:20:47 +00:00
commit fb7e443138
7 changed files with 750 additions and 24 deletions

View File

@ -53,6 +53,13 @@ final class Odometer extends Item
$return['thresholds'] = $this->extractThresholds($data);
$return['titleColor'] = $this->extractTitleColor($data);
$return['title'] = $this->extractTitle($data);
$return['titleModule'] = $return['moduleName'];
if (strlen($return['moduleName']) >= 25) {
$return['moduleName'] = substr($return['moduleName'], 0, 9).' ... '.substr($return['moduleName'], -9);
}
$return['minMaxValue'] = $this->extractMinMaxValue($data);
return $return;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -39,6 +39,7 @@
"file-loader": "^3.0.1",
"jest": "^24.9.0",
"mini-css-extract-plugin": "^0.5.0",
"npm-watch": "^0.11.0",
"postcss-loader": "^3.0.0",
"prettier": "^1.19.1",
"ts-jest": "^24.3.0",

View File

@ -8,6 +8,7 @@ export type OdometerProps = {
value: number;
status: string;
title: string | null;
titleModule: string;
titleColor: string;
odometerType: string;
thresholds: string | any;
@ -32,6 +33,7 @@ export function odometerPropsDecoder(data: AnyObject): OdometerProps | never {
status: stringIsEmpty(data.status) ? "#B2B2B2" : data.status,
titleColor: stringIsEmpty(data.titleColor) ? "#3f3f3f" : data.titleColor,
title: stringIsEmpty(data.title) ? "" : data.title,
titleModule: stringIsEmpty(data.titleModule) ? "" : data.titleModule,
thresholds: stringIsEmpty(data.thresholds) ? "" : data.thresholds,
minMaxValue: stringIsEmpty(data.minMaxValue) ? "" : data.minMaxValue,
odometerType: stringIsEmpty(data.odometerType)
@ -208,10 +210,13 @@ export default class Odometer extends Item<OdometerProps> {
const h2 = document.createElement("h2");
if (this.props.title == "") {
h2.textContent = this.props.moduleName;
h2.textContent = this.truncateTitle(this.props.moduleName);
} else {
h2.textContent = this.truncateTitle(this.props.title);
}
h2.title = this.props.titleModule;
h2.setAttribute("title", this.props.titleModule);
h2.style.fontSize = `${anchoB * 0.06}px`;
h2.style.color = `${this.props.titleColor}`;
h2.style.lineHeight = "0";