Merge pull request #9518 from KDSBrowne/issue-9511
Change shared notes lock behavior
This commit is contained in:
commit
4e636a2396
@ -43,7 +43,7 @@ const isLocked = () => {
|
||||
const meeting = Meetings.findOne({ meetingId: Auth.meetingID }, { fields: { 'lockSettingsProps.disableNote': 1 } });
|
||||
const user = Users.findOne({ userId: Auth.userID }, { fields: { locked: 1, role: 1 } });
|
||||
|
||||
if (meeting.lockSettingsProps && user.locked && user.role !== ROLE_MODERATOR) {
|
||||
if (meeting.lockSettingsProps && user.role !== ROLE_MODERATOR) {
|
||||
return meeting.lockSettingsProps.disableNote;
|
||||
}
|
||||
return false;
|
||||
@ -75,7 +75,7 @@ const isEnabled = () => {
|
||||
const toggleNotePanel = () => {
|
||||
Session.set(
|
||||
'openPanel',
|
||||
isPanelOpened() ? 'userlist' : 'note'
|
||||
isPanelOpened() ? 'userlist' : 'note',
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -286,8 +286,7 @@ const isMeetingLocked = (id) => {
|
||||
if (lockSettings.disableCam
|
||||
|| lockSettings.disableMic
|
||||
|| lockSettings.disablePrivateChat
|
||||
|| lockSettings.disablePublicChat
|
||||
|| lockSettings.disableNote) {
|
||||
|| lockSettings.disablePublicChat) {
|
||||
isLocked = true;
|
||||
}
|
||||
}
|
||||
|
@ -134,3 +134,8 @@
|
||||
overflow: hidden;
|
||||
flex-shrink: 1;
|
||||
}
|
||||
|
||||
.noteLock {
|
||||
font-size: 65%;
|
||||
color: var(--color-gray-light);
|
||||
}
|
||||
|
@ -26,6 +26,14 @@ const intlMessages = defineMessages({
|
||||
id: 'app.userList.notesListItem.unreadContent',
|
||||
description: 'Aria label for notes unread content',
|
||||
},
|
||||
locked: {
|
||||
id: 'app.userList.locked',
|
||||
description: '',
|
||||
},
|
||||
byModerator: {
|
||||
id: 'app.userList.byModerator',
|
||||
description: '',
|
||||
},
|
||||
});
|
||||
|
||||
class UserNotes extends Component {
|
||||
@ -57,7 +65,7 @@ class UserNotes extends Component {
|
||||
}
|
||||
|
||||
renderNotes() {
|
||||
const { intl } = this.props;
|
||||
const { intl, disableNote } = this.props;
|
||||
const { unread } = this.state;
|
||||
|
||||
let notification = null;
|
||||
@ -82,14 +90,26 @@ class UserNotes extends Component {
|
||||
onClick={NoteService.toggleNotePanel}
|
||||
>
|
||||
<Icon iconName="copy" />
|
||||
<span aria-hidden>{intl.formatMessage(intlMessages.sharedNotes)}</span>
|
||||
<div aria-hidden>
|
||||
<div>
|
||||
{intl.formatMessage(intlMessages.sharedNotes)}
|
||||
</div>
|
||||
{disableNote
|
||||
? (
|
||||
<div className={styles.noteLock}>
|
||||
<Icon iconName="lock" />
|
||||
<span>{`${intl.formatMessage(intlMessages.locked)} ${intl.formatMessage(intlMessages.byModerator)}`}</span>
|
||||
</div>
|
||||
) : null
|
||||
}
|
||||
</div>
|
||||
{notification}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { intl } = this.props;
|
||||
const { intl, disableNote } = this.props;
|
||||
|
||||
if (!NoteService.isEnabled()) return null;
|
||||
|
||||
|
@ -1,11 +1,28 @@
|
||||
import React from 'react';
|
||||
import { withTracker } from 'meteor/react-meteor-data';
|
||||
import NoteService from '/imports/ui/components/note/service';
|
||||
import Meetings from '/imports/api/meetings';
|
||||
import Users from '/imports/api/users';
|
||||
import Auth from '/imports/ui/services/auth';
|
||||
import UserNotes from './component';
|
||||
|
||||
const ROLE_VIEWER = Meteor.settings.public.user.role_viewer;
|
||||
|
||||
const UserNotesContainer = props => <UserNotes {...props} />;
|
||||
|
||||
export default withTracker(() => ({
|
||||
isPanelOpened: NoteService.isPanelOpened(),
|
||||
revs: NoteService.getRevs(),
|
||||
}))(UserNotesContainer);
|
||||
export default withTracker(() => {
|
||||
const Meeting = Meetings.findOne({ meetingId: Auth.meetingID },
|
||||
{ fields: { 'lockSettingsProps.disableNote': 1 } });
|
||||
const isViewer = Users.findOne({ meetingId: Auth.meetingID, userId: Auth.userID }, {
|
||||
fields: {
|
||||
role: 1,
|
||||
},
|
||||
}).role === ROLE_VIEWER;
|
||||
const shouldDisableNote = (Meeting.lockSettingsProps.disableNote) && isViewer;
|
||||
|
||||
return {
|
||||
isPanelOpened: NoteService.isPanelOpened(),
|
||||
revs: NoteService.getRevs(),
|
||||
disableNote: shouldDisableNote,
|
||||
};
|
||||
})(UserNotesContainer);
|
||||
|
@ -63,6 +63,7 @@
|
||||
"app.userList.presenter": "Presenter",
|
||||
"app.userList.you": "You",
|
||||
"app.userList.locked": "Locked",
|
||||
"app.userList.byModerator": "by (Moderator)",
|
||||
"app.userList.label": "User list",
|
||||
"app.userList.toggleCompactView.label": "Toggle compact view mode",
|
||||
"app.userList.guest": "Guest",
|
||||
|
Loading…
Reference in New Issue
Block a user