From 4160ddcf69ef4064d43fa96dcf28b988310a42ca Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Thu, 21 Oct 2021 10:55:11 +0300 Subject: [PATCH] Web: Files: Removed the jump to the beginning of the list when the recovery process is over. --- .../Section/Body/StyledVersionList.js | 94 +++++++++++++++++++ .../Section/Body/StyledVersionRow.js | 66 +------------ .../VersionHistory/Section/Body/VersionRow.js | 9 +- .../VersionHistory/Section/Body/index.js | 42 +++++---- 4 files changed, 122 insertions(+), 89 deletions(-) create mode 100644 products/ASC.Files/Client/src/pages/VersionHistory/Section/Body/StyledVersionList.js diff --git a/products/ASC.Files/Client/src/pages/VersionHistory/Section/Body/StyledVersionList.js b/products/ASC.Files/Client/src/pages/VersionHistory/Section/Body/StyledVersionList.js new file mode 100644 index 00000000000..b843782c0e1 --- /dev/null +++ b/products/ASC.Files/Client/src/pages/VersionHistory/Section/Body/StyledVersionList.js @@ -0,0 +1,94 @@ +import styled from "styled-components"; + +const StyledVersionList = styled.div` + +.row_context-menu-wrapper { + .expandButton { + ${(props) => + props.isRestoreProcess && + ` + touch-action: none; + pointer-events: none; + `} + svg { + path { + ${(props) => + props.isRestoreProcess && + ` + fill: #d0d5da; + `}; + } + } + } + + } + + .row_content { + + .version_link, + .version-link-file, + .version_content-length, + .version_link-action, + .row_context-menu-wrapper, + .version_text { + ${(props) => + props.isRestoreProcess && + ` + color: #d0d5da; + touch-action: none; + pointer-events: none; + `} + } + + .versioned, .not-versioned { + ${(props) => + props.isRestoreProcess && + ` + touch-action: none; + pointer-events: none; + `} + } + + .versioned { + svg { + path { + ${(props) => + props.isRestoreProcess && + ` + fill: #d0d5da; + `}; + } + } + } + + .not-versioned{ + svg { + path { + + ${(props) => + props.isRestoreProcess && + ` + stroke: #d0d5da; + `}; + } + } + } + +} + .icon-link { + ${(props) => + props.isRestoreProcess && + ` + touch-action: none; + pointer-events: none; + `} + svg { + path { + ${(props) => props.isRestoreProcess && " fill: #d0d5da"} + } + } + } + } +`; + +export default StyledVersionList; diff --git a/products/ASC.Files/Client/src/pages/VersionHistory/Section/Body/StyledVersionRow.js b/products/ASC.Files/Client/src/pages/VersionHistory/Section/Body/StyledVersionRow.js index 1e664579680..a0ca7286460 100644 --- a/products/ASC.Files/Client/src/pages/VersionHistory/Section/Body/StyledVersionRow.js +++ b/products/ASC.Files/Client/src/pages/VersionHistory/Section/Body/StyledVersionRow.js @@ -135,23 +135,7 @@ const StyledVersionRow = styled(Row)` display: none; right: 16px !important; - .expandButton { - ${(props) => - props.isRestoreProcess && - ` - touch-action: none; - pointer-events: none; - `} - svg { - path { - ${(props) => - props.isRestoreProcess && - ` - fill: #d0d5da; - `}; - } - } - } + @media ${tablet} { display: block; position: absolute; @@ -162,54 +146,6 @@ const StyledVersionRow = styled(Row)` .row_content { display: block; - - .version_link, - .version-link-file, - .version_content-length, - .version_link-action, - .row_context-menu-wrapper, - .version_text { - ${(props) => - props.isRestoreProcess && - ` - color: #d0d5da; - touch-action: none; - pointer-events: none; - `} - } - - .version_badge { - ${(props) => - props.isRestoreProcess && - ` - touch-action: none; - pointer-events: none; - `} - svg { - path { - ${(props) => - props.isVersion && - props.isRestoreProcess && - ` - fill: #d0d5da; - `}; - } - } - } - - .icon-link { - ${(props) => - props.isRestoreProcess && - ` - touch-action: none; - pointer-events: none; - `} - svg { - path { - ${(props) => props.isRestoreProcess && " fill: #d0d5da"} - } - } - } } .modal-dialog-aside-footer { diff --git a/products/ASC.Files/Client/src/pages/VersionHistory/Section/Body/VersionRow.js b/products/ASC.Files/Client/src/pages/VersionHistory/Section/Body/VersionRow.js index ed07be9214c..d641ed79b7d 100644 --- a/products/ASC.Files/Client/src/pages/VersionHistory/Section/Body/VersionRow.js +++ b/products/ASC.Files/Client/src/pages/VersionHistory/Section/Body/VersionRow.js @@ -32,7 +32,6 @@ const VersionRow = (props) => { restoreVersion, updateCommentVersion, onSetRestoreProcess, - isRestoreProcess, isTabletView, onUpdateHeight, versionsListLength, @@ -108,21 +107,21 @@ const VersionRow = (props) => { newRowHeight && onUpdateHeight(index, newRowHeight); }, [showEditPanel, versionsListLength]); - console.log("updating"); + //console.log("updating"); return (
{ console.log("onSetRestoreProcess", isRestoreProcess); - this.listKey += 1; - this.setState({ isRestoreProcess, }); @@ -62,7 +60,6 @@ class SectionBodyContent extends React.Component { renderRow = memo(({ index, style }) => { const { versions, culture } = this.props; - const { isRestoreProcess } = this.state; const prevVersion = versions[index > 0 ? index - 1 : index].versionGroup; let isVersion = true; @@ -70,6 +67,7 @@ class SectionBodyContent extends React.Component { if (index > 0 && prevVersion === versions[index].versionGroup) { isVersion = false; } + console.log("render row", this.state, "versions.length", versions.length); return (
@@ -81,7 +79,6 @@ class SectionBodyContent extends React.Component { versionsListLength={versions.length} index={index} culture={culture} - isRestoreProcess={isRestoreProcess} onSetRestoreProcess={this.onSetRestoreProcess} onUpdateHeight={this.onUpdateHeight} /> @@ -92,23 +89,30 @@ class SectionBodyContent extends React.Component { const { versions, isLoading } = this.props; const renderList = ({ height, width }) => { + console.log( + "render list", + this.state, + "versions.length", + versions.length + ); return ( - - {this.renderRow} - + + + {this.renderRow} + + ); }; - + console.log("versions", versions); return versions && !isLoading ? (
{renderList}