diff --git a/common/ASC.Api.Core/Core/ApiContext.cs b/common/ASC.Api.Core/Core/ApiContext.cs index fd07711a56..6f98a41743 100644 --- a/common/ASC.Api.Core/Core/ApiContext.cs +++ b/common/ASC.Api.Core/Core/ApiContext.cs @@ -41,7 +41,7 @@ namespace ASC.Api.Core HttpContext = httpContext; //TODO - uint ItemsPerPage = 25; + uint ItemsPerPage = 1000; Count = 0; //Try parse values string count = GetRequestValue("count"); diff --git a/web/ASC.Web.Components/src/components/combobox/index.js b/web/ASC.Web.Components/src/components/combobox/index.js index 64a17b7573..f68cc049db 100644 --- a/web/ASC.Web.Components/src/components/combobox/index.js +++ b/web/ASC.Web.Components/src/components/combobox/index.js @@ -28,103 +28,100 @@ const StyledComboBox = styled.div` `; class ComboBox extends React.PureComponent { - constructor(props) { - super(props); + constructor(props) { + super(props); - this.ref = React.createRef(); + this.ref = React.createRef(); - this.state = { - isOpen: props.opened, - boxLabel: props.options[props.selectedIndex].label, - options: props.options - }; + this.state = { + isOpen: props.opened, + boxLabel: props.options[props.selectedIndex].label, + options: props.options + }; - this.handleClick = this.handleClick.bind(this); - this.stopAction = this.stopAction.bind(this); - this.toggle = this.toggle.bind(this); + this.handleClick = this.handleClick.bind(this); + this.stopAction = this.stopAction.bind(this); + this.toggle = this.toggle.bind(this); + this.comboBoxClick = this.comboBoxClick.bind(this); + this.optionClick = this.optionClick.bind(this); + } + + handleClick = (e) => !this.ref.current.contains(e.target) && this.toggle(false); + stopAction = (e) => e.preventDefault(); + toggle = (isOpen) => this.setState({ isOpen: isOpen }); + comboBoxClick = () => { + this.setState({ option: this.props.option }); + this.toggle(!this.state.isOpen); + }; + optionClick = (option) => { + option.onClick && option.onClick(); + this.toggle(!this.state.isOpen); + this.setState({ boxLabel: option.label }); + this.props.onSelect && this.props.onSelect(option); + }; + + componentDidMount() { + if (this.ref.current) { + document.addEventListener("click", this.handleClick); } + } - handleClick = (e) => !this.ref.current.contains(e.target) && this.toggle(false); - stopAction = (e) => e.preventDefault(); - toggle = (isOpen) => this.setState({ isOpen: isOpen }); + componentWillUnmount() { + document.removeEventListener("click", this.handleClick) + } - componentDidMount() { - if (this.ref.current) { - document.addEventListener("click", this.handleClick); - } + componentDidUpdate(prevProps) { + if (this.props.opened !== prevProps.opened) { + this.toggle(this.props.opened); } + } - componentWillUnmount() { - document.removeEventListener("click", this.handleClick) - } - - componentDidUpdate(prevProps) { - if (this.props.opened !== prevProps.opened) { - this.toggle(this.props.opened); - } - } - - render() { - //console.log("ComboBox render"); - return ( - { - this.setState({ option: this.props.option }); - this.toggle(!this.state.isOpen); - } - : this.stopAction - } - > - false} - > - {this.props.children} - - {this.state.options.map((option, index) => - { - option.onClick && option.onClick(); - this.toggle(!this.state.isOpen); - this.setState({ boxLabel: option.label }); - this.props.onSelect && this.props.onSelect(option); - }} - /> - )} - - - - ); - } + render() { + //console.log("ComboBox render"); + return ( + + + {this.props.children} + + {this.state.options.map((option) => + this.optionClick(option)} + /> + )} + + + + ); + } }; ComboBox.propTypes = { - isDisabled: PropTypes.bool, - withBorder: PropTypes.bool, - selectedIndex: PropTypes.number, - options: PropTypes.array, - onSelect: PropTypes.func + isDisabled: PropTypes.bool, + withBorder: PropTypes.bool, + selectedIndex: PropTypes.number, + options: PropTypes.array, + onSelect: PropTypes.func } ComboBox.defaultProps = { - isDisabled: false, - withBorder: true, - selectedIndex: 0 + isDisabled: false, + withBorder: true, + selectedIndex: 0 } export default ComboBox; \ No newline at end of file diff --git a/web/ASC.Web.Components/src/components/paging/index.js b/web/ASC.Web.Components/src/components/paging/index.js index f9a8b3bed0..c0e7b6e4f9 100644 --- a/web/ASC.Web.Components/src/components/paging/index.js +++ b/web/ASC.Web.Components/src/components/paging/index.js @@ -34,18 +34,26 @@ const Paging = props => { //console.log("Paging render"); const { previousLabel, nextLabel, previousAction, nextAction, pageItems, perPageItems, openDirection, disablePrevious, disableNext } = props; + const onSelectPageAction = (option) => { + props.onSelectPage(option); + } + + const onSelectPerPageAction = (option) => { + props.onSelectPerPage(option) + } + return (