Skip to content

Commit

Permalink
[Lens] Hide the random sampling settings from the UI (#145071)
Browse files Browse the repository at this point in the history
## Summary

Hides the random sampling layer settings from the UI until we decide how
we want to introduce it to our users.
  • Loading branch information
stratoula authored Nov 14, 2022
1 parent e580f23 commit a5cfe8e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ const initialActiveDimensionState = {
isNew: false,
};

// hide the random sampling settings from the UI
const DISPLAY_RANDOM_SAMPLING_SETTINGS = false;

export function LayerPanel(
props: Exclude<LayerPanelProps, 'state' | 'setState'> & {
activeVisualization: Visualization;
Expand Down Expand Up @@ -323,12 +326,14 @@ export function LayerPanel(
updateVisualization,
() => setPanelSettingsOpen(true)
) || []),
...(layerDatasource?.getSupportedActionsForLayer?.(
layerId,
layerDatasourceState,
(newState) => updateDatasource(datasourceId, newState),
() => setPanelSettingsOpen(true)
) || []),
...((DISPLAY_RANDOM_SAMPLING_SETTINGS &&
layerDatasource?.getSupportedActionsForLayer?.(
layerId,
layerDatasourceState,
(newState) => updateDatasource(datasourceId, newState),
() => setPanelSettingsOpen(true)
)) ||
[]),
...getSharedActions({
activeVisualization,
core,
Expand Down Expand Up @@ -639,7 +644,8 @@ export function LayerPanel(
})}
</EuiPanel>
</section>
{(layerDatasource?.renderLayerSettings || activeVisualization?.renderLayerSettings) && (
{((DISPLAY_RANDOM_SAMPLING_SETTINGS && layerDatasource?.renderLayerSettings) ||
activeVisualization?.renderLayerSettings) && (
<FlyoutContainer
panelRef={(el) => (settingsPanelRef.current = el)}
isOpen={isPanelSettingsOpen}
Expand All @@ -655,7 +661,7 @@ export function LayerPanel(
>
<div id={layerId}>
<div className="lnsIndexPatternDimensionEditor--padded lnsIndexPatternDimensionEditor--collapseNext">
{layerDatasource?.renderLayerSettings && (
{DISPLAY_RANDOM_SAMPLING_SETTINGS && layerDatasource?.renderLayerSettings && (
<NativeRenderer
render={layerDatasource.renderLayerSettings}
nativeProps={layerDatasourceConfigProps}
Expand Down
3 changes: 2 additions & 1 deletion x-pack/test/functional/apps/lens/group1/layer_actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const find = getService('find');
const testSubjects = getService('testSubjects');

describe('lens layer actions tests', () => {
// skip random sampling FTs until we figure out next steps
describe.skip('lens layer actions tests', () => {
it('should allow creation of lens xy chart', async () => {
await PageObjects.visualize.navigateToNewVisualization();
await PageObjects.visualize.clickVisType('lens');
Expand Down

0 comments on commit a5cfe8e

Please sign in to comment.