Skip to content

Commit db72f75

Browse files
authored
Merge pull request #760 from plotly/revert-trp
revert last changes, expose PanelEmpty
2 parents 58311eb + 6d78846 commit db72f75

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/components/containers/TraceRequiredPanel.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,21 @@ class TraceRequiredPanel extends Component {
1010

1111
render() {
1212
const {localize: _} = this.context;
13-
const {children, heading, beforeMessage, afterMessage, forceEmpty, ...rest} = this.props;
13+
const {children, ...rest} = this.props;
1414

1515
if (!this.props.visible) {
1616
return null;
1717
}
1818

19-
return !forceEmpty && this.hasTrace() ? (
19+
return this.hasTrace() ? (
2020
<LayoutPanel {...rest}>{children}</LayoutPanel>
2121
) : (
22-
<PanelEmpty heading={heading || _("Looks like there aren't any traces defined yet.")}>
23-
{beforeMessage && <p>{beforeMessage}</p>}
22+
<PanelEmpty heading={_("Looks like there aren't any traces defined yet.")}>
2423
<p>
2524
{_('Go to the ')}
2625
<a onClick={() => this.context.setPanel('Structure', 'Traces')}>{_('Traces')}</a>
2726
{_(' panel under Structure to define traces.')}
2827
</p>
29-
{afterMessage && <p>{afterMessage}</p>}
3028
</PanelEmpty>
3129
);
3230
}
@@ -35,10 +33,6 @@ class TraceRequiredPanel extends Component {
3533
TraceRequiredPanel.propTypes = {
3634
children: PropTypes.node,
3735
visible: PropTypes.bool,
38-
heading: PropTypes.string,
39-
beforeMessage: PropTypes.string,
40-
afterMessage: PropTypes.string,
41-
forceEmpty: PropTypes.bool,
4236
};
4337

4438
TraceRequiredPanel.defaultProps = {

src/components/containers/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import PlotlyFold, {Fold} from './PlotlyFold';
99
import MenuPanel from './MenuPanel';
1010
import PlotlyPanel, {Panel} from './PlotlyPanel';
1111
import PlotlySection, {Section} from './PlotlySection';
12+
import PanelEmpty from './PanelEmpty';
1213
import SubplotAccordion from './SubplotAccordion';
1314
import TraceAccordion from './TraceAccordion';
1415
import TransformAccordion from './TransformAccordion';
@@ -31,6 +32,7 @@ export {
3132
Fold,
3233
PlotlyPanel,
3334
Panel,
35+
PanelEmpty,
3436
PlotlySection,
3537
Section,
3638
SubplotAccordion,

src/components/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ import {
7373
LayoutSection,
7474
Panel,
7575
PlotlyPanel,
76+
PanelEmpty,
7677
PlotlySection,
7778
Section,
7879
SubplotAccordion,
@@ -140,6 +141,7 @@ export {
140141
Text,
141142
PlotlyPanel,
142143
Panel,
144+
PanelEmpty,
143145
PanelMenuWrapper,
144146
Radio,
145147
PlotlySection,

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import {
6363
Text,
6464
PlotlyPanel,
6565
Panel,
66+
PanelEmpty,
6667
PanelMenuWrapper,
6768
Radio,
6869
PlotlySection,
@@ -136,6 +137,7 @@ export {
136137
Text,
137138
PlotlyPanel,
138139
Panel,
140+
PanelEmpty,
139141
PanelMenuWrapper,
140142
Radio,
141143
PlotlySection,

0 commit comments

Comments
 (0)