From 7bdb48d100a9f44909f48462007c76d2106ecb2e Mon Sep 17 00:00:00 2001 From: Tainan Felipe Date: Fri, 8 Mar 2024 10:59:47 -0300 Subject: [PATCH] Fix: meeting end not fetching user data --- .../tables/public_v_meeting.yaml | 3 ++- .../meeting-ended-ts/component.tsx | 22 +++++++++---------- .../meeting-ended/meeting-ended-ts/queries.ts | 4 ++-- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_meeting.yaml b/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_meeting.yaml index f6afd9d0c2..bc0d4ab2fb 100644 --- a/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_meeting.yaml +++ b/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_meeting.yaml @@ -184,10 +184,11 @@ select_permissions: - endedBy - endedByUserName - endedReasonCode + - isBreakout - logoutUrl - meetingId - name filter: meetingId: _eq: X-Hasura-MeetingId - comment: "" \ No newline at end of file + comment: "" diff --git a/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/component.tsx b/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/component.tsx index e03e584aa5..05f71c32e9 100644 --- a/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/component.tsx +++ b/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/component.tsx @@ -171,7 +171,7 @@ interface MeetingEndedProps extends MeetingEndedContainerProps { allowDefaultLogoutUrl: boolean; askForFeedbackOnLogout: boolean learningDashboardAccessToken: string; - role: string; + isModerator: boolean; learningDashboardBase: string; isBreakout: boolean; } @@ -183,7 +183,7 @@ const MeetingEnded: React.FC = ({ allowDefaultLogoutUrl, askForFeedbackOnLogout, learningDashboardAccessToken, - role, + isModerator, learningDashboardBase, isBreakout, }) => { @@ -220,7 +220,7 @@ const MeetingEnded: React.FC = ({ authToken, meetingId, comment, - userRole: role, + isModerator, }; const url = './feedback'; const options = { @@ -233,7 +233,7 @@ const MeetingEnded: React.FC = ({ setDispatched(true); fetch(url, options).then(() => { - if (role === 'VIEWER') { + if (!isModerator) { const REDIRECT_WAIT_TIME = 5000; setTimeout(() => { window.location.href = logoutUrl; @@ -263,7 +263,7 @@ const MeetingEnded: React.FC = ({ ( { - learningDashboardAccessToken && role === 'moderator' + learningDashboardAccessToken && isModerator // Always set cookie in case Dashboard is already opened && setLearningDashboardCookie(learningDashboardAccessToken, meetingId) === true ? ( @@ -298,7 +298,7 @@ const MeetingEnded: React.FC = ({ ) ); - }, [learningDashboardAccessToken, role, meetingId, authToken, learningDashboardBase]); + }, [learningDashboardAccessToken, isModerator, meetingId, authToken, learningDashboardBase]); const feedbackScreen = useMemo(() => { const shouldShowFeedback = askForFeedbackOnLogout && !dispatched; @@ -387,8 +387,7 @@ const MeetingEndedContainer: React.FC = ({ allowDefaultLogoutUrl={false} askForFeedbackOnLogout={false} learningDashboardAccessToken="" - // eslint-disable-next-line jsx-a11y/aria-role - role="" + isModerator={false} learningDashboardBase="" isBreakout={false} /> @@ -405,8 +404,7 @@ const MeetingEndedContainer: React.FC = ({ allowDefaultLogoutUrl={false} askForFeedbackOnLogout={false} learningDashboardAccessToken="" - // eslint-disable-next-line jsx-a11y/aria-role - role="" + isModerator={false} learningDashboardBase="" isBreakout={false} /> @@ -417,7 +415,7 @@ const MeetingEndedContainer: React.FC = ({ user_current, } = meetingEndData; const { - role, + isModerator, meeting, } = user_current[0]; @@ -441,7 +439,7 @@ const MeetingEndedContainer: React.FC = ({ allowDefaultLogoutUrl={allowDefaultLogoutUrl} askForFeedbackOnLogout={askForFeedbackOnLogout} learningDashboardAccessToken={learningDashboard?.learningDashboardAccessToken} - role={role} + isModerator={isModerator} learningDashboardBase={learningDashboardBase} isBreakout={isBreakout} /> diff --git a/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/queries.ts b/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/queries.ts index fc26e5c08a..08ef2b8b67 100644 --- a/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/queries.ts +++ b/bigbluebutton-html5/imports/ui/components/meeting-ended/meeting-ended-ts/queries.ts @@ -2,7 +2,7 @@ import { gql } from '@apollo/client'; export interface MeetingEndDataResponse { user_current: Array<{ - role: string; + isModerator: boolean; meeting: { learningDashboard: { learningDashboardAccessToken: string; @@ -21,7 +21,7 @@ export interface MeetingEndDataResponse { export const getMeetingEndData = gql` query getMeetingEndData { user_current { - role + isModerator meeting { learningDashboard { learningDashboardAccessToken