[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", "textLastModifiedBy": "Last Modified By",
"textLastModified": "Last Modified", "textLastModified": "Last Modified",
"textApplication": "Application", "textApplication": "Application",
"textLoading": "Loading..." "textLoading": "Loading...",
"textAuthor": "Author"
}, },
"Collaboration": { "Collaboration": {
"textEditUser": "Users who are editing the file:" "textEditUser": "Users who are editing the file:"

View file

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

View file

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