From 4fc6c066a5db0e1544514a54e34ea3b538b55124 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Sat, 7 Oct 2023 14:41:20 +0300 Subject: [PATCH] Api config: add image field to user info --- apps/api/documents/api.js | 1 + apps/documenteditor/main/app/controller/Main.js | 3 ++- apps/presentationeditor/main/app/controller/Main.js | 2 +- apps/spreadsheeteditor/main/app/controller/Main.js | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 825a6830ca..1204d5f51e 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -87,6 +87,7 @@ id: 'user id', name: 'user name', group: 'group name' // for customization.reviewPermissions or permissions.reviewGroups or permissions.commentGroups. Can be multiple groups separated by commas (,) : 'Group1' or 'Group1,Group2' + image: 'image url' }, recent: [ { diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index f42e152d17..cfec44cb3a 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -500,6 +500,7 @@ define([ _user.put_Id(this.appOptions.user.id); _user.put_FullName(this.appOptions.user.fullname); _user.put_IsAnonymousUser(!!this.appOptions.user.anonymous); + // this.appOptions.user.image && _user.put_UserImage(this.appOptions.user.image); docInfo = new Asc.asc_CDocInfo(); docInfo.put_Id(data.doc.key); @@ -1626,7 +1627,7 @@ define([ this.appOptions.canUseCommentPermissions && AscCommon.UserInfoParser.setCommentPermissions(this.permissions.commentGroups); this.appOptions.canUseUserInfoPermissions && AscCommon.UserInfoParser.setUserInfoPermissions(this.permissions.userInfoGroups); appHeader.setUserName(AscCommon.UserInfoParser.getParsedName(AscCommon.UserInfoParser.getCurrentName())); - appHeader.setUserAvatar(this.appOptions.user.avatar); + appHeader.setUserAvatar(this.appOptions.user.image); this.appOptions.canRename && appHeader.setCanRename(true); this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 6bd5855d43..4d2c6ecdb6 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1277,7 +1277,7 @@ define([ this.appOptions.canUseCommentPermissions && AscCommon.UserInfoParser.setCommentPermissions(this.permissions.commentGroups); this.appOptions.canUseUserInfoPermissions && AscCommon.UserInfoParser.setUserInfoPermissions(this.permissions.userInfoGroups); appHeader.setUserName(AscCommon.UserInfoParser.getParsedName(AscCommon.UserInfoParser.getCurrentName())); - appHeader.setUserAvatar(this.appOptions.user.avatar); + appHeader.setUserAvatar(this.appOptions.user.image); this.appOptions.canRename && appHeader.setCanRename(true); this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 3d4abf32ae..f45744fc96 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1357,7 +1357,7 @@ define([ this.appOptions.canUseCommentPermissions && AscCommon.UserInfoParser.setCommentPermissions(this.permissions.commentGroups); this.appOptions.canUseUserInfoPermissions && AscCommon.UserInfoParser.setUserInfoPermissions(this.permissions.userInfoGroups); this.headerView.setUserName(AscCommon.UserInfoParser.getParsedName(AscCommon.UserInfoParser.getCurrentName())); - this.headerView.setUserAvatar(this.appOptions.user.avatar); + this.headerView.setUserAvatar(this.appOptions.user.image); } else this.appOptions.canModifyFilter = true;