Merge pull request #20477 from gustavotrott/component-flag-sharingCamera

refactor (graphql-server): Introduces `meeting_componentFlags.hasCameraAsContent`
This commit is contained in:
Gustavo Trott 2024-06-24 14:17:55 -03:00 committed by GitHub
commit 9639f70444
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 13 additions and 29 deletions

View File

@ -2133,7 +2133,14 @@ select "meeting"."meetingId",
select 1
from "v_screenshare"
where "v_screenshare"."meetingId" = "meeting"."meetingId"
and "contentType" = 'screenshare'
) as "hasScreenshare",
exists (
select 1
from "v_screenshare"
where "v_screenshare"."meetingId" = "meeting"."meetingId"
and "contentType" = 'camera'
) as "hasCameraAsContent",
exists (
select 1
from "v_externalVideo"

View File

@ -15,6 +15,7 @@ select_permissions:
- hasExternalVideo
- hasPoll
- hasScreenshare
- hasCameraAsContent
- hasTimer
- showRemainingTime
filter:

View File

@ -104,6 +104,7 @@ export interface ComponentsFlags {
hasScreenshare: boolean;
hasTimer: boolean;
showRemainingTime: boolean;
hasCameraAsContent: boolean;
}
export interface Metadata {

View File

@ -23,7 +23,6 @@ import { EXTERNAL_VIDEO_STOP } from '../external-video-player/mutations';
import { PINNED_PAD_SUBSCRIPTION } from '../notes/queries';
import useDeduplicatedSubscription from '../../core/hooks/useDeduplicatedSubscription';
import connectionStatus from '../../core/graphql/singletons/connectionStatus';
import { getSceenShareType } from './queries';
const isReactionsButtonEnabled = () => {
const USER_REACTIONS_ENABLED = window.meetingClientSettings.public.userReaction.enabled;
@ -39,10 +38,6 @@ const ActionsBarContainer = (props) => {
const RAISE_HAND_BUTTON_CENTERED = window.meetingClientSettings
.public.app.raiseHandActionButton.centered;
const {
data: sceenShareType,
} = useDeduplicatedSubscription(getSceenShareType);
const actionsBarStyle = layoutSelectOutput((i) => i.actionBar);
const layoutContextDispatch = layoutDispatch();
@ -108,8 +103,7 @@ const ActionsBarContainer = (props) => {
setPresentationIsOpen: MediaService.setPresentationIsOpen,
hasScreenshare: currentMeeting?.componentsFlags?.hasScreenshare ?? false,
isMeteorConnected: connected,
hasCameraAsContent: currentMeeting?.componentsFlags?.hasScreenshare
&& sceenShareType?.screenshare[0]?.contentType,
hasCameraAsContent: currentMeeting?.componentsFlags?.hasCameraAsContent,
intl,
allowExternalVideo,
isPollingEnabled,

View File

@ -1,21 +0,0 @@
import { gql } from '@apollo/client';
interface ScreenShare {
contentType: string;
}
export interface GetScreenShareTypeResponse {
screenshare: ScreenShare[];
}
export const getSceenShareType = gql`
subscription getSceenShareType {
screenshare {
contentType
}
}
`;
export default {
getSceenShareType,
};

View File

@ -255,7 +255,8 @@ const AppContainer = (props) => {
};
const shouldShowScreenshare = (viewScreenshare || isPresenter)
&& currentMeeting?.componentsFlags?.hasScreenshare;
&& (currentMeeting?.componentsFlags?.hasScreenshare
|| currentMeeting?.componentsFlags?.hasCameraAsContent);
const shouldShowPresentation = (!shouldShowScreenshare && !isSharedNotesPinned
&& !shouldShowExternalVideo && !shouldShowGenericMainContent
&& (presentationIsOpen || presentationRestoreOnUpdate)) && isPresentationEnabled;

View File

@ -121,6 +121,7 @@ const MEETING_SUBSCRIPTION = gql`
hasScreenshare
hasTimer
showRemainingTime
hasCameraAsContent
}
}
}