Web: Restored transition to the editor by clicking on the file.
This commit is contained in:
parent
d4cff06f99
commit
8e14aad3f5
@ -80,12 +80,14 @@ class NewFilesPanel extends React.Component {
|
|||||||
onNewFileClick = (e) => {
|
onNewFileClick = (e) => {
|
||||||
const { id, extension: fileExst } = e.target.dataset;
|
const { id, extension: fileExst } = e.target.dataset;
|
||||||
|
|
||||||
const { /* updateFolderBadge, */ markAsRead } = this.props;
|
const { /* updateFolderBadge, */ markAsRead, newFiles } = this.props;
|
||||||
const readingFiles = this.state.readingFiles;
|
const readingFiles = this.state.readingFiles;
|
||||||
|
|
||||||
const fileIds = fileExst ? [id] : [];
|
const fileIds = fileExst ? [id] : [];
|
||||||
const folderIds = fileExst ? [] : [id];
|
const folderIds = fileExst ? [] : [id];
|
||||||
|
|
||||||
|
const item = newFiles.find((file) => file.id.toString() === id);
|
||||||
|
|
||||||
if (readingFiles.includes(id)) return this.onFileClick(item);
|
if (readingFiles.includes(id)) return this.onFileClick(item);
|
||||||
markAsRead(folderIds, fileIds, item)
|
markAsRead(folderIds, fileIds, item)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -198,6 +200,7 @@ class NewFilesPanel extends React.Component {
|
|||||||
<StyledSharingBody stype="mediumBlack" style={SharingBodyStyle}>
|
<StyledSharingBody stype="mediumBlack" style={SharingBodyStyle}>
|
||||||
{newFiles.map((file) => {
|
{newFiles.map((file) => {
|
||||||
const element = this.getItemIcon(file);
|
const element = this.getItemIcon(file);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row key={file.id} element={element}>
|
<Row key={file.id} element={element}>
|
||||||
<Link
|
<Link
|
||||||
@ -205,7 +208,7 @@ class NewFilesPanel extends React.Component {
|
|||||||
containerWidth="100%"
|
containerWidth="100%"
|
||||||
type="page"
|
type="page"
|
||||||
fontWeight={600}
|
fontWeight={600}
|
||||||
color="#333"
|
color={theme.filesPanels.color}
|
||||||
isTextOverflow
|
isTextOverflow
|
||||||
truncate
|
truncate
|
||||||
title={file.title}
|
title={file.title}
|
||||||
@ -213,21 +216,9 @@ class NewFilesPanel extends React.Component {
|
|||||||
className="files-new-link"
|
className="files-new-link"
|
||||||
data-id={file.id}
|
data-id={file.id}
|
||||||
data-extension={file.fileExst}
|
data-extension={file.fileExst}
|
||||||
>
|
|
||||||
<Link
|
|
||||||
containerWidth="100%"
|
|
||||||
type="page"
|
|
||||||
fontWeight="bold"
|
|
||||||
color={theme.filesPanels.color}
|
|
||||||
isTextOverflow
|
|
||||||
truncate
|
|
||||||
title={file.title}
|
|
||||||
fontSize="14px"
|
|
||||||
className="files-new-link"
|
|
||||||
>
|
>
|
||||||
{file.title}
|
{file.title}
|
||||||
</Link>
|
</Link>
|
||||||
</Link>
|
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@ -243,7 +234,7 @@ class NewFilesPanel extends React.Component {
|
|||||||
)}
|
)}
|
||||||
<StyledFooter>
|
<StyledFooter>
|
||||||
<Button
|
<Button
|
||||||
className="new_files_panel-button"
|
className="new_files_panel-button new_file_panel-first-button"
|
||||||
label={t("MarkAsRead")}
|
label={t("MarkAsRead")}
|
||||||
size="normal"
|
size="normal"
|
||||||
primary
|
primary
|
||||||
@ -251,7 +242,7 @@ class NewFilesPanel extends React.Component {
|
|||||||
isLoading={this.state.inProgress}
|
isLoading={this.state.inProgress}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
className="sharing_panel-button"
|
className="new_files_panel-button"
|
||||||
label={t("Common:CloseButton")}
|
label={t("Common:CloseButton")}
|
||||||
size="normal"
|
size="normal"
|
||||||
onClick={this.onClose}
|
onClick={this.onClose}
|
||||||
|
Loading…
Reference in New Issue
Block a user