Merge pull request #1578 from ONLYOFFICE/fix/bugfix

[Mobile] Handle permissions.userInfoGroups: hide cursors from users n…
This commit is contained in:
Julia Radzhabova 2022-02-17 21:27:11 +03:00 committed by GitHub
commit dc15c38338
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 1 deletions

View file

@ -163,6 +163,8 @@ class ContextMenuController extends Component {
}
onApiShowForeignCursorLabel(UserId, X, Y, color) {
if (!this.isUserVisible(UserId)) return;
/** coauthoring begin **/
const tipHeight = 20;

View file

@ -29,6 +29,7 @@ class ContextMenu extends ContextMenuController {
this.onApiHideComment = this.onApiHideComment.bind(this);
this.onApiShowChange = this.onApiShowChange.bind(this);
this.getUserName = this.getUserName.bind(this);
this.isUserVisible = this.isUserVisible.bind(this);
this.ShowModal = this.ShowModal.bind(this);
}
@ -41,6 +42,11 @@ class ContextMenu extends ContextMenuController {
return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName());
}
isUserVisible(id) {
const user = this.props.users.searchUserByCurrentId(id);
return user ? (user.asc_getIdOriginal()===this.props.users.currentUser.asc_getIdOriginal() || AscCommon.UserInfoParser.isUserVisible(user.asc_getUserName())) : true;
}
componentWillUnmount() {
super.componentWillUnmount();

View file

@ -25,6 +25,7 @@ class ContextMenu extends ContextMenuController {
this.onApiShowComment = this.onApiShowComment.bind(this);
this.onApiHideComment = this.onApiHideComment.bind(this);
this.getUserName = this.getUserName.bind(this);
this.isUserVisible = this.isUserVisible.bind(this);
}
static closeContextMenu() {
@ -36,6 +37,11 @@ class ContextMenu extends ContextMenuController {
return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName());
}
isUserVisible(id) {
const user = this.props.users.searchUserByCurrentId(id);
return user ? (user.asc_getIdOriginal()===this.props.users.currentUser.asc_getIdOriginal() || AscCommon.UserInfoParser.isUserVisible(user.asc_getUserName())) : true;
}
componentWillUnmount() {
super.componentWillUnmount();

View file

@ -30,6 +30,7 @@ class ContextMenu extends ContextMenuController {
this.isOpenWindowUser = false;
this.timer;
this.getUserName = this.getUserName.bind(this);
this.isUserVisible = this.isUserVisible.bind(this);
this.onApiMouseMove = this.onApiMouseMove.bind(this);
this.onApiHyperlinkClick = this.onApiHyperlinkClick.bind(this);
}
@ -43,6 +44,11 @@ class ContextMenu extends ContextMenuController {
return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName());
}
isUserVisible(id) {
const user = this.props.users.searchUserByCurrentId(id);
return user ? (user.asc_getIdOriginal()===this.props.users.currentUser.asc_getIdOriginal() || AscCommon.UserInfoParser.isUserVisible(user.asc_getUserName())) : true;
}
componentWillUnmount() {
super.componentWillUnmount();
@ -277,7 +283,7 @@ class ContextMenu extends ContextMenuController {
$$('.username-tip').remove();
}
if (index_locked ) {
if (index_locked && this.isUserVisible(dataarray[index_locked-1].asc_getUserId())) {
const tipHeight = 20;
let editorOffset = $$("#editor_sdk").offset(),
XY = [ editorOffset.left - $(window).scrollLeft(), editorOffset.top - $(window).scrollTop()],