Web: Files: fixed opening SharingPanel
This commit is contained in:
parent
a6c29d8931
commit
5cf2798aa4
@ -25,6 +25,7 @@ import {
|
||||
getTreeFolders,
|
||||
getIsLoading,
|
||||
getIsRecycleBinFolder,
|
||||
getSelection,
|
||||
} from "../../../store/files/selectors";
|
||||
import { createI18N } from "../../../helpers/i18n";
|
||||
const i18n = createI18N({
|
||||
@ -282,6 +283,7 @@ const mapStateToProps = (state) => {
|
||||
treeFolders: getTreeFolders(state),
|
||||
isLoading: getIsLoading(state),
|
||||
isRecycleBinFolder: getIsRecycleBinFolder(state),
|
||||
selection: getSelection(state)
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -17,7 +17,7 @@ import { connect } from "react-redux";
|
||||
import { withRouter } from "react-router";
|
||||
import { withTranslation } from "react-i18next";
|
||||
import { utils as commonUtils, constants, toastr, store } from "asc-web-common";
|
||||
import { getShareUsers, setShareFiles, setIsLoading } from "../../../store/files/actions";
|
||||
import { getShareUsers, setShareFiles } from "../../../store/files/actions";
|
||||
import { getAccessOption, getSelection } from "../../../store/files/selectors";
|
||||
import {
|
||||
StyledAsidePanel,
|
||||
@ -389,10 +389,7 @@ class SharingPanelComponent extends React.Component {
|
||||
|
||||
const accessOptions = getAccessOption(this.props.selectedItems);
|
||||
|
||||
this.setState(
|
||||
{ baseShareData, shareDataItems: arrayItems, accessOptions },
|
||||
() => this.props.setIsLoading(false)
|
||||
);
|
||||
return { baseShareData, shareDataItems: arrayItems, accessOptions };
|
||||
};
|
||||
|
||||
removeDuplicateShareData = shareDataItems => {
|
||||
@ -427,18 +424,18 @@ class SharingPanelComponent extends React.Component {
|
||||
const folderId = returnValue[0];
|
||||
const fileId = returnValue[1];
|
||||
let error = null;
|
||||
let shareData = {};
|
||||
|
||||
if (folderId.length !== 0 || fileId.length !== 0) {
|
||||
getShareUsers(folderId, fileId)
|
||||
.then(res => {
|
||||
this.getShareDataItems(res);
|
||||
shareData = this.getShareDataItems(res);
|
||||
})
|
||||
.catch(err => {
|
||||
this.props.setIsLoading(false);
|
||||
error = err;
|
||||
toastr.error(err);
|
||||
})
|
||||
.finally(() => !error && this.setState({ showPanel: true }));
|
||||
.finally(() => !error && this.setState({...shareData, ...{ showPanel: true }}));
|
||||
}
|
||||
};
|
||||
|
||||
@ -461,7 +458,6 @@ class SharingPanelComponent extends React.Component {
|
||||
onClose = () => this.setState({ showPanel: false });
|
||||
|
||||
componentDidMount() {
|
||||
this.props.setIsLoading(true);
|
||||
this.getShareData();
|
||||
|
||||
document.addEventListener("keyup", this.onKeyPress);
|
||||
@ -739,4 +735,4 @@ const mapStateToProps = state => {
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, { setIsLoading })(withRouter(SharingPanel));
|
||||
export default connect(mapStateToProps)(withRouter(SharingPanel));
|
||||
|
@ -29,6 +29,7 @@ const StyledAsidePanel = styled.div`
|
||||
}
|
||||
|
||||
.header_aside-panel {
|
||||
transition: unset;
|
||||
transform: translateX(${(props) => (props.visible ? "0" : "500px")});
|
||||
width: 500px;
|
||||
overflow-y: hidden;
|
||||
|
Loading…
Reference in New Issue
Block a user