Fixed Bug 60257: Files. Lock icon for files in 'My Documents'/'Archive'/'Trash' folder.

This commit is contained in:
Tatiana Lopaeva 2022-12-21 11:21:01 +03:00
parent d696d0cd4b
commit 7c910ca78f
4 changed files with 24 additions and 12 deletions

View File

@ -56,7 +56,7 @@ export default function withQuickButtons(WrappedComponent) {
isAdmin,
sectionWidth,
viewAs,
isPersonalRoom,
folderCategory,
} = this.props;
const quickButtonsComponent = (
@ -71,7 +71,7 @@ export default function withQuickButtons(WrappedComponent) {
isCanWebEdit={isCanWebEdit}
onClickLock={this.onClickLock}
onClickFavorite={this.onClickFavorite}
isPersonalRoom={isPersonalRoom}
folderCategory={folderCategory}
/>
);
@ -97,9 +97,16 @@ export default function withQuickButtons(WrappedComponent) {
setFavoriteAction,
onSelectItem,
} = filesActionsStore;
const { isPersonalRoom } = treeFoldersStore;
const {
isPersonalFolderRoot,
isArchiveFolderRoot,
isTrashFolder,
} = treeFoldersStore;
const { setSharingPanelVisible } = dialogsStore;
const folderCategory =
isTrashFolder || isArchiveFolderRoot || isPersonalFolderRoot;
return {
theme: auth.settingsStore.theme,
isAdmin: auth.isAdmin,
@ -107,8 +114,7 @@ export default function withQuickButtons(WrappedComponent) {
setFavoriteAction,
onSelectItem,
setSharingPanelVisible,
isPersonalRoom,
folderCategory,
};
}
)(observer(WithQuickButtons));

View File

@ -16,13 +16,14 @@ const QuickButtons = (props) => {
item,
theme,
sectionWidth,
isTrashFolder,
onClickLock,
isDisabled,
onClickFavorite,
viewAs,
isCanWebEdit,
isPersonalRoom,
folderCategory,
} = props;
const { id, locked, fileStatus, title, fileExst } = item;
@ -58,7 +59,7 @@ const QuickButtons = (props) => {
const setFavorite = () => onClickFavorite(isFavorite);
const isAvailableLockFile =
!isPersonalRoom && fileExst && displayBadges && isCanWebEdit;
!folderCategory && fileExst && displayBadges && isCanWebEdit;
return (
<div className="badges additional-badges">

View File

@ -180,12 +180,12 @@ const StyledSimpleFilesRow = styled(Row)`
}
.expandButton {
margin-left: ${(props) => (!props.isPersonalRoom ? "6px" : "0")};
margin-left: ${(props) => (!props.folderCategory ? "6px" : "0")};
padding-top: 0px;
}
.expandButton > div:first-child {
${(props) =>
props.isPersonalRoom &&
props.folderCategory &&
css`
padding-left: 0 !important;
`}
@ -220,7 +220,8 @@ const SimpleFilesRow = (props) => {
showHotkeyBorder,
id,
isRooms,
isPersonalRoom,
folderCategory,
} = props;
const [isDragOver, setIsDragOver] = React.useState(false);
@ -316,7 +317,7 @@ const SimpleFilesRow = (props) => {
isDragOver={isDragOver}
isSmallContainer={isSmallContainer}
isRooms={isRooms}
isPersonalRoom={isPersonalRoom}
folderCategory={folderCategory}
>
<FilesRowContent
item={item}

View File

@ -203,6 +203,10 @@ class TreeFoldersStore {
return FolderType.Archive === this.selectedFolderStore.rootFolderType;
}
get isPersonalFolderRoot() {
return FolderType.USER === this.selectedFolderStore.rootFolderType;
}
get selectedKeys() {
const selectedKeys =
this.selectedTreeNode.length > 0 &&