mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 13:45:23 +02:00
fix: resolve primary_metric toUpperCase crash on legacy experiment detail
This commit is contained in:
@@ -67,7 +67,7 @@ const ExperimentDetail: React.FC<ExperimentDetailProps> = ({ experimentId, onClo
|
|||||||
const chartData = useMemo(() => {
|
const chartData = useMemo(() => {
|
||||||
if (!experiment || !salesData.length) return [];
|
if (!experiment || !salesData.length) return [];
|
||||||
|
|
||||||
const asinSet = new Set((experiment.asins || []).map(a => a.toUpperCase()));
|
const asinSet = new Set((experiment.asins || []).map(a => (a || '').toUpperCase()));
|
||||||
const weeklyMap = new Map<string, any>();
|
const weeklyMap = new Map<string, any>();
|
||||||
|
|
||||||
salesData.forEach(r => {
|
salesData.forEach(r => {
|
||||||
@@ -253,7 +253,7 @@ const ExperimentDetail: React.FC<ExperimentDetailProps> = ({ experimentId, onClo
|
|||||||
<div className="bg-slate-800/30 border border-slate-700 rounded-xl p-4">
|
<div className="bg-slate-800/30 border border-slate-700 rounded-xl p-4">
|
||||||
<div className="flex justify-between items-center mb-4">
|
<div className="flex justify-between items-center mb-4">
|
||||||
<h3 className="text-sm font-semibold text-slate-300">
|
<h3 className="text-sm font-semibold text-slate-300">
|
||||||
Timeline Impact ({experiment.primary_metric.toUpperCase()})
|
Timeline Impact ({(experiment.primary_metric || 'units').toUpperCase()})
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className="h-48 w-full">
|
<div className="h-48 w-full">
|
||||||
|
|||||||
Reference in New Issue
Block a user