refactor: Rename all customParameters references to userMetadata or userdata (#20692)

* Rename all customParameters references to userMetadata

* fix linter error

* Update docs/docs/development/api.md

Co-authored-by: Anton Georgiev <antobinary@users.noreply.github.com>

* Update bigbluebutton-html5/imports/ui/components/settings-loader/component.tsx

---------

Co-authored-by: Anton Georgiev <antobinary@users.noreply.github.com>
This commit is contained in:
Gustavo Trott 2024-07-16 14:40:49 -03:00 committed by GitHub
parent 81d5d7daae
commit 1683f4c3fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
30 changed files with 118 additions and 118 deletions

View File

@ -63,7 +63,7 @@ trait RegisterUserReqMsgHdlr {
val regUser = RegisteredUsers.create(liveMeeting.props.meetingProp.intId, msg.body.intUserId, msg.body.extUserId, val regUser = RegisteredUsers.create(liveMeeting.props.meetingProp.intId, msg.body.intUserId, msg.body.extUserId,
msg.body.name, msg.body.role, msg.body.authToken, msg.body.sessionToken, msg.body.name, msg.body.role, msg.body.authToken, msg.body.sessionToken,
msg.body.avatarURL, ColorPicker.nextColor(liveMeeting.props.meetingProp.intId), msg.body.guest, msg.body.authed, msg.body.avatarURL, ColorPicker.nextColor(liveMeeting.props.meetingProp.intId), msg.body.guest, msg.body.authed,
guestStatus, msg.body.excludeFromDashboard, msg.body.enforceLayout, msg.body.customParameters, false) guestStatus, msg.body.excludeFromDashboard, msg.body.enforceLayout, msg.body.userMetadata, false)
checkUserConcurrentAccesses(regUser) checkUserConcurrentAccesses(regUser)
RegisteredUsers.add(liveMeeting.registeredUsers, regUser, liveMeeting.props.meetingProp.intId) RegisteredUsers.add(liveMeeting.registeredUsers, regUser, liveMeeting.props.meetingProp.intId)

View File

@ -1,39 +0,0 @@
package org.bigbluebutton.core.db
import slick.jdbc.PostgresProfile.api._
import slick.lifted.{ ProvenShape }
case class UserCustomParameterDbModel(
meetingId: String,
userId: String,
parameter: String,
value: String
)
class UserCustomParameterDbTableDef(tag: Tag) extends Table[UserCustomParameterDbModel](tag, "user_customParameter") {
val meetingId = column[String]("meetingId", O.PrimaryKey)
val userId = column[String]("userId", O.PrimaryKey)
val parameter = column[String]("parameter", O.PrimaryKey)
val value = column[String]("value")
override def * : ProvenShape[UserCustomParameterDbModel] = (meetingId, userId, parameter, value) <> (UserCustomParameterDbModel.tupled, UserCustomParameterDbModel.unapply)
}
object UserCustomParameterDAO {
def insert(meetingId: String, userId: String, customParameters: Map[String, String]) = {
DatabaseConnection.enqueue(DBIO.sequence(
for {
parameter <- customParameters
} yield {
TableQuery[UserCustomParameterDbTableDef].insertOrUpdate(
UserCustomParameterDbModel(
meetingId = meetingId,
userId = userId,
parameter = parameter._1,
value = parameter._2
)
)
}
).transactionally)
}
}

View File

@ -86,7 +86,7 @@ object UserDAO {
) )
UserConnectionStatusDAO.insert(meetingId, regUser.id) UserConnectionStatusDAO.insert(meetingId, regUser.id)
UserCustomParameterDAO.insert(meetingId, regUser.id, regUser.customParameters) UserMetadataDAO.insert(meetingId, regUser.id, regUser.userMetadata)
UserClientSettingsDAO.insertOrUpdate(meetingId, regUser.id, JsonUtils.stringToJson("{}")) UserClientSettingsDAO.insertOrUpdate(meetingId, regUser.id, JsonUtils.stringToJson("{}"))
ChatUserDAO.insertUserPublicChat(meetingId, regUser.id) ChatUserDAO.insertUserPublicChat(meetingId, regUser.id)
} }

View File

@ -0,0 +1,39 @@
package org.bigbluebutton.core.db
import slick.jdbc.PostgresProfile.api._
import slick.lifted.{ ProvenShape }
case class UserMetadataDbModel(
meetingId: String,
userId: String,
parameter: String,
value: String
)
class UserMetadataDbTableDef(tag: Tag) extends Table[UserMetadataDbModel](tag, "user_metadata") {
val meetingId = column[String]("meetingId", O.PrimaryKey)
val userId = column[String]("userId", O.PrimaryKey)
val parameter = column[String]("parameter", O.PrimaryKey)
val value = column[String]("value")
override def * : ProvenShape[UserMetadataDbModel] = (meetingId, userId, parameter, value) <> (UserMetadataDbModel.tupled, UserMetadataDbModel.unapply)
}
object UserMetadataDAO {
def insert(meetingId: String, userId: String, userMetadata: Map[String, String]) = {
DatabaseConnection.enqueue(DBIO.sequence(
for {
metadata <- userMetadata
} yield {
TableQuery[UserMetadataDbTableDef].insertOrUpdate(
UserMetadataDbModel(
meetingId = meetingId,
userId = userId,
parameter = metadata._1,
value = metadata._2
)
)
}
).transactionally)
}
}

View File

@ -8,7 +8,7 @@ object RegisteredUsers {
def create(meetingId: String, userId: String, extId: String, name: String, roles: String, def create(meetingId: String, userId: String, extId: String, name: String, roles: String,
authToken: String, sessionToken: String, avatar: String, color: String, guest: Boolean, authenticated: Boolean, authToken: String, sessionToken: String, avatar: String, color: String, guest: Boolean, authenticated: Boolean,
guestStatus: String, excludeFromDashboard: Boolean, enforceLayout: String, guestStatus: String, excludeFromDashboard: Boolean, enforceLayout: String,
customParameters: Map[String, String], loggedOut: Boolean): RegisteredUser = { userMetadata: Map[String, String], loggedOut: Boolean): RegisteredUser = {
new RegisteredUser( new RegisteredUser(
userId, userId,
extId, extId,
@ -31,7 +31,7 @@ object RegisteredUsers {
ejected = false, ejected = false,
banned = false, banned = false,
enforceLayout, enforceLayout,
customParameters, userMetadata,
loggedOut, loggedOut,
) )
} }
@ -252,7 +252,7 @@ case class RegisteredUser(
ejected: Boolean, ejected: Boolean,
banned: Boolean, banned: Boolean,
enforceLayout: String, enforceLayout: String,
customParameters: Map[String,String], userMetadata: Map[String,String],
loggedOut: Boolean, loggedOut: Boolean,
lastBreakoutRoom: BreakoutRoom2x = null, lastBreakoutRoom: BreakoutRoom2x = null,
) )

View File

@ -451,7 +451,7 @@ case class UserState(
userLeftFlag: UserLeftFlag, userLeftFlag: UserLeftFlag,
speechLocale: String = "", speechLocale: String = "",
captionLocale: String = "", captionLocale: String = "",
customParameters: Map[String, String] = Map.empty userMetadata: Map[String, String] = Map.empty
) )

View File

@ -47,8 +47,8 @@ class ParticipantJoinRecordEvent extends AbstractParticipantRecordEvent {
eventMap.put(ROLE, role) eventMap.put(ROLE, role)
} }
def setUserdata(customParameters: Map[String, String]): Unit = { def setUserdata(userMetadata: Map[String, String]): Unit = {
eventMap.put(USER_DATA, customParameters.toJson.compactPrint) eventMap.put(USER_DATA, userMetadata.toJson.compactPrint)
} }
} }

View File

@ -75,7 +75,7 @@ trait HandlerHelpers extends SystemConfiguration {
color = regUser.color, color = regUser.color,
clientType = clientType, clientType = clientType,
userLeftFlag = UserLeftFlag(false, 0), userLeftFlag = UserLeftFlag(false, 0),
customParameters = regUser.customParameters userMetadata = regUser.userMetadata
) )
} }

View File

@ -18,7 +18,7 @@ object UserJoinedMeetingEvtMsgBuilder {
pin = userState.pin, pin = userState.pin,
presenter = userState.presenter, locked = userState.locked, avatar = userState.avatar, color = userState.color, presenter = userState.presenter, locked = userState.locked, avatar = userState.avatar, color = userState.color,
clientType = userState.clientType, clientType = userState.clientType,
customParameters = userState.customParameters) userMetadata = userState.userMetadata)
val event = UserJoinedMeetingEvtMsg(meetingId, userState.intId, body) val event = UserJoinedMeetingEvtMsg(meetingId, userState.intId, body)

View File

@ -352,7 +352,7 @@ class RedisRecorderActor(
ev.setExternalUserId(msg.body.extId) ev.setExternalUserId(msg.body.extId)
ev.setName(msg.body.name) ev.setName(msg.body.name)
ev.setRole(msg.body.role) ev.setRole(msg.body.role)
ev.setUserdata(msg.body.customParameters) ev.setUserdata(msg.body.userMetadata)
record(msg.header.meetingId, ev.toMap.asJava) record(msg.header.meetingId, ev.toMap.asJava)
} }

View File

@ -8,7 +8,7 @@ case class RegisterUserReqMsg(
case class RegisterUserReqMsgBody(meetingId: String, intUserId: String, name: String, role: String, case class RegisterUserReqMsgBody(meetingId: String, intUserId: String, name: String, role: String,
extUserId: String, authToken: String, sessionToken: String, avatarURL: String, extUserId: String, authToken: String, sessionToken: String, avatarURL: String,
guest: Boolean, authed: Boolean, guestStatus: String, excludeFromDashboard: Boolean, guest: Boolean, authed: Boolean, guestStatus: String, excludeFromDashboard: Boolean,
enforceLayout: String, customParameters: Map[String, String]) enforceLayout: String, userMetadata: Map[String, String])
object UserRegisteredRespMsg { val NAME = "UserRegisteredRespMsg" } object UserRegisteredRespMsg { val NAME = "UserRegisteredRespMsg" }
case class UserRegisteredRespMsg( case class UserRegisteredRespMsg(
@ -90,24 +90,24 @@ case class UserJoinedMeetingEvtMsg(
body: UserJoinedMeetingEvtMsgBody body: UserJoinedMeetingEvtMsgBody
) extends BbbCoreMsg ) extends BbbCoreMsg
case class UserJoinedMeetingEvtMsgBody( case class UserJoinedMeetingEvtMsgBody(
intId: String, intId: String,
extId: String, extId: String,
name: String, name: String,
role: String, role: String,
guest: Boolean, guest: Boolean,
authed: Boolean, authed: Boolean,
guestStatus: String, guestStatus: String,
emoji: String, emoji: String,
reactionEmoji: String, reactionEmoji: String,
raiseHand: Boolean, raiseHand: Boolean,
away: Boolean, away: Boolean,
pin: Boolean, pin: Boolean,
presenter: Boolean, presenter: Boolean,
locked: Boolean, locked: Boolean,
avatar: String, avatar: String,
color: String, color: String,
clientType: String, clientType: String,
customParameters: Map[String, String] userMetadata: Map[String, String]
) )
/** /**

View File

@ -124,11 +124,11 @@ public class MeetingService implements MessageListener {
String fullname, String role, String externUserID, String fullname, String role, String externUserID,
String authToken, String sessionToken, String avatarURL, Boolean guest, String authToken, String sessionToken, String avatarURL, Boolean guest,
Boolean authed, String guestStatus, Boolean excludeFromDashboard, Boolean leftGuestLobby, Boolean authed, String guestStatus, Boolean excludeFromDashboard, Boolean leftGuestLobby,
String enforceLayout, Map<String, String> customParameters) { String enforceLayout, Map<String, String> userMetadata) {
handle( handle(
new RegisterUser(meetingID, internalUserId, fullname, role, new RegisterUser(meetingID, internalUserId, fullname, role,
externUserID, authToken, sessionToken, avatarURL, guest, authed, guestStatus, externUserID, authToken, sessionToken, avatarURL, guest, authed, guestStatus,
excludeFromDashboard, leftGuestLobby, enforceLayout, customParameters excludeFromDashboard, leftGuestLobby, enforceLayout, userMetadata
) )
); );
@ -447,7 +447,7 @@ public class MeetingService implements MessageListener {
gw.registerUser(message.meetingID, gw.registerUser(message.meetingID,
message.internalUserId, message.fullname, message.role, message.internalUserId, message.fullname, message.role,
message.externUserID, message.authToken, message.sessionToken, message.avatarURL, message.guest, message.externUserID, message.authToken, message.sessionToken, message.avatarURL, message.guest,
message.authed, message.guestStatus, message.excludeFromDashboard, message.enforceLayout, message.customParameters); message.authed, message.guestStatus, message.excludeFromDashboard, message.enforceLayout, message.userMetadata);
} }
public Meeting getMeeting(String meetingId) { public Meeting getMeeting(String meetingId) {

View File

@ -19,12 +19,12 @@ public class RegisterUser implements IMessage {
public final Boolean excludeFromDashboard; public final Boolean excludeFromDashboard;
public final Boolean leftGuestLobby; public final Boolean leftGuestLobby;
public final String enforceLayout; public final String enforceLayout;
public final Map<String, String> customParameters; public final Map<String, String> userMetadata;
public RegisterUser(String meetingID, String internalUserId, String fullname, String role, String externUserID, public RegisterUser(String meetingID, String internalUserId, String fullname, String role, String externUserID,
String authToken, String sessionToken, String avatarURL, Boolean guest, String authToken, String sessionToken, String avatarURL, Boolean guest,
Boolean authed, String guestStatus, Boolean excludeFromDashboard, Boolean leftGuestLobby, Boolean authed, String guestStatus, Boolean excludeFromDashboard, Boolean leftGuestLobby,
String enforceLayout, Map<String, String> customParameters) { String enforceLayout, Map<String, String> userMetadata) {
this.meetingID = meetingID; this.meetingID = meetingID;
this.internalUserId = internalUserId; this.internalUserId = internalUserId;
this.fullname = fullname; this.fullname = fullname;
@ -39,6 +39,6 @@ public class RegisterUser implements IMessage {
this.excludeFromDashboard = excludeFromDashboard; this.excludeFromDashboard = excludeFromDashboard;
this.leftGuestLobby = leftGuestLobby; this.leftGuestLobby = leftGuestLobby;
this.enforceLayout = enforceLayout; this.enforceLayout = enforceLayout;
this.customParameters = customParameters; this.userMetadata = userMetadata;
} }
} }

View File

@ -73,7 +73,7 @@ public interface IBbbWebApiGWApp {
void registerUser(String meetingID, String internalUserId, String fullname, String role, void registerUser(String meetingID, String internalUserId, String fullname, String role,
String externUserID, String authToken, String sessionToken, String avatarURL, String externUserID, String authToken, String sessionToken, String avatarURL,
Boolean guest, Boolean authed, String guestStatus, Boolean excludeFromDashboard, Boolean guest, Boolean authed, String guestStatus, Boolean excludeFromDashboard,
String enforceLayout, Map<String, String> customParameters); String enforceLayout, Map<String, String> userMetadata);
void destroyMeeting(DestroyMeetingMessage msg); void destroyMeeting(DestroyMeetingMessage msg);
void endMeeting(EndMeetingMessage msg); void endMeeting(EndMeetingMessage msg);

View File

@ -286,7 +286,7 @@ class BbbWebApiGWApp(
role: String, extUserId: String, authToken: String, sessionToken: String, role: String, extUserId: String, authToken: String, sessionToken: String,
avatarURL: String, guest: java.lang.Boolean, authed: java.lang.Boolean, avatarURL: String, guest: java.lang.Boolean, authed: java.lang.Boolean,
guestStatus: String, excludeFromDashboard: java.lang.Boolean, guestStatus: String, excludeFromDashboard: java.lang.Boolean,
enforceLayout: String, customParameters: java.util.Map[String, String]): Unit = { enforceLayout: String, userMetadata: java.util.Map[String, String]): Unit = {
// meetingManagerActorRef ! new RegisterUser(meetingId = meetingId, intUserId = intUserId, name = name, // meetingManagerActorRef ! new RegisterUser(meetingId = meetingId, intUserId = intUserId, name = name,
// role = role, extUserId = extUserId, authToken = authToken, avatarURL = avatarURL, // role = role, extUserId = extUserId, authToken = authToken, avatarURL = avatarURL,
@ -296,7 +296,7 @@ class BbbWebApiGWApp(
role = role, extUserId = extUserId, authToken = authToken, sessionToken = sessionToken, role = role, extUserId = extUserId, authToken = authToken, sessionToken = sessionToken,
avatarURL = avatarURL, guest = guest.booleanValue(), authed = authed.booleanValue(), avatarURL = avatarURL, guest = guest.booleanValue(), authed = authed.booleanValue(),
guestStatus = guestStatus, excludeFromDashboard = excludeFromDashboard, enforceLayout = enforceLayout, guestStatus = guestStatus, excludeFromDashboard = excludeFromDashboard, enforceLayout = enforceLayout,
customParameters = (customParameters).asScala.toMap) userMetadata = (userMetadata).asScala.toMap)
val event = MsgBuilder.buildRegisterUserRequestToAkkaApps(regUser) val event = MsgBuilder.buildRegisterUserRequestToAkkaApps(regUser)
msgToAkkaAppsEventBus.publish(MsgToAkkaApps(toAkkaAppsChannel, event)) msgToAkkaAppsEventBus.publish(MsgToAkkaApps(toAkkaAppsChannel, event))

View File

@ -51,7 +51,7 @@ object MsgBuilder {
val body = RegisterUserReqMsgBody(meetingId = msg.meetingId, intUserId = msg.intUserId, val body = RegisterUserReqMsgBody(meetingId = msg.meetingId, intUserId = msg.intUserId,
name = msg.name, role = msg.role, extUserId = msg.extUserId, authToken = msg.authToken, sessionToken = msg.sessionToken, name = msg.name, role = msg.role, extUserId = msg.extUserId, authToken = msg.authToken, sessionToken = msg.sessionToken,
avatarURL = msg.avatarURL, guest = msg.guest, authed = msg.authed, guestStatus = msg.guestStatus, avatarURL = msg.avatarURL, guest = msg.guest, authed = msg.authed, guestStatus = msg.guestStatus,
excludeFromDashboard = msg.excludeFromDashboard, enforceLayout = msg.enforceLayout, customParameters = msg.customParameters) excludeFromDashboard = msg.excludeFromDashboard, enforceLayout = msg.enforceLayout, userMetadata = msg.userMetadata)
val req = RegisterUserReqMsg(header, body) val req = RegisterUserReqMsg(header, body)
BbbCommonEnvCoreMsg(envelope, req) BbbCommonEnvCoreMsg(envelope, req)
} }

View File

@ -18,7 +18,7 @@ case class AddUserSession(token: String, session: UserSession)
case class RegisterUser(meetingId: String, intUserId: String, name: String, role: String, case class RegisterUser(meetingId: String, intUserId: String, name: String, role: String,
extUserId: String, authToken: String, sessionToken: String, avatarURL: String, extUserId: String, authToken: String, sessionToken: String, avatarURL: String,
guest: Boolean, authed: Boolean, guestStatus: String, excludeFromDashboard: Boolean, guest: Boolean, authed: Boolean, guestStatus: String, excludeFromDashboard: Boolean,
enforceLayout: String, customParameters: Map[String, String]) enforceLayout: String, userMetadata: Map[String, String])
case class CreateMeetingMsg(defaultProps: DefaultProps) case class CreateMeetingMsg(defaultProps: DefaultProps)

View File

@ -30,7 +30,7 @@ trait ToAkkaAppsSendersTrait extends SystemConfiguration {
name = msg.name, role = msg.role, extUserId = msg.extUserId, authToken = msg.authToken, name = msg.name, role = msg.role, extUserId = msg.extUserId, authToken = msg.authToken,
sessionToken = msg.sessionToken, avatarURL = msg.avatarURL, guest = msg.guest, authed = msg.authed, sessionToken = msg.sessionToken, avatarURL = msg.avatarURL, guest = msg.guest, authed = msg.authed,
guestStatus = msg.guestStatus, excludeFromDashboard = msg.excludeFromDashboard, guestStatus = msg.guestStatus, excludeFromDashboard = msg.excludeFromDashboard,
enforceLayout = msg.enforceLayout, customParameters = msg.customParameters) enforceLayout = msg.enforceLayout, userMetadata = msg.userMetadata)
val req = RegisterUserReqMsg(header, body) val req = RegisterUserReqMsg(header, body)
val message = BbbCommonEnvCoreMsg(envelope, req) val message = BbbCommonEnvCoreMsg(envelope, req)
sendToBus(message) sendToBus(message)

View File

@ -551,19 +551,19 @@ AS SELECT
"user"."isOnline" "user"."isOnline"
FROM "user"; FROM "user";
create table "user_customParameter"( create table "user_metadata"(
"meetingId" varchar(100), "meetingId" varchar(100),
"userId" varchar(50), "userId" varchar(50),
"parameter" varchar(255), "parameter" varchar(255),
"value" varchar(255), "value" varchar(255),
CONSTRAINT "user_customParameter_pkey" PRIMARY KEY ("meetingId", "userId","parameter"), CONSTRAINT "user_metadata_pkey" PRIMARY KEY ("meetingId", "userId","parameter"),
FOREIGN KEY ("meetingId", "userId") REFERENCES "user"("meetingId","userId") ON DELETE CASCADE FOREIGN KEY ("meetingId", "userId") REFERENCES "user"("meetingId","userId") ON DELETE CASCADE
); );
create index "idx_user_customParameter_pk_reverse" on "user_customParameter" ("userId", "meetingId"); create index "idx_user_metadata_pk_reverse" on "user_metadata" ("userId", "meetingId");
CREATE VIEW "v_user_customParameter" AS CREATE VIEW "v_user_metadata" AS
SELECT * SELECT *
FROM "user_customParameter"; FROM "user_metadata";
CREATE VIEW "v_user_welcomeMsgs" AS CREATE VIEW "v_user_welcomeMsgs" AS
SELECT SELECT

View File

@ -16,14 +16,14 @@ object_relationships:
remote_table: remote_table:
name: v_user_connectionStatus name: v_user_connectionStatus
schema: public schema: public
- name: customParameters - name: userMetadata
using: using:
manual_configuration: manual_configuration:
column_mapping: column_mapping:
userId: userId userId: userId
insertion_order: null insertion_order: null
remote_table: remote_table:
name: v_user_customParameter name: v_user_metadata
schema: public schema: public
- name: guestStatusDetails - name: guestStatusDetails
using: using:

View File

@ -1,10 +1,10 @@
table: table:
name: v_user_customParameter name: v_user_metadata
schema: public schema: public
configuration: configuration:
column_config: {} column_config: {}
custom_column_names: {} custom_column_names: {}
custom_name: user_customParameter custom_name: user_metadata
custom_root_fields: {} custom_root_fields: {}
select_permissions: select_permissions:
- role: bbb_client - role: bbb_client

View File

@ -51,7 +51,7 @@
- "!include public_v_user_connectionStatus.yaml" - "!include public_v_user_connectionStatus.yaml"
- "!include public_v_user_connectionStatusReport.yaml" - "!include public_v_user_connectionStatusReport.yaml"
- "!include public_v_user_current.yaml" - "!include public_v_user_current.yaml"
- "!include public_v_user_customParameter.yaml" - "!include public_v_user_metadata.yaml"
- "!include public_v_user_guest.yaml" - "!include public_v_user_guest.yaml"
- "!include public_v_user_reaction.yaml" - "!include public_v_user_reaction.yaml"
- "!include public_v_user_ref.yaml" - "!include public_v_user_ref.yaml"

View File

@ -39,7 +39,7 @@ export interface Voice {
startTime: number; startTime: number;
} }
export interface CustomParameter { export interface UserMetadata {
parameter: string; parameter: string;
value: string; value: string;
} }

View File

@ -1,6 +1,6 @@
import { useQuery } from '@apollo/client'; import { useQuery } from '@apollo/client';
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import { UserCustomParameterResponse, getCustomParameter } from './queries'; import { UserMetadataResponse, getUserMetadata } from './queries';
import { setUserSettings } from '/imports/ui/core/local-states/useUserSettings'; import { setUserSettings } from '/imports/ui/core/local-states/useUserSettings';
interface CustomUsersSettingsProps { interface CustomUsersSettingsProps {
@ -11,14 +11,14 @@ const CustomUsersSettings: React.FC<CustomUsersSettingsProps> = ({
children, children,
}) => { }) => {
const { const {
data: customParameterData, data: userMetadataData,
loading: customParameterLoading, loading: userMetadataLoading,
error: customParameterError, error: userMetadataError,
} = useQuery<UserCustomParameterResponse>(getCustomParameter); } = useQuery<UserMetadataResponse>(getUserMetadata);
const [allowToRender, setAllowToRender] = React.useState(false); const [allowToRender, setAllowToRender] = React.useState(false);
useEffect(() => { useEffect(() => {
if (customParameterData && !customParameterLoading) { if (userMetadataData && !userMetadataLoading) {
const filteredData = customParameterData.user_customParameter.map((uc) => { const filteredData = userMetadataData.user_metadata.map((uc) => {
const { parameter, value } = uc; const { parameter, value } = uc;
let parsedValue: string | boolean | string[] = ''; let parsedValue: string | boolean | string[] = '';
try { try {
@ -32,15 +32,15 @@ const CustomUsersSettings: React.FC<CustomUsersSettingsProps> = ({
setAllowToRender(true); setAllowToRender(true);
} }
}, [ }, [
customParameterData, userMetadataData,
customParameterLoading, userMetadataLoading,
]); ]);
useEffect(() => { useEffect(() => {
if (customParameterError) { if (userMetadataError) {
throw new Error(`Error on requesting custom parameter data: ${customParameterError}`); throw new Error(`Error on requesting custom parameter data: ${userMetadataError}`);
} }
}, [customParameterError]); }, [userMetadataError]);
return allowToRender ? <>{children}</> : null; return allowToRender ? <>{children}</> : null;
}; };

View File

@ -1,17 +1,17 @@
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
interface CustomParameter { interface UserMetadata {
parameter: string; parameter: string;
value: string; value: string;
} }
export interface UserCustomParameterResponse { export interface UserMetadataResponse {
user_customParameter: CustomParameter[]; user_metadata: UserMetadata[];
} }
export const getCustomParameter = gql` export const getUserMetadata = gql`
query getCustomParameter { query getUserMetadata {
user_customParameter { user_metadata {
parameter parameter
value value
} }
@ -19,5 +19,5 @@ export const getCustomParameter = gql`
`; `;
export default { export default {
getCustomParameter, getUserMetadata,
}; };

View File

@ -2,7 +2,7 @@ import DEFAULT_VALUES from '/imports/ui/components/layout/defaultValues';
export const INITIAL_INPUT_STATE = { export const INITIAL_INPUT_STATE = {
autoarrAngeLayout: true, autoarrAngeLayout: true,
customParameters: { userMetadata: {
}, },
browser: { browser: {

View File

@ -246,7 +246,7 @@ interface Input {
bannerBar: BannerBar; bannerBar: BannerBar;
browser: Browser; browser: Browser;
cameraDock: CameraDock cameraDock: CameraDock
customParameters: NonNullable<unknown>; userMetadata: NonNullable<unknown>;
externalVideo: ExternalVideo; externalVideo: ExternalVideo;
genericMainContent: GenericContentMainArea; genericMainContent: GenericContentMainArea;
navBar: NavBar; navBar: NavBar;

View File

@ -1375,14 +1375,14 @@ These configs can be set in `/etc/bigbluebutton/bbb-web.properties`
- _`overwritable`_: Config will be overwritten if the param is present in the API `/create` request - _`overwritable`_: Config will be overwritten if the param is present in the API `/create` request
### Passing custom parameters to the client on join ### Passing user metadata to the client on join
The HTML5 client supports a list of parameters that can be added to the `join` API call which modify the look and default behaviour of the client. This list is accurate as of BigBlueButton version 2.2.17 (build 937). These parameters override the global defaults set in `settings.yml`. As the parameters are passed on call to join, it allows for some powerful customization that can vary depending on which user is joining the session. The HTML5 client supports a list of parameters that can be added to the `join` API call which modify the look and default behaviour of the client. This list is accurate as of BigBlueButton version 2.2.17 (build 937). These parameters override the global defaults set in `settings.yml`. As the parameters are passed on call to join, it allows for some powerful customization that can vary depending on which user is joining the session.
Useful tools for development: Useful tools for development:
- A tool like (https://meyerweb.com/eric/tools/dencoder/) is useful in the encoding-decoding process for the fields expecting encoded value passed (see below). - A tool like (https://meyerweb.com/eric/tools/dencoder/) is useful in the encoding-decoding process for the fields expecting encoded value passed (see below).
- The [API mate](https://mconf.github.io/api-mate/) allows you to directly experiment with these custom parameters. To use the API mate, run the following command on your BigBlueButton machine: `sudo bbb-conf --secret`. This creates a link for you with your secret as a parameter so you can get started experimenting right away. - The [API mate](https://mconf.github.io/api-mate/) allows you to directly experiment with these user metadata. To use the API mate, run the following command on your BigBlueButton machine: `sudo bbb-conf --secret`. This creates a link for you with your secret as a parameter so you can get started experimenting right away.
#### Application parameters #### Application parameters

View File

@ -550,7 +550,7 @@ There is a XML response for this call only when the `redirect` parameter is set
</response> </response>
``` ```
See [Passing custom parameters to the client on join](/administration/customize/#passing-custom-parameters-to-the-client-on-join) for additional `join` parameters that can override default settings for the user. See [Passing user metadata to the client on join](/administration/customize/#passing-user-metadata-to-the-client-on-join) for additional `join` parameters that can override default settings for the user.
### `POST` insertDocument ### `POST` insertDocument
@ -1264,7 +1264,7 @@ See the following [bigbluebutton-api-ruby](https://github.com/mconf/bigbluebutto
To help you create/test valid API calls against your BigBlueButton server, use the excellent [API Mate](http://mconf.github.io/api-mate/) to interactively create API calls. API Mate generates the checksums within the browser (no server component needed) so you can use it to test API calls against a local BigBlueButton server. To help you create/test valid API calls against your BigBlueButton server, use the excellent [API Mate](http://mconf.github.io/api-mate/) to interactively create API calls. API Mate generates the checksums within the browser (no server component needed) so you can use it to test API calls against a local BigBlueButton server.
If you're developing new API calls or adding parameters on API calls, you can still use the API Mate to test them. Just scroll the page down or type "custom" in the parameter filter and you'll see the inputs where you can add custom API calls or custom parameters. New API calls will appear in the list of API links and new parameters will be added to all the API links. If you're developing new API calls or adding parameters on API calls, you can still use the API Mate to test them. Just scroll the page down or type "custom" in the parameter filter and you'll see the inputs where you can add custom API calls or user metadata. New API calls will appear in the list of API links and new parameters will be added to all the API links.
If your using API Mate to test recordings and want to query by `meetingID`, be sure to clear the `recordID` field first. BigBlueButton's API supports querying for recordings by either value, but not both at the same time. If your using API Mate to test recordings and want to query by `meetingID`, be sure to clear the `recordID` field first. BigBlueButton's API supports querying for recordings by either value, but not both at the same time.

View File

@ -1717,7 +1717,7 @@ Note :
## Custom Parameters [(Automated)](https://github.com/bigbluebutton/bigbluebutton/blob/v2.6.x-release/bigbluebutton-tests/playwright/customparameters/customparameters.spec.js) ## Custom Parameters [(Automated)](https://github.com/bigbluebutton/bigbluebutton/blob/v2.6.x-release/bigbluebutton-tests/playwright/customparameters/customparameters.spec.js)
Client should apply custom parameters according to the descriptions from [here](/administration/customize#application-parameters). Client should apply user metadata according to the descriptions from [here](/administration/customize#application-parameters).
## iFrame ## iFrame