Merge remote-tracking branch 'upstream/v3.0.x-release' into pres-graphql

This commit is contained in:
Ramón Souza 2023-11-01 08:56:39 -03:00
commit 3457413d58
14 changed files with 78 additions and 33 deletions

View File

@ -16,7 +16,7 @@ object TimerModel {
def reset(model: TimerModel) : Unit = {
model.accumulated = 0
model.startedAt = 0
model.startedAt = if (model.running) System.currentTimeMillis() else 0
model.endedAt = 0
}
@ -24,7 +24,7 @@ object TimerModel {
model.isActive = active
}
def getIsACtive(model: TimerModel): Boolean = {
def getIsActive(model: TimerModel): Boolean = {
model.isActive
}

View File

@ -1,7 +1,7 @@
package org.bigbluebutton.core.db
import org.bigbluebutton.core.apps.TimerModel
import org.bigbluebutton.core.apps.TimerModel.{getAccumulated, getEndedAt, getIsACtive, getRunning, getStartedAt, getStopwatch, getTime, getTrack}
import org.bigbluebutton.core.apps.TimerModel.{getAccumulated, getEndedAt, getIsActive, getRunning, getStartedAt, getStopwatch, getTime, getTrack}
import slick.jdbc.PostgresProfile.api._
import scala.util.{Failure, Success}
@ -59,7 +59,7 @@ object TimerDAO {
TableQuery[TimerDbTableDef]
.filter(_.meetingId === meetingId)
.map(t => (t.stopwatch, t.running, t.active, t.time, t.accumulated, t.startedAt, t.endedAt, t.songTrack))
.update((getStopwatch(timerModel), getRunning(timerModel), getIsACtive(timerModel), getTime(timerModel), getAccumulated(timerModel), getStartedAt(timerModel), getEndedAt(timerModel), getTrack(timerModel))
.update((getStopwatch(timerModel), getRunning(timerModel), getIsActive(timerModel), getTime(timerModel), getAccumulated(timerModel), getStartedAt(timerModel), getEndedAt(timerModel), getTrack(timerModel))
)
).onComplete {
case Success(rowsAffected) => DatabaseConnection.logger.debug(s"$rowsAffected row(s) updated on Timer table!")

View File

@ -61,13 +61,13 @@ const ChatPollContent: React.FC<ChatPollContentProps> = ({
<Styled.PollText>
{pollData.questionText}
</Styled.PollText>
<ResponsiveContainer width="100%" height={250}>
<ResponsiveContainer width="90%" height={250}>
<BarChart
data={pollData.answers}
layout="vertical"
>
<XAxis type="number" />
<YAxis type="category" dataKey="key" />
<YAxis width={70} type="category" dataKey="key" />
<Bar dataKey="numVotes" fill="#0C57A7" />
</BarChart>
</ResponsiveContainer>

View File

@ -143,6 +143,7 @@ const IsTalkingWrapper = styled.div`
flex-direction: row;
position: relative;
overflow: hidden;
margin-top: 0.5rem;
`;
const Speaking = styled.div`

View File

@ -70,6 +70,7 @@ const PluginDataChannelManagerContainer: React.ElementType<PluginDataChannelMana
key: PluginSdk.createChannelIdentifier(keyChannelName, pluginNameInUse),
pluginName: pluginNameInUse,
channelName: keyChannelName,
pluginApi,
}}
/>
))

View File

@ -7,6 +7,7 @@ import { PLUGIN_DATA_CHANNEL_DISPATCH_QUERY, PLUGIN_DATA_CHANNEL_FETCH_QUERY } f
export interface DataChannelItemManagerProps {
pluginName: string;
channelName: string;
pluginApi: PluginSdk.PluginApi
}
export interface MutationVariables {
@ -23,6 +24,7 @@ export const DataChannelItemManager: React.ElementType<DataChannelItemManagerPro
const {
pluginName,
channelName,
pluginApi,
} = props;
const pluginIdentifier = PluginSdk.createChannelIdentifier(channelName, pluginName);
@ -70,11 +72,8 @@ export const DataChannelItemManager: React.ElementType<DataChannelItemManagerPro
dispatchPluginDataChannelMessage(argumentsOfDispatcher);
}) as PluginSdk.DispatcherFunction;
window.dispatchEvent(new CustomEvent(`${pluginIdentifier}::dispatcherFunction`, {
detail: {
hook: PluginSdk.Internal.BbbDataChannel.UseDataChannel, data: useDataChannelHandlerFunction,
},
}));
pluginApi.mapOfDispatchers[pluginIdentifier] = useDataChannelHandlerFunction;
window.dispatchEvent(new Event(`${pluginIdentifier}::dispatcherFunction`));
useEffect(() => {
window.dispatchEvent(

View File

@ -4,6 +4,7 @@ import React, { useEffect, useState } from 'react';
import * as PluginSdk from 'bigbluebutton-html-plugin-sdk';
import CurrentPresentationHookContainer from './use-current-presentation/container';
import LoadedUserListHookContainer from './use-loaded-user-list/container';
import UsersOverviewHookContainer from './use-users-overview/container';
import CurrentUserHookContainer from './use-current-user/container';
const hooksMap:{
@ -12,6 +13,7 @@ const hooksMap:{
[PluginSdk.Internal.BbbHooks.UseCurrentPresentation]: CurrentPresentationHookContainer,
[PluginSdk.Internal.BbbHooks.UseLoadedUserList]: LoadedUserListHookContainer,
[PluginSdk.Internal.BbbHooks.UseCurrentUser]: CurrentUserHookContainer,
[PluginSdk.Internal.BbbHooks.UseUsersOverview]: UsersOverviewHookContainer,
};
const PluginHooksHandlerContainer: React.FC = () => {

View File

@ -0,0 +1,41 @@
import { useEffect, useState } from 'react';
import { useSubscription } from '@apollo/client';
import * as PluginSdk from 'bigbluebutton-html-plugin-sdk';
import { USERS_OVERVIEW } from '/imports/ui/core/graphql/queries/users';
const UsersOverviewHookContainer = () => {
const [sendSignal, setSendSignal] = useState(false);
const { data: usersData } = useSubscription(USERS_OVERVIEW);
const updateUsersOverviewForPlugin = () => {
window.dispatchEvent(new CustomEvent(PluginSdk.Internal.BbbHookEvents.Update, {
detail: {
data: usersData?.user,
hook: PluginSdk.Internal.BbbHooks.UseUsersOverview,
},
}));
};
useEffect(() => {
updateUsersOverviewForPlugin();
}, [usersData, sendSignal]);
useEffect(() => {
const updateHookUseUsersOverview = () => {
setSendSignal(!sendSignal);
};
window.addEventListener(
PluginSdk.Internal.BbbHookEvents.Subscribe, updateHookUseUsersOverview,
);
return () => {
window.removeEventListener(
PluginSdk.Internal.BbbHookEvents.Subscribe, updateHookUseUsersOverview,
);
};
}, []);
return null;
};
export default UsersOverviewHookContainer;

View File

@ -457,7 +457,11 @@ class PresentationToolbar extends PureComponent {
hideLabel
/>
{multiUser ? (
<Styled.MultiUserTool>{multiUserSize}</Styled.MultiUserTool>
<Styled.MultiUserTool
onClick={() => this.handleSwitchWhiteboardMode(!multiUser)}
>
{multiUserSize}
</Styled.MultiUserTool>
) : (
<Styled.MUTPlaceholder />
)}

View File

@ -225,6 +225,8 @@ const MultiUserTool = styled.span`
align-items: center;
box-shadow: 1px 1px ${borderSizeLarge} ${colorGrayDark};
font-size: ${smPaddingX};
user-select: none;
cursor: pointer;
[dir="ltr"] & {
right: 1rem;

View File

@ -43,28 +43,12 @@ const ChatList: React.FC<ChatListProps> = ({ chats }) => {
const [selectedChat, setSelectedChat] = React.useState<HTMLElement>();
const { roving } = Service;
React.useEffect(() => {
messageListRef.current?.addEventListener(
'keydown',
rove,
true,
);
return () => {
messageListRef.current?.removeEventListener(
'keydown',
rove,
true,
);
};
}, [messageListRef]);
React.useEffect(() => {
const firstChild = (selectedChat as HTMLElement)?.firstChild;
if (firstChild && firstChild instanceof HTMLElement) firstChild.focus();
}, [selectedChat]);
const rove = (event: KeyboardEvent) => {
const rove = (event: React.KeyboardEvent) => {
// eslint-disable-next-line react/no-find-dom-node
const msgItemsRef = findDOMNode(messageItemsRef.current);
const msgItemsRefChild = msgItemsRef?.firstChild;
@ -84,6 +68,7 @@ const ChatList: React.FC<ChatListProps> = ({ chats }) => {
role="tabpanel"
tabIndex={0}
ref={messageListRef}
onKeyDown={rove}
>
<Styled.List ref={messageItemsRef}>
<TransitionGroup>

View File

@ -69,7 +69,17 @@ export const USER_AGGREGATE_COUNT_SUBSCRIPTION = gql`
}
`;
export const USERS_OVERVIEW = gql`
subscription Users {
user {
userId
name
role
}
}`;
export default {
USER_LIST_SUBSCRIPTION,
USER_AGGREGATE_COUNT_SUBSCRIPTION,
USERS_OVERVIEW,
};

View File

@ -3754,9 +3754,9 @@
"dev": true
},
"bigbluebutton-html-plugin-sdk": {
"version": "0.0.20",
"resolved": "https://registry.npmjs.org/bigbluebutton-html-plugin-sdk/-/bigbluebutton-html-plugin-sdk-0.0.20.tgz",
"integrity": "sha512-JJqKLcdKA6FR8gK+QYkL0MAbTpDR/Xug4/9Rm6WVTEi3nKREx+MJAUr5ayb4MFVSKT3vl5M2MPmVrdt9fRgSqg=="
"version": "0.0.22",
"resolved": "https://registry.npmjs.org/bigbluebutton-html-plugin-sdk/-/bigbluebutton-html-plugin-sdk-0.0.22.tgz",
"integrity": "sha512-CyULo4yKPjnwPTnD2bX86WUl/6aja+cOMOpaOwecK5ojqogIt03ZptbF1S5tawgmEJEC/5D4I0+m8aLNSpryhQ=="
},
"bintrees": {
"version": "1.0.2",

View File

@ -45,7 +45,7 @@
"autoprefixer": "^10.4.4",
"axios": "^0.21.3",
"babel-runtime": "~6.26.0",
"bigbluebutton-html-plugin-sdk": "0.0.20",
"bigbluebutton-html-plugin-sdk": "0.0.22",
"bowser": "^2.11.0",
"browser-bunyan": "^1.8.0",
"classnames": "^2.2.6",