Skip to content

Commit

Permalink
rename props
Browse files Browse the repository at this point in the history
  • Loading branch information
angorayc committed Dec 22, 2022
1 parent 26da70b commit da58b26
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const AlertsTreemapPanelComponent: React.FC<Props> = ({
inputId: InputsModelId.global,
queryId: uniqueQueryId,
});
const alertsOptions = useMemo(
const extraVisualizationOptions = useMemo(
() => ({
breakdownField: stackByField1,
showBuildingBlockAlerts,
Expand Down Expand Up @@ -231,9 +231,9 @@ const AlertsTreemapPanelComponent: React.FC<Props> = ({
{isPanelExpanded ? (
isChartEmbeddablesEnabled && getLensAttributes && timerange ? (
<LensEmbeddable
alertsOptions={alertsOptions}
data-test-subj="embeddable-matrix-histogram"
extraActions={extraActions}
extraOptions={extraVisualizationOptions}
getLensAttributes={getLensAttributes}
height={`${DEFAULT_MIN_CHART_HEIGHT}px`}
id={uniqueQueryId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const initVisualizationData: {
const style = { height: '100%', minWidth: '100px' };

const LensEmbeddableComponent: React.FC<LensEmbeddableComponentProps> = ({
alertsOptions,
extraOptions,
extraActions,
getLensAttributes,
height: wrapperHeight,
Expand All @@ -69,7 +69,7 @@ const LensEmbeddableComponent: React.FC<LensEmbeddableComponentProps> = ({
const getGlobalQuery = inputsSelectors.globalQueryByIdSelector();
const { searchSessionId } = useDeepEqualSelector((state) => getGlobalQuery(state, id));
const attributes = useLensAttributes({
alertsOptions,
extraOptions,
getLensAttributes,
lensAttributes,
scopeId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface VisualizationActionsProps {
}

export interface LensEmbeddableComponentProps {
alertsOptions?: AlertsOptions;
extraOptions?: AlertsOptions;
extraActions?: Action[];
getLensAttributes?: GetLensAttributes;
height?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ import {
} from './utils';

export const useLensAttributes = ({
lensAttributes,
extraOptions,
getLensAttributes,
lensAttributes,
scopeId = SourcererScopeName.default,
stackByField,
title,
scopeId = SourcererScopeName.default,
alertsOptions,
}: {
lensAttributes?: LensAttributes | null;
extraOptions?: AlertsOptions;
getLensAttributes?: GetLensAttributes;
lensAttributes?: LensAttributes | null;
scopeId?: SourcererScopeName;
stackByField?: string;
title?: string;
scopeId?: SourcererScopeName;
alertsOptions?: AlertsOptions;
}): LensAttributes | null => {
const { selectedPatterns, dataViewId, indicesExist } = useSourcererDataView(scopeId);
const getGlobalQuerySelector = useMemo(() => inputsSelectors.globalQuerySelector(), []);
Expand Down Expand Up @@ -76,7 +76,7 @@ export const useLensAttributes = ({
lensAttributes ??
((getLensAttributes &&
stackByField &&
getLensAttributes(stackByField, alertsOptions)) as LensAttributes);
getLensAttributes(stackByField, extraOptions)) as LensAttributes);

return {
...attrs,
Expand All @@ -98,8 +98,8 @@ export const useLensAttributes = ({
})),
} as LensAttributes;
}, [
alertsOptions,
dataViewId,
extraOptions,
filters,
getLensAttributes,
indexFilters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const AlertsCountPanel = memo<AlertsCountPanelProps>(
inputId: InputsModelId.global,
queryId: uniqueQueryId,
});
const alertsOptions = useMemo(
const extraVisualizationOptions = useMemo(
() => ({
breakdownField: stackByField1,
showBuildingBlockAlerts,
Expand Down Expand Up @@ -232,9 +232,9 @@ export const AlertsCountPanel = memo<AlertsCountPanelProps>(
{toggleStatus ? (
isChartEmbeddablesEnabled && getLensAttributes && timerange ? (
<LensEmbeddable
alertsOptions={alertsOptions}
data-test-subj="embeddable-matrix-histogram"
extraActions={extraActions}
extraOptions={extraVisualizationOptions}
getLensAttributes={getLensAttributes}
height={ChartHeight}
id={uniqueQueryId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export const AlertsHistogramPanel = memo<AlertsHistogramPanelProps>(
inputId: InputsModelId.global,
queryId: uniqueQueryId,
});
const alertsOptions = useMemo(
const extraVisualizationOptions = useMemo(
() => ({
showBuildingBlockAlerts,
showOnlyThreatIndicatorAlerts,
Expand Down Expand Up @@ -438,9 +438,9 @@ export const AlertsHistogramPanel = memo<AlertsHistogramPanelProps>(
{toggleStatus ? (
isChartEmbeddablesEnabled && getLensAttributes && timerange ? (
<LensEmbeddable
alertsOptions={alertsOptions}
data-test-subj="embeddable-matrix-histogram"
extraActions={extraActions}
extraOptions={extraVisualizationOptions}
getLensAttributes={getLensAttributes}
height={ChartHeight}
id={uniqueQueryId}
Expand Down

0 comments on commit da58b26

Please sign in to comment.