Skip to content

Commit

Permalink
#26750 include in 23.10.24 LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
erickgonzalez committed Nov 4, 2024
1 parent ab6a84b commit 30396d0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ export class DotExperimentsReportsStore extends ComponentStore<DotExperimentsRep
);

readonly getSuggestedWinner$: Observable<DotResultVariant | null> = this.select(({ results }) =>
BayesianNoWinnerStatus.includes(results?.bayesianResult.suggestedWinner)
BayesianNoWinnerStatus.includes(results?.bayesianResult?.suggestedWinner)
? null
: results?.goals.primary.variants[results?.bayesianResult.suggestedWinner]
: results?.goals.primary.variants[results?.bayesianResult?.suggestedWinner]
);

readonly getPromotedVariant$: Observable<Variant | null> = this.select(({ experiment }) =>
Expand All @@ -117,7 +117,7 @@ export class DotExperimentsReportsStore extends ComponentStore<DotExperimentsRep
const { datasets } = chartData;

return (
results.bayesianResult.suggestedWinner != BayesianStatusResponse.NONE &&
results.bayesianResult?.suggestedWinner != BayesianStatusResponse.NONE &&
datasets.every((dataset) => dataset.data.length > 0)
);
}
Expand Down Expand Up @@ -163,7 +163,7 @@ export class DotExperimentsReportsStore extends ComponentStore<DotExperimentsRep
CONVERSION_RATE_RANGE_SEPARATOR_LABEL
);

return results
return results && results.bayesianResult
? Object.values(results.goals.primary.variants).map((variant) => {
return this.getDotExperimentVariantDetail(
experiment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,15 @@ export const getSuggestedWinner = (
): SummaryLegend => {
const { bayesianResult, sessions } = results;

if (!bayesianResult) {
return ReportSummaryLegendByBayesianStatus.NO_ENOUGH_SESSIONS;
}

const hasSessions = sessions.total > 0;
const isATieBayesianSuggestionWinner =
bayesianResult.suggestedWinner === BayesianStatusResponse.TIE;
bayesianResult?.suggestedWinner === BayesianStatusResponse.TIE;
const isNoneBayesianSuggestionWinner =
bayesianResult.suggestedWinner === BayesianStatusResponse.NONE;
bayesianResult?.suggestedWinner === BayesianStatusResponse.NONE;

if (!hasSessions || isNoneBayesianSuggestionWinner) {
return experiment.status === DotExperimentStatus.ENDED
Expand Down Expand Up @@ -172,7 +176,7 @@ export const getBayesianDatasets = (
const { sessions, bayesianResult } = results;

// If we don't have a suggested winner, return an empty array
if (bayesianResult.suggestedWinner === BayesianStatusResponse.NONE) {
if (!bayesianResult || bayesianResult.suggestedWinner === BayesianStatusResponse.NONE) {
return [];
}

Expand Down
1 change: 1 addition & 0 deletions dotCMS/hotfix_tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,4 @@ This maintenance release includes the following code fixes:
163. https://github.com/dotCMS/core/issues/30243 : Intermittent 404 issues for customers who came from another DB engine #30243
164. https://github.com/dotCMS/core/issues/26271 : [UI] Text in experiment data results needs be aligned #26271
165. https://github.com/dotCMS/core/issues/26399 : [UI] Change Experiment mod date display from simple date to date/time #26399
166. https://github.com/dotCMS/core/issues/26750 : [UI] Experiments reports - JS error when bayesianResult is null #26750

0 comments on commit 30396d0

Please sign in to comment.