Web: Files: renamed tempSelection to bufferSelection

This commit is contained in:
Nikita Gopienko 2021-09-30 17:46:16 +03:00
parent 8a3cb45e77
commit b51cf18617
7 changed files with 40 additions and 35 deletions

View File

@ -107,7 +107,7 @@ class DeleteDialogComponent extends React.Component {
};
onClose = () => {
this.props.setTempSelection(null);
this.props.setBufferSelection(null);
this.props.setRemoveMediaItem(null);
this.props.setDeleteDialogVisible(false);
};
@ -258,8 +258,8 @@ export default inject(
const {
selection,
isLoading,
tempSelection,
setTempSelection,
bufferSelection,
setBufferSelection,
} = filesStore;
const { deleteAction, unsubscribeAction } = filesActionsStore;
const { isPrivacyFolder, isRecycleBinFolder } = treeFoldersStore;
@ -277,8 +277,8 @@ export default inject(
return {
selection: removeMediaItem
? [removeMediaItem]
: tempSelection
? [tempSelection]
: bufferSelection
? [bufferSelection]
: selection,
isLoading,
isRootFolder: selectedFolderStore.isRootFolder,
@ -294,7 +294,7 @@ export default inject(
setRemoveMediaItem,
personal,
setTempSelection,
setBufferSelection,
};
}
)(withRouter(observer(DeleteDialog)));

View File

@ -28,7 +28,7 @@ const PureThirdPartyMoveContainer = ({
const deleteAfter = false; // TODO: get from settings
const onClose = () => {
setTempSelection(null);
setBufferSelection(null);
setDestFolderId(false);
setThirdPartyMoveDialogVisible(false);
};
@ -109,10 +109,10 @@ export default inject(({ filesStore, dialogsStore, filesActionsStore }) => {
destFolderId,
setDestFolderId,
} = dialogsStore;
const { tempSelection, setTempSelection } = filesStore;
const { bufferSelection, setBufferSelection } = filesStore;
const { checkOperationConflict } = filesActionsStore;
const selection = tempSelection ? [tempSelection] : filesStore.selection;
const selection = bufferSelection ? [bufferSelection] : filesStore.selection;
return {
visible,
@ -122,7 +122,7 @@ export default inject(({ filesStore, dialogsStore, filesActionsStore }) => {
provider: selection[0].providerKey,
checkOperationConflict,
selection,
setTempSelection,
setBufferSelection,
};
})(
withTranslation(["ThirdPartyMoveDialog", "Common", "Translations"])(

View File

@ -70,7 +70,7 @@ class ChangeOwnerComponent extends React.Component {
};
onClose = () => {
this.props.setTempSelection(null);
this.props.setBufferSelection(null);
this.props.setChangeOwnerPanelVisible(false);
};
@ -146,19 +146,19 @@ const ChangeOwnerPanel = withTranslation(["ChangeOwnerPanel", "Common"])(
export default inject(({ auth, filesStore, dialogsStore }) => {
const {
selection,
tempSelection,
bufferSelection,
setFile,
setFolder,
setFilesOwner,
setIsLoading,
isLoading,
setTempSelection,
setBufferSelection,
} = filesStore;
const { ownerPanelVisible, setChangeOwnerPanelVisible } = dialogsStore;
return {
groupsCaption: auth.settingsStore.customNames.groupsCaption,
selection: tempSelection ? [tempSelection] : selection,
selection: bufferSelection ? [bufferSelection] : selection,
isLoading,
visible: ownerPanelVisible,
@ -167,6 +167,6 @@ export default inject(({ auth, filesStore, dialogsStore }) => {
setIsLoading,
setChangeOwnerPanelVisible,
setFilesOwner,
setTempSelection,
setBufferSelection,
};
})(withRouter(observer(ChangeOwnerPanel)));

View File

@ -25,7 +25,7 @@ const OperationsPanelComponent = (props) => {
setMoveToPanelVisible,
checkOperationConflict,
setThirdPartyMoveDialogVisible,
setTempSelection,
setBufferSelection,
} = props;
const zIndex = 310;
@ -34,7 +34,7 @@ const OperationsPanelComponent = (props) => {
const expandedKeys = props.expandedKeys.map((item) => item.toString());
const onClose = () => {
!provider && setTempSelection(null);
!provider && setBufferSelection(null);
isCopy ? setCopyPanelVisible(false) : setMoveToPanelVisible(false);
setExpandedPanelKeys(null);
};
@ -142,7 +142,12 @@ export default inject(
dialogsStore,
filesActionsStore,
}) => {
const { filter, selection, tempSelection, setTempSelection } = filesStore;
const {
filter,
selection,
bufferSelection,
setBufferSelection,
} = filesStore;
const {
isRecycleBinFolder,
operationsFolders,
@ -160,7 +165,7 @@ export default inject(
setThirdPartyMoveDialogVisible,
} = dialogsStore;
const selections = tempSelection ? [tempSelection] : selection;
const selections = bufferSelection ? [bufferSelection] : selection;
const provider = selections.find((x) => x.providerKey);
@ -182,7 +187,7 @@ export default inject(
setThirdPartyMoveDialogVisible,
checkOperationConflict,
setExpandedPanelKeys,
setTempSelection,
setBufferSelection,
};
}
)(withRouter(observer(OperationsPanel)));

View File

@ -341,12 +341,12 @@ class SharingPanelComponent extends React.Component {
onCancel,
setSharingPanelVisible,
selectUploadedFile,
setTempSelection,
setBufferSelection,
} = this.props;
setSharingPanelVisible(false);
selectUploadedFile([]);
setTempSelection(null);
setBufferSelection(null);
onCancel && onCancel();
};
@ -626,7 +626,7 @@ const SharingPanel = inject(
const {
selection,
tempSelection,
bufferSelection,
canShareOwnerChange,
getAccessOption,
getExternalAccessOption,
@ -638,7 +638,7 @@ const SharingPanel = inject(
getFileInfo,
getFolderInfo,
isLoading,
setTempSelection,
setBufferSelection,
} = filesStore;
const { isPrivacyFolder } = treeFoldersStore;
const { setSharingPanelVisible, sharingPanelVisible } = dialogsStore;
@ -656,8 +656,8 @@ const SharingPanel = inject(
homepage: config.homepage,
selection: uploadPanelVisible
? selectedUploadFile
: tempSelection
? [tempSelection]
: bufferSelection
? [bufferSelection]
: selection,
isLoading,
isPrivacy: isPrivacyFolder,
@ -679,7 +679,7 @@ const SharingPanel = inject(
setShareFiles,
getFileInfo,
getFolderInfo,
setTempSelection,
setBufferSelection,
};
}
)(

View File

@ -229,10 +229,10 @@ class FilesActionStore {
setSecondaryProgressBarData,
clearSecondaryProgressData,
} = this.uploadDataStore.secondaryProgressDataStore;
const { tempSelection } = this.filesStore;
const { bufferSelection } = this.filesStore;
const selection = tempSelection
? [tempSelection]
const selection = bufferSelection
? [bufferSelection]
: this.filesStore.selection;
const fileIds = [];
@ -313,7 +313,7 @@ class FilesActionStore {
};
onSelectItem = ({ id, isFolder }) => {
const { setTempSelection, selected, setSelected } = this.filesStore;
const { setBufferSelection, selected, setSelected } = this.filesStore;
selected === "close" && setSelected("none");
if (!id) return;
@ -322,7 +322,7 @@ class FilesActionStore {
(elm) => elm.id === id
);
setTempSelection(item);
setBufferSelection(item);
};
deleteItemAction = (

View File

@ -46,7 +46,7 @@ class FilesStore {
files = [];
folders = [];
selection = [];
tempSelection = [];
bufferSelection = [];
selected = "close";
filter = FilesFilter.getDefault(); //TODO: FILTER
loadTimeout = null;
@ -235,8 +235,8 @@ class FilesStore {
this.selection = selection;
};
setTempSelection = (tempSelection) => {
this.tempSelection = tempSelection;
setBufferSelection = (bufferSelection) => {
this.bufferSelection = bufferSelection;
};
//TODO: FILTER