[DE mobile] Added author list in Document Info

This commit is contained in:
SergeyEzhin 2020-11-24 13:10:05 +03:00
parent 3e706114eb
commit 0402a93aaf
3 changed files with 29 additions and 3 deletions

View file

@ -28,7 +28,8 @@
"textLastModifiedBy": "Last Modified By",
"textLastModified": "Last Modified",
"textApplication": "Application",
"textLoading": "Loading..."
"textLoading": "Loading...",
"textAuthor": "Author"
},
"Collaboration": {
"textEditUser": "Users who are editing the file:"

View file

@ -10,6 +10,7 @@ class DocumentInfoController extends Component {
const api = Common.EditorApi.get();
if (api) {
let docProps = api.asc_getCoreProps();
// console.log(docProps);
return docProps;
}
}
@ -18,7 +19,7 @@ class DocumentInfoController extends Component {
const api = Common.EditorApi.get();
if (api) {
const appProps = api.asc_getAppProps();
console.log(appProps);
// console.log(appProps);
if (appProps) {
let appName =
(appProps.asc_getApplication() || "") +
@ -33,7 +34,7 @@ class DocumentInfoController extends Component {
const docProps = this.getDocProps();
if (docProps) {
let valueModified = docProps.asc_getModified();
console.log(docProps);
if (valueModified) {
return (
valueModified.toLocaleString('en', {
@ -52,12 +53,21 @@ class DocumentInfoController extends Component {
const docProps = this.getDocProps();
if (docProps) {
let valueModifiedBy = docProps.asc_getLastModifiedBy();
if (valueModifiedBy) {
return Common.Utils.UserInfoParser.getParsedName(valueModifiedBy);
}
}
}
getCreators() {
const docProps = this.getDocProps();
if(docProps) {
let valueCreators = docProps.asc_getCreator();
return valueCreators;
}
}
componentDidMount() {
const api = Common.EditorApi.get();
if (api) {
@ -72,6 +82,7 @@ class DocumentInfoController extends Component {
getModified={this.getModified}
getModifiedBy={this.getModifiedBy}
getDocProps={this.getDocProps}
getCreators={this.getCreators}
/>
);
}

View file

@ -10,6 +10,8 @@ const PageDocumentInfo = (props) => {
const dataApp = props.getAppProps();
const dataModified = props.getModified();
const dataModifiedBy = props.getModifiedBy();
const creators = props.getCreators();
console.log(creators);
const {
pageCount,
paragraphCount,
@ -64,6 +66,18 @@ const PageDocumentInfo = (props) => {
</List>
</Fragment>
) : null}
{creators ? (
<Fragment>
<BlockTitle>{_t.textAuthor}</BlockTitle>
<List>
{
creators.split(/\s*[,;]\s*/).map(item => {
return <ListItem title={item}></ListItem>
})
}
</List>
</Fragment>
) : null}
</Page>
);
};