Skip to content

Commit e66b34d

Browse files
committed
Add back isRequired
1 parent 52109c5 commit e66b34d

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

src/components/containers/PlotlyFold.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
striptags,
1111
} from 'lib';
1212

13-
export class Fold extends Component {
13+
class UnlocalizedFold extends Component {
1414
constructor() {
1515
super();
1616
this.foldVisible = true;
@@ -103,22 +103,24 @@ export class Fold extends Component {
103103
}
104104
}
105105

106-
Fold.plotly_editor_traits = {foldable: true};
106+
UnlocalizedFold.plotly_editor_traits = {foldable: true};
107107

108-
Fold.propTypes = {
108+
UnlocalizedFold.propTypes = {
109109
canDelete: PropTypes.bool,
110110
children: PropTypes.node,
111111
className: PropTypes.string,
112-
folded: PropTypes.bool,
113-
toggleFold: PropTypes.func,
112+
folded: PropTypes.bool.isRequired,
113+
toggleFold: PropTypes.func.isRequired,
114114
hideHeader: PropTypes.bool,
115115
icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
116116
messageIfEmpty: PropTypes.string,
117117
localize: PropTypes.func,
118118
name: PropTypes.string,
119119
};
120120

121-
class PlotlyFold extends Fold {
121+
export const Fold = localize(UnlocalizedFold);
122+
123+
class PlotlyFold extends UnlocalizedFold {
122124
constructor(props, context) {
123125
super(props, context);
124126

src/components/containers/PlotlyPanel.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ PanelErrorImpl.propTypes = {
2626

2727
const PanelError = localize(PanelErrorImpl);
2828

29-
export class Panel extends Component {
29+
class UnlocalizedPanel extends Component {
3030
constructor(props) {
3131
super(props);
3232
this.state = {
@@ -123,18 +123,20 @@ export class Panel extends Component {
123123
}
124124
}
125125

126-
Panel.propTypes = {
126+
UnlocalizedPanel.propTypes = {
127127
children: PropTypes.node,
128128
addAction: PropTypes.object,
129129
showExpandCollapse: PropTypes.bool,
130130
noPadding: PropTypes.bool,
131131
};
132132

133-
Panel.defaultProps = {
133+
UnlocalizedPanel.defaultProps = {
134134
showExpandCollapse: true,
135135
};
136136

137-
export default class PlotlyPanel extends Panel {}
137+
export const Panel = localize(UnlocalizedPanel);
138+
139+
export default class PlotlyPanel extends UnlocalizedPanel {}
138140

139141
PlotlyPanel.plotly_editor_traits = {
140142
no_visibility_forcing: true,

src/components/containers/PlotlySection.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
unpackPlotProps,
77
} from '../../lib';
88

9-
export class Section extends Component {
9+
class UnlocalizedSection extends Component {
1010
constructor() {
1111
super();
1212
this.sectionVisible = true;
@@ -30,14 +30,16 @@ export class Section extends Component {
3030
}
3131
}
3232

33-
Section.plotly_editor_traits = {no_visibility_forcing: false};
34-
Section.propTypes = {
33+
UnlocalizedSection.plotly_editor_traits = {no_visibility_forcing: false};
34+
UnlocalizedSection.propTypes = {
3535
children: PropTypes.node,
3636
name: PropTypes.string,
3737
attr: PropTypes.string,
3838
};
3939

40-
class PlotlySection extends Section {
40+
export const Section = localize(UnlocalizedSection);
41+
42+
class PlotlySection extends UnlocalizedSection {
4143
constructor(props, context) {
4244
super(props, context);
4345
this.determineVisibility(props, context);

0 commit comments

Comments
 (0)