Merge branch 'release/v1.2' of https://github.com/ONLYOFFICE/AppServer into release/v1.2

This commit is contained in:
Maria Sukhova 2022-05-16 12:51:35 +03:00
commit 39302e3f59
4 changed files with 23 additions and 18 deletions

View File

@ -16,14 +16,14 @@ const OptionList = ({
isItemLoaded,
itemCount,
loadMoreItems,
countLoad,
isFirstLoad,
}) => {
const renderOption = React.useCallback(
({ index, style }) => {
const isLoaded = isItemLoaded(index);
if (!isLoaded) {
if (countLoad >= 1) {
if (!isFirstLoad) {
return (
<div style={style}>
<Option isLoader={true} countLoaderRows={2} />

View File

@ -37,7 +37,6 @@ const getCurrentGroup = (items) => {
return currentGroup;
};
let countLoad;
const Selector = (props) => {
const {
groups,
@ -63,6 +62,7 @@ const Selector = (props) => {
onArrowClick,
headerLabel,
total,
isFirstLoad,
} = props;
const listOptionsRef = useRef(null);
@ -73,9 +73,6 @@ const Selector = (props) => {
resetCache();
}, [searchValue, currentGroup, hasNextPage]);
useEffect(() => {
countLoad = 0;
}, []);
const resetCache = useCallback(() => {
if (listOptionsRef && listOptionsRef.current) {
listOptionsRef.current.resetloadMoreItemsCache(true);
@ -152,7 +149,6 @@ const Selector = (props) => {
const onSearchChange = useCallback(
(value) => {
countLoad = 0;
setSearchValue(value);
onSearchChanged && onSearchChanged(value);
},
@ -160,7 +156,6 @@ const Selector = (props) => {
);
const onSearchReset = useCallback(() => {
countLoad = 0;
onSearchChanged && onSearchChange("");
}, [onSearchChanged]);
@ -264,7 +259,7 @@ const Selector = (props) => {
searchValue: searchValue,
currentGroup: currentGroup ? currentGroup.key : null,
};
countLoad++;
loadNextPage && loadNextPage(options);
},
[isNextPageLoading, searchValue, currentGroup, options]
@ -301,8 +296,6 @@ const Selector = (props) => {
);
const onArrowClickAction = useCallback(() => {
countLoad = 0;
if (groupHeader && groups.length !== 1) {
setGroupHeader(null);
@ -389,7 +382,7 @@ const Selector = (props) => {
isItemLoaded={isItemLoaded}
isOptionChecked={isOptionChecked}
loadMoreItems={loadMoreItems}
countLoad={countLoad}
isFirstLoad={isFirstLoad}
/>
)}
</>
@ -429,6 +422,7 @@ Selector.propTypes = {
isDisabled: PropTypes.bool,
isMultiSelect: PropTypes.bool,
allowGroupSelection: PropTypes.bool,
isFirstLoad: PropTypes.bool,
selectButtonLabel: PropTypes.string,
selectAllLabel: PropTypes.string,

View File

@ -18,7 +18,7 @@ const StyledRowContainer = styled(RowContainer)`
}
.row-wrapper:not(.row-selected)
+ .row-wrapper:not(.row-hotkey-border)
//+ .row-wrapper:not(.row-hotkey-border)
+ .row-selected {
.files-row {
border-top: ${(props) =>
@ -28,6 +28,12 @@ const StyledRowContainer = styled(RowContainer)`
}
}
.row-hotkey-border + .row-selected {
.files-row {
border-top: 1px solid #2da7db !important;
}
}
.row-selected:last-child {
.files-row {
border-bottom: ${(props) =>

View File

@ -20,6 +20,7 @@ class PeopleSelector extends React.Component {
page: 0,
hasNextPage: true,
isNextPageLoading: false,
isFirstLoad: true,
};
}
@ -93,8 +94,10 @@ class PeopleSelector extends React.Component {
const pageCount = 100;
this.setState({ isNextPageLoading: true }, () => {
const { role, employeeStatus, useFake } = this.props;
this.setState(
{ isNextPageLoading: true, isFirstLoad: startIndex === 0 },
() => {
const { role, employeeStatus, useFake } = this.props;
const filter = Filter.getDefault();
filter.page = startIndex / pageCount;
@ -204,12 +207,12 @@ class PeopleSelector extends React.Component {
onSearchChanged = () => {
//console.log("onSearchChanged")(value);
this.setState({ options: [], hasNextPage: true });
this.setState({ options: [], hasNextPage: true, isFirstLoad: true });
};
onGroupChanged = () => {
//console.log("onGroupChanged")(group);
this.setState({ options: [], hasNextPage: true });
this.setState({ options: [], hasNextPage: true, isFirstLoad: true });
};
render() {
@ -219,6 +222,7 @@ class PeopleSelector extends React.Component {
hasNextPage,
isNextPageLoading,
total,
isFirstLoad,
} = this.state;
const {
@ -280,6 +284,7 @@ class PeopleSelector extends React.Component {
onArrowClick={onArrowClick}
headerLabel={headerLabel ? headerLabel : `${t("Common:AddUsers")}`}
total={total}
isFirstLoad={isFirstLoad}
/>
);
}