diff --git a/bigbluebutton-html5/imports/ui/components/note/service.js b/bigbluebutton-html5/imports/ui/components/note/service.js index 1eaa0ca51d402e9bcdd8e2a8fb601d0af773342d..303bece5e19fc6eed230a0234cdac640244234e9 100644 --- a/bigbluebutton-html5/imports/ui/components/note/service.js +++ b/bigbluebutton-html5/imports/ui/components/note/service.js @@ -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', ); }; diff --git a/bigbluebutton-html5/imports/ui/components/user-list/service.js b/bigbluebutton-html5/imports/ui/components/user-list/service.js index 189a52085f1c1f95e4f7d3da935fad72cedb893d..c1b082740e4f66c65322ddd5b8073787a35a6c47 100755 --- a/bigbluebutton-html5/imports/ui/components/user-list/service.js +++ b/bigbluebutton-html5/imports/ui/components/user-list/service.js @@ -286,8 +286,7 @@ const isMeetingLocked = (id) => { if (lockSettings.disableCam || lockSettings.disableMic || lockSettings.disablePrivateChat - || lockSettings.disablePublicChat - || lockSettings.disableNote) { + || lockSettings.disablePublicChat) { isLocked = true; } } diff --git a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/styles.scss b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/styles.scss index fac980e0fd802aac66729997f8fc5c4c305afd6c..f0e2dc7778eb571663fd38be013e9bedd6a0ff3a 100755 --- a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/styles.scss +++ b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/styles.scss @@ -134,3 +134,8 @@ overflow: hidden; flex-shrink: 1; } + +.noteLock { + font-size: 65%; + color: var(--color-gray-light); +} diff --git a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-notes/component.jsx b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-notes/component.jsx index 34b1bc59439046e263856712808ec6e20b10be8c..60cf083574b15a7d4e23feaae338bf2678c36a20 100644 --- a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-notes/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-notes/component.jsx @@ -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; diff --git a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-notes/container.jsx b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-notes/container.jsx index 4e8f514ec274b6982c38b1c078e523c040630155..9090376936ff3e58ea762728529e335fd9397e7e 100644 --- a/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-notes/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-list/user-list-content/user-notes/container.jsx @@ -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); diff --git a/bigbluebutton-html5/private/locales/en.json b/bigbluebutton-html5/private/locales/en.json index f5f23652d1db49c84221cbecdd440b963b095f89..347e5dddfa3bc44d138461fb6205265a3565786a 100755 --- a/bigbluebutton-html5/private/locales/en.json +++ b/bigbluebutton-html5/private/locales/en.json @@ -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",