@harbortouch/skytab-analytics-report-utils 0.23.1 → 0.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3432,7 +3432,13 @@ var ExportBuilder = class {
|
|
|
3432
3432
|
const metricCols = selectedGroupIds?.length ? config.availableColumns.filter((c) => selectedGroupIds.includes(c)) : config.defaultVisibleColumns;
|
|
3433
3433
|
return [...this.buildColumnPrefix(config, parameters), ...metricCols];
|
|
3434
3434
|
}
|
|
3435
|
-
getColumnHeader(fieldName, config) {
|
|
3435
|
+
getColumnHeader(fieldName, config, parameters) {
|
|
3436
|
+
if (fieldName === "groupByName" && parameters.groupBy) {
|
|
3437
|
+
return this.translate(`analytics.field.${parameters.groupBy}`);
|
|
3438
|
+
}
|
|
3439
|
+
if (fieldName === "groupByName2" && parameters.secondGroupBy) {
|
|
3440
|
+
return this.translate(`analytics.field.${parameters.secondGroupBy}`);
|
|
3441
|
+
}
|
|
3436
3442
|
const columnKey = config.fields[fieldName]?.columnKey;
|
|
3437
3443
|
const titleKey = columnKey ? getColumnMetadata(columnKey)?.shortTitleKey : void 0;
|
|
3438
3444
|
const colHeader = titleKey ? this.translate(titleKey) : fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (c) => c.toUpperCase()).trim();
|
|
@@ -3443,12 +3449,7 @@ var ExportBuilder = class {
|
|
|
3443
3449
|
}
|
|
3444
3450
|
resolveColumnsAndHeaders(parameters, config) {
|
|
3445
3451
|
const columns = this.resolveColumns(config, parameters);
|
|
3446
|
-
const headers = columns.map((col) =>
|
|
3447
|
-
if (col === "groupByName2" && parameters.secondGroupBy) {
|
|
3448
|
-
return this.translate(`analytics.field.${parameters.secondGroupBy}`);
|
|
3449
|
-
}
|
|
3450
|
-
return this.getColumnHeader(col, config);
|
|
3451
|
-
});
|
|
3452
|
+
const headers = columns.map((col) => this.getColumnHeader(col, config, parameters));
|
|
3452
3453
|
const columnTypes = columns.map((col) => config.fields[col]);
|
|
3453
3454
|
return { columns, headers, columnTypes };
|
|
3454
3455
|
}
|
|
@@ -87,7 +87,13 @@ var ExportBuilder = class {
|
|
|
87
87
|
const metricCols = selectedGroupIds?.length ? config.availableColumns.filter((c) => selectedGroupIds.includes(c)) : config.defaultVisibleColumns;
|
|
88
88
|
return [...this.buildColumnPrefix(config, parameters), ...metricCols];
|
|
89
89
|
}
|
|
90
|
-
getColumnHeader(fieldName, config) {
|
|
90
|
+
getColumnHeader(fieldName, config, parameters) {
|
|
91
|
+
if (fieldName === "groupByName" && parameters.groupBy) {
|
|
92
|
+
return this.translate(`analytics.field.${parameters.groupBy}`);
|
|
93
|
+
}
|
|
94
|
+
if (fieldName === "groupByName2" && parameters.secondGroupBy) {
|
|
95
|
+
return this.translate(`analytics.field.${parameters.secondGroupBy}`);
|
|
96
|
+
}
|
|
91
97
|
const columnKey = config.fields[fieldName]?.columnKey;
|
|
92
98
|
const titleKey = columnKey ? getColumnMetadata(columnKey)?.shortTitleKey : void 0;
|
|
93
99
|
const colHeader = titleKey ? this.translate(titleKey) : fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (c) => c.toUpperCase()).trim();
|
|
@@ -98,12 +104,7 @@ var ExportBuilder = class {
|
|
|
98
104
|
}
|
|
99
105
|
resolveColumnsAndHeaders(parameters, config) {
|
|
100
106
|
const columns = this.resolveColumns(config, parameters);
|
|
101
|
-
const headers = columns.map((col) =>
|
|
102
|
-
if (col === "groupByName2" && parameters.secondGroupBy) {
|
|
103
|
-
return this.translate(`analytics.field.${parameters.secondGroupBy}`);
|
|
104
|
-
}
|
|
105
|
-
return this.getColumnHeader(col, config);
|
|
106
|
-
});
|
|
107
|
+
const headers = columns.map((col) => this.getColumnHeader(col, config, parameters));
|
|
107
108
|
const columnTypes = columns.map((col) => config.fields[col]);
|
|
108
109
|
return { columns, headers, columnTypes };
|
|
109
110
|
}
|