Skip to content

Commit

Permalink
Merge pull request #461 from ONLYOFFICE/bugfix/Bug53151
Browse files Browse the repository at this point in the history
Bugfix/empty-trash-menu
  • Loading branch information
AlexeySafronov authored Nov 18, 2021
2 parents 594b767 + d5fb86f commit c3b4bf4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
37 changes: 37 additions & 0 deletions products/ASC.Files/Client/src/pages/Home/Section/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@ const StyledContainer = styled.div`
}
}
}
.trash-button {
margin-bottom: -1px;
@media (min-width: 1024px) {
margin-left: 8px;
}
@media ${tablet} {
& > div:first-child {
margin-right: -8px;
}
}
}
}
.group-button-menu-container {
Expand Down Expand Up @@ -352,6 +366,8 @@ class SectionHeaderContent extends React.Component {
isTabletView,
personal,
viewAs,
isRecycleBinFolder,
isEmptyFilesList,
} = this.props;

const menuItems = this.getMenuItems();
Expand Down Expand Up @@ -449,6 +465,19 @@ class SectionHeaderContent extends React.Component {
/>
)
)}
{isRecycleBinFolder && !isEmptyFilesList && (
<span title={t("EmptyRecycleBin")}>
<IconButton
iconName="images/clear.active.react.svg"
size="15"
color="#A3A9AE"
hoverColor="#657077"
isFill={true}
onClick={this.onEmptyTrashAction}
className="trash-button"
/>
</span>
)}
</>
)}
</div>
Expand All @@ -468,6 +497,7 @@ export default inject(
selectedFolderStore,
filesActionsStore,
settingsStore,
treeFoldersStore,
}) => {
const {
setSelected,
Expand All @@ -483,15 +513,18 @@ export default inject(
viewAs,
cbMenuItems,
getCheckboxItemLabel,
isEmptyFilesList,
} = filesStore;
const { setAction } = fileActionStore;
const {
setSharingPanelVisible,
setMoveToPanelVisible,
setCopyPanelVisible,
setDeleteDialogVisible,
setEmptyTrashDialogVisible,
} = dialogsStore;

const { isRecycleBinFolder } = treeFoldersStore;
const { deleteAction, downloadAction, getHeaderMenu } = filesActionsStore;

return {
Expand Down Expand Up @@ -524,6 +557,10 @@ export default inject(
downloadAction,
getHeaderMenu,
getCheckboxItemLabel,

isRecycleBinFolder,
setEmptyTrashDialogVisible,
isEmptyFilesList,
};
}
)(
Expand Down
6 changes: 1 addition & 5 deletions products/ASC.Files/Client/src/store/FilesActionsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -843,11 +843,7 @@ class FilesActionStore {
label: t("Translations:Restore"),
onClick: () => setMoveToPanelVisible(true),
})
.set("delete", deleteOption)
.set("emptyRecycleBin", {
label: t("EmptyRecycleBin"),
onClick: () => setEmptyTrashDialogVisible(true),
});
.set("delete", deleteOption);
return this.convertToArray(itemsCollection);
};
getHeaderMenu = (t) => {
Expand Down

0 comments on commit c3b4bf4

Please sign in to comment.