Skip to content

Commit

Permalink
corrección de nomenclatura para clase de codigo de colores
Browse files Browse the repository at this point in the history
también se quita un console log en chart-utils

# Conflicts:
#	eda/eda_app/src/app/module/components/eda-table/eda-table.component.ts
  • Loading branch information
asafJortilles committed Jan 10, 2024
1 parent 54d1e80 commit 0f30baa
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export class EdaTableComponent implements OnInit {
let cellClass = null;
let field = col.field;
if(this.inject.pivot) field = this.styles[col.field].value;
field = field.replace('%', 'percent').replace(/ /g, '') ;

field = this.getNiceName(field);

if(!parseFloat(rowData[col.field])) cellClass = null;
else if (parseFloat(rowData[col.field]) < parseFloat(this.styles[col.field].ranges[0])) cellClass = `table-gradient-${field}-${0}`
Expand Down Expand Up @@ -131,7 +132,7 @@ export class EdaTableComponent implements OnInit {
const colors = this.generateColor(styles[i].max, styles[i].min, 5);

colors.forEach((color, i) => {
let name = key.replace('%', 'percent').replace(/ /g, '').replace(/[^a-zA-Z0-9-_ ]/g, '') ;
const name = this.getNiceName(key)
this.elementRef.nativeElement.style.setProperty(`--table-gradient-bg-color-${name}-${i}`, `#${color} `);
this.styleService.setStyles(`.table-gradient-${name}-${i}`,
{
Expand Down Expand Up @@ -193,7 +194,7 @@ export class EdaTableComponent implements OnInit {
const colors = this.generateColor(styles[i].max, styles[i].min, 5);

colors.forEach((color, i) => {
let name = key.replace('%', 'percent').replace(/ /g, '').replace(/[^a-zA-Z0-9 ]/g, '') ;
const name = this.getNiceName(key)
this.elementRef.nativeElement.style.setProperty(`--table-gradient-bg-color-${name}-${i}`, `#${color}`);
this.styleService.setStyles(`.table-gradient-${name}-${i}`,
{
Expand All @@ -206,7 +207,6 @@ export class EdaTableComponent implements OnInit {
});

});

let tmpStyles = {};

Object.keys(limits).forEach(key => {
Expand All @@ -224,7 +224,6 @@ export class EdaTableComponent implements OnInit {
});

});

this.styles = tmpStyles;

}
Expand Down Expand Up @@ -289,5 +288,9 @@ export class EdaTableComponent implements OnInit {

}

private getNiceName(name) {
return name.replace('%', 'percent').replace(/ /g, '').replace(/[^a-zA-Z0-9-_-\wáéíóúüñÁÉÍÓÚÜÑ ]/g, '').replace('_','');
}


}

0 comments on commit 0f30baa

Please sign in to comment.