Merge branch 'release/1.0.0' into bugfix/icons-blur

This commit is contained in:
Ilya Oleshko 2021-10-26 16:56:35 +03:00
commit cece18f0e7
5 changed files with 19 additions and 16 deletions

View File

@ -89,6 +89,7 @@ class ComboBox extends React.Component {
toggleAction, toggleAction,
textOverflow, textOverflow,
showDisabledItems, showDisabledItems,
offsetDropDownY,
} = this.props; } = this.props;
const { isOpen, selectedOption } = this.state; const { isOpen, selectedOption } = this.state;
@ -138,7 +139,7 @@ class ComboBox extends React.Component {
className="dropdown-container not-selectable" className="dropdown-container not-selectable"
directionX={directionX} directionX={directionX}
directionY={directionY} directionY={directionY}
manualY="102%" manualY={offsetDropDownY}
open={isOpen} open={isOpen}
clickOutsideAction={this.handleClickOutside} clickOutsideAction={this.handleClickOutside}
{...dropDownMaxHeightProp} {...dropDownMaxHeightProp}
@ -210,6 +211,8 @@ ComboBox.propTypes = {
textOverflow: PropTypes.bool, textOverflow: PropTypes.bool,
/** Disables clicking on the icon */ /** Disables clicking on the icon */
disableIconClick: PropTypes.bool, disableIconClick: PropTypes.bool,
/** Y offset */
offsetDropDownY: PropTypes.string,
}; };
ComboBox.defaultProps = { ComboBox.defaultProps = {
@ -221,6 +224,7 @@ ComboBox.defaultProps = {
size: "base", size: "base",
disableIconClick: true, disableIconClick: true,
showDisabledItems: false, showDisabledItems: false,
offsetDropDownY: "102%",
}; };
export default ComboBox; export default ComboBox;

View File

@ -105,9 +105,11 @@ class GroupButton extends React.Component {
? { maxHeight: dropDownMaxHeight } ? { maxHeight: dropDownMaxHeight }
: {}; : {};
const offsetSelectDropDown = isSelect const offsetSelectDropDown = isSelect
? { manualX: window.innerWidth <= 1024 ? "16px" : "24px" } ? { manualX: window.innerWidth <= 1024 ? "44px" : "50px" }
: {}; : {};
const manualY = window.innerWidth <= 1024 ? "60px" : "53px";
return ( return (
<StyledGroupButton <StyledGroupButton
ref={this.ref} ref={this.ref}
@ -140,7 +142,7 @@ class GroupButton extends React.Component {
<DropDown <DropDown
{...dropDownMaxHeightProp} {...dropDownMaxHeightProp}
{...offsetSelectDropDown} {...offsetSelectDropDown}
manualY="72px" manualY={manualY}
open={this.state.isOpen} open={this.state.isOpen}
clickOutsideAction={this.clickOutsideAction} clickOutsideAction={this.clickOutsideAction}
showDisabledItems={true} showDisabledItems={true}

View File

@ -51,6 +51,7 @@ const TableGroupMenu = (props) => {
className="table-container_group-menu-combobox not-selectable" className="table-container_group-menu-combobox not-selectable"
options={[]} options={[]}
selectedOption={{}} selectedOption={{}}
offsetDropDownY="44px"
/> />
<div className="table-container_group-menu-separator" /> <div className="table-container_group-menu-separator" />
{headerMenu.map((item, index) => { {headerMenu.map((item, index) => {

View File

@ -609,7 +609,7 @@ class FilesActionStore {
} = this.treeFoldersStore; } = this.treeFoldersStore;
const { const {
isAccessedSelected, isAccessedSelected,
isWebEditSelected, canConvertSelected,
isThirdPartyRootSelection, isThirdPartyRootSelection,
hasSelection, hasSelection,
} = this.filesStore; } = this.filesStore;
@ -623,7 +623,7 @@ class FilesActionStore {
case "download": case "download":
return hasSelection; return hasSelection;
case "downloadAs": case "downloadAs":
return isWebEditSelected && hasSelection; return canConvertSelected;
case "moveTo": case "moveTo":
return ( return (
!isThirdPartyRootSelection && !isThirdPartyRootSelection &&

View File

@ -426,6 +426,8 @@ class FilesStore {
const { isDesktopClient } = this.authStore.settingsStore; const { isDesktopClient } = this.authStore.settingsStore;
if (isFile) { if (isFile) {
const shouldEdit = canWebEdit(item.fileExst);
const shouldView = canViewedDocs(item.fileExst);
let fileOptions = [ let fileOptions = [
//"open", //"open",
"edit", "edit",
@ -470,12 +472,12 @@ class FilesStore {
"unsubscribe", "unsubscribe",
]); ]);
if (!this.isWebEditSelected && !canViewedDocs(item.fileExst)) { if (!shouldEdit && !shouldView) {
fileOptions = this.removeOptions(fileOptions, ["sharing-settings"]); fileOptions = this.removeOptions(fileOptions, ["sharing-settings"]);
} }
} }
if (!this.isWebEditSelected) { if (!this.canConvertSelected) {
fileOptions = this.removeOptions(fileOptions, ["download-as"]); fileOptions = this.removeOptions(fileOptions, ["download-as"]);
} }
@ -698,11 +700,7 @@ class FilesStore {
); );
} }
if ( if (!shouldEdit && !shouldView && !fileOptions.includes("view")) {
!canWebEdit(item.fileExst) &&
!canViewedDocs(item.fileExst) &&
!fileOptions.includes("view")
) {
fileOptions = this.removeOptions(fileOptions, [ fileOptions = this.removeOptions(fileOptions, [
"edit", "edit",
"preview", "preview",
@ -710,7 +708,7 @@ class FilesStore {
]); ]);
} }
if (!canWebEdit(item.fileExst) && canViewedDocs(item.fileExst)) { if (!shouldEdit && shouldView) {
fileOptions = this.removeOptions(fileOptions, ["edit"]); fileOptions = this.removeOptions(fileOptions, ["edit"]);
} }
@ -1133,7 +1131,6 @@ class FilesStore {
const contextOptions = this.getFilesContextOptions(item, canOpenPlayer); const contextOptions = this.getFilesContextOptions(item, canOpenPlayer);
const isThirdPartyFolder = providerKey && id === rootFolderId; const isThirdPartyFolder = providerKey && id === rootFolderId;
//const isCanWebEdit = canWebEdit(item.fileExst);
const iconSize = this.viewAs === "tile" && isMobile ? 32 : 24; const iconSize = this.viewAs === "tile" && isMobile ? 32 : 24;
const icon = getIcon(iconSize, fileExst, providerKey, contentLength); const icon = getIcon(iconSize, fileExst, providerKey, contentLength);
@ -1203,7 +1200,6 @@ class FilesStore {
webUrl, webUrl,
providerKey, providerKey,
canOpenPlayer, canOpenPlayer,
//canWebEdit: isCanWebEdit,
//canShare, //canShare,
canShare, canShare,
canEdit, canEdit,
@ -1367,7 +1363,7 @@ class FilesStore {
return !!withProvider; return !!withProvider;
} }
get isWebEditSelected() { get canConvertSelected() {
const { filesConverts } = this.formatsStore.docserviceStore; const { filesConverts } = this.formatsStore.docserviceStore;
const selection = this.selection.length const selection = this.selection.length