Commit 9b044f23 authored by mgabdev's avatar mgabdev

Fixed issue with SidebarPanelGroup showing StatusPromotionPanels

• Fixed:
- issue with SidebarPanelGroup showing StatusPromotionPanels
parent 65c5ee56
......@@ -2,7 +2,7 @@ import React from 'react'
import PropTypes from 'prop-types'
import { me, promotions } from '../initial_state'
import Bundle from '../features/ui/util/bundle'
import WrappedBundle from '../features/ui/util/bundle'
import WrappedBundle from '../features/ui/util/wrapped_bundle'
import {
StatusPromotionPanel
} from '../features/ui/util/async_components'
......@@ -19,7 +19,7 @@ class SidebarPanelGroup extends React.PureComponent {
if (!!promotion) {
const correctedPosition = promotion.position - 1 > layout.length ? layout.length - 1 : promotion.position
if (!layout.find(p => p.key === 'status-promotion-panel')) {
layout.splice(correctedPosition, 0, <WrappedBundle component={StatusPromotionPanel} componentParams={{ statusId: promotion.status_id }} />)
layout.splice(correctedPosition, 0, <WrappedBundle key='status-promotion-panel' component={StatusPromotionPanel} componentParams={{ statusId: promotion.status_id }} />)
}
}
}
......@@ -30,7 +30,7 @@ class SidebarPanelGroup extends React.PureComponent {
layout.map((panel) => {
if (!panel) return null
if (typeof panel !== 'function') {
if (typeof panel !== 'function' || panel.key === 'status-promotion-panel') {
return panel
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment