Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions src/components/containers/TraceRequiredPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,21 @@ class TraceRequiredPanel extends Component {

render() {
const {localize: _} = this.context;
const {children, heading, beforeMessage, afterMessage, forceEmpty, ...rest} = this.props;
const {children, ...rest} = this.props;

if (!this.props.visible) {
return null;
}

return !forceEmpty && this.hasTrace() ? (
return this.hasTrace() ? (
<LayoutPanel {...rest}>{children}</LayoutPanel>
) : (
<PanelEmpty heading={heading || _("Looks like there aren't any traces defined yet.")}>
{beforeMessage && <p>{beforeMessage}</p>}
<PanelEmpty heading={_("Looks like there aren't any traces defined yet.")}>
<p>
{_('Go to the ')}
<a onClick={() => this.context.setPanel('Structure', 'Traces')}>{_('Traces')}</a>
{_(' panel under Structure to define traces.')}
</p>
{afterMessage && <p>{afterMessage}</p>}
</PanelEmpty>
);
}
Expand All @@ -35,10 +33,6 @@ class TraceRequiredPanel extends Component {
TraceRequiredPanel.propTypes = {
children: PropTypes.node,
visible: PropTypes.bool,
heading: PropTypes.string,
beforeMessage: PropTypes.string,
afterMessage: PropTypes.string,
forceEmpty: PropTypes.bool,
};

TraceRequiredPanel.defaultProps = {
Expand Down
2 changes: 2 additions & 0 deletions src/components/containers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import PlotlyFold, {Fold} from './PlotlyFold';
import MenuPanel from './MenuPanel';
import PlotlyPanel, {Panel} from './PlotlyPanel';
import PlotlySection, {Section} from './PlotlySection';
import PanelEmpty from './PanelEmpty';
import SubplotAccordion from './SubplotAccordion';
import TraceAccordion from './TraceAccordion';
import TransformAccordion from './TransformAccordion';
Expand All @@ -31,6 +32,7 @@ export {
Fold,
PlotlyPanel,
Panel,
PanelEmpty,
PlotlySection,
Section,
SubplotAccordion,
Expand Down
2 changes: 2 additions & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import {
LayoutSection,
Panel,
PlotlyPanel,
PanelEmpty,
PlotlySection,
Section,
SubplotAccordion,
Expand Down Expand Up @@ -140,6 +141,7 @@ export {
Text,
PlotlyPanel,
Panel,
PanelEmpty,
PanelMenuWrapper,
Radio,
PlotlySection,
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import {
Text,
PlotlyPanel,
Panel,
PanelEmpty,
PanelMenuWrapper,
Radio,
PlotlySection,
Expand Down Expand Up @@ -136,6 +137,7 @@ export {
Text,
PlotlyPanel,
Panel,
PanelEmpty,
PanelMenuWrapper,
Radio,
PlotlySection,
Expand Down