mirror of
https://github.com/getredash/redash.git
synced 2026-03-22 10:00:17 -04:00
* Prettier all the JS files * Add GitHub Action to autoformat code pushed to master * Fix eslint violation due to formatting. * Remove GitHub actions for styling * Add restyled.io config
28 lines
863 B
JavaScript
28 lines
863 B
JavaScript
import { map } from "lodash";
|
|
import React from "react";
|
|
import { Section, Select } from "@/components/visualizations/editor";
|
|
import { EditorPropTypes } from "@/visualizations";
|
|
|
|
const ALLOWED_ITEM_PER_PAGE = [5, 10, 15, 20, 25, 50, 100, 150, 200, 250];
|
|
|
|
export default function GridSettings({ options, onOptionsChange }) {
|
|
return (
|
|
<Section>
|
|
<Select
|
|
label="Items per page"
|
|
data-test="Table.ItemsPerPage"
|
|
className="w-100"
|
|
defaultValue={options.itemsPerPage}
|
|
onChange={itemsPerPage => onOptionsChange({ itemsPerPage })}>
|
|
{map(ALLOWED_ITEM_PER_PAGE, value => (
|
|
<Select.Option key={`ipp${value}`} value={value} data-test={`Table.ItemsPerPage.${value}`}>
|
|
{value}
|
|
</Select.Option>
|
|
))}
|
|
</Select>
|
|
</Section>
|
|
);
|
|
}
|
|
|
|
GridSettings.propTypes = EditorPropTypes;
|