Skip to content

Commit 80b863d

Browse files
committed
move transforms out of dev; fix transforms dropdown; remove Aggregate section heading from other transforms
1 parent 8631af0 commit 80b863d

File tree

6 files changed

+33
-30
lines changed

6 files changed

+33
-30
lines changed

src/DefaultEditor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class DefaultEditor extends Component {
2626
<PanelMenuWrapper>
2727
{logo ? logo : null}
2828
<GraphCreatePanel group={_('Graph')} name={_('Create')} />
29-
<GraphTransformsPanel group={_('Graph')} name={_('Transforms')} />
29+
<GraphTransformsPanel group='Graph' name="Transforms" />
3030
<StyleTracesPanel group={_('Style')} name={_('Traces')} />
3131
<StyleLayoutPanel group={_('Style')} name={_('Layout')} />
3232
<StyleNotesPanel group={_('Style')} name={_('Notes')} />

src/components/containers/PanelHeader.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,20 @@ class PanelHeader extends Component {
6363
label={addAction.label}
6464
/>
6565
{this.state.addPanelOpen && (
66-
<ModalBox onClose={this.togglePanel} relative>
66+
<div className="Select"><div className="Select-menu-outer"><div className="Select-menu">
6767
{addAction.handler.map(({label, handler}) => (
68-
<p
68+
<div
69+
className="Select-option"
6970
key={label}
7071
onClick={() => {
7172
handler(this.context);
7273
this.togglePanel();
7374
}}
7475
>
7576
{label}
76-
</p>
77+
</div>
7778
))}
78-
</ModalBox>
79+
</div></div></div>
7980
)}
8081
</div>
8182
) : null}

src/components/containers/TransformAccordion.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@ class TransformAccordion extends Component {
3434
</TransformFold>
3535
));
3636

37-
const handlers = transformTypes.map(({label, type}) => {
38-
return {
39-
label,
40-
handler: context => {
41-
const {fullContainer, updateContainer} = context;
42-
if (updateContainer) {
43-
const transformIndex = Array.isArray(fullContainer.transforms)
44-
? fullContainer.transforms.length
45-
: 0;
46-
const key = `transforms[${transformIndex}]`;
47-
updateContainer({[key]: {type}});
48-
}
49-
},
50-
};
51-
});
37+
5238

5339
const addAction = {
54-
label: _('Aggregation'),
55-
handler: handlers[2].handler,
40+
label: _('Transform'),
41+
handler: transformTypes.map(({label, type}) => {
42+
return {
43+
label,
44+
handler: context => {
45+
const {fullContainer, updateContainer} = context;
46+
if (updateContainer) {
47+
const transformIndex = Array.isArray(fullContainer.transforms)
48+
? fullContainer.transforms.length
49+
: 0;
50+
const key = `transforms[${transformIndex}]`;
51+
updateContainer({[key]: {type}});
52+
}
53+
},
54+
};
55+
}),
5656
};
5757

5858
return (

src/default_panels/GraphTransformsPanel.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export class Aggregations extends Component {
4747
}
4848
}
4949

50+
Aggregations.plotly_editor_traits = {no_visibility_forcing: true};
5051
Aggregations.contextTypes = {
5152
fullContainer: PropTypes.object,
5253
localize: PropTypes.func,
@@ -66,7 +67,9 @@ const GraphTransformsPanel = (props, {localize: _}) => {
6667

6768
<DataSelector label={_('By')} attr="groups" />
6869

69-
<Aggregations />
70+
<PlotlySection name={_('Aggregations')} attr="aggregations">
71+
<Aggregations />
72+
</PlotlySection>
7073
</TransformAccordion>
7174
</TraceAccordion>
7275
);

src/styles/components/containers/_fold.scss

+6
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@
158158
border-width: 1px 1px 1px 1px;
159159
}
160160
}
161+
162+
// if the panel is within a fold, allow overflow for dropdown, etc.
163+
.panel {
164+
overflow-x: visible;
165+
overflow-y: visible;
166+
}
161167
}
162168

163169
.fold + .fold {

src/styles/components/containers/_panel.scss

-7
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,3 @@
9292
padding: 0;
9393
}
9494
}
95-
96-
.fold {
97-
.panel {
98-
overflow-y: initial;
99-
overflow-x: initial;
100-
}
101-
}

0 commit comments

Comments
 (0)