Web: Files: fix after merdge

This commit is contained in:
Artem Tarasov 2021-04-15 16:11:36 +03:00
parent 54b96e8aa0
commit 1d8ba62421
5 changed files with 683 additions and 684 deletions

View File

@ -70,8 +70,7 @@ const FileItem = (props) => {
const onContentFileSelect = (checked, file) => {
if (!file) return;
selectRowAction(checked, file); // rename to selectFileAction ?
selectRowAction(checked, file);
};
const onClickShare = () => {
@ -173,7 +172,7 @@ const FileItem = (props) => {
const isDragging = isFolder && access < 2 && !isRecycleBin;
let className = isDragging ? " droppable" : "";
if (draggable) className += " draggable";
if (draggable) className += " draggable not-selectable";
const sharedButton =
!canShare || (isPrivacy && !fileExst) || isEdit || id <= 0 || isMobile
@ -183,50 +182,53 @@ const FileItem = (props) => {
const temporaryIcon = getIcon(96, fileExst, providerKey, contentLength);
return (
<DragAndDrop
className={className}
onDrop={onDrop}
onMouseDown={onMouseDown}
dragging={dragging && isDragging}
{...contextOptionsProps}
value={value}
>
{viewAs === "tile" ? (
<Tile
key={id}
item={item}
isFolder={isFolder}
element={element}
onSelect={onContentFileSelect}
rowContextClick={fileContextClick}
{...checkedProps}
{...contextOptionsProps}
temporaryIcon={temporaryIcon}
>
<FilesContent item={item} viewAs={viewAs} />
</Tile>
) : (
<SimpleFilesRow
sectionWidth={sectionWidth}
key={id}
data={item}
element={element}
contentElement={sharedButton}
onSelect={onContentFileSelect}
rowContextClick={fileContextClick}
isPrivacy={isPrivacy}
{...checkedProps}
{...contextOptionsProps}
contextButtonSpacerWidth={displayShareButton}
>
<FilesContent
<div ref={props.selectableRef}>
<DragAndDrop
className={className}
onDrop={onDrop}
onMouseDown={onMouseDown}
dragging={dragging && isDragging}
{...contextOptionsProps}
value={value}
>
{viewAs === "tile" ? (
<Tile
key={id}
item={item}
isFolder={isFolder}
element={element}
onSelect={onContentFileSelect}
rowContextClick={fileContextClick} // rename!
{...checkedProps}
{...contextOptionsProps}
temporaryIcon={temporaryIcon}
isPrivacy={isPrivacy}
>
<FilesContent item={item} viewAs={viewAs} />
</Tile>
) : (
<SimpleFilesRow
sectionWidth={sectionWidth}
viewAs={viewAs}
/>
</SimpleFilesRow>
)}
</DragAndDrop>
key={id}
data={item}
element={element}
contentElement={sharedButton}
onSelect={onContentFileSelect}
rowContextClick={fileContextClick}
isPrivacy={isPrivacy}
{...checkedProps}
{...contextOptionsProps}
contextButtonSpacerWidth={displayShareButton}
>
<FilesContent
item={item}
sectionWidth={sectionWidth}
viewAs={viewAs}
/>
</SimpleFilesRow>
)}
</DragAndDrop>
</div>
);
};

View File

@ -26,15 +26,9 @@ const FilesContainer = (props) => {
headingFolders={t("Folders")}
headingFiles={t("Files")}
>
{filesList.map((item) => {
return (
<FileItem
key={item.id}
item={item}
// viewAs={viewAs}
/>
);
})}
{filesList.map((item) => (
<FileItem key={item.id} item={item} />
))}
</TileContainer>
) : (
<RowContainer
@ -42,16 +36,13 @@ const FilesContainer = (props) => {
draggable
useReactWindow={false}
>
{filesList.map((item) => {
return (
<FileItem
key={item.id}
item={item}
sectionWidth={context.sectionWidth}
//viewAs={viewAs}
/>
);
})}
{filesList.map((item) => (
<FileItem
key={item.id}
item={item}
sectionWidth={context.sectionWidth}
/>
))}
</RowContainer>
)
}

View File

@ -445,13 +445,7 @@ class FilesContent extends React.Component {
};
render() {
const {
itemTitle,
showConvertDialog,
showNewFilesPanel,
newFolderId,
newItems,
} = this.state;
const { itemTitle, showConvertDialog, newItems } = this.state;
const {
t,
@ -736,8 +730,8 @@ export default inject(
fetchFileVersions,
fetchFiles,
filter,
setNewRowItems,
newRowItems,
//setNewRowItems,
//newRowItems,
createFile,
updateFile,
renameFolder,

View File

@ -341,7 +341,7 @@ class ContextOptionsStore {
onClick: this.onClickDownloadAs,
disabled: false,
};
case "move":
case "move-to":
return {
key: option,
label: t("MoveTo"),
@ -357,7 +357,7 @@ class ContextOptionsStore {
onClick: this.onMoveAction,
disabled: false,
};
case "copy":
case "copy-to":
return {
key: option,
label: t("Copy"),
@ -365,7 +365,7 @@ class ContextOptionsStore {
onClick: this.onCopyAction,
disabled: false,
};
case "duplicate":
case "copy":
return {
key: option,
label: t("Duplicate"),

1228
yarn.lock

File diff suppressed because it is too large Load Diff