Merge pull request #19957 from JoVictorNunes/fix-conn-status-session-logs-30
fix(connection status): restore session logs tab
This commit is contained in:
commit
88b31db097
@ -525,6 +525,7 @@ class ConnectionStatusComponent extends PureComponent {
|
||||
setModalIsOpen,
|
||||
intl,
|
||||
isModalOpen,
|
||||
amIModerator,
|
||||
} = this.props;
|
||||
|
||||
const { selectedTab } = this.state;
|
||||
@ -557,7 +558,7 @@ class ConnectionStatusComponent extends PureComponent {
|
||||
<Styled.ConnectionTabSelector selectedClassName="is-selected">
|
||||
<span id="my-logs-tab">{intl.formatMessage(intlMessages.myLogs)}</span>
|
||||
</Styled.ConnectionTabSelector>
|
||||
{Service.isModerator()
|
||||
{amIModerator
|
||||
&& (
|
||||
<Styled.ConnectionTabSelector selectedClassName="is-selected">
|
||||
<span id="session-logs-tab">{intl.formatMessage(intlMessages.sessionLogs)}</span>
|
||||
@ -574,7 +575,7 @@ class ConnectionStatusComponent extends PureComponent {
|
||||
<Styled.ConnectionTabPanel selectedClassName="is-selected">
|
||||
<ul>{this.renderConnections()}</ul>
|
||||
</Styled.ConnectionTabPanel>
|
||||
{Service.isModerator()
|
||||
{amIModerator
|
||||
&& (
|
||||
<Styled.ConnectionTabPanel selectedClassName="is-selected">
|
||||
<ul>{this.renderConnections()}</ul>
|
||||
|
@ -3,13 +3,17 @@ import { useSubscription } from '@apollo/client';
|
||||
import { CONNECTION_STATUS_REPORT_SUBSCRIPTION } from '../queries';
|
||||
import Service from '../service';
|
||||
import Component from './component';
|
||||
import useCurrentUser from '/imports/ui/core/hooks/useCurrentUser';
|
||||
|
||||
const ConnectionStatusContainer = (props) => {
|
||||
const { data } = useSubscription(CONNECTION_STATUS_REPORT_SUBSCRIPTION);
|
||||
const connectionData = data ? Service.sortConnectionData(data.user_connectionStatusReport) : [];
|
||||
const { data: currentUser } = useCurrentUser((u) => ({ isModerator: u.isModerator }));
|
||||
const amIModerator = !!currentUser?.isModerator;
|
||||
return (
|
||||
<Component
|
||||
connectionData={connectionData}
|
||||
amIModerator={amIModerator}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { defineMessages } from 'react-intl';
|
||||
import Users from '/imports/api/users';
|
||||
import Auth from '/imports/ui/services/auth';
|
||||
import { Session } from 'meteor/session';
|
||||
import { notify } from '/imports/ui/services/notification';
|
||||
@ -9,7 +8,6 @@ import ScreenshareService from '/imports/ui/components/screenshare/service';
|
||||
|
||||
const STATS = window.meetingClientSettings.public.stats;
|
||||
const NOTIFICATION = STATS.notification;
|
||||
const ROLE_MODERATOR = window.meetingClientSettings.public.user.role_moderator;
|
||||
|
||||
const intlMessages = defineMessages({
|
||||
saved: {
|
||||
@ -89,22 +87,6 @@ const sortOnline = (a, b) => {
|
||||
|
||||
const isEnabled = () => STATS.enabled;
|
||||
|
||||
const isModerator = () => {
|
||||
const user = Users.findOne(
|
||||
{
|
||||
meetingId: Auth.meetingID,
|
||||
userId: Auth.userID,
|
||||
},
|
||||
{ fields: { role: 1 } },
|
||||
);
|
||||
|
||||
if (user && user.role === ROLE_MODERATOR) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
if (STATS.enabled) {
|
||||
window.addEventListener('audiostats', handleAudioStatsEvent);
|
||||
}
|
||||
@ -393,7 +375,6 @@ const calculateBitsPerSecondFromMultipleData = (currentData, previousData) => {
|
||||
const sortConnectionData = (connectionData) => connectionData.sort(sortLevel).sort(sortOnline);
|
||||
|
||||
export default {
|
||||
isModerator,
|
||||
getStats,
|
||||
getHelp,
|
||||
isEnabled,
|
||||
|
Loading…
Reference in New Issue
Block a user