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

This commit is contained in:
Maria Sukhova 2022-05-17 12:57:17 +03:00
commit 3db47823bd
6 changed files with 60 additions and 6 deletions

View File

@ -155,8 +155,11 @@ class SelectFolderDialog extends React.Component {
providerKey,
folderTitle,
folderId,
setSelectedItems,
} = this.props;
setSelectedItems();
onSubmit && onSubmit(folderId, folderTitle, providerKey);
onSave && onSave(e, folderId);
onSetNewFolderPath && onSetNewFolderPath(folderId);
@ -285,10 +288,13 @@ export default inject(
selectFolderDialogStore,
filesStore,
auth,
filesActionsStore,
}) => {
const { treeFolders, setExpandedPanelKeys } = treeFoldersStore;
const { filter } = filesStore;
const { setSelectedItems } = filesActionsStore;
const { id } = selectedFolderStore;
const {
setFolderId,
@ -314,6 +320,7 @@ export default inject(
setProviderKey,
treeFolders,
filter,
setSelectedItems,
};
}
)(

View File

@ -84,7 +84,7 @@ const StyledSimpleFilesRow = styled(Row)`
}
${(props) =>
!props.contextOptions &&
(!props.contextOptions || props.isEdit) &&
`
& > div:last-child {
width: 0px;

View File

@ -220,7 +220,14 @@ class SectionHeaderContent extends React.Component {
}
};
onEmptyTrashAction = () => this.props.setEmptyTrashDialogVisible(true);
onEmptyTrashAction = () => {
const { activeFiles, activeFolders } = this.props;
const isExistActiveItems = [...activeFiles, ...activeFolders].length > 0;
if (isExistActiveItems) return;
this.props.setEmptyTrashDialogVisible(true);
};
getContextOptionsFolder = () => {
const { t, personal } = this.props;
@ -447,6 +454,8 @@ export default inject(
viewAs,
setIsLoading,
fetchFiles,
activeFiles,
activeFolders,
} = filesStore;
const { setAction } = fileActionStore;
const {
@ -515,6 +524,9 @@ export default inject(
setIsLoading,
fetchFiles,
activeFiles,
activeFolders,
};
}
)(

View File

@ -262,8 +262,8 @@ class PureHome extends React.Component {
const {
isProgressFinished,
secondaryProgressDataStoreIcon,
selectionLength,
selectionTitle,
itemsSelectionLength,
itemsSelectionTitle,
} = this.props;
if (this.props.isHeaderVisible !== prevProps.isHeaderVisible) {
@ -275,8 +275,8 @@ class PureHome extends React.Component {
) {
this.showOperationToast(
secondaryProgressDataStoreIcon,
selectionLength,
selectionTitle
itemsSelectionLength,
itemsSelectionTitle
);
}
}
@ -440,6 +440,8 @@ export default inject(
icon: secondaryProgressDataStoreIcon,
alert: secondaryProgressDataStoreAlert,
isSecondaryProgressFinished: isProgressFinished,
itemsSelectionLength,
itemsSelectionTitle,
} = secondaryProgressDataStore;
const {
@ -494,6 +496,9 @@ export default inject(
isProgressFinished,
selectionTitle,
itemsSelectionLength,
itemsSelectionTitle,
setExpandedKeys,
setFirstLoad,
setDragging,

View File

@ -740,10 +740,26 @@ class FilesActionStore {
this.dialogsStore.setConflictResolveDialogVisible(true);
};
setSelectedItems = () => {
const selectionLength = this.filesStore.selection.length;
const selectionTitle = this.filesStore.selectionTitle;
if (selectionLength && selectionTitle) {
this.uploadDataStore.secondaryProgressDataStore.setItemsSelectionLength(
selectionLength
);
this.uploadDataStore.secondaryProgressDataStore.setItemsSelectionTitle(
selectionTitle
);
}
};
checkOperationConflict = async (operationData) => {
const { destFolderId, folderIds, fileIds } = operationData;
const { setBufferSelection } = this.filesStore;
this.setSelectedItems();
this.filesStore.setSelected("none");
let conflicts;

View File

@ -7,6 +7,8 @@ class SecondaryProgressDataStore {
icon = "trash";
alert = false;
filesCount = 0;
itemsSelectionLength = 0;
itemsSelectionTitle = null;
constructor() {
makeObservable(this, {
@ -16,11 +18,15 @@ class SecondaryProgressDataStore {
icon: observable,
alert: observable,
filesCount: observable,
itemsSelectionLength: observable,
itemsSelectionTitle: observable,
isSecondaryProgressFinished: computed,
setSecondaryProgressBarData: action,
clearSecondaryProgressData: action,
setItemsSelectionLength: action,
setItemsSelectionTitle: action,
});
}
@ -33,6 +39,14 @@ class SecondaryProgressDataStore {
}
};
setItemsSelectionTitle = (itemsSelectionTitle) => {
this.itemsSelectionTitle = itemsSelectionTitle;
};
setItemsSelectionLength = (itemsSelectionLength) => {
this.itemsSelectionLength = itemsSelectionLength;
};
clearSecondaryProgressData = () => {
this.percent = 0;
this.label = "";