Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/empty-trash-menu #461

Merged
merged 8 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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