diff --git a/static/app/views/dashboards/detail.tsx b/static/app/views/dashboards/detail.tsx index e9fb05b91ba9fc..feec65ab23df3d 100644 --- a/static/app/views/dashboards/detail.tsx +++ b/static/app/views/dashboards/detail.tsx @@ -718,39 +718,63 @@ class DashboardDetail extends Component { legacyWhen={this.onLegacyRouteLeave} when={this.onRouteLeave} /> - - {({releaseSeries}) => { - // release series passed through to avoid multiple calls for line and area charts widgets - return isValidElement(children) - ? cloneElement(children, { - dashboard: modifiedDashboard ?? dashboard, - onSave: this.isEditingDashboard - ? this.onUpdateWidget - : this.handleUpdateWidgetList, - updateDashboardSplitDecision: ( - widgetId: string, - splitDecision: WidgetType - ) => { - handleUpdateDashboardSplit({ - widgetId, - splitDecision, - dashboard, - modifiedDashboard, - stateSetter: this.setState.bind(this), - onDashboardUpdate, - }); - }, - releaseSeries: releaseSeries, - }) - : children; - }} - + {this.props.organization.features.includes('dashboards-releases-on-charts') ? ( + + {({releaseSeries}) => { + // release series passed through to avoid multiple calls for line and area charts widgets + return isValidElement(children) + ? cloneElement(children, { + dashboard: modifiedDashboard ?? dashboard, + onSave: this.isEditingDashboard + ? this.onUpdateWidget + : this.handleUpdateWidgetList, + updateDashboardSplitDecision: ( + widgetId: string, + splitDecision: WidgetType + ) => { + handleUpdateDashboardSplit({ + widgetId, + splitDecision, + dashboard, + modifiedDashboard, + stateSetter: this.setState.bind(this), + onDashboardUpdate, + }); + }, + releaseSeries: releaseSeries, + }) + : children; + }} + + ) : isValidElement(children) ? ( + cloneElement(children, { + dashboard: modifiedDashboard ?? dashboard, + onSave: this.isEditingDashboard + ? this.onUpdateWidget + : this.handleUpdateWidgetList, + updateDashboardSplitDecision: ( + widgetId: string, + splitDecision: WidgetType + ) => { + handleUpdateDashboardSplit({ + widgetId, + splitDecision, + dashboard, + modifiedDashboard, + stateSetter: this.setState.bind(this), + onDashboardUpdate, + }); + }, + }) + ) : ( + children + )} ); }; @@ -829,34 +853,53 @@ class DashboardDetail extends Component { location={location} forceTransactions={metricsDataSide.forceTransactionsOnly} > - - {({releaseSeries}) => { - // release series passed through to avoid multiple calls for line and area charts widgets - return ( - - ); - }} - + {organization.features.includes( + 'dashboards-releases-on-charts' + ) ? ( + + {({releaseSeries}) => { + // release series passed through to avoid multiple calls for line and area charts widgets + return ( + + ); + }} + + ) : ( + + )} )} @@ -1075,43 +1118,71 @@ class DashboardDetail extends Component { ); }} /> - - - {({releaseSeries}) => { - // release series passed through to avoid multiple calls for line and area charts widgets - return ( - - - - ); - }} - + {organization.features.includes( + 'dashboards-releases-on-charts' + ) ? ( + + {({releaseSeries}) => { + // release series passed through to avoid multiple calls for line and area charts widgets + return ( + + + + ); + }} + + ) : ( + + + + )} )} diff --git a/static/app/views/dashboards/widgetBuilder/buildSteps/visualizationStep.tsx b/static/app/views/dashboards/widgetBuilder/buildSteps/visualizationStep.tsx index 2d37915b8b009e..d4f460f0604ae2 100644 --- a/static/app/views/dashboards/widgetBuilder/buildSteps/visualizationStep.tsx +++ b/static/app/views/dashboards/widgetBuilder/buildSteps/visualizationStep.tsx @@ -118,41 +118,64 @@ export function VisualizationStep({ /> - - {({releaseSeries}) => { - return ( - - typeof errorMessage === 'string' && ( - {errorMessage} - ) - } - noLazyLoad - showStoredAlert - noDashboardsMEPProvider={noDashboardsMEPProvider} - isWidgetInvalid={isWidgetInvalid} - onDataFetched={onDataFetched} - onWidgetSplitDecision={onWidgetSplitDecision} - shouldResize={false} - releaseSeries={releaseSeries} - /> - ); - }} - + {organization.features.includes('dashboards-releases-on-charts') ? ( + + {({releaseSeries}) => { + return ( + + typeof errorMessage === 'string' && ( + {errorMessage} + ) + } + noLazyLoad + showStoredAlert + noDashboardsMEPProvider={noDashboardsMEPProvider} + isWidgetInvalid={isWidgetInvalid} + onDataFetched={onDataFetched} + onWidgetSplitDecision={onWidgetSplitDecision} + shouldResize={false} + releaseSeries={releaseSeries} + /> + ); + }} + + ) : ( + + typeof errorMessage === 'string' && ( + {errorMessage} + ) + } + noLazyLoad + showStoredAlert + noDashboardsMEPProvider={noDashboardsMEPProvider} + isWidgetInvalid={isWidgetInvalid} + onDataFetched={onDataFetched} + onWidgetSplitDecision={onWidgetSplitDecision} + shouldResize={false} + /> + )} );