Web: Files: fixed selection file with same id, fixed tile view
This commit is contained in:
parent
720703cbab
commit
5e65c857c7
@ -461,8 +461,12 @@ class FilesStore {
|
|||||||
clearFilter = true,
|
clearFilter = true,
|
||||||
withSubfolders = false
|
withSubfolders = false
|
||||||
) => {
|
) => {
|
||||||
const { treeFolders, setSelectedNode, getSubfolders, selectedTreeNode } =
|
const {
|
||||||
this.treeFoldersStore;
|
treeFolders,
|
||||||
|
setSelectedNode,
|
||||||
|
getSubfolders,
|
||||||
|
selectedTreeNode,
|
||||||
|
} = this.treeFoldersStore;
|
||||||
const { id } = this.selectedFolderStore;
|
const { id } = this.selectedFolderStore;
|
||||||
|
|
||||||
const isPrefSettings = isNaN(+selectedTreeNode) && !id;
|
const isPrefSettings = isNaN(+selectedTreeNode) && !id;
|
||||||
@ -629,8 +633,17 @@ class FilesStore {
|
|||||||
deselectFile = (file) => {
|
deselectFile = (file) => {
|
||||||
const { id, parentId } = file;
|
const { id, parentId } = file;
|
||||||
const isFileSelected = this.isFileSelected(id, parentId);
|
const isFileSelected = this.isFileSelected(id, parentId);
|
||||||
if (isFileSelected)
|
if (isFileSelected) {
|
||||||
this.selection = this.selection.filter((x) => x.id !== id);
|
let selectionIndex = this.selection.findIndex(
|
||||||
|
(x) => x.parentId === parentId && x.id === id
|
||||||
|
);
|
||||||
|
|
||||||
|
if (selectionIndex !== -1) {
|
||||||
|
this.selection = this.selection.filter(
|
||||||
|
(x, index) => index !== selectionIndex
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
removeOptions = (options, toRemoveArray) =>
|
removeOptions = (options, toRemoveArray) =>
|
||||||
@ -665,8 +678,11 @@ class FilesStore {
|
|||||||
isMy,
|
isMy,
|
||||||
} = this.treeFoldersStore;
|
} = this.treeFoldersStore;
|
||||||
|
|
||||||
const { canWebEdit, canViewedDocs, canFormFillingDocs } =
|
const {
|
||||||
this.filesSettingsStore;
|
canWebEdit,
|
||||||
|
canViewedDocs,
|
||||||
|
canFormFillingDocs,
|
||||||
|
} = this.filesSettingsStore;
|
||||||
|
|
||||||
const isThirdPartyFolder =
|
const isThirdPartyFolder =
|
||||||
item.providerKey && item.id === item.rootFolderId;
|
item.providerKey && item.id === item.rootFolderId;
|
||||||
@ -1433,7 +1449,7 @@ class FilesStore {
|
|||||||
|
|
||||||
let isFolder = false;
|
let isFolder = false;
|
||||||
this.folders.map((x) => {
|
this.folders.map((x) => {
|
||||||
if (x.id === item.id) isFolder = true;
|
if (x.id === item.id && x.parentId === item.parentId) isFolder = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
const { isRecycleBinFolder } = this.treeFoldersStore;
|
const { isRecycleBinFolder } = this.treeFoldersStore;
|
||||||
@ -1582,8 +1598,12 @@ class FilesStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
get sortedFiles() {
|
get sortedFiles() {
|
||||||
const { extsConvertible, isSpreadsheet, isPresentation, isDocument } =
|
const {
|
||||||
this.filesSettingsStore;
|
extsConvertible,
|
||||||
|
isSpreadsheet,
|
||||||
|
isPresentation,
|
||||||
|
isDocument,
|
||||||
|
} = this.filesSettingsStore;
|
||||||
|
|
||||||
let sortedFiles = {
|
let sortedFiles = {
|
||||||
documents: [],
|
documents: [],
|
||||||
|
Loading…
Reference in New Issue
Block a user