Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documents size limit #141

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion maps_dashboards/common/index.ts
Expand Up @@ -17,7 +17,7 @@ export const MAP_LAYER_DEFAULT_MIN_OPACITY = 0;
export const MAP_LAYER_DEFAULT_MAX_OPACITY = 100;
export const MAP_LAYER_DEFAULT_OPACITY_STEP = 1;
export const MAP_LAYER_DEFAULT_BORDER_THICKNESS = 1;
export const DOCUMENTS_DEFAULT_REQUEST_NUMBER = 20;
export const DOCUMENTS_DEFAULT_REQUEST_NUMBER = 1000;
export const DOCUMENTS_DEFAULT_SHOW_TOOLTIPS: boolean = false;
export const DOCUMENTS_DEFAULT_TOOLTIPS: string[] = [];
export const DOCUMENTS_DEFAULT_MARKER_SIZE = 5;
Expand Down
Expand Up @@ -68,9 +68,10 @@ export const DocumentLayerSource = ({
};

useEffect(() => {
const disableUpdate = !indexPattern || !selectedField;
const disableUpdate =
!indexPattern || !selectedField || documentRequestNumber < 1 || documentRequestNumber > 10000;
setIsUpdateDisabled(disableUpdate);
}, [setIsUpdateDisabled, indexPattern, selectedField]);
}, [setIsUpdateDisabled, indexPattern, selectedField, documentRequestNumber]);

const formatFieldToComboBox = (field?: IndexPatternField | null) => {
if (!field) return [];
Expand Down Expand Up @@ -196,7 +197,7 @@ export const DocumentLayerSource = ({
}, [selectedField]);

useEffect(() => {
setHasInvalidRequestNumber(documentRequestNumber < 1 || documentRequestNumber > 1000);
setHasInvalidRequestNumber(documentRequestNumber < 1 || documentRequestNumber > 10000);
}, [documentRequestNumber]);

const onShowTooltipsChange = (event: { target: { checked: React.SetStateAction<boolean> } }) => {
Expand Down
Expand Up @@ -71,14 +71,14 @@ export const MapTopNavMenu = ({
changeTitle(title || 'Create');
}, [title, changeTitle]);

const refreshDataLayerRender = useCallback(() => {
const refreshDataLayerRender = () => {
layers.forEach((layer: MapLayerSpecification) => {
if (layer.type === DASHBOARDS_MAPS_LAYER_TYPE.OPENSEARCH_MAP) {
return;
}
doDataLayerRender(layer, mapState, services, maplibreRef);
});
}, [layers, mapState, maplibreRef, services]);
};

const handleQuerySubmit = ({ query, dateRange }: { query?: Query; dateRange: TimeRange }) => {
if (query) {
Expand All @@ -96,7 +96,7 @@ export const MapTopNavMenu = ({
setIsRefreshPaused(mapState.refreshInterval.pause);
setRefreshIntervalValue(mapState.refreshInterval.value);
refreshDataLayerRender();
}, [mapState, refreshDataLayerRender]);
}, [mapState]);

return (
<TopNavMenu
Expand Down