bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/waiting-users/container.jsx
Tainan Felipe f05cfd0cf8
Refactor: migrate waitingUserPanel to TS and graphql (#18677)
* Refactor: migrate waitingUserPanel to TS and graphql

* Small code improvements

* Fix: allow everyone aren't working

* Fix: add a condition for edge cases

* Make the remember choice works well

* Fix TS and eslint errors

* Change eslint

* Change eslint
2023-10-06 14:12:42 -03:00

56 lines
1.9 KiB
JavaScript

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import Auth from '/imports/ui/services/auth';
import GuestUsers from '/imports/api/guest-users';
import Meetings from '/imports/api/meetings';
import Service from './service';
import WaitingComponent from './component';
import { layoutDispatch } from '../layout/context';
import GuestUsersManagementPanelContainer from './waiting-users-graphql/component';
const WaitingContainer = (props) => {
const layoutContextDispatch = layoutDispatch();
return <WaitingComponent {...{ layoutContextDispatch, ...props }} />;
};
withTracker(() => {
const guestUsers = GuestUsers.find({
meetingId: Auth.meetingID,
guest: true,
approved: false,
denied: false,
}).fetch();
const authenticatedUsers = GuestUsers.find({
meetingId: Auth.meetingID,
authenticated: true,
guest: false,
approved: false,
denied: false,
}).fetch();
const meeting = Meetings.findOne({ meetingId: Auth.meetingID });
const { usersProp } = meeting;
const { authenticatedGuest } = usersProp;
return {
guestUsers,
authenticatedUsers,
privateMessageVisible: Service.privateMessageVisible,
guestUsersCall: Service.guestUsersCall,
isWaitingRoomEnabled: Service.isWaitingRoomEnabled(),
changeGuestPolicy: Service.changeGuestPolicy,
isGuestLobbyMessageEnabled: Service.isGuestLobbyMessageEnabled,
setGuestLobbyMessage: Service.setGuestLobbyMessage,
guestLobbyMessage: Service.getGuestLobbyMessage(),
privateGuestLobbyMessage: Service.getPrivateGuestLobbyMessage,
setPrivateGuestLobbyMessage: Service.setPrivateGuestLobbyMessage,
authenticatedGuest,
guestPolicyExtraAllowOptions: Meteor.settings.public.app.guestPolicyExtraAllowOptions,
allowRememberChoice: Service.allowRememberChoice,
};
})(WaitingContainer);
export default GuestUsersManagementPanelContainer;