@eric-emg/symphiq-components 1.2.190 → 1.2.191
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.
|
@@ -57512,19 +57512,35 @@ function aggregateAndSortByMonth(points) {
|
|
|
57512
57512
|
return sortDataByMonth(Array.from(monthMap.values()));
|
|
57513
57513
|
}
|
|
57514
57514
|
function sumMetricFromUiData(uiData, metricToSum) {
|
|
57515
|
+
console.group('[sumMetricFromUiData] Debug');
|
|
57516
|
+
console.log('Input uiData:', uiData);
|
|
57517
|
+
console.log('metricToSum:', metricToSum);
|
|
57515
57518
|
if (!uiData?.convertedDataResults) {
|
|
57519
|
+
console.log('EARLY RETURN: uiData or convertedDataResults is falsy');
|
|
57520
|
+
console.groupEnd();
|
|
57516
57521
|
return 0;
|
|
57517
57522
|
}
|
|
57518
57523
|
let total = 0;
|
|
57519
57524
|
const convertedData = uiData.convertedDataResults;
|
|
57520
57525
|
const metricIndex = convertedData.metrics?.indexOf(metricToSum);
|
|
57526
|
+
console.log('Available metrics:', convertedData.metrics);
|
|
57527
|
+
console.log('metricIndex for', metricToSum, ':', metricIndex);
|
|
57521
57528
|
if (metricIndex === undefined || metricIndex === -1) {
|
|
57529
|
+
console.log('EARLY RETURN: metricIndex is undefined or -1');
|
|
57530
|
+
console.groupEnd();
|
|
57522
57531
|
return 0;
|
|
57523
57532
|
}
|
|
57524
|
-
convertedData.rows?.
|
|
57525
|
-
|
|
57533
|
+
console.log('Number of rows:', convertedData.rows?.length ?? 0);
|
|
57534
|
+
convertedData.rows?.forEach((row, idx) => {
|
|
57535
|
+
const rawValue = row.metricValues?.[metricIndex];
|
|
57536
|
+
const metricValue = parseFloat(rawValue || '0');
|
|
57537
|
+
if (idx < 3) {
|
|
57538
|
+
console.log(`Row ${idx}: raw="${rawValue}", parsed=${metricValue}`);
|
|
57539
|
+
}
|
|
57526
57540
|
total += metricValue;
|
|
57527
57541
|
});
|
|
57542
|
+
console.log('Final total:', total);
|
|
57543
|
+
console.groupEnd();
|
|
57528
57544
|
return total;
|
|
57529
57545
|
}
|
|
57530
57546
|
|
|
@@ -57847,6 +57863,31 @@ class InitialTargetSettingComponent {
|
|
|
57847
57863
|
}, ...(ngDevMode ? [{ debugName: "revenueChartData" }] : []));
|
|
57848
57864
|
this.currentYear = computed(() => new Date().getFullYear(), ...(ngDevMode ? [{ debugName: "currentYear" }] : []));
|
|
57849
57865
|
this.priorYear = computed(() => new Date().getFullYear() - 1, ...(ngDevMode ? [{ debugName: "priorYear" }] : []));
|
|
57866
|
+
effect(() => {
|
|
57867
|
+
const mainData = this.mainUiData();
|
|
57868
|
+
console.group('[InitialTargetSetting] mainUiData Debug');
|
|
57869
|
+
console.log('mainUiData exists:', !!mainData);
|
|
57870
|
+
console.log('mainUiData:', mainData);
|
|
57871
|
+
if (mainData) {
|
|
57872
|
+
console.log('convertedDataResults exists:', !!mainData.convertedDataResults);
|
|
57873
|
+
if (mainData.convertedDataResults) {
|
|
57874
|
+
const converted = mainData.convertedDataResults;
|
|
57875
|
+
console.log('metrics array:', converted.metrics);
|
|
57876
|
+
console.log('dimensions array:', converted.dimensions);
|
|
57877
|
+
console.log('rows count:', converted.rows?.length ?? 0);
|
|
57878
|
+
console.log('first 3 rows:', converted.rows?.slice(0, 3));
|
|
57879
|
+
const metricIndex = converted.metrics?.indexOf(MetricEnum.PURCHASE_REVENUE);
|
|
57880
|
+
console.log('PURCHASE_REVENUE enum value:', MetricEnum.PURCHASE_REVENUE);
|
|
57881
|
+
console.log('PURCHASE_REVENUE index in metrics:', metricIndex);
|
|
57882
|
+
if (metricIndex !== undefined && metricIndex !== -1 && converted.rows?.length) {
|
|
57883
|
+
const sampleValues = converted.rows.slice(0, 5).map(r => r.metricValues?.[metricIndex]);
|
|
57884
|
+
console.log('Sample metric values at index', metricIndex, ':', sampleValues);
|
|
57885
|
+
}
|
|
57886
|
+
}
|
|
57887
|
+
}
|
|
57888
|
+
console.log('Computed priorYearRevenue:', this.priorYearRevenue());
|
|
57889
|
+
console.groupEnd();
|
|
57890
|
+
});
|
|
57850
57891
|
}
|
|
57851
57892
|
ngAfterViewInit() {
|
|
57852
57893
|
setTimeout(() => {
|
|
@@ -58254,7 +58295,7 @@ class InitialTargetSettingComponent {
|
|
|
58254
58295
|
</div>
|
|
58255
58296
|
`
|
|
58256
58297
|
}]
|
|
58257
|
-
}],
|
|
58298
|
+
}], () => [], { absoluteInputRef: [{
|
|
58258
58299
|
type: ViewChild,
|
|
58259
58300
|
args: ['absoluteInputRef']
|
|
58260
58301
|
}], viewMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewMode", required: false }] }], funnelMetrics: [{ type: i0.Input, args: [{ isSignal: true, alias: "funnelMetrics", required: false }] }], mainUiData: [{ type: i0.Input, args: [{ isSignal: true, alias: "mainUiData", required: false }] }], trendUiData: [{ type: i0.Input, args: [{ isSignal: true, alias: "trendUiData", required: false }] }], shopId: [{ type: i0.Input, args: [{ isSignal: true, alias: "shopId", required: false }] }], pacingMetrics: [{ type: i0.Input, args: [{ isSignal: true, alias: "pacingMetrics", required: false }] }], dataResults: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataResults", required: false }] }], targetsCreated: [{ type: i0.Output, args: ["targetsCreated"] }] }); })();
|