Merge pull request #1063 from ONLYOFFICE/feature/bug-fixes

[DE PE SSE mobile] Fix Bug 51869
This commit is contained in:
Julia Radzhabova 2021-08-11 14:38:40 +03:00 committed by GitHub
commit 811977cb48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 62 additions and 58 deletions

View file

@ -6,13 +6,16 @@ class DocumentInfoController extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.docProps = this.getDocProps(); this.docProps = this.getDocProps();
this.getModified = this.getModified();
this.getModifiedBy = this.getModifiedBy(); if(this.docProps) {
this.getCreators = this.getCreators(); this.modified = this.getModified();
this.modifiedBy = this.getModifiedBy();
this.creators = this.getCreators();
this.title = this.getTitle(); this.title = this.getTitle();
this.subject = this.getSubject(); this.subject = this.getSubject();
this.description = this.getDescription(); this.description = this.getDescription();
this.getCreated = this.getCreated(); this.created = this.getCreated();
}
} }
getDocProps() { getDocProps() {
@ -76,6 +79,7 @@ class DocumentInfoController extends Component {
getCreated() { getCreated() {
let value = this.docProps.asc_getCreated(); let value = this.docProps.asc_getCreated();
const _lang = this.props.storeAppOptions.lang;
if(value) { if(value) {
return value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'}); return value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'});
@ -91,10 +95,10 @@ class DocumentInfoController extends Component {
return ( return (
<DocumentInfo <DocumentInfo
getAppProps={this.getAppProps} getAppProps={this.getAppProps}
getModified={this.getModified} modified={this.modified}
getModifiedBy={this.getModifiedBy} modifiedBy={this.modifiedBy}
getCreators={this.getCreators} creators={this.creators}
getCreated={this.getCreated} created={this.created}
title={this.title} title={this.title}
subject={this.subject} subject={this.subject}
description={this.description} description={this.description}

View file

@ -8,10 +8,7 @@ const PageDocumentInfo = (props) => {
const _t = t("Settings", { returnObjects: true }); const _t = t("Settings", { returnObjects: true });
const storeInfo = props.storeDocumentInfo; const storeInfo = props.storeDocumentInfo;
const dataApp = props.getAppProps(); const dataApp = props.getAppProps();
const dataModified = props.getModified;
const dataModifiedBy = props.getModifiedBy;
const creators = props.getCreators;
// console.log(creators);
const { const {
pageCount, pageCount,
paragraphCount, paragraphCount,
@ -19,10 +16,9 @@ const PageDocumentInfo = (props) => {
symbolsWSCount, symbolsWSCount,
wordsCount, wordsCount,
} = storeInfo.infoObj; } = storeInfo.infoObj;
const dataDoc = JSON.parse(JSON.stringify(storeInfo.dataDoc)); const dataDoc = JSON.parse(JSON.stringify(storeInfo.dataDoc));
// console.log(dataDoc);
const isLoaded = storeInfo.isLoaded; const isLoaded = storeInfo.isLoaded;
// console.log(pageCount, paragraphCount, symbolsCount, symbolsWSCount, wordsCount);
return ( return (
<Page> <Page>
@ -91,27 +87,27 @@ const PageDocumentInfo = (props) => {
</List> </List>
</Fragment> </Fragment>
) : null} ) : null}
{dataModified ? ( {props.modified ? (
<Fragment> <Fragment>
<BlockTitle>{_t.textLastModified}</BlockTitle> <BlockTitle>{_t.textLastModified}</BlockTitle>
<List> <List>
<ListItem title={dataModified}></ListItem> <ListItem title={props.modified}></ListItem>
</List> </List>
</Fragment> </Fragment>
) : null} ) : null}
{dataModifiedBy ? ( {props.modifiedBy ? (
<Fragment> <Fragment>
<BlockTitle>{_t.textLastModifiedBy}</BlockTitle> <BlockTitle>{_t.textLastModifiedBy}</BlockTitle>
<List> <List>
<ListItem title={dataModifiedBy}></ListItem> <ListItem title={props.modifiedBy}></ListItem>
</List> </List>
</Fragment> </Fragment>
) : null} ) : null}
{props.getCreated ? ( {props.created ? (
<Fragment> <Fragment>
<BlockTitle>{_t.textCreated}</BlockTitle> <BlockTitle>{_t.textCreated}</BlockTitle>
<List> <List>
<ListItem title={props.getCreated}></ListItem> <ListItem title={props.created}></ListItem>
</List> </List>
</Fragment> </Fragment>
) : null} ) : null}
@ -123,12 +119,12 @@ const PageDocumentInfo = (props) => {
</List> </List>
</Fragment> </Fragment>
) : null} ) : null}
{creators ? ( {props.creators ? (
<Fragment> <Fragment>
<BlockTitle>{_t.textAuthor}</BlockTitle> <BlockTitle>{_t.textAuthor}</BlockTitle>
<List> <List>
{ {
creators.split(/\s*[,;]\s*/).map(item => { props.creators.split(/\s*[,;]\s*/).map(item => {
return <ListItem title={item}></ListItem> return <ListItem title={item}></ListItem>
}) })
} }

View file

@ -1,17 +1,21 @@
import React, { Component } from "react"; import React, { Component } from "react";
import PresentationInfo from "../../view/settings/PresentationInfo"; import PresentationInfo from "../../view/settings/PresentationInfo";
import { observer, inject } from "mobx-react";
class PresentationInfoController extends Component { class PresentationInfoController extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.docProps = this.getDocProps(); this.docProps = this.getDocProps();
this.getModified = this.getModified();
this.getModifiedBy = this.getModifiedBy(); if(this.docProps) {
this.getCreators = this.getCreators(); this.modified = this.getModified();
this.modifiedBy = this.getModifiedBy();
this.creators = this.getCreators();
this.title = this.getTitle(); this.title = this.getTitle();
this.subject = this.getSubject(); this.subject = this.getSubject();
this.description = this.getDescription(); this.description = this.getDescription();
this.getCreated = this.getCreated(); this.created = this.getCreated();
}
} }
getDocProps() { getDocProps() {
@ -30,17 +34,17 @@ class PresentationInfoController extends Component {
getModified() { getModified() {
let valueModified = this.docProps.asc_getModified(); let valueModified = this.docProps.asc_getModified();
// const _lang = this.props.storeAppOptions.lang; const _lang = this.props.storeAppOptions.lang;
if (valueModified) { if (valueModified) {
return ( return (
valueModified.toLocaleString("en", { valueModified.toLocaleString(_lang, {
year: "numeric", year: "numeric",
month: "2-digit", month: "2-digit",
day: "2-digit", day: "2-digit",
}) + }) +
" " + " " +
valueModified.toLocaleTimeString("en", { timeStyle: "short" }) valueModified.toLocaleTimeString(_lang, { timeStyle: "short" })
); );
} }
} }
@ -71,9 +75,10 @@ class PresentationInfoController extends Component {
getCreated() { getCreated() {
let value = this.docProps.asc_getCreated(); let value = this.docProps.asc_getCreated();
const _lang = this.props.storeAppOptions.lang;
if(value) { if(value) {
return value.toLocaleString("en", {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString("en", {timeStyle: 'short'}); return value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'});
} }
} }
@ -81,10 +86,10 @@ class PresentationInfoController extends Component {
return ( return (
<PresentationInfo <PresentationInfo
getAppProps={this.getAppProps} getAppProps={this.getAppProps}
getModified={this.getModified} modified={this.modified}
getModifiedBy={this.getModifiedBy} modifiedBy={this.modifiedBy}
getCreators={this.getCreators} creators={this.creators}
getCreated={this.getCreated} created={this.created}
title={this.title} title={this.title}
subject={this.subject} subject={this.subject}
description={this.description} description={this.description}
@ -94,4 +99,4 @@ class PresentationInfoController extends Component {
} }
export default PresentationInfoController; export default inject("storeAppOptions")(observer(PresentationInfoController));

View file

@ -8,9 +8,6 @@ const PagePresentationInfo = (props) => {
const _t = t("View.Settings", { returnObjects: true }); const _t = t("View.Settings", { returnObjects: true });
const storeInfo = props.storePresentationInfo; const storeInfo = props.storePresentationInfo;
const dataApp = props.getAppProps(); const dataApp = props.getAppProps();
const dataModified = props.getModified;
const dataModifiedBy = props.getModifiedBy;
const creators = props.getCreators;
const dataDoc = JSON.parse(JSON.stringify(storeInfo.dataDoc)); const dataDoc = JSON.parse(JSON.stringify(storeInfo.dataDoc));
return ( return (
@ -72,27 +69,27 @@ const PagePresentationInfo = (props) => {
</List> </List>
</Fragment> </Fragment>
) : null} ) : null}
{dataModified ? ( {props.modified ? (
<Fragment> <Fragment>
<BlockTitle>{_t.textLastModified}</BlockTitle> <BlockTitle>{_t.textLastModified}</BlockTitle>
<List> <List>
<ListItem title={dataModified}></ListItem> <ListItem title={props.modified}></ListItem>
</List> </List>
</Fragment> </Fragment>
) : null} ) : null}
{dataModifiedBy ? ( {props.modifiedBy ? (
<Fragment> <Fragment>
<BlockTitle>{_t.textLastModifiedBy}</BlockTitle> <BlockTitle>{_t.textLastModifiedBy}</BlockTitle>
<List> <List>
<ListItem title={dataModifiedBy}></ListItem> <ListItem title={props.modifiedBy}></ListItem>
</List> </List>
</Fragment> </Fragment>
) : null} ) : null}
{props.getCreated ? ( {props.created ? (
<Fragment> <Fragment>
<BlockTitle>{_t.textCreated}</BlockTitle> <BlockTitle>{_t.textCreated}</BlockTitle>
<List> <List>
<ListItem title={props.getCreated}></ListItem> <ListItem title={props.created}></ListItem>
</List> </List>
</Fragment> </Fragment>
) : null} ) : null}
@ -104,12 +101,12 @@ const PagePresentationInfo = (props) => {
</List> </List>
</Fragment> </Fragment>
) : null} ) : null}
{creators ? ( {props.creators ? (
<Fragment> <Fragment>
<BlockTitle>{_t.textAuthor}</BlockTitle> <BlockTitle>{_t.textAuthor}</BlockTitle>
<List> <List>
{ {
creators.split(/\s*[,;]\s*/).map(item => { props.creators.split(/\s*[,;]\s*/).map(item => {
return <ListItem title={item}></ListItem> return <ListItem title={item}></ListItem>
}) })
} }

View file

@ -6,8 +6,8 @@ class SpreadsheetInfoController extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.docProps = this.getDocProps(); this.docProps = this.getDocProps();
if (this.docProps) { if (this.docProps) {
this.dataApp = this.getAppProps();
this.modified = this.getModified(); this.modified = this.getModified();
this.modifiedBy = this.getModifiedBy(); this.modifiedBy = this.getModifiedBy();
this.creators = this.getCreators(); this.creators = this.getCreators();
@ -15,7 +15,6 @@ class SpreadsheetInfoController extends Component {
this.subject = this.getSubject(); this.subject = this.getSubject();
this.description = this.getDescription(); this.description = this.getDescription();
this.created = this.getCreated(); this.created = this.getCreated();
} }
} }
@ -40,6 +39,7 @@ class SpreadsheetInfoController extends Component {
getModified() { getModified() {
let valueModified = this.docProps.asc_getModified(); let valueModified = this.docProps.asc_getModified();
const _lang = this.props.storeAppOptions.lang; const _lang = this.props.storeAppOptions.lang;
if (valueModified) { if (valueModified) {
return ( return (
valueModified.toLocaleString(_lang, { valueModified.toLocaleString(_lang, {
@ -81,16 +81,18 @@ class SpreadsheetInfoController extends Component {
getCreated() { getCreated() {
let value = this.docProps.asc_getCreated(); let value = this.docProps.asc_getCreated();
const _lang = this.props.storeAppOptions.lang; const _lang = this.props.storeAppOptions.lang;
if(value) { if(value) {
return value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'}); return value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'});
} }
return null; return null;
} }
render() { render() {
return ( return (
<SpreadsheetInfo <SpreadsheetInfo
dataApp={this.dataApp} getAppProps={this.getAppProps}
modified={this.modified} modified={this.modified}
modifiedBy={this.modifiedBy} modifiedBy={this.modifiedBy}
creators={this.creators} creators={this.creators}

View file

@ -8,7 +8,7 @@ const PageSpreadsheetInfo = (props) => {
const _t = t("View.Settings", { returnObjects: true }); const _t = t("View.Settings", { returnObjects: true });
const storeSpreadsheetInfo = props.storeSpreadsheetInfo; const storeSpreadsheetInfo = props.storeSpreadsheetInfo;
const dataDoc = storeSpreadsheetInfo.dataDoc; const dataDoc = storeSpreadsheetInfo.dataDoc;
const dataApp = props.dataApp; const dataApp = props.getAppProps();
const dataModified = props.modified; const dataModified = props.modified;
const dataModifiedBy = props.modifiedBy; const dataModifiedBy = props.modifiedBy;
const creators = props.creators; const creators = props.creators;
@ -88,11 +88,11 @@ const PageSpreadsheetInfo = (props) => {
</List> </List>
</Fragment> </Fragment>
) : null} ) : null}
{props.getCreated ? ( {props.created ? (
<Fragment> <Fragment>
<BlockTitle>{_t.textCreated}</BlockTitle> <BlockTitle>{_t.textCreated}</BlockTitle>
<List> <List>
<ListItem title={props.getCreated}></ListItem> <ListItem title={props.created}></ListItem>
</List> </List>
</Fragment> </Fragment>
) : null} ) : null}