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 (
{pageItems &&
- props.onSelectPage(a)} />
+
}
{perPageItems &&
- props.onSelectPerPage(a)} />
+
}
diff --git a/web/ASC.Web.Storybook/stories/input/combobox/combobox.stories.js b/web/ASC.Web.Storybook/stories/input/combobox/combobox.stories.js
index b91b90734c..6f445aad9d 100644
--- a/web/ASC.Web.Storybook/stories/input/combobox/combobox.stories.js
+++ b/web/ASC.Web.Storybook/stories/input/combobox/combobox.stories.js
@@ -9,18 +9,15 @@ import { ComboBox } from 'asc-web-components'
let options = [
{
key: '0',
- label: '25 per page',
- onClick: (e) => console.log(e.target)
+ label: '25 per page'
},
{
key: '1',
label: '50 per page',
- onClick: (e) => console.log(e.target)
},
{
key: '2',
- label: '100 per page',
- onClick: (e) => console.log(e.target)
+ label: '100 per page'
}
];
diff --git a/web/ASC.Web.Storybook/stories/paging/base/base.paging.stories.js b/web/ASC.Web.Storybook/stories/paging/base/base.paging.stories.js
index 787de82ec2..1c2441d741 100644
--- a/web/ASC.Web.Storybook/stories/paging/base/base.paging.stories.js
+++ b/web/ASC.Web.Storybook/stories/paging/base/base.paging.stories.js
@@ -8,65 +8,65 @@ import Section from '../../../.storybook/decorators/section';
import { isUndefined } from 'util';
storiesOf('Components|Paging', module)
- .addDecorator(withKnobs)
- .addDecorator(withReadme(Readme))
- .add('base', () => {
+ .addDecorator(withKnobs)
+ .addDecorator(withReadme(Readme))
+ .add('base', () => {
- const pageItems = [
- {
- key: '1',
- label: '1 of 5'
- },
- {
- key: '2',
- label: '2 of 5'
- },
- {
- key: '3',
- label: '3 of 5'
- },
- {
- key: '4',
- label: '4 of 5'
- },
- {
- key: '5',
- label: '5 of 5'
- }
- ];
+ const pageItems = [
+ {
+ key: '1',
+ label: '1 of 5'
+ },
+ {
+ key: '2',
+ label: '2 of 5'
+ },
+ {
+ key: '3',
+ label: '3 of 5'
+ },
+ {
+ key: '4',
+ label: '4 of 5'
+ },
+ {
+ key: '5',
+ label: '5 of 5'
+ }
+ ];
- const perPageItems = [
- {
- key: '1-1',
- label: '25 per page'
- },
- {
- key: '1-2',
- label: '50 per page'
- },
- {
- key: '1-3',
- label: '100 per page'
- }
- ];
+ const perPageItems = [
+ {
+ key: '1-1',
+ label: '25 per page'
+ },
+ {
+ key: '1-2',
+ label: '50 per page'
+ },
+ {
+ key: '1-3',
+ label: '100 per page'
+ }
+ ];
- const displayItems = boolean('Display pageItems', true);
- const displayPerPage = boolean('Display perPageItems', true);
-
- return (
-
- console.log('Prev')}
- nextAction={ () => console.log('Next')}
- openDirection='bottom'
- onSelectPage={(a) => console.log(a)}
- onSelectPerPage={(a) => console.log(a)}
- />
-
- )
- });
\ No newline at end of file
+ const displayItems = boolean('Display pageItems', true);
+ const displayPerPage = boolean('Display perPageItems', true);
+
+ return (
+
+ console.log('Prev')}
+ nextAction={() => console.log('Next')}
+ openDirection='bottom'
+ onSelectPage={(a) => console.log(a)}
+ onSelectPerPage={(a) => console.log(a)}
+ />
+
+ )
+ });
\ No newline at end of file